ENH: Add simple grouped view.
This commit is contained in:
parent
6e1b510319
commit
9ced0bf69b
@ -81,11 +81,8 @@ CMakeSetupDialog::CMakeSetupDialog()
|
|||||||
this->Splitter->restoreState(p);
|
this->Splitter->restoreState(p);
|
||||||
|
|
||||||
bool groupView = settings.value("GroupView", false).toBool();
|
bool groupView = settings.value("GroupView", false).toBool();
|
||||||
if(groupView)
|
this->setGroupedView(groupView);
|
||||||
{
|
this->groupedCheck->setCheckState(groupView ? Qt::Checked : Qt::Unchecked);
|
||||||
this->setViewType(2);
|
|
||||||
this->ViewType->setCurrentIndex(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
QMenu* FileMenu = this->menuBar()->addMenu(tr("&File"));
|
QMenu* FileMenu = this->menuBar()->addMenu(tr("&File"));
|
||||||
this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache"));
|
this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache"));
|
||||||
@ -217,8 +214,10 @@ void CMakeSetupDialog::initialize()
|
|||||||
SIGNAL(outputMessage(QString)),
|
SIGNAL(outputMessage(QString)),
|
||||||
this, SLOT(message(QString)));
|
this, SLOT(message(QString)));
|
||||||
|
|
||||||
QObject::connect(this->ViewType, SIGNAL(currentIndexChanged(int)),
|
QObject::connect(this->groupedCheck, SIGNAL(toggled(bool)),
|
||||||
this, SLOT(setViewType(int)));
|
this, SLOT(setGroupedView(bool)));
|
||||||
|
QObject::connect(this->advancedCheck, SIGNAL(toggled(bool)),
|
||||||
|
this, SLOT(setAdvancedView(bool)));
|
||||||
QObject::connect(this->Search, SIGNAL(textChanged(QString)),
|
QObject::connect(this->Search, SIGNAL(textChanged(QString)),
|
||||||
this, SLOT(setSearchFilter(QString)));
|
this, SLOT(setSearchFilter(QString)));
|
||||||
|
|
||||||
@ -950,33 +949,22 @@ void CMakeSetupDialog::setDebugOutput(bool flag)
|
|||||||
"setDebugOutput", Qt::QueuedConnection, Q_ARG(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(v ? QCMakeCacheModel::GroupView : QCMakeCacheModel::FlatView);
|
||||||
{
|
this->CacheValues->setRootIsDecorated(v);
|
||||||
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;
|
QSettings settings;
|
||||||
settings.beginGroup("Settings/StartPath");
|
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()
|
void CMakeSetupDialog::showUserChanges()
|
||||||
{
|
{
|
||||||
QSet<QCMakeProperty> changes =
|
QSet<QCMakeProperty> changes =
|
||||||
|
@ -70,7 +70,8 @@ protected slots:
|
|||||||
void addCacheEntry();
|
void addCacheEntry();
|
||||||
void startSearch();
|
void startSearch();
|
||||||
void setDebugOutput(bool);
|
void setDebugOutput(bool);
|
||||||
void setViewType(int);
|
void setAdvancedView(bool);
|
||||||
|
void setGroupedView(bool);
|
||||||
void showUserChanges();
|
void showUserChanges();
|
||||||
void setSearchFilter(const QString& str);
|
void setSearchFilter(const QString& str);
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CMakeSetupDialog</class>
|
<class>CMakeSetupDialog</class>
|
||||||
<widget class="QWidget" name="CMakeSetupDialog">
|
<widget class="QWidget" name="CMakeSetupDialog">
|
||||||
@ -51,7 +52,7 @@
|
|||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QComboBox" name="BinaryDirectory">
|
<widget class="QComboBox" name="BinaryDirectory">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Ignored" >
|
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -83,26 +84,24 @@
|
|||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout">
|
<layout class="QVBoxLayout">
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout">
|
<layout class="QHBoxLayout">
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy>
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<hsizetype>0</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -115,34 +114,13 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="Search">
|
<widget class="QLineEdit" name="Search">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy>
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
<hsizetype>7</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -151,7 +129,7 @@
|
|||||||
<property name="sizeType">
|
<property name="sizeType">
|
||||||
<enum>QSizePolicy::Minimum</enum>
|
<enum>QSizePolicy::Minimum</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>40</width>
|
||||||
<height>23</height>
|
<height>23</height>
|
||||||
@ -159,6 +137,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<widget class="QToolButton" name="AddEntry">
|
<widget class="QToolButton" name="AddEntry">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@ -168,7 +160,8 @@
|
|||||||
<string>&Add Entry</string>
|
<string>&Add Entry</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<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>
|
||||||
<property name="toolButtonStyle">
|
<property name="toolButtonStyle">
|
||||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||||
@ -184,7 +177,8 @@
|
|||||||
<string>&Remove Entry</string>
|
<string>&Remove Entry</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<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>
|
||||||
<property name="toolButtonStyle">
|
<property name="toolButtonStyle">
|
||||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||||
@ -221,12 +215,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout">
|
<layout class="QHBoxLayout">
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="ConfigureButton">
|
<widget class="QPushButton" name="ConfigureButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -256,7 +250,7 @@
|
|||||||
<property name="sizeType">
|
<property name="sizeType">
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>121</width>
|
<width>121</width>
|
||||||
<height>27</height>
|
<height>27</height>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user