diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2010-04-26 22:06:21 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2010-04-26 22:06:52 (GMT) |
commit | 9ced0bf69b84e9e09a584abe11138aec8e9cf681 (patch) | |
tree | 3bddbfa3671c200061f357273da2d1d82628f1ab | |
parent | 6e1b510319cb60c4820b1e0d882f4a7911aabf53 (diff) | |
download | CMake-9ced0bf69b84e9e09a584abe11138aec8e9cf681.zip CMake-9ced0bf69b84e9e09a584abe11138aec8e9cf681.tar.gz CMake-9ced0bf69b84e9e09a584abe11138aec8e9cf681.tar.bz2 |
ENH: Add simple grouped view.
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.cxx | 42 | ||||
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.h | 3 | ||||
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.ui | 240 |
3 files changed, 134 insertions, 151 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index eb82f2a..74a3d35 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -81,11 +81,8 @@ CMakeSetupDialog::CMakeSetupDialog() this->Splitter->restoreState(p); bool groupView = settings.value("GroupView", false).toBool(); - if(groupView) - { - this->setViewType(2); - this->ViewType->setCurrentIndex(2); - } + this->setGroupedView(groupView); + this->groupedCheck->setCheckState(groupView ? Qt::Checked : Qt::Unchecked); QMenu* FileMenu = this->menuBar()->addMenu(tr("&File")); this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache")); @@ -217,8 +214,10 @@ void CMakeSetupDialog::initialize() SIGNAL(outputMessage(QString)), this, SLOT(message(QString))); - QObject::connect(this->ViewType, SIGNAL(currentIndexChanged(int)), - this, SLOT(setViewType(int))); + QObject::connect(this->groupedCheck, SIGNAL(toggled(bool)), + this, SLOT(setGroupedView(bool))); + QObject::connect(this->advancedCheck, SIGNAL(toggled(bool)), + this, SLOT(setAdvancedView(bool))); QObject::connect(this->Search, SIGNAL(textChanged(QString)), this, SLOT(setSearchFilter(QString))); @@ -950,33 +949,22 @@ void CMakeSetupDialog::setDebugOutput(bool flag) "setDebugOutput", Qt::QueuedConnection, Q_ARG(bool, flag)); } -void CMakeSetupDialog::setViewType(int v) +void CMakeSetupDialog::setGroupedView(bool v) { - 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); - } + this->CacheValues->cacheModel()->setViewType(v ? QCMakeCacheModel::GroupView : QCMakeCacheModel::FlatView); + this->CacheValues->setRootIsDecorated(v); QSettings settings; settings.beginGroup("Settings/StartPath"); - settings.setValue("GroupView", v == 2); + settings.setValue("GroupView", v); } +void CMakeSetupDialog::setAdvancedView(bool v) +{ + this->CacheValues->setShowAdvanced(v); +} + void CMakeSetupDialog::showUserChanges() { QSet<QCMakeProperty> changes = diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index de7922a..0e3caec 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -70,7 +70,8 @@ protected slots: void addCacheEntry(); void startSearch(); void setDebugOutput(bool); - void setViewType(int); + void setAdvancedView(bool); + void setGroupedView(bool); void showUserChanges(); void setSearchFilter(const QString& str); diff --git a/Source/QtDialog/CMakeSetupDialog.ui b/Source/QtDialog/CMakeSetupDialog.ui index ae0dca2..dc8ee3f 100644 --- a/Source/QtDialog/CMakeSetupDialog.ui +++ b/Source/QtDialog/CMakeSetupDialog.ui @@ -1,7 +1,8 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <class>CMakeSetupDialog</class> - <widget class="QWidget" name="CMakeSetupDialog" > - <property name="geometry" > + <widget class="QWidget" name="CMakeSetupDialog"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> @@ -9,115 +10,111 @@ <height>582</height> </rect> </property> - <layout class="QGridLayout" > - <property name="margin" > + <layout class="QGridLayout"> + <property name="margin"> <number>9</number> </property> - <property name="spacing" > + <property name="spacing"> <number>6</number> </property> - <item row="0" column="0" > - <layout class="QGridLayout" > - <property name="margin" > + <item row="0" column="0"> + <layout class="QGridLayout"> + <property name="margin"> <number>0</number> </property> - <property name="spacing" > + <property name="spacing"> <number>6</number> </property> - <item row="0" column="0" > - <widget class="QLabel" name="label" > - <property name="text" > + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> <string>Where is the source code:</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="SourceDirectory" /> + <item row="0" column="1"> + <widget class="QLineEdit" name="SourceDirectory"/> </item> - <item row="0" column="2" > - <widget class="QPushButton" name="BrowseSourceDirectoryButton" > - <property name="text" > + <item row="0" column="2"> + <widget class="QPushButton" name="BrowseSourceDirectoryButton"> + <property name="text"> <string>Browse &Source...</string> </property> </widget> </item> - <item row="1" column="0" > - <widget class="QLabel" name="label_2" > - <property name="text" > + <item row="1" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> <string>Where to build the binaries:</string> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QComboBox" name="BinaryDirectory" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Ignored" > + <item row="1" column="1"> + <widget class="QComboBox" name="BinaryDirectory"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Ignored" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="editable" > + <property name="editable"> <bool>true</bool> </property> </widget> </item> - <item row="1" column="2" > - <widget class="QPushButton" name="BrowseBinaryDirectoryButton" > - <property name="text" > + <item row="1" column="2"> + <widget class="QPushButton" name="BrowseBinaryDirectoryButton"> + <property name="text"> <string>Browse &Build...</string> </property> </widget> </item> </layout> </item> - <item row="1" column="0" > - <widget class="QSplitter" name="Splitter" > - <property name="orientation" > + <item row="1" column="0"> + <widget class="QSplitter" name="Splitter"> + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <widget class="QFrame" name="frame" > - <property name="frameShape" > + <widget class="QFrame" name="frame"> + <property name="frameShape"> <enum>QFrame::NoFrame</enum> </property> - <property name="frameShadow" > + <property name="frameShadow"> <enum>QFrame::Raised</enum> </property> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > + <layout class="QVBoxLayout"> + <property name="spacing"> <number>6</number> </property> + <property name="margin"> + <number>0</number> + </property> <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > + <layout class="QHBoxLayout"> + <property name="spacing"> <number>6</number> </property> + <property name="margin"> + <number>0</number> + </property> <item> - <widget class="QLabel" name="label_4" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>0</vsizetype> + <widget class="QLabel" name="label_4"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text" > + <property name="text"> <string>Search:</string> </property> </widget> </item> <item> - <widget class="QLineEdit" name="Search" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>7</hsizetype> - <vsizetype>0</vsizetype> + <widget class="QLineEdit" name="Search"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -125,33 +122,14 @@ </widget> </item> <item> - <widget class="QComboBox" name="ViewType" > - <item> - <property name="text" > - <string>Simple View</string> - </property> - </item> - <item> - <property name="text" > - <string>Advanced View</string> - </property> - </item> - <item> - <property name="text" > - <string>Grouped View</string> - </property> - </item> - </widget> - </item> - <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeType" > + <property name="sizeType"> <enum>QSizePolicy::Minimum</enum> </property> - <property name="sizeHint" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>23</height> @@ -160,33 +138,49 @@ </spacer> </item> <item> - <widget class="QToolButton" name="AddEntry" > - <property name="toolTip" > + <widget class="QCheckBox" name="groupedCheck"> + <property name="text"> + <string>Grouped</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="advancedCheck"> + <property name="text"> + <string>Advanced</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="AddEntry"> + <property name="toolTip"> <string>Add New Entry</string> </property> - <property name="text" > + <property name="text"> <string>&Add Entry</string> </property> - <property name="icon" > - <iconset resource="CMakeSetup.qrc" >:/Icons/Plus16.png</iconset> + <property name="icon"> + <iconset resource="CMakeSetup.qrc"> + <normaloff>:/Icons/Plus16.png</normaloff>:/Icons/Plus16.png</iconset> </property> - <property name="toolButtonStyle" > + <property name="toolButtonStyle"> <enum>Qt::ToolButtonTextBesideIcon</enum> </property> </widget> </item> <item> - <widget class="QToolButton" name="RemoveEntry" > - <property name="toolTip" > + <widget class="QToolButton" name="RemoveEntry"> + <property name="toolTip"> <string>Remove Selected Entries</string> </property> - <property name="text" > + <property name="text"> <string>&Remove Entry</string> </property> - <property name="icon" > - <iconset resource="CMakeSetup.qrc" >:/Icons/Delete16.png</iconset> + <property name="icon"> + <iconset resource="CMakeSetup.qrc"> + <normaloff>:/Icons/Delete16.png</normaloff>:/Icons/Delete16.png</iconset> </property> - <property name="toolButtonStyle" > + <property name="toolButtonStyle"> <enum>Qt::ToolButtonTextBesideIcon</enum> </property> </widget> @@ -194,69 +188,69 @@ </layout> </item> <item> - <widget class="QCMakeCacheView" name="CacheValues" > - <property name="alternatingRowColors" > + <widget class="QCMakeCacheView" name="CacheValues"> + <property name="alternatingRowColors"> <bool>true</bool> </property> - <property name="selectionMode" > + <property name="selectionMode"> <enum>QAbstractItemView::ExtendedSelection</enum> </property> - <property name="selectionBehavior" > + <property name="selectionBehavior"> <enum>QAbstractItemView::SelectRows</enum> </property> </widget> </item> <item> - <widget class="QLabel" name="label_3" > - <property name="text" > + <widget class="QLabel" name="label_3"> + <property name="text"> <string>Press Configure to update and display new values in red, then press Generate to generate selected build files.</string> </property> - <property name="alignment" > + <property name="alignment"> <set>Qt::AlignCenter</set> </property> - <property name="wordWrap" > + <property name="wordWrap"> <bool>true</bool> </property> </widget> </item> <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > + <layout class="QHBoxLayout"> + <property name="spacing"> <number>6</number> </property> + <property name="margin"> + <number>0</number> + </property> <item> - <widget class="QPushButton" name="ConfigureButton" > - <property name="text" > + <widget class="QPushButton" name="ConfigureButton"> + <property name="text"> <string>&Configure</string> </property> </widget> </item> <item> - <widget class="QPushButton" name="GenerateButton" > - <property name="text" > + <widget class="QPushButton" name="GenerateButton"> + <property name="text"> <string>&Generate</string> </property> </widget> </item> <item> - <widget class="QLabel" name="Generator" > - <property name="text" > + <widget class="QLabel" name="Generator"> + <property name="text"> <string>Current Generator:</string> </property> </widget> </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeType" > + <property name="sizeType"> <enum>QSizePolicy::Expanding</enum> </property> - <property name="sizeHint" > + <property name="sizeHint" stdset="0"> <size> <width>121</width> <height>27</height> @@ -265,23 +259,23 @@ </spacer> </item> <item> - <widget class="QProgressBar" name="ProgressBar" > - <property name="minimum" > + <widget class="QProgressBar" name="ProgressBar"> + <property name="minimum"> <number>0</number> </property> - <property name="maximum" > + <property name="maximum"> <number>100</number> </property> - <property name="value" > + <property name="value"> <number>0</number> </property> - <property name="textVisible" > + <property name="textVisible"> <bool>false</bool> </property> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="textDirection" > + <property name="textDirection"> <enum>QProgressBar::BottomToTop</enum> </property> </widget> @@ -290,11 +284,11 @@ </item> </layout> </widget> - <widget class="QTextEdit" name="Output" > - <property name="lineWrapMode" > + <widget class="QTextEdit" name="Output"> + <property name="lineWrapMode"> <enum>QTextEdit::NoWrap</enum> </property> - <property name="readOnly" > + <property name="readOnly"> <bool>true</bool> </property> </widget> @@ -310,7 +304,7 @@ </customwidget> </customwidgets> <resources> - <include location="CMakeSetup.qrc" /> + <include location="CMakeSetup.qrc"/> </resources> <connections/> </ui> |