COSMETIC: Added monochrome tray icon

This commit is contained in:
Christophe Dumez
2011-03-12 20:59:44 +00:00
parent 2acf90d813
commit 14341f3be2
44 changed files with 2904 additions and 2677 deletions

View File

@@ -172,7 +172,7 @@
<x>0</x>
<y>0</y>
<width>499</width>
<height>487</height>
<height>515</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
@@ -390,6 +390,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkUseMonoSystrayIcon">
<property name="text">
<string>Use monochrome system tray icon (requires restart)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkMinimizeToSysTray">
<property name="text">
@@ -467,7 +474,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>499</width>
<width>440</width>
<height>698</height>
</rect>
</property>
@@ -910,7 +917,7 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>499</width>
<width>447</width>
<height>457</height>
</rect>
</property>
@@ -1390,8 +1397,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>517</width>
<height>414</height>
<width>404</width>
<height>334</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_33">
@@ -2162,8 +2169,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>517</width>
<height>414</height>
<width>378</width>
<height>255</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_23">
@@ -2311,8 +2318,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>62</width>
<height>18</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_36"/>

View File

@@ -106,6 +106,9 @@ options_imp::options_imp(QWidget *parent):
checkShowSystray->setChecked(false);
checkShowSystray->setEnabled(false);
}
#if !defined(Q_WS_X11) || !defined(QT_SVG_LIB)
checkUseMonoSystrayIcon->setVisible(false);
#endif
// Connect signals / slots
// General tab
connect(checkShowSystray, SIGNAL(toggled(bool)), this, SLOT(setSystrayOptionsState(bool)));
@@ -132,6 +135,7 @@ options_imp::options_imp(QWidget *parent):
connect(checkShowSplash, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkProgramExitConfirm, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkPreventFromSuspend, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkUseMonoSystrayIcon, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
#if defined(Q_WS_X11) && !defined(QT_DBUS_LIB)
checkPreventFromSuspend->setDisabled(true);
#endif
@@ -323,6 +327,7 @@ void options_imp::saveOptions(){
pref.setLocale(locale);
pref.setAlternatingRowColors(checkAltRowColors->isChecked());
pref.setSystrayIntegration(systrayIntegration());
pref.setUseMonochromeTrayIcon(checkUseMonoSystrayIcon->isChecked());
pref.setCloseToTray(closeToTray());
pref.setMinimizeToTray(minimizeToTray());
pref.setStartMinimized(startMinimized());
@@ -471,6 +476,7 @@ void options_imp::loadOptions(){
checkCloseToSystray->setChecked(pref.closeToTray());
checkMinimizeToSysTray->setChecked(pref.minimizeToTray());
checkStartMinimized->setChecked(pref.startMinimized());
checkUseMonoSystrayIcon->setChecked(pref.useMonochromeTrayIcon());
}
checkProgramExitConfirm->setChecked(pref.confirmOnExit());
checkPreventFromSuspend->setChecked(pref.preventFromSuspend());
@@ -848,11 +854,13 @@ void options_imp::enableMaxConnecsLimitPerTorrent(bool checked){
void options_imp::enableSystrayOptions() {
checkCloseToSystray->setEnabled(true);
checkMinimizeToSysTray->setEnabled(true);
checkUseMonoSystrayIcon->setEnabled(true);
}
void options_imp::disableSystrayOptions() {
checkCloseToSystray->setEnabled(false);
checkMinimizeToSysTray->setEnabled(false);
checkUseMonoSystrayIcon->setEnabled(false);
}
void options_imp::setSystrayOptionsState(bool checked) {

View File

@@ -1032,6 +1032,13 @@ public:
void setConfirmTorrentDeletion(bool enabled) {
setValue(QString::fromUtf8("Preferences/Advanced/confirmTorrentDeletion"), enabled);
}
bool useMonochromeTrayIcon() const {
return value(QString::fromUtf8("Preferences/Advanced/useMonochromeTrayIcon"), false).toBool();
}
void setUseMonochromeTrayIcon(bool use) {
setValue(QString::fromUtf8("Preferences/Advanced/useMonochromeTrayIcon"), use);
}
};
#endif // PREFERENCES_H