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