mirror of https://github.com/mgba-emu/mgba.git
Qt: Move last directory setting from qt.ini to config.ini
This commit is contained in:
parent
d7d48e605b
commit
20f8cdc3e0
1
CHANGES
1
CHANGES
|
@ -53,6 +53,7 @@ Misc:
|
||||||
- GBA Memory: Support for Mo Jie Qi Bing by Vast Fame (taizou)
|
- GBA Memory: Support for Mo Jie Qi Bing by Vast Fame (taizou)
|
||||||
- GBA Memory: Support reading/writing POSTFLG
|
- GBA Memory: Support reading/writing POSTFLG
|
||||||
- Util: Add size counting to Table
|
- Util: Add size counting to Table
|
||||||
|
- Qt: Move last directory setting from qt.ini to config.ini
|
||||||
|
|
||||||
0.5.1: (2016-10-05)
|
0.5.1: (2016-10-05)
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|
|
@ -152,10 +152,10 @@ void GBAApp::continueAll(const QList<int>* paused) {
|
||||||
QString GBAApp::getOpenFileName(QWidget* owner, const QString& title, const QString& filter) {
|
QString GBAApp::getOpenFileName(QWidget* owner, const QString& title, const QString& filter) {
|
||||||
QList<int> paused;
|
QList<int> paused;
|
||||||
pauseAll(&paused);
|
pauseAll(&paused);
|
||||||
QString filename = QFileDialog::getOpenFileName(owner, title, m_configController.getQtOption("lastDirectory").toString(), filter);
|
QString filename = QFileDialog::getOpenFileName(owner, title, m_configController.getOption("lastDirectory"), filter);
|
||||||
continueAll(&paused);
|
continueAll(&paused);
|
||||||
if (!filename.isEmpty()) {
|
if (!filename.isEmpty()) {
|
||||||
m_configController.setQtOption("lastDirectory", QFileInfo(filename).dir().path());
|
m_configController.setOption("lastDirectory", QFileInfo(filename).dir().path());
|
||||||
}
|
}
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
@ -163,10 +163,10 @@ QString GBAApp::getOpenFileName(QWidget* owner, const QString& title, const QStr
|
||||||
QString GBAApp::getSaveFileName(QWidget* owner, const QString& title, const QString& filter) {
|
QString GBAApp::getSaveFileName(QWidget* owner, const QString& title, const QString& filter) {
|
||||||
QList<int> paused;
|
QList<int> paused;
|
||||||
pauseAll(&paused);
|
pauseAll(&paused);
|
||||||
QString filename = QFileDialog::getSaveFileName(owner, title, m_configController.getQtOption("lastDirectory").toString(), filter);
|
QString filename = QFileDialog::getSaveFileName(owner, title, m_configController.getOption("lastDirectory"), filter);
|
||||||
continueAll(&paused);
|
continueAll(&paused);
|
||||||
if (!filename.isEmpty()) {
|
if (!filename.isEmpty()) {
|
||||||
m_configController.setQtOption("lastDirectory", QFileInfo(filename).dir().path());
|
m_configController.setOption("lastDirectory", QFileInfo(filename).dir().path());
|
||||||
}
|
}
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
@ -174,10 +174,10 @@ QString GBAApp::getSaveFileName(QWidget* owner, const QString& title, const QStr
|
||||||
QString GBAApp::getOpenDirectoryName(QWidget* owner, const QString& title) {
|
QString GBAApp::getOpenDirectoryName(QWidget* owner, const QString& title) {
|
||||||
QList<int> paused;
|
QList<int> paused;
|
||||||
pauseAll(&paused);
|
pauseAll(&paused);
|
||||||
QString filename = QFileDialog::getExistingDirectory(owner, title, m_configController.getQtOption("lastDirectory").toString());
|
QString filename = QFileDialog::getExistingDirectory(owner, title, m_configController.getOption("lastDirectory"));
|
||||||
continueAll(&paused);
|
continueAll(&paused);
|
||||||
if (!filename.isEmpty()) {
|
if (!filename.isEmpty()) {
|
||||||
m_configController.setQtOption("lastDirectory", QFileInfo(filename).dir().path());
|
m_configController.setOption("lastDirectory", QFileInfo(filename).dir().path());
|
||||||
}
|
}
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@ bool GBAApp::reloadGameDB() {
|
||||||
}
|
}
|
||||||
|
|
||||||
GBAApp::FileDialog::FileDialog(GBAApp* app, QWidget* parent, const QString& caption, const QString& filter)
|
GBAApp::FileDialog::FileDialog(GBAApp* app, QWidget* parent, const QString& caption, const QString& filter)
|
||||||
: QFileDialog(parent, caption, app->m_configController.getQtOption("lastDirectory").toString(), filter)
|
: QFileDialog(parent, caption, app->m_configController.getOption("lastDirectory"), filter)
|
||||||
, m_app(app)
|
, m_app(app)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ int GBAApp::FileDialog::exec() {
|
||||||
bool didAccept = QFileDialog::exec() == QDialog::Accepted;
|
bool didAccept = QFileDialog::exec() == QDialog::Accepted;
|
||||||
QStringList filenames = selectedFiles();
|
QStringList filenames = selectedFiles();
|
||||||
if (!filenames.isEmpty()) {
|
if (!filenames.isEmpty()) {
|
||||||
m_app->m_configController.setQtOption("lastDirectory", QFileInfo(filenames[0]).dir().path());
|
m_app->m_configController.setOption("lastDirectory", QFileInfo(filenames[0]).dir().path());
|
||||||
}
|
}
|
||||||
m_app->continueAll(&paused);
|
m_app->continueAll(&paused);
|
||||||
return didAccept;
|
return didAccept;
|
||||||
|
|
Loading…
Reference in New Issue