diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2008-06-13 15:19:53 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2008-06-13 15:19:53 (GMT) |
commit | b1c31be668122b23014a7e71be75353f81d157e3 (patch) | |
tree | 6b6f30c8bf56b950b6db1e2cdd003f3ffbc917d6 /Source/QtDialog/CMakeSetupDialog.cxx | |
parent | 7b45050c5d3f994a2ef64ed05e56184d563b4446 (diff) | |
download | CMake-b1c31be668122b23014a7e71be75353f81d157e3.zip CMake-b1c31be668122b23014a7e71be75353f81d157e3.tar.gz CMake-b1c31be668122b23014a7e71be75353f81d157e3.tar.bz2 |
ENH: Make original flat view the default.
Add option to switch to grouped view (and remember it).
Diffstat (limited to 'Source/QtDialog/CMakeSetupDialog.cxx')
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.cxx | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 2ec70d7..0da6543 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -77,6 +77,11 @@ CMakeSetupDialog::CMakeSetupDialog() this->RemoveEntry->setEnabled(false); this->AddEntry->setEnabled(false); + bool groupView = settings.value("GroupView", false).toBool(); + this->CacheValues->cacheModel()->setViewType(groupView ? + QCMakeCacheModel::GroupView : QCMakeCacheModel::FlatView); + this->CacheValues->setRootIsDecorated(groupView); + QMenu* FileMenu = this->menuBar()->addMenu(tr("&File")); this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache")); QObject::connect(this->ReloadCacheAction, SIGNAL(triggered(bool)), @@ -112,10 +117,16 @@ CMakeSetupDialog::CMakeSetupDialog() QObject::connect(debugAction, SIGNAL(toggled(bool)), this, SLOT(setDebugOutput(bool))); - QAction* expandAction = OptionsMenu->addAction(tr("&Expand Variables Tree")); + 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())); - QAction* collapseAction = OptionsMenu->addAction(tr("&Collapse Variables Tree")); + QAction* collapseAction = OptionsMenu->addAction(tr("&Collapse Grouped Entries")); QObject::connect(collapseAction, SIGNAL(triggered(bool)), this->CacheValues, SLOT(collapseAll())); @@ -307,7 +318,7 @@ void CMakeSetupDialog::doConfigure() void CMakeSetupDialog::finishConfigure(int err) { - if(0 == err && !this->CacheValues->cacheModel()->hasNewProperties()) + if(0 == err && !this->CacheValues->cacheModel()->newPropertyCount()) { this->enterState(ReadyGenerate); } @@ -920,3 +931,13 @@ void CMakeSetupDialog::setDebugOutput(bool flag) "setDebugOutput", Qt::QueuedConnection, Q_ARG(bool, flag)); } +void CMakeSetupDialog::toggleGroupView(bool f) +{ + this->CacheValues->cacheModel()->setViewType(f ? QCMakeCacheModel::GroupView : QCMakeCacheModel::FlatView); + this->CacheValues->setRootIsDecorated(f); + + QSettings settings; + settings.beginGroup("Settings/StartPath"); + settings.setValue("GroupView", this->CacheValues->cacheModel()->viewType() == QCMakeCacheModel::GroupView); +} + |