summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/CMakeSetupDialog.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2008-07-05 17:25:04 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2008-07-05 17:25:04 (GMT)
commitf729538aaa8710155ea7dc9651c176aaf1c05c9e (patch)
treedc7ffc4ca4330ad62b20accc073aa6c678b7a95b /Source/QtDialog/CMakeSetupDialog.cxx
parent65ad7ba830588ab2646783b1a0df58abc0c38e37 (diff)
downloadCMake-f729538aaa8710155ea7dc9651c176aaf1c05c9e.zip
CMake-f729538aaa8710155ea7dc9651c176aaf1c05c9e.tar.gz
CMake-f729538aaa8710155ea7dc9651c176aaf1c05c9e.tar.bz2
ENH: Replace Advanced checkbox and group option in menu with a combo box to
choose view type.
Diffstat (limited to 'Source/QtDialog/CMakeSetupDialog.cxx')
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx42
1 files changed, 28 insertions, 14 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 0da6543..32e6516 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -78,9 +78,11 @@ CMakeSetupDialog::CMakeSetupDialog()
this->AddEntry->setEnabled(false);
bool groupView = settings.value("GroupView", false).toBool();
- this->CacheValues->cacheModel()->setViewType(groupView ?
- QCMakeCacheModel::GroupView : QCMakeCacheModel::FlatView);
- this->CacheValues->setRootIsDecorated(groupView);
+ if(groupView)
+ {
+ this->setViewType(2);
+ this->ViewType->setCurrentIndex(2);
+ }
QMenu* FileMenu = this->menuBar()->addMenu(tr("&File"));
this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache"));
@@ -118,11 +120,6 @@ CMakeSetupDialog::CMakeSetupDialog()
this, SLOT(setDebugOutput(bool)));
OptionsMenu->addSeparator();
- QAction* groupAction = OptionsMenu->addAction(tr("&Group Entries"));
- groupAction->setCheckable(true);
- groupAction->setChecked(this->CacheValues->cacheModel()->viewType() == QCMakeCacheModel::GroupView);
- QObject::connect(groupAction, SIGNAL(toggled(bool)),
- this, SLOT(toggleGroupView(bool)));
QAction* expandAction = OptionsMenu->addAction(tr("&Expand Grouped Entries"));
QObject::connect(expandAction, SIGNAL(triggered(bool)),
this->CacheValues, SLOT(expandAll()));
@@ -214,8 +211,8 @@ void CMakeSetupDialog::initialize()
SIGNAL(outputMessage(QString)),
this, SLOT(message(QString)));
- QObject::connect(this->Advanced, SIGNAL(clicked(bool)),
- this->CacheValues, SLOT(setShowAdvanced(bool)));
+ QObject::connect(this->ViewType, SIGNAL(currentIndexChanged(int)),
+ this, SLOT(setViewType(int)));
QObject::connect(this->Search, SIGNAL(textChanged(QString)),
this->CacheValues, SLOT(setSearchFilter(QString)));
@@ -931,13 +928,30 @@ void CMakeSetupDialog::setDebugOutput(bool flag)
"setDebugOutput", Qt::QueuedConnection, Q_ARG(bool, flag));
}
-void CMakeSetupDialog::toggleGroupView(bool f)
+void CMakeSetupDialog::setViewType(int v)
{
- this->CacheValues->cacheModel()->setViewType(f ? QCMakeCacheModel::GroupView : QCMakeCacheModel::FlatView);
- this->CacheValues->setRootIsDecorated(f);
+ if(v == 0) // simple view
+ {
+ this->CacheValues->cacheModel()->setViewType(QCMakeCacheModel::FlatView);
+ this->CacheValues->setRootIsDecorated(false);
+ this->CacheValues->setShowAdvanced(false);
+ }
+ else if(v == 1) // advanced view
+ {
+ this->CacheValues->cacheModel()->setViewType(QCMakeCacheModel::FlatView);
+ this->CacheValues->setRootIsDecorated(false);
+ this->CacheValues->setShowAdvanced(true);
+ }
+ else if(v == 2) // grouped view
+ {
+ this->CacheValues->cacheModel()->setViewType(QCMakeCacheModel::GroupView);
+ this->CacheValues->setRootIsDecorated(true);
+ this->CacheValues->setShowAdvanced(true);
+ }
QSettings settings;
settings.beginGroup("Settings/StartPath");
- settings.setValue("GroupView", this->CacheValues->cacheModel()->viewType() == QCMakeCacheModel::GroupView);
+ settings.setValue("GroupView", v == 2);
+
}