GUI: Disable platform selection during checking.
Fixes ticket: #3250 (GUI: platform type should not be changeable at runtime)
This commit is contained in:
parent
326d6df9f5
commit
f15729bee2
|
@ -28,6 +28,8 @@
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QActionGroup>
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "aboutdialog.h"
|
#include "aboutdialog.h"
|
||||||
#include "threadhandler.h"
|
#include "threadhandler.h"
|
||||||
|
@ -48,6 +50,7 @@ MainWindow::MainWindow() :
|
||||||
mTranslation(new TranslationHandler(this)),
|
mTranslation(new TranslationHandler(this)),
|
||||||
mLogView(NULL),
|
mLogView(NULL),
|
||||||
mProject(NULL),
|
mProject(NULL),
|
||||||
|
mPlatformActions(new QActionGroup(this)),
|
||||||
mExiting(false)
|
mExiting(false)
|
||||||
{
|
{
|
||||||
mUI.setupUi(this);
|
mUI.setupUi(this);
|
||||||
|
@ -148,7 +151,6 @@ MainWindow::MainWindow() :
|
||||||
mUI.mActionProjectMRU->setVisible(false);
|
mUI.mActionProjectMRU->setVisible(false);
|
||||||
UpdateMRUMenuItems();
|
UpdateMRUMenuItems();
|
||||||
|
|
||||||
QActionGroup* platformGroup = new QActionGroup(this);
|
|
||||||
for (int i = 0; i < mPlatforms.getCount(); i++) {
|
for (int i = 0; i < mPlatforms.getCount(); i++) {
|
||||||
Platform plat = mPlatforms.mPlatforms[i];
|
Platform plat = mPlatforms.mPlatforms[i];
|
||||||
QAction *act = new QAction(this);
|
QAction *act = new QAction(this);
|
||||||
|
@ -157,7 +159,7 @@ MainWindow::MainWindow() :
|
||||||
act->setText(plat.mTitle);
|
act->setText(plat.mTitle);
|
||||||
act->setData(plat.mType);
|
act->setData(plat.mType);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
act->setActionGroup(platformGroup);
|
act->setActionGroup(mPlatformActions);
|
||||||
mUI.mMenuCheck->insertAction(mUI.mActionPlatforms, act);
|
mUI.mMenuCheck->insertAction(mUI.mActionPlatforms, act);
|
||||||
connect(act, SIGNAL(triggered()), this, SLOT(SelectPlatform()));
|
connect(act, SIGNAL(triggered()), this, SLOT(SelectPlatform()));
|
||||||
}
|
}
|
||||||
|
@ -503,6 +505,7 @@ void MainWindow::CheckDone()
|
||||||
mUI.mActionOpenXML->setEnabled(true);
|
mUI.mActionOpenXML->setEnabled(true);
|
||||||
EnableProjectActions(true);
|
EnableProjectActions(true);
|
||||||
EnableProjectOpenActions(true);
|
EnableProjectOpenActions(true);
|
||||||
|
mPlatformActions->setEnabled(true);
|
||||||
|
|
||||||
if (mUI.mResults->HasResults()) {
|
if (mUI.mResults->HasResults()) {
|
||||||
mUI.mActionClearResults->setEnabled(true);
|
mUI.mActionClearResults->setEnabled(true);
|
||||||
|
@ -520,6 +523,7 @@ void MainWindow::CheckLockDownUI()
|
||||||
mUI.mActionOpenXML->setEnabled(false);
|
mUI.mActionOpenXML->setEnabled(false);
|
||||||
EnableProjectActions(false);
|
EnableProjectActions(false);
|
||||||
EnableProjectOpenActions(false);
|
EnableProjectOpenActions(false);
|
||||||
|
mPlatformActions->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ProgramSettings()
|
void MainWindow::ProgramSettings()
|
||||||
|
|
|
@ -41,6 +41,7 @@ class Project;
|
||||||
class ErrorItem;
|
class ErrorItem;
|
||||||
class StatsDialog;
|
class StatsDialog;
|
||||||
class QAction;
|
class QAction;
|
||||||
|
class QActionGroup;
|
||||||
|
|
||||||
/// @addtogroup GUI
|
/// @addtogroup GUI
|
||||||
/// @{
|
/// @{
|
||||||
|
@ -473,6 +474,11 @@ protected:
|
||||||
*/
|
*/
|
||||||
QTimer* mFilterTimer;
|
QTimer* mFilterTimer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GUI actions for selecting the checked platform.
|
||||||
|
*/
|
||||||
|
QActionGroup *mPlatformActions;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue