Merge branch 'master' of github.com:royqh1979/RedPanda-CPP
This commit is contained in:
commit
fd9e51a040
8
NEWS.md
8
NEWS.md
|
@ -1,3 +1,11 @@
|
||||||
|
Red Panda C++ Version 1.0.6
|
||||||
|
- fix: gcc compiler set name is not correct in Linux
|
||||||
|
- enhancement: hide add charset option when the currect compiler set is clang
|
||||||
|
- enhancement: auto check the c project option in the new project dialog
|
||||||
|
- change: use "app.ico" as default name for the project icon file
|
||||||
|
- fix: c file should use CC to build in the auto generated makefile
|
||||||
|
- enhancement: package script for msys2 clang
|
||||||
|
|
||||||
Red Panda C++ Version 1.0.5
|
Red Panda C++ Version 1.0.5
|
||||||
- enhancement: add autolink and project template for sqlite3
|
- enhancement: add autolink and project template for sqlite3
|
||||||
- enhancement: add sqlite3 lib to the gcc in distribution
|
- enhancement: add sqlite3 lib to the gcc in distribution
|
||||||
|
|
|
@ -10,7 +10,7 @@ isEmpty(APP_NAME) {
|
||||||
}
|
}
|
||||||
|
|
||||||
isEmpty(APP_VERSION) {
|
isEmpty(APP_VERSION) {
|
||||||
APP_VERSION=1.0.5
|
APP_VERSION=1.0.6
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,7 @@ QString Compiler::getCharsetArgument(const QByteArray& encoding, bool checkSynta
|
||||||
{
|
{
|
||||||
QString result;
|
QString result;
|
||||||
if (compilerSet()->autoAddCharsetParams() && encoding != ENCODING_ASCII
|
if (compilerSet()->autoAddCharsetParams() && encoding != ENCODING_ASCII
|
||||||
&& compilerSet()->compilerType()!="Clang") {
|
&& compilerSet()->compilerType()!=COMPILER_CLANG) {
|
||||||
QString encodingName;
|
QString encodingName;
|
||||||
QString execEncodingName;
|
QString execEncodingName;
|
||||||
QString compilerSetExecCharset = compilerSet()->execCharset();
|
QString compilerSetExecCharset = compilerSet()->execCharset();
|
||||||
|
|
|
@ -74,18 +74,6 @@ void CompilerManager::compile(const QString& filename, const QByteArray& encodin
|
||||||
tr("No compiler set is configured.")+tr("Can't start debugging."));
|
tr("No compiler set is configured.")+tr("Can't start debugging."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pSettings->compilerSets().defaultSet()->compilerType() == "Clang"
|
|
||||||
&& (
|
|
||||||
(encoding!= ENCODING_ASCII && encoding!=ENCODING_UTF8)
|
|
||||||
|| (encoding == ENCODING_UTF8
|
|
||||||
&& pCharsetInfoManager->getDefaultSystemEncoding()!=ENCODING_UTF8)
|
|
||||||
)) {
|
|
||||||
QMessageBox::information(pMainWindow,
|
|
||||||
tr("Encoding not support"),
|
|
||||||
tr("Clang only support utf-8 encoding.")
|
|
||||||
+"<br />"
|
|
||||||
+tr("Strings in the program might be wrongly processed."));
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mCompileMutex);
|
QMutexLocker locker(&mCompileMutex);
|
||||||
if (mCompiler!=nullptr) {
|
if (mCompiler!=nullptr) {
|
||||||
|
|
|
@ -326,6 +326,9 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
mHeaderCompletionPopup = std::make_shared<HeaderCompletionPopup>();
|
mHeaderCompletionPopup = std::make_shared<HeaderCompletionPopup>();
|
||||||
mFunctionTip = std::make_shared<FunctionTooltipWidget>();
|
mFunctionTip = std::make_shared<FunctionTooltipWidget>();
|
||||||
|
|
||||||
|
mBottomPanelHeight = 0;
|
||||||
|
mLeftPanelWidth = 0;
|
||||||
|
|
||||||
mClassBrowserModel.setColors(mStatementColors);
|
mClassBrowserModel.setColors(mStatementColors);
|
||||||
|
|
||||||
connect(&mAutoSaveTimer, &QTimer::timeout,
|
connect(&mAutoSaveTimer, &QTimer::timeout,
|
||||||
|
@ -970,7 +973,6 @@ void MainWindow::updateClassBrowserForEditor(Editor *editor)
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
mClassBrowserModel.setParser(nullptr);
|
mClassBrowserModel.setParser(nullptr);
|
||||||
mClassBrowserModel.setCurrentFile("");
|
mClassBrowserModel.setCurrentFile("");
|
||||||
mClassBrowserModel.clear();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mQuitting)
|
if (mQuitting)
|
||||||
|
@ -1825,7 +1827,7 @@ void MainWindow::debug()
|
||||||
mDebugger->sendCommand("-gdb-set", "confirm off");
|
mDebugger->sendCommand("-gdb-set", "confirm off");
|
||||||
mDebugger->sendCommand("-gdb-set", "print repeats 0"); // don't repeat elements
|
mDebugger->sendCommand("-gdb-set", "print repeats 0"); // don't repeat elements
|
||||||
mDebugger->sendCommand("-gdb-set", "print elements 0"); // don't limit elements
|
mDebugger->sendCommand("-gdb-set", "print elements 0"); // don't limit elements
|
||||||
mDebugger->sendCommand("-environment-cd", QString("\"%1\"").arg(excludeTrailingPathDelimiter(filePath))); // restore working directory
|
mDebugger->sendCommand("-environment-cd", QString("\"%1\"").arg(extractFileDir(filePath))); // restore working directory
|
||||||
if (pSettings->debugger().useGDBServer()) {
|
if (pSettings->debugger().useGDBServer()) {
|
||||||
mDebugger->sendCommand("-target-select",QString("remote localhost:%1").arg(pSettings->debugger().GDBServerPort()));
|
mDebugger->sendCommand("-target-select",QString("remote localhost:%1").arg(pSettings->debugger().GDBServerPort()));
|
||||||
if (!debugInferiorhasBreakpoint()) {
|
if (!debugInferiorhasBreakpoint()) {
|
||||||
|
|
|
@ -52,6 +52,7 @@ CppParser::CppParser(QObject *parent) : QObject(parent),
|
||||||
|
|
||||||
mCppKeywords = CppKeywords;
|
mCppKeywords = CppKeywords;
|
||||||
mCppTypeKeywords = CppTypeKeywords;
|
mCppTypeKeywords = CppTypeKeywords;
|
||||||
|
mEnabled = true;
|
||||||
//mNamespaces;
|
//mNamespaces;
|
||||||
//mBlockBeginSkips;
|
//mBlockBeginSkips;
|
||||||
//mBlockEndSkips;
|
//mBlockEndSkips;
|
||||||
|
|
|
@ -132,7 +132,6 @@ struct StatementMatchPosition{
|
||||||
|
|
||||||
using PStatementMathPosition = std::shared_ptr<StatementMatchPosition>;
|
using PStatementMathPosition = std::shared_ptr<StatementMatchPosition>;
|
||||||
|
|
||||||
|
|
||||||
struct Statement;
|
struct Statement;
|
||||||
using PStatement = std::shared_ptr<Statement>;
|
using PStatement = std::shared_ptr<Statement>;
|
||||||
using StatementList = QList<PStatement>;
|
using StatementList = QList<PStatement>;
|
||||||
|
|
|
@ -279,7 +279,11 @@ PProjectUnit Project::newUnit(PProjectModelNode parentNode, const QString& custo
|
||||||
newUnit->node()->unitIndex = count;
|
newUnit->node()->unitIndex = count;
|
||||||
//parentNode.Expand(True);
|
//parentNode.Expand(True);
|
||||||
newUnit->setCompile(true);
|
newUnit->setCompile(true);
|
||||||
newUnit->setCompileCpp(mOptions.isCpp);
|
if (getFileType(customFileName) == FileType::CSource) {
|
||||||
|
newUnit->setCompileCpp(false);
|
||||||
|
} else {
|
||||||
|
newUnit->setCompileCpp(mOptions.isCpp);
|
||||||
|
}
|
||||||
newUnit->setLink(true);
|
newUnit->setLink(true);
|
||||||
newUnit->setPriority(1000);
|
newUnit->setPriority(1000);
|
||||||
newUnit->setOverrideBuildCmd(false);
|
newUnit->setOverrideBuildCmd(false);
|
||||||
|
@ -758,7 +762,7 @@ bool Project::assignTemplate(const std::shared_ptr<ProjectTemplate> aTemplate, b
|
||||||
if (!mOptions.icon.isEmpty()) {
|
if (!mOptions.icon.isEmpty()) {
|
||||||
QString originIcon = QFileInfo(aTemplate->fileName()).absoluteDir().absoluteFilePath(mOptions.icon);
|
QString originIcon = QFileInfo(aTemplate->fileName()).absoluteDir().absoluteFilePath(mOptions.icon);
|
||||||
if (fileExists(originIcon)) {
|
if (fileExists(originIcon)) {
|
||||||
QString destIcon = changeFileExt(mFilename,ICON_EXT);
|
QString destIcon = QFileInfo(mFilename).absoluteDir().absoluteFilePath("app.ico");
|
||||||
QFile::copy(originIcon,destIcon);
|
QFile::copy(originIcon,destIcon);
|
||||||
mOptions.icon = destIcon;
|
mOptions.icon = destIcon;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -42,6 +42,8 @@
|
||||||
SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
|
SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
|
||||||
mDropped(false)
|
mDropped(false)
|
||||||
{
|
{
|
||||||
|
mCharWidth=1;
|
||||||
|
mTextHeight = 1;
|
||||||
mLastKey = 0;
|
mLastKey = 0;
|
||||||
mLastKeyModifiers = Qt::NoModifier;
|
mLastKeyModifiers = Qt::NoModifier;
|
||||||
mModified = false;
|
mModified = false;
|
||||||
|
@ -55,6 +57,7 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
|
||||||
#else
|
#else
|
||||||
#error "Not supported!"
|
#error "Not supported!"
|
||||||
#endif
|
#endif
|
||||||
|
mFontDummy.setStyleStrategy(QFont::PreferAntialias);
|
||||||
mDocument = std::make_shared<SynDocument>(mFontDummy, this);
|
mDocument = std::make_shared<SynDocument>(mFontDummy, this);
|
||||||
//fPlugins := TList.Create;
|
//fPlugins := TList.Create;
|
||||||
mMouseMoved = false;
|
mMouseMoved = false;
|
||||||
|
@ -66,10 +69,10 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
|
||||||
mDocument->connect(mDocument.get(), &SynDocument::inserted, this, &SynEdit::onLinesInserted);
|
mDocument->connect(mDocument.get(), &SynDocument::inserted, this, &SynEdit::onLinesInserted);
|
||||||
mDocument->connect(mDocument.get(), &SynDocument::putted, this, &SynEdit::onLinesPutted);
|
mDocument->connect(mDocument.get(), &SynDocument::putted, this, &SynEdit::onLinesPutted);
|
||||||
|
|
||||||
mFontDummy.setStyleStrategy(QFont::PreferAntialias);
|
mGutterWidth = 0;
|
||||||
setFont(mFontDummy);
|
mScrollBars = SynScrollStyle::ssBoth;
|
||||||
|
|
||||||
|
|
||||||
setFontForNonAscii(mFontDummy);
|
|
||||||
|
|
||||||
mUndoList = std::make_shared<SynEditUndoList>();
|
mUndoList = std::make_shared<SynEditUndoList>();
|
||||||
mUndoList->connect(mUndoList.get(), &SynEditUndoList::addedUndo, this, &SynEdit::onUndoAdded);
|
mUndoList->connect(mUndoList.get(), &SynEditUndoList::addedUndo, this, &SynEdit::onUndoAdded);
|
||||||
|
@ -100,7 +103,6 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
|
||||||
this->setCursor(Qt::CursorShape::IBeamCursor);
|
this->setCursor(Qt::CursorShape::IBeamCursor);
|
||||||
//TabStop := True;
|
//TabStop := True;
|
||||||
mInserting = true;
|
mInserting = true;
|
||||||
mScrollBars = SynScrollStyle::ssBoth;
|
|
||||||
mExtraLineSpacing = 0;
|
mExtraLineSpacing = 0;
|
||||||
|
|
||||||
this->setFrameShape(QFrame::Panel);
|
this->setFrameShape(QFrame::Panel);
|
||||||
|
@ -150,8 +152,6 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
|
||||||
m_blinkTimerId = 0;
|
m_blinkTimerId = 0;
|
||||||
m_blinkStatus = 0;
|
m_blinkStatus = 0;
|
||||||
|
|
||||||
synFontChanged();
|
|
||||||
|
|
||||||
hideCaret();
|
hideCaret();
|
||||||
|
|
||||||
connect(horizontalScrollBar(),&QScrollBar::valueChanged,
|
connect(horizontalScrollBar(),&QScrollBar::valueChanged,
|
||||||
|
@ -164,6 +164,8 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
|
||||||
//setMouseTracking(true);
|
//setMouseTracking(true);
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
|
||||||
|
setFont(mFontDummy);
|
||||||
|
setFontForNonAscii(mFontDummy);
|
||||||
}
|
}
|
||||||
|
|
||||||
int SynEdit::displayLineCount() const
|
int SynEdit::displayLineCount() const
|
||||||
|
|
|
@ -1950,7 +1950,7 @@ void Settings::CompilerSet::setProperties(const QString &binDir)
|
||||||
targetStr = "clang version ";
|
targetStr = "clang version ";
|
||||||
delimPos1 = output.indexOf(targetStr);
|
delimPos1 = output.indexOf(targetStr);
|
||||||
if (delimPos1>=0) {
|
if (delimPos1>=0) {
|
||||||
mCompilerType = "Clang";
|
mCompilerType = COMPILER_CLANG;
|
||||||
delimPos1+=strlen(targetStr);
|
delimPos1+=strlen(targetStr);
|
||||||
delimPos2 = delimPos1;
|
delimPos2 = delimPos1;
|
||||||
while (delimPos2<output.length() && !isNonPrintableAsciiChar(output[delimPos2]))
|
while (delimPos2<output.length() && !isNonPrintableAsciiChar(output[delimPos2]))
|
||||||
|
@ -1959,7 +1959,7 @@ void Settings::CompilerSet::setProperties(const QString &binDir)
|
||||||
|
|
||||||
mName = "Clang " + mVersion;
|
mName = "Clang " + mVersion;
|
||||||
} else {
|
} else {
|
||||||
mCompilerType = "GCC";
|
mCompilerType = COMPILER_GCC;
|
||||||
targetStr = "gcc version ";
|
targetStr = "gcc version ";
|
||||||
delimPos1 = output.indexOf(targetStr);
|
delimPos1 = output.indexOf(targetStr);
|
||||||
if (delimPos1<0)
|
if (delimPos1<0)
|
||||||
|
@ -1987,9 +1987,17 @@ void Settings::CompilerSet::setProperties(const QString &binDir)
|
||||||
} else if (mType.contains("MSYS2")) {
|
} else if (mType.contains("MSYS2")) {
|
||||||
mName = "MinGW-w64 GCC " + mVersion;
|
mName = "MinGW-w64 GCC " + mVersion;
|
||||||
} else if (mType.contains("GCC")) {
|
} else if (mType.contains("GCC")) {
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
mName = "MinGW GCC " + mVersion;
|
mName = "MinGW GCC " + mVersion;
|
||||||
|
#else
|
||||||
|
mName = "GCC " + mVersion;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
mName = "MinGW GCC " + mVersion;
|
mName = "MinGW GCC " + mVersion;
|
||||||
|
#else
|
||||||
|
mName = "GCC " + mVersion;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2640,6 +2648,11 @@ void Settings::CompilerSets::findSets()
|
||||||
addSets(folder);
|
addSets(folder);
|
||||||
searched.insert(folder);
|
searched.insert(folder);
|
||||||
}
|
}
|
||||||
|
folder = includeTrailingPathDelimiter(mSettings->dirs().appDir())+"Clang64"+QDir::separator()+"bin";
|
||||||
|
if (!searched.contains(folder)) {
|
||||||
|
addSets(folder);
|
||||||
|
searched.insert(folder);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
#define SETTING_EDITOR_DEFAULT_ENCODING "default_encoding"
|
#define SETTING_EDITOR_DEFAULT_ENCODING "default_encoding"
|
||||||
#define SETTING_EDITOR_AUTO_INDENT "default_auto_indent"
|
#define SETTING_EDITOR_AUTO_INDENT "default_auto_indent"
|
||||||
|
|
||||||
|
#define COMPILER_CLANG "Clang"
|
||||||
|
#define COMPILER_GCC "GCC"
|
||||||
|
|
||||||
extern const char ValueToChar[28];
|
extern const char ValueToChar[28];
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,13 @@ void resetOptionTabs(Settings::PCompilerSet pSet,QTabWidget* pTab)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void loadCompilerSetSettings(Settings::PCompilerSet pSet, Ui::CompilerSetOptionWidget* ui) {
|
static void loadCompilerSetSettings(Settings::PCompilerSet pSet, Ui::CompilerSetOptionWidget* ui) {
|
||||||
|
ui->chkAutoAddCharset->setEnabled(pSet->compilerType() != COMPILER_CLANG);
|
||||||
|
ui->chkAutoAddCharset->setVisible(pSet->compilerType() != COMPILER_CLANG);
|
||||||
|
ui->cbEncoding->setEnabled(pSet->compilerType() != COMPILER_CLANG);
|
||||||
|
ui->cbEncoding->setVisible(pSet->compilerType() != COMPILER_CLANG);
|
||||||
|
ui->cbEncodingDetails->setEnabled(pSet->compilerType() != COMPILER_CLANG);
|
||||||
|
ui->cbEncodingDetails->setVisible(pSet->compilerType() != COMPILER_CLANG);
|
||||||
|
|
||||||
ui->chkUseCustomCompilerParams->setChecked(pSet->useCustomCompileParams());
|
ui->chkUseCustomCompilerParams->setChecked(pSet->useCustomCompileParams());
|
||||||
ui->txtCustomCompileParams->setPlainText(pSet->customCompileParams());
|
ui->txtCustomCompileParams->setPlainText(pSet->customCompileParams());
|
||||||
ui->txtCustomCompileParams->setEnabled(pSet->useCustomCompileParams());
|
ui->txtCustomCompileParams->setEnabled(pSet->useCustomCompileParams());
|
||||||
|
|
|
@ -88,7 +88,7 @@ void EditorSnippetWidget::on_btnAdd_clicked()
|
||||||
ui->tblSnippets->edit(mModel.lastSnippetCaption());
|
ui->tblSnippets->edit(mModel.lastSnippetCaption());
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorSnippetWidget::updateIcons(const QSize &size)
|
void EditorSnippetWidget::updateIcons(const QSize &/*size*/)
|
||||||
{
|
{
|
||||||
pIconsManager->setIcon(ui->btnAdd,IconsManager::ACTION_MISC_ADD);
|
pIconsManager->setIcon(ui->btnAdd,IconsManager::ACTION_MISC_ADD);
|
||||||
pIconsManager->setIcon(ui->btnRemove,IconsManager::ACTION_MISC_REMOVE);
|
pIconsManager->setIcon(ui->btnRemove,IconsManager::ACTION_MISC_REMOVE);
|
||||||
|
|
|
@ -81,7 +81,7 @@ void EnvironmentFoldersWidget::on_btnResetDefault_clicked()
|
||||||
emit shouldQuitApp();
|
emit shouldQuitApp();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnvironmentFoldersWidget::updateIcons(const QSize &size)
|
void EnvironmentFoldersWidget::updateIcons(const QSize &/*size*/)
|
||||||
{
|
{
|
||||||
pIconsManager->setIcon(ui->btnOpenConfigFolderInBrowser,IconsManager::ACTION_FILE_OPEN_FOLDER);
|
pIconsManager->setIcon(ui->btnOpenConfigFolderInBrowser,IconsManager::ACTION_FILE_OPEN_FOLDER);
|
||||||
pIconsManager->setIcon(ui->btnOpenThemeFolderInFileBrowser,IconsManager::ACTION_FILE_OPEN_FOLDER);
|
pIconsManager->setIcon(ui->btnOpenThemeFolderInFileBrowser,IconsManager::ACTION_FILE_OPEN_FOLDER);
|
||||||
|
|
|
@ -70,7 +70,7 @@ void ProjectCompileParamatersWidget::on_btnChooseLib_clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectCompileParamatersWidget::updateIcons(const QSize &size)
|
void ProjectCompileParamatersWidget::updateIcons(const QSize &/*size*/)
|
||||||
{
|
{
|
||||||
pIconsManager->setIcon(ui->btnChooseLib, IconsManager::ACTION_MISC_FOLDER);
|
pIconsManager->setIcon(ui->btnChooseLib, IconsManager::ACTION_MISC_FOLDER);
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,7 +145,7 @@ void ProjectCompilerWidget::doSave()
|
||||||
void ProjectCompilerWidget::init()
|
void ProjectCompilerWidget::init()
|
||||||
{
|
{
|
||||||
ui->cbCompilerSet->clear();
|
ui->cbCompilerSet->clear();
|
||||||
for (int i=0;i<pSettings->compilerSets().size();i++) {
|
for (size_t i=0;i<pSettings->compilerSets().size();i++) {
|
||||||
ui->cbCompilerSet->addItem(pSettings->compilerSets().getSet(i)->name());
|
ui->cbCompilerSet->addItem(pSettings->compilerSets().getSet(i)->name());
|
||||||
}
|
}
|
||||||
SettingsWidget::init();
|
SettingsWidget::init();
|
||||||
|
|
|
@ -57,7 +57,7 @@ void ProjectDLLHostWidget::on_btnBrowse_clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectDLLHostWidget::updateIcons(const QSize &size)
|
void ProjectDLLHostWidget::updateIcons(const QSize &/*size*/)
|
||||||
{
|
{
|
||||||
pIconsManager->setIcon(ui->btnBrowse, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
pIconsManager->setIcon(ui->btnBrowse, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@ void ProjectGeneralWidget::doSave()
|
||||||
|| !ui->lbIcon->pixmap() || ui->lbIcon->pixmap()->isNull()) {
|
|| !ui->lbIcon->pixmap() || ui->lbIcon->pixmap()->isNull()) {
|
||||||
project->options().icon = "";
|
project->options().icon = "";
|
||||||
} else {
|
} else {
|
||||||
QString iconPath = changeFileExt(project->filename(),"ico");
|
QString iconPath = QFileInfo(project->filename()).absoluteDir().absoluteFilePath("app.ico");
|
||||||
if (iconPath!=mIconPath) {
|
if (iconPath!=mIconPath) {
|
||||||
if (QFile(iconPath).exists()) {
|
if (QFile(iconPath).exists()) {
|
||||||
if (!QFile::remove(iconPath)) {
|
if (!QFile::remove(iconPath)) {
|
||||||
|
|
|
@ -91,7 +91,7 @@ void ProjectOutputWidget::on_btnCompileLog_clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectOutputWidget::updateIcons(const QSize &size)
|
void ProjectOutputWidget::updateIcons(const QSize &/*size*/)
|
||||||
{
|
{
|
||||||
pIconsManager->setIcon(ui->btnCompileLog, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
pIconsManager->setIcon(ui->btnCompileLog, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
||||||
pIconsManager->setIcon(ui->btnObjOutputDir, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
pIconsManager->setIcon(ui->btnObjOutputDir, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
||||||
|
|
|
@ -59,7 +59,7 @@ void ProjectPreCompileWidget::on_btnBrowse_clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectPreCompileWidget::updateIcons(const QSize &size)
|
void ProjectPreCompileWidget::updateIcons(const QSize &/*size*/)
|
||||||
{
|
{
|
||||||
pIconsManager->setIcon(ui->btnBrowse, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
pIconsManager->setIcon(ui->btnBrowse, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,6 @@
|
||||||
#define DEF_EXT "def"
|
#define DEF_EXT "def"
|
||||||
#define LIB_EXT "a"
|
#define LIB_EXT "a"
|
||||||
#define GCH_EXT "gch"
|
#define GCH_EXT "gch"
|
||||||
#define ICON_EXT "ico"
|
|
||||||
#define TEMPLATE_EXT "template"
|
#define TEMPLATE_EXT "template"
|
||||||
#define DEV_INTERNAL_OPEN "$__DEV_INTERNAL_OPEN"
|
#define DEV_INTERNAL_OPEN "$__DEV_INTERNAL_OPEN"
|
||||||
#define DEV_LASTOPENS_FILE "lastopens.ini"
|
#define DEV_LASTOPENS_FILE "lastopens.ini"
|
||||||
|
|
|
@ -188,6 +188,8 @@ void ClassBrowserModel::setParser(const PCppParser &newCppParser)
|
||||||
&CppParser::onEndParsing,
|
&CppParser::onEndParsing,
|
||||||
this,
|
this,
|
||||||
&ClassBrowserModel::fillStatements);
|
&ClassBrowserModel::fillStatements);
|
||||||
|
} else {
|
||||||
|
clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -971,13 +971,14 @@ void CodeCompletionPopup::hideEvent(QHideEvent *event)
|
||||||
QMutexLocker locker(&mMutex);
|
QMutexLocker locker(&mMutex);
|
||||||
mListView->setKeypressedCallback(nullptr);
|
mListView->setKeypressedCallback(nullptr);
|
||||||
mCompletionStatementList.clear();
|
mCompletionStatementList.clear();
|
||||||
foreach (PStatement statement, mFullCompletionStatementList) {
|
// foreach (PStatement statement, mFullCompletionStatementList) {
|
||||||
statement->matchPositions.clear();
|
// statement->matchPositions.clear();
|
||||||
}
|
// }
|
||||||
mFullCompletionStatementList.clear();
|
mFullCompletionStatementList.clear();
|
||||||
mIncludedFiles.clear();
|
mIncludedFiles.clear();
|
||||||
mUsings.clear();
|
mUsings.clear();
|
||||||
mAddedStatements.clear();
|
mAddedStatements.clear();
|
||||||
|
mCurrentStatement = nullptr;
|
||||||
mParser = nullptr;
|
mParser = nullptr;
|
||||||
QWidget::hideEvent(event);
|
QWidget::hideEvent(event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,6 +220,7 @@ void NewProjectDialog::on_lstTemplates_currentItemChanged(QListWidgetItem *curre
|
||||||
ui->rdCppProject->setChecked(true);
|
ui->rdCppProject->setChecked(true);
|
||||||
} else {
|
} else {
|
||||||
ui->rdCProject->setEnabled(true);
|
ui->rdCProject->setEnabled(true);
|
||||||
|
ui->rdCProject->setChecked(true);
|
||||||
if (pSettings->editor().defaultFileCpp()) {
|
if (pSettings->editor().defaultFileCpp()) {
|
||||||
ui->rdCppProject->setChecked(true);
|
ui->rdCppProject->setChecked(true);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -17,7 +17,7 @@ SUBDIRS += \
|
||||||
|
|
||||||
APP_NAME = RedPandaCPP
|
APP_NAME = RedPandaCPP
|
||||||
|
|
||||||
APP_VERSION = 1.0.5
|
APP_VERSION = 1.0.6
|
||||||
|
|
||||||
linux: {
|
linux: {
|
||||||
|
|
||||||
|
@ -52,11 +52,13 @@ win32: {
|
||||||
target.path = $${PREFIX}
|
target.path = $${PREFIX}
|
||||||
QMAKE_SUBSTITUTES += windows/installer-scripts/config.nsh.in
|
QMAKE_SUBSTITUTES += windows/installer-scripts/config.nsh.in
|
||||||
QMAKE_SUBSTITUTES += windows/installer-scripts/config32.nsh.in
|
QMAKE_SUBSTITUTES += windows/installer-scripts/config32.nsh.in
|
||||||
|
QMAKE_SUBSTITUTES += windows/installer-scripts/config-clang.nsh.in
|
||||||
|
|
||||||
resources.path = $${PREFIX}
|
resources.path = $${PREFIX}
|
||||||
resources.files += windows/templates
|
resources.files += windows/templates
|
||||||
resources.files += windows/installer-scripts/config.nsh
|
resources.files += windows/installer-scripts/config.nsh
|
||||||
resources.files += windows/installer-scripts/config32.nsh
|
resources.files += windows/installer-scripts/config32.nsh
|
||||||
|
resources.files += windows/installer-scripts/config-clang.nsh
|
||||||
resources.files += README.md
|
resources.files += README.md
|
||||||
resources.files += NEWS.md
|
resources.files += NEWS.md
|
||||||
resources.files += LICENSE
|
resources.files += LICENSE
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
BUILD_DIR="${TEMP}/redpandacpp-build"
|
||||||
|
PACKAGE_DIR="${TEMP}/RedPanda-CPP"
|
||||||
|
GCC_DIR="/mingw64"
|
||||||
|
PATH="${GCC_DIR}/bin:${PATH}"
|
||||||
|
QMAKE="${GCC_DIR}/qt5-static/bin/qmake"
|
||||||
|
NSIS="/d/Program Files (x86)/NSIS/bin/makensis.exe"
|
||||||
|
SOURCE_DIR=`pwd`
|
||||||
|
MINGW="/e/Workspaces/contributes/MinGW/Clang64"
|
||||||
|
MINGW_NAME="Clang64"
|
||||||
|
|
||||||
|
rm -rf "${BUILD_DIR}"
|
||||||
|
test -z "${BUILD_DIR}" | mkdir "${BUILD_DIR}"
|
||||||
|
rm -rf "${PACKAGE_DIR}"
|
||||||
|
mkdir "${PACKAGE_DIR}"
|
||||||
|
|
||||||
|
echo "Building..."
|
||||||
|
pushd .
|
||||||
|
cd "${BUILD_DIR}"
|
||||||
|
make distclean
|
||||||
|
"$QMAKE" PREFIX="${PACKAGE_DIR}" -o Makefile "${SOURCE_DIR}\Red_Panda_Cpp.pro" -r -spec win32-g++
|
||||||
|
make -j16
|
||||||
|
make install
|
||||||
|
popd
|
||||||
|
|
||||||
|
#echo "Making no-compiler installer ..."
|
||||||
|
#pushd .
|
||||||
|
#cd "${PACKAGE_DIR}"
|
||||||
|
|
||||||
|
#cp "${SOURCE_DIR}/windows/installer-scripts/lang.nsh" .
|
||||||
|
#cp "${SOURCE_DIR}/windows/installer-scripts/redpanda-nocompiler.nsi" .
|
||||||
|
|
||||||
|
#"${NSIS}" redpanda-nocompiler.nsi
|
||||||
|
#rm -f lang.nsh
|
||||||
|
#rm -f config.nsh
|
||||||
|
#rm -f config32.nsh
|
||||||
|
#rm -f redpanda-nocompiler.nsi
|
||||||
|
|
||||||
|
#SETUP_NAME=`ls *.Setup.exe`
|
||||||
|
#PORTABLE_NAME=`echo $SETUP_NAME | sed 's/Setup.exe/Portable.7z/'`
|
||||||
|
#mv "$SETUP_NAME" "${SOURCE_DIR}"
|
||||||
|
#popd
|
||||||
|
|
||||||
|
#echo "Making no-compiler Portable Package..."
|
||||||
|
#7z a -mmt8 -mx9 "${PORTABLE_NAME}" "${PACKAGE_DIR}"
|
||||||
|
|
||||||
|
# we need reinstall config.nsh
|
||||||
|
#pushd .
|
||||||
|
#cd "${BUILD_DIR}"
|
||||||
|
#make install
|
||||||
|
#popd
|
||||||
|
|
||||||
|
echo "Making installer..."
|
||||||
|
|
||||||
|
pushd .
|
||||||
|
cd "${PACKAGE_DIR}"
|
||||||
|
ln -s "${MINGW}" $MinGW_NAME
|
||||||
|
|
||||||
|
cp "${SOURCE_DIR}/windows/installer-scripts/lang.nsh" .
|
||||||
|
cp "${SOURCE_DIR}/windows/installer-scripts/redpanda-clang.nsi" .
|
||||||
|
|
||||||
|
"${NSIS}" redpanda-clang.nsi
|
||||||
|
rm -f lang.nsh
|
||||||
|
rm -f config.nsh
|
||||||
|
rm -f config32.nsh
|
||||||
|
rm -f redpanda-clang.nsi
|
||||||
|
|
||||||
|
SETUP_NAME=`ls *.Setup.exe`
|
||||||
|
PORTABLE_NAME=`echo $SETUP_NAME | sed 's/Setup.exe/Portable.7z/'`
|
||||||
|
mv "$SETUP_NAME" "${SOURCE_DIR}"
|
||||||
|
|
||||||
|
popd
|
||||||
|
|
||||||
|
echo "Making Portable Package..."
|
||||||
|
7z a -mmt8 -mx9 "${PORTABLE_NAME}" "${PACKAGE_DIR}"
|
||||||
|
|
||||||
|
echo "Clean up..."
|
||||||
|
rm -rf "${PACKAGE_DIR}"
|
||||||
|
|
|
@ -14,7 +14,7 @@ HWND hMainDlg = NULL;
|
||||||
HWND hwndTxtPassword = NULL;
|
HWND hwndTxtPassword = NULL;
|
||||||
|
|
||||||
int WINAPI WinMain(HINSTANCE hInstance,
|
int WINAPI WinMain(HINSTANCE hInstance,
|
||||||
HINSTANCE hPrevInstance,
|
HINSTANCE /*hPrevInstance*/,
|
||||||
LPTSTR lpCmdLine, int nCmdShow) {
|
LPTSTR lpCmdLine, int nCmdShow) {
|
||||||
MSG msg;
|
MSG msg;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ LRESULT CALLBACK TxtPasswordWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
|
||||||
return CallWindowProc(lpfnTxtPasswordWndProc, hwnd, msg, wParam, lParam);
|
return CallWindowProc(lpfnTxtPasswordWndProc, hwnd, msg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT CALLBACK MainDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
|
LRESULT CALLBACK MainDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM /*lParam*/) {
|
||||||
switch (message) {
|
switch (message) {
|
||||||
case WM_INITDIALOG :
|
case WM_INITDIALOG :
|
||||||
return TRUE ;
|
return TRUE ;
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
####################################################################
|
||||||
|
# Startup
|
||||||
|
|
||||||
|
!define COMPILERNAME \"Clang 13.0.1\"
|
||||||
|
!define DEVCPP_VERSION \"$${APP_VERSION}\"
|
||||||
|
|
|
@ -0,0 +1,487 @@
|
||||||
|
####################################################################
|
||||||
|
# Startup
|
||||||
|
|
||||||
|
!include "config-clang.nsh"
|
||||||
|
!define COMPILERFOLDER "Clang64"
|
||||||
|
!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.win64.${COMPILERNAME}.Setup.exe"
|
||||||
|
!define DISPLAY_NAME "Red Panda C++ ${DEVCPP_VERSION}"
|
||||||
|
|
||||||
|
!include "MUI2.nsh"
|
||||||
|
!include "lang.nsh"
|
||||||
|
|
||||||
|
!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# Installer Attributes
|
||||||
|
|
||||||
|
Name "${DISPLAY_NAME}"
|
||||||
|
OutFile "${FINALNAME}"
|
||||||
|
Caption "${DISPLAY_NAME}"
|
||||||
|
|
||||||
|
LicenseData "LICENSE"
|
||||||
|
InstallDir $PROGRAMFILES64\RedPanda-Cpp
|
||||||
|
####################################################################
|
||||||
|
# Interface Settings
|
||||||
|
|
||||||
|
ShowInstDetails show
|
||||||
|
AutoCloseWindow false
|
||||||
|
SilentInstall normal
|
||||||
|
CRCCheck on
|
||||||
|
SetCompressor /SOLID /FINAL lzma
|
||||||
|
SetCompressorDictSize 64
|
||||||
|
SetDatablockOptimize on
|
||||||
|
SetOverwrite try
|
||||||
|
XPStyle on
|
||||||
|
|
||||||
|
InstType "Full";1
|
||||||
|
InstType "Minimal";2
|
||||||
|
InstType "Safe";3
|
||||||
|
|
||||||
|
## Remember the installer language
|
||||||
|
!define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
|
||||||
|
!define MUI_LANGDLL_REGISTRY_KEY "Software\RedPanda-C++"
|
||||||
|
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# Pages
|
||||||
|
|
||||||
|
!define MUI_ICON "devcpp.ico"
|
||||||
|
!define MUI_UNICON "devcpp.ico"
|
||||||
|
!define MUI_ABORTWARNING
|
||||||
|
!define MUI_LANGDLL_ALLLANGUAGES
|
||||||
|
!define MUI_FINISHPAGE_RUN "$INSTDIR\RedPandaIDE.exe"
|
||||||
|
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
|
||||||
|
!define MUI_COMPONENTSPAGE_SMALLDESC
|
||||||
|
|
||||||
|
!insertmacro MUI_PAGE_LICENSE "LICENSE"
|
||||||
|
!insertmacro MUI_PAGE_COMPONENTS
|
||||||
|
!insertmacro MUI_PAGE_DIRECTORY
|
||||||
|
!insertmacro MUI_PAGE_INSTFILES
|
||||||
|
!insertmacro MUI_PAGE_FINISH
|
||||||
|
!insertmacro MUI_UNPAGE_CONFIRM
|
||||||
|
!insertmacro MUI_UNPAGE_INSTFILES
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# Languages
|
||||||
|
|
||||||
|
!insertmacro MUI_LANGUAGE "English"
|
||||||
|
!insertmacro MUI_LANGUAGE "SimpChinese"
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# Files, by option section
|
||||||
|
|
||||||
|
Section "$(SectionMainName)" SectionMain
|
||||||
|
SectionIn 1 2 3 RO
|
||||||
|
|
||||||
|
SetOutPath $INSTDIR
|
||||||
|
|
||||||
|
SetRegView 64
|
||||||
|
; Allways create an uninstaller
|
||||||
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++" "DisplayName" "Redpanda-C++"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++" "UninstallString" "$INSTDIR\uninstall.exe"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++" "DisplayVersion" "${DEVCPP_VERSION}"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++" "DisplayIcon" "$INSTDIR\RedPandaIDE.exe"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++" "Publisher" "Roy Qu(royqh1979@gmail.com)"
|
||||||
|
|
||||||
|
|
||||||
|
; Write required files
|
||||||
|
File "RedPandaIDE.exe"
|
||||||
|
File "ConsolePauser.exe"
|
||||||
|
File "redpanda-win-git-askpass.exe"
|
||||||
|
File "astyle.exe"
|
||||||
|
File "LICENSE"
|
||||||
|
File "NEWS.md"
|
||||||
|
File "README.md"
|
||||||
|
|
||||||
|
; Write required paths
|
||||||
|
SetOutPath $INSTDIR\Templates
|
||||||
|
File /nonfatal /r "Templates\*"
|
||||||
|
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
Section "$(SectionMinGWName)" SectionMinGW
|
||||||
|
SectionIn 1 3
|
||||||
|
SetOutPath $INSTDIR\Clang64
|
||||||
|
|
||||||
|
File /nonfatal /r "${COMPILERFOLDER}\*"
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# File association
|
||||||
|
SubSection "$(SectionAssocsName)" SectionAssocs
|
||||||
|
Section "$(SectionAssocExtNameBegin) .dev $(SectionAssocExtNameEnd)"
|
||||||
|
SectionIn 1 3
|
||||||
|
|
||||||
|
StrCpy $0 ".dev"
|
||||||
|
Call BackupAssoc
|
||||||
|
|
||||||
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
||||||
|
WriteRegStr HKCR ".dev" "" "DevCpp.dev"
|
||||||
|
WriteRegStr HKCR "DevCpp.dev" "" "Dev-C++ Project File"
|
||||||
|
WriteRegStr HKCR "DevCpp.dev\DefaultIcon" "" '$0,3'
|
||||||
|
WriteRegStr HKCR "DevCpp.dev\Shell\Open\Command" "" '$0 "%1"'
|
||||||
|
Call RefreshShellIcons
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
Section "$(SectionAssocExtNameBegin) .c $(SectionAssocExtNameEnd)"
|
||||||
|
SectionIn 1 3
|
||||||
|
|
||||||
|
StrCpy $0 ".c"
|
||||||
|
Call BackupAssoc
|
||||||
|
|
||||||
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
||||||
|
WriteRegStr HKCR ".c" "" "DevCpp.c"
|
||||||
|
WriteRegStr HKCR "DevCpp.c" "" "C Source File"
|
||||||
|
WriteRegStr HKCR "DevCpp.c\DefaultIcon" "" '$0,4'
|
||||||
|
WriteRegStr HKCR "DevCpp.c\Shell\Open\Command" "" '$0 "%1"'
|
||||||
|
Call RefreshShellIcons
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
Section "$(SectionAssocExtNameBegin) .cpp $(SectionAssocExtNameEnd)"
|
||||||
|
SectionIn 1 3
|
||||||
|
|
||||||
|
StrCpy $0 ".cpp"
|
||||||
|
Call BackupAssoc
|
||||||
|
|
||||||
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
||||||
|
WriteRegStr HKCR ".cpp" "" "DevCpp.cpp"
|
||||||
|
WriteRegStr HKCR "DevCpp.cpp" "" "C++ Source File"
|
||||||
|
WriteRegStr HKCR "DevCpp.cpp\DefaultIcon" "" '$0,5'
|
||||||
|
WriteRegStr HKCR "DevCpp.cpp\Shell\Open\Command" "" '$0 "%1"'
|
||||||
|
Call RefreshShellIcons
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
Section "$(SectionAssocExtNameBegin) .cxx $(SectionAssocExtNameEnd)"
|
||||||
|
SectionIn 1 3
|
||||||
|
|
||||||
|
StrCpy $0 ".cxx"
|
||||||
|
Call BackupAssoc
|
||||||
|
|
||||||
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
||||||
|
WriteRegStr HKCR ".cxx" "" "DevCpp.cxx"
|
||||||
|
WriteRegStr HKCR "DevCpp.cxx" "" "C++ Source File"
|
||||||
|
WriteRegStr HKCR "DevCpp.cxx\DefaultIcon" "" '$0,5'
|
||||||
|
WriteRegStr HKCR "DevCpp.cxx\Shell\Open\Command" "" '$0 "%1"'
|
||||||
|
Call RefreshShellIcons
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
Section "$(SectionAssocExtNameBegin) .cc $(SectionAssocExtNameEnd)"
|
||||||
|
SectionIn 1 3
|
||||||
|
|
||||||
|
StrCpy $0 ".cc"
|
||||||
|
Call BackupAssoc
|
||||||
|
|
||||||
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
||||||
|
WriteRegStr HKCR ".cc" "" "DevCpp.cc"
|
||||||
|
WriteRegStr HKCR "DevCpp.cc" "" "C++ Source File"
|
||||||
|
WriteRegStr HKCR "DevCpp.cc\DefaultIcon" "" '$0,5'
|
||||||
|
WriteRegStr HKCR "DevCpp.cc\Shell\Open\Command" "" '$0 "%1"'
|
||||||
|
Call RefreshShellIcons
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
Section "$(SectionAssocExtNameBegin) .hxx $(SectionAssocExtNameEnd)"
|
||||||
|
SectionIn 1 3
|
||||||
|
|
||||||
|
StrCpy $0 ".hxx"
|
||||||
|
Call BackupAssoc
|
||||||
|
|
||||||
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
||||||
|
WriteRegStr HKCR ".hxx" "" "DevCpp.hxx"
|
||||||
|
WriteRegStr HKCR "DevCpp.hxx" "" "C++ Header File"
|
||||||
|
WriteRegStr HKCR "DevCpp.hxx\DefaultIcon" "" '$0,7'
|
||||||
|
WriteRegStr HKCR "DevCpp.hxx\Shell\Open\Command" "" '$0 "%1"'
|
||||||
|
Call RefreshShellIcons
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
Section "$(SectionAssocExtNameBegin) .h $(SectionAssocExtNameEnd)"
|
||||||
|
SectionIn 1 3
|
||||||
|
|
||||||
|
StrCpy $0 ".h"
|
||||||
|
Call BackupAssoc
|
||||||
|
|
||||||
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
||||||
|
WriteRegStr HKCR ".h" "" "DevCpp.h"
|
||||||
|
WriteRegStr HKCR "DevCpp.h" "" "C Header File"
|
||||||
|
WriteRegStr HKCR "DevCpp.h\DefaultIcon" "" '$0,6'
|
||||||
|
WriteRegStr HKCR "DevCpp.h\Shell\Open\Command" "" '$0 "%1"'
|
||||||
|
Call RefreshShellIcons
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
Section "$(SectionAssocExtNameBegin) .hpp $(SectionAssocExtNameEnd)"
|
||||||
|
SectionIn 1 3
|
||||||
|
|
||||||
|
StrCpy $0 ".hpp"
|
||||||
|
Call BackupAssoc
|
||||||
|
|
||||||
|
StrCpy $0 $INSTDIR\RedPandaIDE.exe
|
||||||
|
WriteRegStr HKCR ".hpp" "" "DevCpp.hpp"
|
||||||
|
WriteRegStr HKCR "DevCpp.hpp" "" "C++ Header File"
|
||||||
|
WriteRegStr HKCR "DevCpp.hpp\DefaultIcon" "" '$0,7'
|
||||||
|
WriteRegStr HKCR "DevCpp.hpp\Shell\Open\Command" "" '$0 "%1"'
|
||||||
|
Call RefreshShellIcons
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
SubSectionEnd
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# Shortcuts
|
||||||
|
SubSection "$(SectionShortcutsName)" SectionShortcuts
|
||||||
|
|
||||||
|
Section "$(SectionMenuLaunchName)" SectionMenuLaunch
|
||||||
|
SectionIn 1 3
|
||||||
|
|
||||||
|
; always use all user start menu, normal users can delete these
|
||||||
|
SetShellVarContext all
|
||||||
|
StrCpy $0 $SMPROGRAMS ; start menu Programs folder
|
||||||
|
CreateDirectory "$0\$(MessageAppName)"
|
||||||
|
CreateShortCut "$0\$(MessageAppName)\$(MessageAppName).lnk" "$INSTDIR\RedPandaIDE.exe"
|
||||||
|
CreateShortCut "$0\$(MessageAppName)\License.lnk" "$INSTDIR\LICENSE"
|
||||||
|
CreateShortCut "$0\$(MessageAppName)\Uninstall $(MessageAppName).lnk" "$INSTDIR\uninstall.exe"
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
Section "$(SectionDesktopLaunchName)" SectionDesktopLaunch
|
||||||
|
SectionIn 1 3
|
||||||
|
|
||||||
|
; always use current user desktop, normal users can't delete all users' shortcuts
|
||||||
|
SetShellVarContext current
|
||||||
|
CreateShortCut "$DESKTOP\$(MessageAppName).lnk" "$INSTDIR\RedPandaIDE.exe"
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
SubSectionEnd
|
||||||
|
|
||||||
|
Section "$(SectionConfigName)" SectionConfig
|
||||||
|
SectionIn 3
|
||||||
|
|
||||||
|
RMDir /r "$APPDATA\RedPandaIDE"
|
||||||
|
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
|
||||||
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||||
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionMain} "$(MessageSectionMain)"
|
||||||
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionMinGW} "$(MessageSectionMinGW)"
|
||||||
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionShortcuts} "$(MessageSectionShortcuts)"
|
||||||
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionAssocs} "$(MessageSectionAssocs)"
|
||||||
|
!insertmacro MUI_DESCRIPTION_TEXT ${SectionConfig} "$(MessageSectionConfig)"
|
||||||
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# Functions, utilities
|
||||||
|
|
||||||
|
Function .onInit
|
||||||
|
!insertmacro MUI_LANGDLL_DISPLAY
|
||||||
|
|
||||||
|
IfFileExists "C:\Dev-Cpp\devcpp.exe" 0 +2
|
||||||
|
SectionSetFlags ${SectionConfig} ${SF_SELECTED} # Remove old Dev-Cpp config files
|
||||||
|
|
||||||
|
IfFileExists "$APPDATA\Dev-Cpp\devcpp.cfg" 0 +2 # deprecated config file
|
||||||
|
SectionSetFlags ${SectionConfig} ${SF_SELECTED}
|
||||||
|
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
Function myGuiInit
|
||||||
|
|
||||||
|
; uninstall existing
|
||||||
|
SetRegView 32
|
||||||
|
Call UninstallExisting
|
||||||
|
SetRegView 64
|
||||||
|
Call UninstallExisting
|
||||||
|
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
;backup file association
|
||||||
|
Function BackupAssoc
|
||||||
|
;$0 is an extension - for example ".dev"
|
||||||
|
|
||||||
|
;check if backup already exists
|
||||||
|
ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++\Backup" "$0"
|
||||||
|
;don't backup if backup exists in registry
|
||||||
|
StrCmp $1 "" 0 no_assoc
|
||||||
|
|
||||||
|
ReadRegStr $1 HKCR "$0" ""
|
||||||
|
;don't backup dev-cpp associations
|
||||||
|
StrCmp $1 "DevCpp$0" no_assoc
|
||||||
|
|
||||||
|
StrCmp $1 "" no_assoc
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++\Backup" "$0" "$1"
|
||||||
|
no_assoc:
|
||||||
|
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
Function un.onInit
|
||||||
|
!insertmacro MUI_UNGETLANGUAGE
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
;restore file association
|
||||||
|
Function un.RestoreAssoc
|
||||||
|
;$0 is an extension - for example ".dev"
|
||||||
|
|
||||||
|
DeleteRegKey HKCR "$0"
|
||||||
|
ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++\Backup" "$0"
|
||||||
|
StrCmp $1 "" no_backup
|
||||||
|
WriteRegStr HKCR "$0" "" "$1"
|
||||||
|
Call un.RefreshShellIcons
|
||||||
|
no_backup:
|
||||||
|
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
;http://nsis.sourceforge.net/archive/viewpage.php?pageid=202
|
||||||
|
;After changing file associations, you can call this macro to refresh the shell immediatly.
|
||||||
|
;It calls the shell32 function SHChangeNotify. This will force windows to reload your changes from the registry.
|
||||||
|
!define SHCNE_ASSOCCHANGED 0x08000000
|
||||||
|
!define SHCNF_IDLIST 0
|
||||||
|
|
||||||
|
Function RefreshShellIcons
|
||||||
|
; By jerome tremblay - april 2003
|
||||||
|
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v \
|
||||||
|
(${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
Function un.RefreshShellIcons
|
||||||
|
; By jerome tremblay - april 2003
|
||||||
|
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v \
|
||||||
|
(${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
Function un.DeleteDirIfEmpty
|
||||||
|
FindFirst $R0 $R1 "$0\*.*"
|
||||||
|
strcmp $R1 "." 0 NoDelete
|
||||||
|
FindNext $R0 $R1
|
||||||
|
strcmp $R1 ".." 0 NoDelete
|
||||||
|
ClearErrors
|
||||||
|
FindNext $R0 $R1
|
||||||
|
IfErrors 0 NoDelete
|
||||||
|
FindClose $R0
|
||||||
|
Sleep 1000
|
||||||
|
RMDir "$0"
|
||||||
|
NoDelete:
|
||||||
|
FindClose $R0
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
Function GetParent
|
||||||
|
|
||||||
|
Exch $R0
|
||||||
|
Push $R1
|
||||||
|
Push $R2
|
||||||
|
Push $R3
|
||||||
|
|
||||||
|
StrCpy $R1 0
|
||||||
|
StrLen $R2 $R0
|
||||||
|
|
||||||
|
loop:
|
||||||
|
IntOp $R1 $R1 + 1
|
||||||
|
IntCmp $R1 $R2 get 0 get
|
||||||
|
StrCpy $R3 $R0 1 -$R1
|
||||||
|
StrCmp $R3 "\" get
|
||||||
|
Goto loop
|
||||||
|
|
||||||
|
get:
|
||||||
|
StrCpy $R0 $R0 -$R1
|
||||||
|
|
||||||
|
Pop $R3
|
||||||
|
Pop $R2
|
||||||
|
Pop $R1
|
||||||
|
Exch $R0
|
||||||
|
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
Function UninstallExisting
|
||||||
|
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++" "UninstallString"
|
||||||
|
|
||||||
|
StrCmp $R0 "" done
|
||||||
|
|
||||||
|
Push $R0
|
||||||
|
Call GetParent
|
||||||
|
Pop $R1
|
||||||
|
|
||||||
|
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
|
||||||
|
"$(MessageUninstallExisting)" \
|
||||||
|
IDOK uninst
|
||||||
|
Abort
|
||||||
|
|
||||||
|
;Run the uninstaller
|
||||||
|
uninst:
|
||||||
|
ClearErrors
|
||||||
|
HideWindow
|
||||||
|
ClearErrors
|
||||||
|
ExecWait '"$R0" _?=$R1'
|
||||||
|
BringToFront
|
||||||
|
|
||||||
|
done:
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# uninstall
|
||||||
|
|
||||||
|
UninstallText "$(MessageUninstallText)"
|
||||||
|
ShowUninstDetails show
|
||||||
|
|
||||||
|
Section "Uninstall"
|
||||||
|
|
||||||
|
; Remove uninstaller
|
||||||
|
Delete "$INSTDIR\uninstall.exe"
|
||||||
|
|
||||||
|
; Remove start menu stuff, located in all users folder
|
||||||
|
SetShellVarContext all
|
||||||
|
Delete "$SMPROGRAMS\$(MessageAppName)\$(MessageAppName).lnk"
|
||||||
|
Delete "$SMPROGRAMS\$(MessageAppName)\License.lnk"
|
||||||
|
Delete "$SMPROGRAMS\$(MessageAppName)\Uninstall $(MessageAppName).lnk"
|
||||||
|
RMDir "$SMPROGRAMS\$(MessageAppName)"
|
||||||
|
|
||||||
|
; Remove desktop stuff, located in current user folder
|
||||||
|
SetShellVarContext current
|
||||||
|
Delete "$QUICKLAUNCH\$(MessageAppName).lnk"
|
||||||
|
Delete "$DESKTOP\$(MessageAppName).lnk"
|
||||||
|
|
||||||
|
; Restore file associations
|
||||||
|
StrCpy $0 ".dev"
|
||||||
|
Call un.RestoreAssoc
|
||||||
|
StrCpy $0 ".c"
|
||||||
|
Call un.RestoreAssoc
|
||||||
|
StrCpy $0 ".cpp"
|
||||||
|
Call un.RestoreAssoc
|
||||||
|
StrCpy $0 ".h"
|
||||||
|
Call un.RestoreAssoc
|
||||||
|
StrCpy $0 ".hpp"
|
||||||
|
Call un.RestoreAssoc
|
||||||
|
|
||||||
|
DeleteRegKey HKCR "DevCpp.dev"
|
||||||
|
DeleteRegKey HKCR "DevCpp.c"
|
||||||
|
DeleteRegKey HKCR "DevCpp.cpp"
|
||||||
|
DeleteRegKey HKCR "DevCpp.cxx"
|
||||||
|
DeleteRegKey HKCR "DevCpp.cc"
|
||||||
|
DeleteRegKey HKCR "DevCpp.h"
|
||||||
|
DeleteRegKey HKCR "DevCpp.hpp"
|
||||||
|
DeleteRegKey HKCR "DevCpp.hxx"
|
||||||
|
|
||||||
|
|
||||||
|
Delete "$INSTDIR\NEWS.md"
|
||||||
|
Delete "$INSTDIR\RedPandaIDE.exe"
|
||||||
|
Delete "$INSTDIR\ConsolePauser.exe"
|
||||||
|
Delete "$INSTDIR\redpanda-win-git-askpass.exe"
|
||||||
|
Delete "$INSTDIR\astyle.exe"
|
||||||
|
Delete "$INSTDIR\LICENSE"
|
||||||
|
Delete "$INSTDIR\README.md"
|
||||||
|
|
||||||
|
RMDir /r "$INSTDIR\Lang"
|
||||||
|
RMDir /r "$INSTDIR\Templates"
|
||||||
|
RMDir /r "$INSTDIR\MinGW32"
|
||||||
|
RMDir /r "$INSTDIR\MinGW64"
|
||||||
|
RMDir /r "$INSTDIR\Clang64"
|
||||||
|
|
||||||
|
StrCpy $0 "$INSTDIR"
|
||||||
|
Call un.DeleteDirIfEmpty
|
||||||
|
|
||||||
|
; Remove registry keys
|
||||||
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++"
|
||||||
|
DeleteRegKey HKCU "Software\RedPanda-C++"
|
||||||
|
|
||||||
|
IfSilent +2 ; Don't ask when running in silent mode
|
||||||
|
MessageBox MB_YESNO "$(MessageRemoveConfig)" IDNO Done
|
||||||
|
|
||||||
|
RMDir /r "$APPDATA\RedPandaIDE"
|
||||||
|
|
||||||
|
Done:
|
||||||
|
SectionEnd
|
|
@ -460,6 +460,7 @@ Section "Uninstall"
|
||||||
RMDir /r "$INSTDIR\Templates"
|
RMDir /r "$INSTDIR\Templates"
|
||||||
RMDir /r "$INSTDIR\MinGW32"
|
RMDir /r "$INSTDIR\MinGW32"
|
||||||
RMDir /r "$INSTDIR\MinGW64"
|
RMDir /r "$INSTDIR\MinGW64"
|
||||||
|
RMDir /r "$INSTDIR\Clang64"
|
||||||
|
|
||||||
StrCpy $0 "$INSTDIR"
|
StrCpy $0 "$INSTDIR"
|
||||||
Call un.DeleteDirIfEmpty
|
Call un.DeleteDirIfEmpty
|
||||||
|
|
|
@ -467,6 +467,7 @@ Section "Uninstall"
|
||||||
RMDir /r "$INSTDIR\Templates"
|
RMDir /r "$INSTDIR\Templates"
|
||||||
RMDir /r "$INSTDIR\MinGW32"
|
RMDir /r "$INSTDIR\MinGW32"
|
||||||
RMDir /r "$INSTDIR\MinGW64"
|
RMDir /r "$INSTDIR\MinGW64"
|
||||||
|
RMDir /r "$INSTDIR\Clang64"
|
||||||
|
|
||||||
StrCpy $0 "$INSTDIR"
|
StrCpy $0 "$INSTDIR"
|
||||||
Call un.DeleteDirIfEmpty
|
Call un.DeleteDirIfEmpty
|
||||||
|
|
|
@ -460,6 +460,7 @@ Section "Uninstall"
|
||||||
RMDir /r "$INSTDIR\Templates"
|
RMDir /r "$INSTDIR\Templates"
|
||||||
RMDir /r "$INSTDIR\MinGW32"
|
RMDir /r "$INSTDIR\MinGW32"
|
||||||
RMDir /r "$INSTDIR\MinGW64"
|
RMDir /r "$INSTDIR\MinGW64"
|
||||||
|
RMDir /r "$INSTDIR\Clang64"
|
||||||
|
|
||||||
StrCpy $0 "$INSTDIR"
|
StrCpy $0 "$INSTDIR"
|
||||||
Call un.DeleteDirIfEmpty
|
Call un.DeleteDirIfEmpty
|
||||||
|
|
|
@ -469,6 +469,7 @@ Section "Uninstall"
|
||||||
RMDir /r "$INSTDIR\Templates"
|
RMDir /r "$INSTDIR\Templates"
|
||||||
RMDir /r "$INSTDIR\MinGW32"
|
RMDir /r "$INSTDIR\MinGW32"
|
||||||
RMDir /r "$INSTDIR\MinGW64"
|
RMDir /r "$INSTDIR\MinGW64"
|
||||||
|
RMDir /r "$INSTDIR\Clang64"
|
||||||
|
|
||||||
StrCpy $0 "$INSTDIR"
|
StrCpy $0 "$INSTDIR"
|
||||||
Call un.DeleteDirIfEmpty
|
Call un.DeleteDirIfEmpty
|
||||||
|
|
Loading…
Reference in New Issue