diff --git a/Changelog b/Changelog index 9048c4326..56f4b48c1 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +* Unreleased - Christophe Dumez - v2.8.0 + - FEATURE: Added monochrome icon for light themes + - BUGFIX: Change systray icon on the fly (no restart needed) + * Sun Mar 20 2011 - Christophe Dumez - v2.7.0 - FEATURE: Added search field for torrent content - FEATURE: Added auto-shutdown confirmation dialog diff --git a/src/Icons/skin/qbittorrent_mono_light.png b/src/Icons/skin/qbittorrent_mono_light.png new file mode 100644 index 000000000..6ee1bab51 Binary files /dev/null and b/src/Icons/skin/qbittorrent_mono_light.png differ diff --git a/src/Info.plist b/src/Info.plist index b3aebebfd..d3f077614 100644 --- a/src/Info.plist +++ b/src/Info.plist @@ -47,7 +47,7 @@ CFBundlePackageType APPL CFBundleGetInfoString - 2.7.0 + 2.8.0 CFBundleSignature ???? CFBundleExecutable diff --git a/src/icons.qrc b/src/icons.qrc index a2a5511ca..c651e1159 100644 --- a/src/icons.qrc +++ b/src/icons.qrc @@ -9,6 +9,7 @@ Icons/magnet.png Icons/slow.png Icons/L.gif + Icons/skin/qbittorrent_mono_light.png Icons/skin/seeding.png Icons/skin/splash.png Icons/skin/tabs.gif diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 96319ed30..56485b5e3 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -994,6 +994,10 @@ void MainWindow::loadPreferences(bool configure_session) { delete myTrayIconMenu; } } + // Reload systray icon + if(newSystrayIntegration && systrayIcon) { + systrayIcon->setIcon(getSystrayIcon()); + } // General if(pref.isToolbarDisplayed()) { toolBar->setVisible(true); @@ -1350,8 +1354,14 @@ void MainWindow::checkForActiveTorrents() QIcon MainWindow::getSystrayIcon() const { #if defined(Q_WS_X11) - if(Preferences().useMonochromeTrayIcon()) { + TrayIcon::Style style = Preferences().trayIconStyle(); + switch(style) { + case TrayIcon::MONO_DARK: return QIcon(":/Icons/skin/qbittorrent_mono_dark.png"); + case TrayIcon::MONO_LIGHT: + return QIcon(":/Icons/skin/qbittorrent_mono_light.png"); + default: + break; } #endif QIcon icon; diff --git a/src/preferences/options.ui b/src/preferences/options.ui index 5902f823a..0d4b362ad 100644 --- a/src/preferences/options.ui +++ b/src/preferences/options.ui @@ -171,8 +171,8 @@ 0 0 - 499 - 515 + 508 + 531 @@ -360,9 +360,6 @@ Desktop - - 0 - @@ -390,13 +387,6 @@ - - - - Use monochrome system tray icon (requires restart) - - - @@ -414,6 +404,49 @@ + + + + + + Tray icon style: + + + + + + + + Normal + + + + + Monochrome (Dark theme) + + + + + Monochrome (Light theme) + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + @@ -473,8 +506,8 @@ 0 - -330 - 499 + 0 + 453 744 @@ -924,7 +957,7 @@ QGroupBox { 0 0 - 447 + 480 457 @@ -1404,7 +1437,7 @@ QGroupBox { 0 0 - 404 + 403 334 @@ -1793,7 +1826,7 @@ QGroupBox { 0 0 - 542 + 589 422 @@ -2176,7 +2209,7 @@ QGroupBox { 0 0 - 378 + 380 255 @@ -2325,8 +2358,8 @@ QGroupBox { 0 0 - 517 - 414 + 64 + 18 diff --git a/src/preferences/options_imp.cpp b/src/preferences/options_imp.cpp index d669248ad..e0dd8c563 100644 --- a/src/preferences/options_imp.cpp +++ b/src/preferences/options_imp.cpp @@ -107,7 +107,8 @@ options_imp::options_imp(QWidget *parent): checkShowSystray->setEnabled(false); } #if !defined(Q_WS_X11) - checkUseMonoSystrayIcon->setVisible(false); + label_trayIconStyle->setVisible(false); + comboTrayIcon->setVisible(false); #endif // Connect signals / slots // General tab @@ -135,7 +136,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())); + connect(comboTrayIcon, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); #if defined(Q_WS_X11) && !defined(QT_DBUS_LIB) checkPreventFromSuspend->setDisabled(true); #endif @@ -327,7 +328,7 @@ void options_imp::saveOptions(){ pref.setLocale(locale); pref.setAlternatingRowColors(checkAltRowColors->isChecked()); pref.setSystrayIntegration(systrayIntegration()); - pref.setUseMonochromeTrayIcon(checkUseMonoSystrayIcon->isChecked()); + pref.setTrayIconStyle(TrayIcon::Style(comboTrayIcon->currentIndex())); pref.setCloseToTray(closeToTray()); pref.setMinimizeToTray(minimizeToTray()); pref.setStartMinimized(startMinimized()); @@ -476,8 +477,8 @@ void options_imp::loadOptions(){ checkCloseToSystray->setChecked(pref.closeToTray()); checkMinimizeToSysTray->setChecked(pref.minimizeToTray()); checkStartMinimized->setChecked(pref.startMinimized()); - checkUseMonoSystrayIcon->setChecked(pref.useMonochromeTrayIcon()); } + comboTrayIcon->setCurrentIndex(pref.trayIconStyle()); checkProgramExitConfirm->setChecked(pref.confirmOnExit()); checkPreventFromSuspend->setChecked(pref.preventFromSuspend()); // End General preferences @@ -854,13 +855,13 @@ void options_imp::enableMaxConnecsLimitPerTorrent(bool checked){ void options_imp::enableSystrayOptions() { checkCloseToSystray->setEnabled(true); checkMinimizeToSysTray->setEnabled(true); - checkUseMonoSystrayIcon->setEnabled(true); + comboTrayIcon->setEnabled(true); } void options_imp::disableSystrayOptions() { checkCloseToSystray->setEnabled(false); checkMinimizeToSysTray->setEnabled(false); - checkUseMonoSystrayIcon->setEnabled(false); + comboTrayIcon->setEnabled(false); } void options_imp::setSystrayOptionsState(bool checked) { diff --git a/src/preferences/preferences.h b/src/preferences/preferences.h index ac9bcd621..fad81255d 100644 --- a/src/preferences/preferences.h +++ b/src/preferences/preferences.h @@ -58,6 +58,9 @@ enum maxRatioAction {PAUSE_ACTION, REMOVE_ACTION}; namespace Proxy { enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4, SOCKS4=5}; } +namespace TrayIcon { +enum Style { NORMAL = 0, MONO_DARK, MONO_LIGHT }; +} class Preferences : public QIniSettings { Q_DISABLE_COPY(Preferences); @@ -1033,11 +1036,11 @@ public: setValue(QString::fromUtf8("Preferences/Advanced/confirmTorrentDeletion"), enabled); } - bool useMonochromeTrayIcon() const { - return value(QString::fromUtf8("Preferences/Advanced/useMonochromeTrayIcon"), false).toBool(); + TrayIcon::Style trayIconStyle() const { + return TrayIcon::Style(value(QString::fromUtf8("Preferences/Advanced/TrayIconStyle"), TrayIcon::NORMAL).toInt()); } - void setUseMonochromeTrayIcon(bool use) { - setValue(QString::fromUtf8("Preferences/Advanced/useMonochromeTrayIcon"), use); + void setTrayIconStyle(TrayIcon::Style style) { + setValue(QString::fromUtf8("Preferences/Advanced/TrayIconStyle"), style); } }; diff --git a/version.pri b/version.pri index e1aee098e..355438678 100644 --- a/version.pri +++ b/version.pri @@ -1,11 +1,11 @@ os2 { - DEFINES += VERSION=\'\"v2.7.0\"\' + DEFINES += VERSION=\'\"v2.8.0alpha1\"\' } else { - DEFINES += VERSION=\\\"v2.7.0\\\" + DEFINES += VERSION=\\\"v2.8.0alpha1\\\" } DEFINES += VERSION_MAJOR=2 -DEFINES += VERSION_MINOR=7 +DEFINES += VERSION_MINOR=8 DEFINES += VERSION_BUGFIX=0 # NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL -DEFINES += VERSION_TYPE=NORMAL +DEFINES += VERSION_TYPE=ALPHA