Changeset View
Changeset View
Standalone View
Standalone View
ktorrent/statusbar.cpp
Context not available. | |||||
29 | #include <dht/dhtbase.h> | 29 | #include <dht/dhtbase.h> | ||
---|---|---|---|---|---|
30 | 30 | | |||
31 | #include "statusbarofflineindicator.h" | 31 | #include "statusbarofflineindicator.h" | ||
32 | #include "settings.h" | ||||
33 | | ||||
32 | using namespace bt; | 34 | using namespace bt; | ||
33 | 35 | | |||
34 | namespace kt | 36 | namespace kt | ||
Context not available. | |||||
69 | if (up == up_speed && down == down_speed) | 71 | if (up == up_speed && down == down_speed) | ||
70 | return; | 72 | return; | ||
71 | 73 | | |||
72 | up_speed = up; | | |||
73 | down_speed = down; | 74 | down_speed = down; | ||
74 | QString s = i18n("Speed down: %1 / up: %2", BytesPerSecToString((double)down_speed), BytesPerSecToString((double)up_speed)); | 75 | up_speed = up; | ||
75 | speed->setText(s); | 76 | QString down_rate; | ||
77 | QString up_rate; | ||||
78 | | ||||
79 | if (Settings::maxDownloadRate() > 0) | ||||
80 | down_rate = QStringLiteral("(%1 %2)").arg(Settings::maxDownloadRate()).arg(i18n("KiB/s")); | ||||
81 | if (Settings::maxUploadRate() > 0) | ||||
82 | up_rate = QStringLiteral("(%1 %2)").arg(Settings::maxUploadRate()).arg(i18n("KiB/s")); | ||||
83 | | ||||
84 | down_rate = QStringLiteral("%1 %2").arg(BytesPerSecToString((double)down_speed)).arg(down_rate); | ||||
85 | up_rate = QStringLiteral("%1 %2").arg(BytesPerSecToString((double)up_speed)).arg(up_rate); | ||||
86 | | ||||
87 | speed->setText(i18n("Speed down: %1 / up: %2", down_rate, up_rate)); | ||||
76 | } | 88 | } | ||
77 | 89 | | |||
78 | void StatusBar::updateTransfer(bt::Uint64 up, bt::Uint64 down) | 90 | void StatusBar::updateTransfer(bt::Uint64 up, bt::Uint64 down) | ||
Context not available. | |||||
82 | 94 | | |||
83 | up_transfer = up; | 95 | up_transfer = up; | ||
84 | down_transfer = down; | 96 | down_transfer = down; | ||
85 | QString t = i18n("Transferred down: %1 / up: %2", BytesToString(down_transfer), BytesToString(up_transfer)); | 97 | transfer->setText(i18n("Transferred down: %1 / up: %2", BytesToString(down_transfer), BytesToString(up_transfer))); | ||
86 | transfer->setText(t); | | |||
87 | } | 98 | } | ||
88 | 99 | | |||
89 | void StatusBar::updateDHTStatus(bool on, const dht::Stats& s) | 100 | void StatusBar::updateDHTStatus(bool on, const dht::Stats& s) | ||
Context not available. |