diff --git a/NEWS.md b/NEWS.md index 157a7e0c..d411ab7f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,7 @@ Red Panda C++ Version 1.0.8 - enhancement: add compiler commandline argument for "-E" (only preprocessing) - enhancement: auto set output suffix to ".expanded.cpp" when compiler commandline argument for "-E" is turned on - enhancement: auto set output suffix to ".s" when compiler commandline argument for "-S" is turned on + - enhancement: show error message when user set a shortcut that's already being used. Red Panda C++ Version 1.0.7 - change: use Shift+Enter to break line diff --git a/RedPandaIDE/settingsdialog/environmentshortcutwidget.cpp b/RedPandaIDE/settingsdialog/environmentshortcutwidget.cpp index a2a12d26..c3b65fd8 100644 --- a/RedPandaIDE/settingsdialog/environmentshortcutwidget.cpp +++ b/RedPandaIDE/settingsdialog/environmentshortcutwidget.cpp @@ -19,6 +19,7 @@ #include "../mainwindow.h" #include "../widgets/shortcutinputedit.h" #include +#include EnvironmentShortcutWidget::EnvironmentShortcutWidget(const QString& name, const QString& group, QWidget *parent) : SettingsWidget(name,group,parent), @@ -119,6 +120,17 @@ bool EnvironmentShortcutModel::setData(const QModelIndex &index, const QVariant PEnvironmentShortcut item = mShortcuts[index.row()]; QString s = value.toString().trimmed(); if (s!=item->shortcut) { + for (int i=0;ishortcut) { + QMessageBox::critical(nullptr, + tr("Error"), + tr("Shortcut \"%1\" is used by \"%2\".") + .arg(s,mShortcuts[i]->fullPath)); + return false; + } + } item->shortcut = value.toString(); emit shortcutChanged(); }