- enhancement: Add compiler set by choose the executable.

This commit is contained in:
Roy Qu 2024-03-27 23:29:03 +08:00
parent e70ec78bef
commit ab8133d7cf
3 changed files with 26 additions and 2 deletions

View File

@ -101,6 +101,7 @@ Red Panda C++ Version 2.27
- fix: "project name".exe.manifest is auto removed when build the project. - fix: "project name".exe.manifest is auto removed when build the project.
- fix: "0x3.12p+1" is treadted as a plus expression when reformatting code. ( by 绣球135@qq - fix: "0x3.12p+1" is treadted as a plus expression when reformatting code. ( by 绣球135@qq
- change: Don't turn on the code format option "indent class" by default. - change: Don't turn on the code format option "indent class" by default.
- enhancement: Add compiler set by choose the executable.
Red Panda C++ Version 2.26 Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors. - enhancement: Code suggestion for embedded std::vectors.

View File

@ -344,7 +344,7 @@ void CompilerSetOptionWidget::on_btnAddBlankCompilerSet_clicked()
void CompilerSetOptionWidget::on_btnAddCompilerSetByFolder_clicked() void CompilerSetOptionWidget::on_btnAddCompilerSetByFolder_clicked()
{ {
QString folder = QFileDialog::getExistingDirectory(this, tr("Compiler Set Folder")); QString folder = QFileDialog::getExistingDirectory(this, tr("Compiler Folder"));
int oldSize = pSettings->compilerSets().size(); int oldSize = pSettings->compilerSets().size();
if (!pSettings->compilerSets().addSets(folder)) { if (!pSettings->compilerSets().addSets(folder)) {
@ -388,6 +388,7 @@ void CompilerSetOptionWidget::updateIcons(const QSize& /*size*/)
{ {
pIconsManager->setIcon(ui->btnFindCompilers, IconsManager::ACTION_EDIT_SEARCH); pIconsManager->setIcon(ui->btnFindCompilers, IconsManager::ACTION_EDIT_SEARCH);
pIconsManager->setIcon(ui->btnAddCompilerSetByFolder, IconsManager::ACTION_FILE_OPEN_FOLDER); pIconsManager->setIcon(ui->btnAddCompilerSetByFolder, IconsManager::ACTION_FILE_OPEN_FOLDER);
pIconsManager->setIcon(ui->btnAddCompilerSetByFile, IconsManager::ACTION_FILE_LOCATE);
pIconsManager->setIcon(ui->btnAddBlankCompilerSet, IconsManager::ACTION_MISC_ADD); pIconsManager->setIcon(ui->btnAddBlankCompilerSet, IconsManager::ACTION_MISC_ADD);
pIconsManager->setIcon(ui->btnRemoveCompilerSet, IconsManager::ACTION_MISC_REMOVE); pIconsManager->setIcon(ui->btnRemoveCompilerSet, IconsManager::ACTION_MISC_REMOVE);
pIconsManager->setIcon(ui->btnRenameCompilerSet, IconsManager::ACTION_MISC_RENAME); pIconsManager->setIcon(ui->btnRenameCompilerSet, IconsManager::ACTION_MISC_RENAME);
@ -496,3 +497,17 @@ void CompilerSetOptionWidget::on_btnChooseResourceCompiler_clicked()
ui->txtResourceCompiler->setText(fileName); ui->txtResourceCompiler->setText(fileName);
} }
void CompilerSetOptionWidget::on_btnAddCompilerSetByFile_clicked()
{
QString file = QFileDialog::getOpenFileName(this, tr("Compiler"));
if (file.isEmpty())
return;
QFileInfo fileInfo(file);
if (!fileInfo.isExecutable())
return false;
if (!pSettings->compilerSets().addSets(fileInfo.absolutePath(), fileInfo.fileName()));
return;
doLoad();
}

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>892</width> <width>1005</width>
<height>607</height> <height>607</height>
</rect> </rect>
</property> </property>
@ -49,6 +49,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QToolButton" name="btnAddCompilerSetByFile">
<property name="text">
<string>Add Compiler</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QToolButton" name="btnAddBlankCompilerSet"> <widget class="QToolButton" name="btnAddBlankCompilerSet">
<property name="toolTip"> <property name="toolTip">
@ -508,6 +515,7 @@
<tabstop>cbCompilerSet</tabstop> <tabstop>cbCompilerSet</tabstop>
<tabstop>btnFindCompilers</tabstop> <tabstop>btnFindCompilers</tabstop>
<tabstop>btnAddCompilerSetByFolder</tabstop> <tabstop>btnAddCompilerSetByFolder</tabstop>
<tabstop>btnAddCompilerSetByFile</tabstop>
<tabstop>btnAddBlankCompilerSet</tabstop> <tabstop>btnAddBlankCompilerSet</tabstop>
<tabstop>btnRenameCompilerSet</tabstop> <tabstop>btnRenameCompilerSet</tabstop>
<tabstop>btnRemoveCompilerSet</tabstop> <tabstop>btnRemoveCompilerSet</tabstop>