diff --git a/NEWS.md b/NEWS.md index 0d683a77..4047f1dd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +Version 0.8.4 For Dev-C++ 7 Beta + - enhancement: auto save/load the default open folder in the configuration file + Version 0.8.3 For Dev-C++ 7 Beta - enhancement: View menu - enhancement: hide/show statusbar diff --git a/RedPandaIDE/main.cpp b/RedPandaIDE/main.cpp index 760fe8e0..7a5fa913 100644 --- a/RedPandaIDE/main.cpp +++ b/RedPandaIDE/main.cpp @@ -124,6 +124,10 @@ int main(int argc, char *argv[]) QMessageBox::Ok); } + //set default open folder + QDir::setCurrent(pSettings->environment().defaultOpenFolder()); + + MainWindow mainWindow; pMainWindow = &mainWindow; if (app.arguments().count()>1) { diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 32bc327b..c8d2c8ef 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -3254,6 +3254,7 @@ void MainWindow::closeEvent(QCloseEvent *event) { settings.save(); //save current folder ( for files view ) + pSettings->environment().setDefaultOpenFolder(QDir::currentPath()); pSettings->environment().save(); try { mBookmarkModel->save(includeTrailingPathDelimiter(pSettings->dirs().config()) diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 602eec87..acc904c6 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -2658,10 +2658,15 @@ void Settings::Environment::doLoad() mInterfaceFont = stringValue("interface font","Segoe UI"); mInterfaceFontSize = intValue("interface font size",10); mLanguage = stringValue("language", QLocale::system().name()); + mCurrentFolder = stringValue("current_folder",QDir::currentPath()); if (!fileExists(mCurrentFolder)) { mCurrentFolder = QDir::currentPath(); } + mDefaultOpenFolder = stringValue("default_open_folder",QDir::currentPath()); + if (!fileExists(mDefaultOpenFolder)) { + mDefaultOpenFolder = QDir::currentPath(); + } } int Settings::Environment::interfaceFontSize() const @@ -2694,6 +2699,16 @@ void Settings::Environment::setCurrentFolder(const QString &newCurrentFolder) mCurrentFolder = newCurrentFolder; } +const QString &Settings::Environment::defaultOpenFolder() const +{ + return mDefaultOpenFolder; +} + +void Settings::Environment::setDefaultOpenFolder(const QString &newDefaultOpenFolder) +{ + mDefaultOpenFolder = newDefaultOpenFolder; +} + void Settings::Environment::doSave() { //Appearence @@ -2701,7 +2716,9 @@ void Settings::Environment::doSave() saveValue("interface font", mInterfaceFont); saveValue("interface font size", mInterfaceFontSize); saveValue("language", mLanguage); + saveValue("current_folder",mCurrentFolder); + saveValue("default_open_folder",mDefaultOpenFolder); } QString Settings::Environment::interfaceFont() const diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h index 1d9f6105..d6d6f0a4 100644 --- a/RedPandaIDE/settings.h +++ b/RedPandaIDE/settings.h @@ -468,6 +468,9 @@ public: const QString ¤tFolder() const; void setCurrentFolder(const QString &newCurrentFolder); + const QString &defaultOpenFolder() const; + void setDefaultOpenFolder(const QString &newDefaultOpenFolder); + private: //Appearence @@ -476,6 +479,8 @@ public: int mInterfaceFontSize; QString mLanguage; QString mCurrentFolder; + + QString mDefaultOpenFolder; // _Base interface protected: void doSave() override; diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h index dba38657..b5431dcb 100644 --- a/RedPandaIDE/systemconsts.h +++ b/RedPandaIDE/systemconsts.h @@ -3,7 +3,7 @@ #include -#define DEVCPP_VERSION "beta.0.8.3" +#define DEVCPP_VERSION "beta.0.8.4" #define APP_SETTSINGS_FILENAME "redpandacpp.ini" #ifdef Q_OS_WIN