Browse Source

- FEATURE: Added monochrome icon for light themes

- BUGFIX: Change systray icon on the fly (no restart needed)
adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
01b5844174
  1. 4
      Changelog
  2. BIN
      src/Icons/skin/qbittorrent_mono_light.png
  3. 2
      src/Info.plist
  4. 1
      src/icons.qrc
  5. 12
      src/mainwindow.cpp
  6. 73
      src/preferences/options.ui
  7. 13
      src/preferences/options_imp.cpp
  8. 11
      src/preferences/preferences.h
  9. 8
      version.pri

4
Changelog

@ -1,3 +1,7 @@ @@ -1,3 +1,7 @@
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - 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 <chris@qbittorrent.org> - v2.7.0
- FEATURE: Added search field for torrent content
- FEATURE: Added auto-shutdown confirmation dialog

BIN
src/Icons/skin/qbittorrent_mono_light.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

2
src/Info.plist

@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>2.7.0</string>
<string>2.8.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>

1
src/icons.qrc

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
<file>Icons/magnet.png</file>
<file>Icons/slow.png</file>
<file>Icons/L.gif</file>
<file>Icons/skin/qbittorrent_mono_light.png</file>
<file>Icons/skin/seeding.png</file>
<file>Icons/skin/splash.png</file>
<file>Icons/skin/tabs.gif</file>

12
src/mainwindow.cpp

@ -994,6 +994,10 @@ void MainWindow::loadPreferences(bool configure_session) { @@ -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() @@ -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;

73
src/preferences/options.ui

@ -171,8 +171,8 @@ @@ -171,8 +171,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>499</width>
<height>515</height>
<width>508</width>
<height>531</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
@ -360,9 +360,6 @@ @@ -360,9 +360,6 @@
<string>Desktop</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="checkShowSplash">
<property name="text">
@ -390,13 +387,6 @@ @@ -390,13 +387,6 @@
</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">
@ -414,6 +404,49 @@ @@ -414,6 +404,49 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_trayIconStyle">
<property name="text">
<string>Tray icon style:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboTrayIcon">
<item>
<property name="text">
<string>Normal</string>
</property>
</item>
<item>
<property name="text">
<string>Monochrome (Dark theme)</string>
</property>
</item>
<item>
<property name="text">
<string>Monochrome (Light theme)</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkProgramExitConfirm">
<property name="text">
@ -473,8 +506,8 @@ @@ -473,8 +506,8 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-330</y>
<width>499</width>
<y>0</y>
<width>453</width>
<height>744</height>
</rect>
</property>
@ -924,7 +957,7 @@ QGroupBox { @@ -924,7 +957,7 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>447</width>
<width>480</width>
<height>457</height>
</rect>
</property>
@ -1404,7 +1437,7 @@ QGroupBox { @@ -1404,7 +1437,7 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>404</width>
<width>403</width>
<height>334</height>
</rect>
</property>
@ -1793,7 +1826,7 @@ QGroupBox { @@ -1793,7 +1826,7 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>542</width>
<width>589</width>
<height>422</height>
</rect>
</property>
@ -2176,7 +2209,7 @@ QGroupBox { @@ -2176,7 +2209,7 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>378</width>
<width>380</width>
<height>255</height>
</rect>
</property>
@ -2325,8 +2358,8 @@ QGroupBox { @@ -2325,8 +2358,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>517</width>
<height>414</height>
<width>64</width>
<height>18</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_36"/>

13
src/preferences/options_imp.cpp

@ -107,7 +107,8 @@ options_imp::options_imp(QWidget *parent): @@ -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): @@ -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(){ @@ -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(){ @@ -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){ @@ -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) {

11
src/preferences/preferences.h

@ -58,6 +58,9 @@ enum maxRatioAction {PAUSE_ACTION, REMOVE_ACTION}; @@ -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: @@ -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);
}
};

8
version.pri

@ -1,11 +1,11 @@ @@ -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

Loading…
Cancel
Save