diff --git a/NEWS.md b/NEWS.md index 098d4a68..55c01dc7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -Beta Version 0.8 For Dev-C++ 7 +Version 0.8 For Dev-C++ 7 Beta - fix: find in the current file is not correcly saved in the search history - fix: hit info not correctly displayed in the search result view - fix: If find in files found no hits, search result view will not be shown. @@ -6,6 +6,7 @@ Beta Version 0.8 For Dev-C++ 7 - fix: Results of "find symbol usage" in project not correctly set in the search result view - change: turn on gcc compiler's "-pipe" option by default, to use pipe instead of temp files in compiliation (and make the life of SSD longer) - fix: correctly save input histories for the find combo box in the Find dialog + - fix: can't correctly test if it's not running in green mode Version 0.7.8 - enhancement: In problem view's output control, indicates which line is different with the expected diff --git a/README.md b/README.md index 5d311566..71f19f79 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,26 @@ This project is the successor of Red Panda Dev-C++ 6. All main features of version 6 have been ported. New Features: -* Code intellisense for unicode identifiers +* Problem Set (run and test program against predefined input / expected output data) +* Competitve Companion support ( It's an chrome/firefox extension that can fetch problems from OJ websites) +* Memory View for debugging +* TODO View +* Find symbol occurrences + +UI Improvements: +* Redesigned Find/Replace in Files UI +* Redesigned bookmark UI +* Better dark theme support +* Better editor color scheme support + +Editing Improvements: * Enhanced auto indent -* TODO view -* Memory view in the debug panel -* Skip system header files when step into in debugging -* Better color scheme support -* C++ 14 using type alias support -* Code intellisense for clang (the msys2 version) +* Better code folding support + +Code Intellisense Improvements: +* Support UTF-8 identifiers +* Support C++ 14 using type alias +* Support C-Style enum variable definitions +* Support MACRO with arguments + +And many other improvements and bug fixes. See NEWS.md for full informantion. \ No newline at end of file diff --git a/RedPandaIDE/main.cpp b/RedPandaIDE/main.cpp index 748ef64b..760fe8e0 100644 --- a/RedPandaIDE/main.cpp +++ b/RedPandaIDE/main.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "common.h" #include "colorscheme.h" #include "iconsmanager.h" @@ -81,6 +82,9 @@ int main(int argc, char *argv[]) //Translation must be loaded first QTranslator trans; QString settingFilename = getSettingFilename(); + if (!isGreenEdition()) { + QDir::setCurrent(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0]); + } if (settingFilename.isEmpty()) return -1; { diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 88da683f..7eee5c56 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -7,6 +7,7 @@ #include "systemconsts.h" #include #include +#include const char ValueToChar[28] = {'0', '1', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', @@ -159,7 +160,12 @@ QString Settings::Dirs::templateDir() const QString Settings::Dirs::projectDir() const { - return includeTrailingPathDelimiter(app()) + "projects"; + if (isGreenEdition()) { + return includeTrailingPathDelimiter(app()) + "projects"; + } else { + return includeTrailingPathDelimiter(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0]) + + "projects"; + } } QString Settings::Dirs::data(Settings::Dirs::DataType dataType) const diff --git a/RedPandaIDE/settingsdialog/environmentfileassociationwidget.cpp b/RedPandaIDE/settingsdialog/environmentfileassociationwidget.cpp index 65cf09a8..39a62fcd 100644 --- a/RedPandaIDE/settingsdialog/environmentfileassociationwidget.cpp +++ b/RedPandaIDE/settingsdialog/environmentfileassociationwidget.cpp @@ -128,31 +128,6 @@ void FileAssociationModel::saveAssociations() } -bool readRegistry(HKEY key,QByteArray subKey, QString& value) { - DWORD dataSize; - LONG result; - result = RegGetValueA(key,subKey, - "", RRF_RT_REG_SZ | RRF_RT_REG_MULTI_SZ, - NULL, - NULL, - &dataSize); - if (result!=ERROR_SUCCESS) - return false; - char * buffer = new char[dataSize+10]; - result = RegGetValueA(HKEY_CLASSES_ROOT,subKey, - "", RRF_RT_REG_SZ | RRF_RT_REG_MULTI_SZ, - NULL, - buffer, - &dataSize); - if (result!=ERROR_SUCCESS) { - delete[] buffer; - return false; - } - value=QString::fromLocal8Bit(buffer); - delete [] buffer; - return true; -} - bool FileAssociationModel::checkAssociation(const QString &extension, const QString &filetype, const QString &verb, const QString &serverApp) { HKEY key; diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h index 9bc6a70c..2cd1c472 100644 --- a/RedPandaIDE/systemconsts.h +++ b/RedPandaIDE/systemconsts.h @@ -3,7 +3,7 @@ #include -#define DEVCPP_VERSION "0.7.9" +#define DEVCPP_VERSION "beta.0.8.0" #define APP_SETTSINGS_FILENAME "redpandacpp.ini" #ifdef Q_OS_WIN diff --git a/RedPandaIDE/utils.cpp b/RedPandaIDE/utils.cpp index 265a38a3..1cfd0f10 100644 --- a/RedPandaIDE/utils.cpp +++ b/RedPandaIDE/utils.cpp @@ -94,12 +94,16 @@ static bool gIsGreenEditionInited = false; bool isGreenEdition() { if (!gIsGreenEditionInited) { + QString keyString = QString("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\RedPanda-C++"); + QString value1,value2; + if (!readRegistry(HKEY_LOCAL_MACHINE,keyString.toLocal8Bit(),value1)) + return false; QSettings settings("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\RedPanda-C++", QSettings::NativeFormat); - QString regPath = QFileInfo(settings.value("UninstallString").toString()).absolutePath(); + QString regPath = extractFileDir(QFileInfo(settings.value("UninstallString").toString()).absolutePath()); QString appPath = QApplication::instance()->applicationDirPath(); - gIsGreenEdition = (regPath != appPath); + gIsGreenEdition = ( excludeTrailingPathDelimiter(regPath) != excludeTrailingPathDelimiter(appPath)); gIsGreenEditionInited = true; } return gIsGreenEdition; @@ -859,3 +863,28 @@ bool haveGoodContrast(const QColor& c1, const QColor &c2) { int lightness2 = qGray(c2.rgb()); return std::abs(lightness1 - lightness2)>=120; } + +bool readRegistry(HKEY key,QByteArray subKey, QString& value) { + DWORD dataSize; + LONG result; + result = RegGetValueA(key,subKey, + "", RRF_RT_REG_SZ | RRF_RT_REG_MULTI_SZ, + NULL, + NULL, + &dataSize); + if (result!=ERROR_SUCCESS) + return false; + char * buffer = new char[dataSize+10]; + result = RegGetValueA(HKEY_CLASSES_ROOT,subKey, + "", RRF_RT_REG_SZ | RRF_RT_REG_MULTI_SZ, + NULL, + buffer, + &dataSize); + if (result!=ERROR_SUCCESS) { + delete[] buffer; + return false; + } + value=QString::fromLocal8Bit(buffer); + delete [] buffer; + return true; +} diff --git a/RedPandaIDE/utils.h b/RedPandaIDE/utils.h index 958ea8dd..e54f44b7 100644 --- a/RedPandaIDE/utils.h +++ b/RedPandaIDE/utils.h @@ -191,6 +191,8 @@ QString fromByteArray(const QByteArray& s); int getNewFileNumber(); +bool readRegistry(HKEY key,QByteArray subKey, QString& value); + class CppParser; void resetCppParser(std::shared_ptr parser);