COSMETIC: Display "Alternative speed limits" button as pressed when enabled

This commit is contained in:
Christophe Dumez
2010-06-21 22:41:38 +00:00
parent b9f22ef490
commit 4faaf2b642
4 changed files with 7 additions and 11 deletions

View File

@@ -4,6 +4,7 @@
- BUGFIX: Fix possible compilation errors with libtorrent v0.15 - BUGFIX: Fix possible compilation errors with libtorrent v0.15
- BUGFIX: Fix minor issues in torrent creation tool - BUGFIX: Fix minor issues in torrent creation tool
- BUGFIX: Use checkable actions to avoid issues on systems hiding menu icons (e.g. recent Gnome) - 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 <chris@qbittorrent.org> - v2.2.9 * Sun Jun 13 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.9
- FEATURE: Official support for Win32 platform - FEATURE: Official support for Win32 platform

View File

@@ -933,13 +933,7 @@ void GUI::createSystrayDelayed() {
} }
void GUI::updateAltSpeedsBtn(bool alternative) { void GUI::updateAltSpeedsBtn(bool alternative) {
if(alternative) { actionUse_alternative_speed_limits->setChecked(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"));
}
} }
QMenu* GUI::getTrayIconMenu() { QMenu* GUI::getTrayIconMenu() {
@@ -951,6 +945,7 @@ QMenu* GUI::getTrayIconMenu() {
myTrayIconMenu->addAction(actionDownload_from_URL); myTrayIconMenu->addAction(actionDownload_from_URL);
myTrayIconMenu->addSeparator(); myTrayIconMenu->addSeparator();
updateAltSpeedsBtn(Preferences::isAltBandwidthEnabled()); updateAltSpeedsBtn(Preferences::isAltBandwidthEnabled());
actionUse_alternative_speed_limits->setChecked(Preferences::isAltBandwidthEnabled());
myTrayIconMenu->addAction(actionUse_alternative_speed_limits); myTrayIconMenu->addAction(actionUse_alternative_speed_limits);
myTrayIconMenu->addAction(actionSet_global_download_limit); myTrayIconMenu->addAction(actionSet_global_download_limit);
myTrayIconMenu->addAction(actionSet_global_upload_limit); myTrayIconMenu->addAction(actionSet_global_upload_limit);

View File

@@ -195,6 +195,7 @@ public slots:
if(alternative) { if(alternative) {
altSpeedsBtn->setIcon(QIcon(":/Icons/slow.png")); altSpeedsBtn->setIcon(QIcon(":/Icons/slow.png"));
altSpeedsBtn->setToolTip(tr("Click to disable alternative speed limits")); altSpeedsBtn->setToolTip(tr("Click to disable alternative speed limits"));
altSpeedsBtn->setDown(true);
} else { } else {
altSpeedsBtn->setIcon(QIcon(":/Icons/slow_off.png")); altSpeedsBtn->setIcon(QIcon(":/Icons/slow_off.png"));
altSpeedsBtn->setToolTip(tr("Click to enable alternative speed limits")); altSpeedsBtn->setToolTip(tr("Click to enable alternative speed limits"));

View File

@@ -29,7 +29,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>914</width> <width>914</width>
<height>26</height> <height>25</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menu_Edit"> <widget class="QMenu" name="menu_Edit">
@@ -260,9 +260,8 @@
</property> </property>
</action> </action>
<action name="actionUse_alternative_speed_limits"> <action name="actionUse_alternative_speed_limits">
<property name="icon"> <property name="checkable">
<iconset resource="../icons.qrc"> <bool>true</bool>
<normaloff>:/Icons/slow_off.png</normaloff>:/Icons/slow_off.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Use alternative speed limits</string> <string>Use alternative speed limits</string>