Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/ktorrent/gui.cpp b/ktorrent/gui.cpp
- index 55cca0e..23105f4 100644
- --- a/ktorrent/gui.cpp
- +++ b/ktorrent/gui.cpp
- @@ -46,6 +46,7 @@
- #include <torrent/queuemanager.h>
- #include <torrent/torrentcontrol.h>
- #include <util/log.h>
- +#include <util/functions.h>
- #include <util/timer.h>
- #include <util/error.h>
- #include <dht/dhtbase.h>
- @@ -461,6 +462,16 @@ namespace kt
- {
- CurrentStats stats = core->getStats();
- status_bar->updateSpeed(stats.upload_speed,stats.download_speed);
- +
- + //All speed to Window status bar
- + if(Settings::showTotalSpeedInTitle())
- + {
- + QString down_up_speed = QString(i18n("D: %1 | U: %2")).arg(BytesPerSecToString((double)stats.download_speed)).arg(BytesPerSecToString((double)stats.upload_speed));
- + setCaption(down_up_speed);
- + }else{
- + setCaption(core->getGroupManager()->allGroup()->groupName());
- + }
- +
- status_bar->updateTransfer(stats.bytes_uploaded,stats.bytes_downloaded);
- status_bar->updateDHTStatus(Globals::instance().getDHT().isRunning(),Globals::instance().getDHT().getStats());
- @@ -520,7 +531,6 @@ namespace kt
- {
- show();
- }
- -
- setCurrentActivity(central->currentActivity());
- }
- diff --git a/ktorrent/pref/generalpref.ui b/ktorrent/pref/generalpref.ui
- index 5d1ea7f..616c54d 100644
- --- a/ktorrent/pref/generalpref.ui
- +++ b/ktorrent/pref/generalpref.ui
- @@ -176,6 +176,13 @@ p, li { white-space: pre-wrap; }
- </property>
- </widget>
- </item>
- + <item>
- + <widget class="QCheckBox" name="kcfg_showTotalSpeedInTitle">
- + <property name="text">
- + <string>Show total speed in the window title</string>
- + </property>
- + </widget>
- + </item>
- </layout>
- </widget>
- </item>
- diff --git a/libktcore/dbus/dbussettings.cpp b/libktcore/dbus/dbussettings.cpp
- index cf6d80f..4f531c4 100644
- --- a/libktcore/dbus/dbussettings.cpp
- +++ b/libktcore/dbus/dbussettings.cpp
- @@ -777,5 +777,16 @@ namespace kt
- {
- Settings::setAutoRenameSingleFileTorrents(val);
- }
- +
- + bool DBusSettings::showTotalSpeedInTitle()
- + {
- + return Settings::showTotalSpeedInTitle();
- + }
- +
- + void DBusSettings::setShowTotalSpeedInTitle(bool val)
- + {
- + Settings::setShowTotalSpeedInTitle(val);
- + }
- +
- }
- diff --git a/libktcore/dbus/dbussettings.h b/libktcore/dbus/dbussettings.h
- index 2636058..b7dbe50 100644
- --- a/libktcore/dbus/dbussettings.h
- +++ b/libktcore/dbus/dbussettings.h
- @@ -186,6 +186,8 @@ namespace kt
- Q_SCRIPTABLE void setPrimaryTransportProtocol(int val);
- Q_SCRIPTABLE bool autoRenameSingleFileTorrents();
- Q_SCRIPTABLE void setAutoRenameSingleFileTorrents(bool val);
- + Q_SCRIPTABLE bool showTotalSpeedInTitle();
- + Q_SCRIPTABLE void setShowTotalSpeedInTitle(bool val);
- Q_SCRIPTABLE void apply();
- private:
- diff --git a/libktcore/ktorrent.kcfg b/libktcore/ktorrent.kcfg
- index b203259..07f98bb 100644
- --- a/libktcore/ktorrent.kcfg
- +++ b/libktcore/ktorrent.kcfg
- @@ -66,6 +66,10 @@
- <label>Show a system tray icon</label>
- <default>true</default>
- </entry>
- + <entry name="showTotalSpeedInTitle" type="Bool">
- + <label>Show a total speeds in the title</label>
- + <default>false</default>
- + </entry>
- <entry name="showSpeedBarInTrayIcon" type="Bool">
- <label>Show speed bar in tray icon</label>
- <default>false</default>
Advertisement
Add Comment
Please, Sign In to add comment