diff --git a/NEWS.md b/NEWS.md index 0f31f47a..2d23c21f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,7 @@ Red Panda C++ Version 1.1.0 - fix: undo doesn't work correctly after rename symbole & reformat - fix: can't remove a shortcut - enhancement: hide all menu actions in the option dialog's shortcut panel + - enhancement: add 'run all problem cases' / 'run current problem case' / 'batch set cases' to the option dialog's shortcut panel Red Panda C++ Version 1.0.10 - fix: modify watch doesn't work diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 837a001a..582c4a74 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -6898,6 +6898,17 @@ bool MainWindow::openningFiles() const return mOpenningFiles; } +QList MainWindow::listShortCutableActions() +{ + QList actions = findChildren(QString(), Qt::FindDirectChildrenOnly); + actions.append(mProblem_RunAllCases); + actions.append(mProblem_RunCurrentCase); + actions.append(mProblem_batchSetCases); + actions.append(mProblem_Properties); + return actions; +} + + void MainWindow::on_actionTool_Window_Bars_triggered() { bool state = ui->tabExplorer->isVisible(); @@ -6907,7 +6918,6 @@ void MainWindow::on_actionTool_Window_Bars_triggered() ui->actionTool_Window_Bars->setChecked(state); } - void MainWindow::on_actionStatus_Bar_triggered() { bool state = ui->statusbar->isVisible(); @@ -6916,7 +6926,6 @@ void MainWindow::on_actionStatus_Bar_triggered() ui->actionStatus_Bar->setChecked(state); } - void MainWindow::on_actionProject_triggered() { bool state = ui->actionProject->isChecked(); diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index 34636cb2..1358be05 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -189,6 +189,8 @@ public: bool openningFiles() const; + QList listShortCutableActions(); + public slots: void logToolsOutput(const QString& msg); void onCompileIssue(PCompileIssue issue); diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui index a04d15c5..dc26e31f 100644 --- a/RedPandaIDE/mainwindow.ui +++ b/RedPandaIDE/mainwindow.ui @@ -463,7 +463,7 @@ QTabWidget::West - 0 + 4 true diff --git a/RedPandaIDE/settingsdialog/environmentshortcutwidget.cpp b/RedPandaIDE/settingsdialog/environmentshortcutwidget.cpp index d9f01f04..5f6f1001 100644 --- a/RedPandaIDE/settingsdialog/environmentshortcutwidget.cpp +++ b/RedPandaIDE/settingsdialog/environmentshortcutwidget.cpp @@ -64,7 +64,7 @@ void EnvironmentShortcutModel::reload() beginResetModel(); mShortcuts.clear(); QList menus = pMainWindow->menuBar()->findChildren(); - QList actions = pMainWindow->findChildren(QString(), Qt::FindDirectChildrenOnly); + QList actions = pMainWindow->listShortCutableActions(); foreach( const QMenu* menu, menus) { if (menu->title().isEmpty()) continue; diff --git a/RedPandaIDE/widgets/customfilesystemmodel.cpp b/RedPandaIDE/widgets/customfilesystemmodel.cpp index 8d96e058..dcdc92bf 100644 --- a/RedPandaIDE/widgets/customfilesystemmodel.cpp +++ b/RedPandaIDE/widgets/customfilesystemmodel.cpp @@ -22,8 +22,3 @@ CustomFileSystemModel::CustomFileSystemModel(QObject *parent) : QFileSystemModel { } -QVariant CustomFileSystemModel::data(const QModelIndex &index, int role) const -{ - return QFileSystemModel::data(index,role); -} - diff --git a/RedPandaIDE/widgets/customfilesystemmodel.h b/RedPandaIDE/widgets/customfilesystemmodel.h index 67c1aae9..c26ffcc6 100644 --- a/RedPandaIDE/widgets/customfilesystemmodel.h +++ b/RedPandaIDE/widgets/customfilesystemmodel.h @@ -19,7 +19,6 @@ #include - class GitRepository; class GitManager; class CustomFileSystemModel : public QFileSystemModel @@ -28,9 +27,6 @@ class CustomFileSystemModel : public QFileSystemModel public: explicit CustomFileSystemModel(QObject *parent = nullptr); - // QAbstractItemModel interface -public: - QVariant data(const QModelIndex &index, int role) const override; }; #endif // CUSTOMFILESYSTEMMODEL_H