ENH: Add simple grouped view.
This commit is contained in:
parent
6e1b510319
commit
9ced0bf69b
@ -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 =
|
||||
|
@ -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);
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CMakeSetupDialog</class>
|
||||
<widget class="QWidget" name="CMakeSetupDialog">
|
||||
@ -51,7 +52,7 @@
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="BinaryDirectory">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Ignored" >
|
||||
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -83,26 +84,24 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<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">
|
||||
<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>
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -115,34 +114,13 @@
|
||||
<item>
|
||||
<widget class="QLineEdit" name="Search">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</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">
|
||||
@ -151,7 +129,7 @@
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>23</height>
|
||||
@ -159,6 +137,20 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<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">
|
||||
@ -168,7 +160,8 @@
|
||||
<string>&Add Entry</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="CMakeSetup.qrc" >:/Icons/Plus16.png</iconset>
|
||||
<iconset resource="CMakeSetup.qrc">
|
||||
<normaloff>:/Icons/Plus16.png</normaloff>:/Icons/Plus16.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
@ -184,7 +177,8 @@
|
||||
<string>&Remove Entry</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="CMakeSetup.qrc" >:/Icons/Delete16.png</iconset>
|
||||
<iconset resource="CMakeSetup.qrc">
|
||||
<normaloff>:/Icons/Delete16.png</normaloff>:/Icons/Delete16.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
@ -221,12 +215,12 @@
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ConfigureButton">
|
||||
<property name="text">
|
||||
@ -256,7 +250,7 @@
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>121</width>
|
||||
<height>27</height>
|
||||
|
Loading…
x
Reference in New Issue
Block a user