diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-12-17 13:09:55 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-12-17 13:09:55 +0000 |
| commit | fcc385fc5c74fb0af9483fefa5be64b95d299189 (patch) | |
| tree | c11c51550f2c613c5cdf68e060029716f7b253e7 /src/plugins/General | |
| parent | fbf6df0e267774e4cfa32678176869095fa28986 (diff) | |
| download | qmmp-fcc385fc5c74fb0af9483fefa5be64b95d299189.tar.gz qmmp-fcc385fc5c74fb0af9483fefa5be64b95d299189.tar.bz2 qmmp-fcc385fc5c74fb0af9483fefa5be64b95d299189.zip | |
using standard dialog buttons
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@690 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General')
| -rw-r--r-- | src/plugins/General/mpris/playerobject.cpp | 3 | ||||
| -rw-r--r-- | src/plugins/General/notifier/settingsdialog.cpp | 5 | ||||
| -rw-r--r-- | src/plugins/General/notifier/settingsdialog.h | 4 | ||||
| -rw-r--r-- | src/plugins/General/notifier/settingsdialog.ui | 96 | ||||
| -rw-r--r-- | src/plugins/General/statusicon/settingsdialog.cpp | 5 | ||||
| -rw-r--r-- | src/plugins/General/statusicon/settingsdialog.h | 4 | ||||
| -rw-r--r-- | src/plugins/General/statusicon/settingsdialog.ui | 90 |
7 files changed, 93 insertions, 114 deletions
diff --git a/src/plugins/General/mpris/playerobject.cpp b/src/plugins/General/mpris/playerobject.cpp index 8175df301..4e3cc1a10 100644 --- a/src/plugins/General/mpris/playerobject.cpp +++ b/src/plugins/General/mpris/playerobject.cpp @@ -147,12 +147,13 @@ int PlayerObject::GetCaps() caps |= CAN_SEEK; caps |= CAN_GO_NEXT; caps |= CAN_GO_PREV; + caps |= CAN_PROVIDE_METADATA; return caps; } void PlayerObject::VolumeSet(int volume) { - int balance = (m_core->rightVolume() - m_core->leftVolume()) * 100/VolumeGet(); + int balance = (VolumeGet() > 0) ? (m_core->rightVolume() - m_core->leftVolume()) * 100/VolumeGet() : 0; m_core->setVolume(volume - qMax(balance,0)*volume/100, volume + qMin(balance,0)*volume/100); } diff --git a/src/plugins/General/notifier/settingsdialog.cpp b/src/plugins/General/notifier/settingsdialog.cpp index 3899216ec..297fae316 100644 --- a/src/plugins/General/notifier/settingsdialog.cpp +++ b/src/plugins/General/notifier/settingsdialog.cpp @@ -47,14 +47,13 @@ SettingsDialog::SettingsDialog(QWidget *parent) ui.psiCheckBox->setChecked(settings.value("psi_notification", FALSE).toBool()); ui.desktopCheckBox->setChecked(settings.value("desktop_notification", TRUE).toBool()); settings.endGroup(); - connect(ui.okButton, SIGNAL(clicked()), SLOT(writeSettings())); } SettingsDialog::~SettingsDialog() {} -void SettingsDialog::writeSettings() +void SettingsDialog::accept() { QSettings settings(QDir::homePath()+"/.qmmp/qmmprc", QSettings::IniFormat); settings.beginGroup("Notifier"); @@ -69,5 +68,5 @@ void SettingsDialog::writeSettings() settings.setValue("psi_notification", ui.psiCheckBox->isChecked()); settings.setValue("desktop_notification", ui.desktopCheckBox->isChecked()); settings.endGroup(); - accept(); + QDialog::accept(); } diff --git a/src/plugins/General/notifier/settingsdialog.h b/src/plugins/General/notifier/settingsdialog.h index 6d5f39a15..04cbc0516 100644 --- a/src/plugins/General/notifier/settingsdialog.h +++ b/src/plugins/General/notifier/settingsdialog.h @@ -37,8 +37,8 @@ public: ~SettingsDialog(); -private slots: - void writeSettings(); +public slots: + virtual void accept(); private: Ui::SettingsDialog ui; diff --git a/src/plugins/General/notifier/settingsdialog.ui b/src/plugins/General/notifier/settingsdialog.ui index d77592dff..8b2df2d37 100644 --- a/src/plugins/General/notifier/settingsdialog.ui +++ b/src/plugins/General/notifier/settingsdialog.ui @@ -6,14 +6,14 @@ <x>0</x> <y>0</y> <width>278</width> - <height>355</height> + <height>330</height> </rect> </property> <property name="windowTitle" > <string>Notifier Plugin Settings</string> </property> - <layout class="QVBoxLayout" > - <item> + <layout class="QGridLayout" name="gridLayout" > + <item row="0" column="0" colspan="2" > <widget class="QGroupBox" name="groupBox_2" > <property name="title" > <string>Psi Notification</string> @@ -29,7 +29,7 @@ </layout> </widget> </item> - <item> + <item row="1" column="0" colspan="2" > <widget class="QGroupBox" name="groupBox" > <property name="title" > <string>Desktop Notification</string> @@ -201,7 +201,7 @@ <property name="orientation" > <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" > + <property name="sizeHint" stdset="0" > <size> <width>40</width> <height>20</height> @@ -212,69 +212,59 @@ </layout> </widget> </item> - <item> - <layout class="QHBoxLayout" > - <property name="spacing" > - <number>6</number> + <item row="2" column="0" > + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> </property> - <property name="leftMargin" > - <number>0</number> + <property name="sizeHint" stdset="0" > + <size> + <width>131</width> + <height>31</height> + </size> </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > - <number>0</number> + </spacer> + </item> + <item row="2" column="1" > + <widget class="QDialogButtonBox" name="buttonBox" > + <property name="standardButtons" > + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> </property> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>131</width> - <height>31</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="okButton" > - <property name="text" > - <string>OK</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="cancelButton" > - <property name="text" > - <string>Cancel</string> - </property> - </widget> - </item> - </layout> + </widget> </item> </layout> </widget> <resources/> <connections> <connection> - <sender>cancelButton</sender> - <signal>clicked()</signal> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>SettingsDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel" > + <x>183</x> + <y>303</y> + </hint> + <hint type="destinationlabel" > + <x>62</x> + <y>314</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> <receiver>SettingsDialog</receiver> <slot>reject()</slot> <hints> <hint type="sourcelabel" > - <x>336</x> - <y>210</y> + <x>249</x> + <y>298</y> </hint> <hint type="destinationlabel" > - <x>179</x> - <y>224</y> + <x>95</x> + <y>299</y> </hint> </hints> </connection> diff --git a/src/plugins/General/statusicon/settingsdialog.cpp b/src/plugins/General/statusicon/settingsdialog.cpp index d2050f88c..1c3118659 100644 --- a/src/plugins/General/statusicon/settingsdialog.cpp +++ b/src/plugins/General/statusicon/settingsdialog.cpp @@ -33,14 +33,13 @@ SettingsDialog::SettingsDialog(QWidget *parent) ui.messageDelaySpinBox->setValue(settings.value("message_delay", 2000).toInt()); ui.toolTipCheckBox->setChecked(settings.value("show_tooltip",FALSE).toBool()); settings.endGroup(); - connect(ui.okButton, SIGNAL(clicked()), SLOT(writeSettings())); } SettingsDialog::~SettingsDialog() {} -void SettingsDialog::writeSettings() +void SettingsDialog::accept() { QSettings settings(QDir::homePath()+"/.qmmp/qmmprc", QSettings::IniFormat); settings.beginGroup("Tray"); @@ -48,5 +47,5 @@ void SettingsDialog::writeSettings() settings.setValue ("message_delay", ui.messageDelaySpinBox->value()); settings.setValue ("show_tooltip", ui.toolTipCheckBox->isChecked()); settings.endGroup(); - accept(); + QDialog::accept(); } diff --git a/src/plugins/General/statusicon/settingsdialog.h b/src/plugins/General/statusicon/settingsdialog.h index 0d5b21d52..81494dfb5 100644 --- a/src/plugins/General/statusicon/settingsdialog.h +++ b/src/plugins/General/statusicon/settingsdialog.h @@ -37,8 +37,8 @@ public: ~SettingsDialog(); -private slots: - void writeSettings(); +public slots: + virtual void accept(); private: Ui::SettingsDialog ui; diff --git a/src/plugins/General/statusicon/settingsdialog.ui b/src/plugins/General/statusicon/settingsdialog.ui index 7ef412e3c..7ffbb20db 100644 --- a/src/plugins/General/statusicon/settingsdialog.ui +++ b/src/plugins/General/statusicon/settingsdialog.ui @@ -6,13 +6,13 @@ <x>0</x> <y>0</y> <width>267</width> - <height>156</height> + <height>127</height> </rect> </property> <property name="windowTitle" > <string>Status Icon Plugin Settings</string> </property> - <layout class="QGridLayout" > + <layout class="QGridLayout" name="gridLayout" > <item row="0" column="0" > <widget class="QCheckBox" name="messageCheckBox" > <property name="text" > @@ -37,7 +37,7 @@ </property> </widget> </item> - <item row="2" column="1" > + <item row="2" column="1" colspan="2" > <widget class="QSpinBox" name="messageDelaySpinBox" > <property name="minimum" > <number>100</number> @@ -54,68 +54,58 @@ </widget> </item> <item row="3" column="0" colspan="2" > - <layout class="QHBoxLayout" > - <property name="spacing" > - <number>6</number> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> </property> - <property name="leftMargin" > - <number>0</number> + <property name="sizeHint" stdset="0" > + <size> + <width>150</width> + <height>18</height> + </size> </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > - <number>0</number> + </spacer> + </item> + <item row="3" column="2" > + <widget class="QDialogButtonBox" name="buttonBox" > + <property name="standardButtons" > + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> </property> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>131</width> - <height>31</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="okButton" > - <property name="text" > - <string>OK</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="cancelButton" > - <property name="text" > - <string>Cancel</string> - </property> - </widget> - </item> - </layout> + </widget> </item> </layout> </widget> <resources/> <connections> <connection> - <sender>cancelButton</sender> - <signal>clicked()</signal> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>SettingsDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel" > + <x>180</x> + <y>102</y> + </hint> + <hint type="destinationlabel" > + <x>112</x> + <y>103</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> <receiver>SettingsDialog</receiver> <slot>reject()</slot> <hints> <hint type="sourcelabel" > - <x>336</x> - <y>210</y> + <x>242</x> + <y>107</y> </hint> <hint type="destinationlabel" > - <x>179</x> - <y>224</y> + <x>27</x> + <y>106</y> </hint> </hints> </connection> |
