Skip to content
Snippets Groups Projects
Commit 6848155c authored by hjk's avatar hjk
Browse files

Fixes: Add "Apply" button to Preferences dialog

RevBy:   con
parent 808b5df5
No related merge requests found
...@@ -47,6 +47,8 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &initialCategory, ...@@ -47,6 +47,8 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &initialCategory,
setupUi(this); setupUi(this);
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply()));
splitter->setCollapsible(1, false); splitter->setCollapsible(1, false);
pageTree->header()->setVisible(false); pageTree->header()->setVisible(false);
...@@ -135,3 +137,9 @@ void SettingsDialog::reject() ...@@ -135,3 +137,9 @@ void SettingsDialog::reject()
page->finished(false); page->finished(false);
done(QDialog::Rejected); done(QDialog::Rejected);
} }
void SettingsDialog::apply()
{
foreach (IOptionsPage *page, m_pages)
page->finished(true);
}
...@@ -57,6 +57,7 @@ private slots: ...@@ -57,6 +57,7 @@ private slots:
void pageSelected(QTreeWidgetItem *cat); void pageSelected(QTreeWidgetItem *cat);
void accept(); void accept();
void reject(); void reject();
void apply();
private: private:
QList<Core::IOptionsPage*> m_pages; QList<Core::IOptionsPage*> m_pages;
......
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SettingsDialog</class> <class>SettingsDialog</class>
<widget class="QDialog" name="SettingsDialog" > <widget class="QDialog" name="SettingsDialog">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
...@@ -9,50 +10,48 @@ ...@@ -9,50 +10,48 @@
<height>476</height> <height>476</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string>Options</string> <string>Options</string>
</property> </property>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout">
<property name="margin" > <property name="spacing">
<number>9</number>
</property>
<property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="margin">
<number>9</number>
</property>
<item> <item>
<widget class="QSplitter" name="splitter" > <widget class="QSplitter" name="splitter">
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<widget class="QTreeWidget" name="pageTree" > <widget class="QTreeWidget" name="pageTree">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="columnCount" > <property name="columnCount">
<number>1</number> <number>1</number>
</property> </property>
<column> <column>
<property name="text" > <property name="text">
<string>0</string> <string>0</string>
</property> </property>
</column> </column>
</widget> </widget>
<widget class="QWidget" name="layoutWidget" > <widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" > <layout class="QVBoxLayout">
<property name="margin" > <property name="spacing">
<number>0</number>
</property>
<property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="margin">
<number>0</number>
</property>
<item> <item>
<widget class="QStackedWidget" name="stackedPages" > <widget class="QStackedWidget" name="stackedPages">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>350</width> <width>350</width>
<height>250</height> <height>250</height>
...@@ -61,8 +60,8 @@ ...@@ -61,8 +60,8 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="Line" name="line" > <widget class="Line" name="line">
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
...@@ -72,12 +71,12 @@ ...@@ -72,12 +71,12 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox" > <widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="standardButtons" > <property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set> <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -91,11 +90,11 @@ ...@@ -91,11 +90,11 @@
<receiver>SettingsDialog</receiver> <receiver>SettingsDialog</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel" > <hint type="sourcelabel">
<x>297</x> <x>297</x>
<y>361</y> <y>361</y>
</hint> </hint>
<hint type="destinationlabel" > <hint type="destinationlabel">
<x>297</x> <x>297</x>
<y>193</y> <y>193</y>
</hint> </hint>
...@@ -107,11 +106,11 @@ ...@@ -107,11 +106,11 @@
<receiver>SettingsDialog</receiver> <receiver>SettingsDialog</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel" > <hint type="sourcelabel">
<x>297</x> <x>297</x>
<y>361</y> <y>361</y>
</hint> </hint>
<hint type="destinationlabel" > <hint type="destinationlabel">
<x>297</x> <x>297</x>
<y>193</y> <y>193</y>
</hint> </hint>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment