Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/ktorrent/gui.cpp b/ktorrent/gui.cpp
- index 94142df..78cf7d6 100644
- --- a/ktorrent/gui.cpp
- +++ b/ktorrent/gui.cpp
- @@ -47,6 +47,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>
- @@ -466,6 +467,15 @@ namespace kt
- status_bar->updateSpeed(stats.upload_speed, stats.download_speed);
- status_bar->updateTransfer(stats.bytes_uploaded, stats.bytes_downloaded);
- status_bar->updateDHTStatus(Globals::instance().getDHT().isRunning(), Globals::instance().getDHT().getStats());
- +
- + //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());
- + }
- tray_icon->updateStats(stats);
- core->updateGuiPlugins();
- diff --git a/ktorrent/pref/generalpref.ui b/ktorrent/pref/generalpref.ui
- index 7d29b0d..5413104 100644
- --- a/ktorrent/pref/generalpref.ui
- +++ b/ktorrent/pref/generalpref.ui
- @@ -171,6 +171,13 @@
- </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 53d445d..af97807 100644
- --- a/libktcore/dbus/dbussettings.cpp
- +++ b/libktcore/dbus/dbussettings.cpp
- @@ -777,5 +777,14 @@ 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 82fc8fd..06226f4 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 c647614..daed91e 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
Advertisement