From 4faaf2b6422a549585d53700b2b75332094bc33b Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 21 Jun 2010 22:41:38 +0000 Subject: [PATCH] COSMETIC: Display "Alternative speed limits" button as pressed when enabled --- Changelog | 1 + src/GUI.cpp | 9 ++------- src/statusbar.h | 1 + src/ui/mainwindow.ui | 7 +++---- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Changelog b/Changelog index ae2af6c03..6cf8f99d3 100644 --- a/Changelog +++ b/Changelog @@ -4,6 +4,7 @@ - BUGFIX: Fix possible compilation errors with libtorrent v0.15 - BUGFIX: Fix minor issues in torrent creation tool - BUGFIX: Use checkable actions to avoid issues on systems hiding menu icons (e.g. recent Gnome) + - COSMETIC: Display "Alternative speed limits" button as pressed when enabled * Sun Jun 13 2010 - Christophe Dumez - v2.2.9 - FEATURE: Official support for Win32 platform diff --git a/src/GUI.cpp b/src/GUI.cpp index afa8077b3..970a0acd8 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -933,13 +933,7 @@ void GUI::createSystrayDelayed() { } void GUI::updateAltSpeedsBtn(bool alternative) { - if(alternative) { - actionUse_alternative_speed_limits->setIcon(QIcon(":/Icons/slow.png")); - actionUse_alternative_speed_limits->setText(tr("Use normal speed limits")); - } else { - actionUse_alternative_speed_limits->setIcon(QIcon(":/Icons/slow_off.png")); - actionUse_alternative_speed_limits->setText(tr("Use alternative speed limits")); - } + actionUse_alternative_speed_limits->setChecked(alternative); } QMenu* GUI::getTrayIconMenu() { @@ -951,6 +945,7 @@ QMenu* GUI::getTrayIconMenu() { myTrayIconMenu->addAction(actionDownload_from_URL); myTrayIconMenu->addSeparator(); updateAltSpeedsBtn(Preferences::isAltBandwidthEnabled()); + actionUse_alternative_speed_limits->setChecked(Preferences::isAltBandwidthEnabled()); myTrayIconMenu->addAction(actionUse_alternative_speed_limits); myTrayIconMenu->addAction(actionSet_global_download_limit); myTrayIconMenu->addAction(actionSet_global_upload_limit); diff --git a/src/statusbar.h b/src/statusbar.h index fcf14d92b..a81aacfe6 100644 --- a/src/statusbar.h +++ b/src/statusbar.h @@ -195,6 +195,7 @@ public slots: if(alternative) { altSpeedsBtn->setIcon(QIcon(":/Icons/slow.png")); altSpeedsBtn->setToolTip(tr("Click to disable alternative speed limits")); + altSpeedsBtn->setDown(true); } else { altSpeedsBtn->setIcon(QIcon(":/Icons/slow_off.png")); altSpeedsBtn->setToolTip(tr("Click to enable alternative speed limits")); diff --git a/src/ui/mainwindow.ui b/src/ui/mainwindow.ui index 9e0cabe8c..23ea26c65 100644 --- a/src/ui/mainwindow.ui +++ b/src/ui/mainwindow.ui @@ -29,7 +29,7 @@ 0 0 914 - 26 + 25 @@ -260,9 +260,8 @@ - - - :/Icons/slow_off.png:/Icons/slow_off.png + + true Use alternative speed limits