@ -54,86 +54,91 @@ StatusBar::StatusBar(QStatusBar *bar)
@@ -54,86 +54,91 @@ StatusBar::StatusBar(QStatusBar *bar)
Preferences * const pref = Preferences : : instance ( ) ;
connect ( BitTorrent : : Session : : instance ( ) , SIGNAL ( speedLimitModeChanged ( bool ) ) , this , SLOT ( updateAltSpeedsBtn ( bool ) ) ) ;
container = new QWidget ( bar ) ;
layout = new QHBoxLayout ( container ) ;
layout - > setContentsMargins ( 0 , 0 , 0 , 0 ) ;
m_ container = new QWidget ( bar ) ;
m_ layout = new QHBoxLayout ( m_ container) ;
m_ layout- > setContentsMargins ( 0 , 0 , 0 , 0 ) ;
container - > setLayout ( layout ) ;
connecStatusLblIcon = new QPushButton ( bar ) ;
connecStatusLblIcon - > setFlat ( true ) ;
connecStatusLblIcon - > setFocusPolicy ( Qt : : NoFocus ) ;
connecStatusLblIcon - > setCursor ( Qt : : PointingHandCursor ) ;
connecStatusLblIcon - > setIcon ( QIcon ( " :/icons/skin/firewalled.png " ) ) ;
connecStatusLblIcon - > setToolTip ( QString : : fromUtf8 ( " <b> " ) + tr ( " Connection status: " ) + QString : : fromUtf8 ( " </b><br> " ) + QString : : fromUtf8 ( " <i> " ) + tr ( " No direct connections. This may indicate network configuration problems. " ) + QString : : fromUtf8 ( " </i> " ) ) ;
dlSpeedLbl = new QPushButton ( bar ) ;
dlSpeedLbl - > setIcon ( QIcon ( " :/icons/skin/download.png " ) ) ;
connect ( dlSpeedLbl , SIGNAL ( clicked ( ) ) , this , SLOT ( capDownloadSpeed ( ) ) ) ;
dlSpeedLbl - > setFlat ( true ) ;
dlSpeedLbl - > setFocusPolicy ( Qt : : NoFocus ) ;
dlSpeedLbl - > setCursor ( Qt : : PointingHandCursor ) ;
m_container - > setLayout ( m_layout ) ;
m_connecStatusLblIcon = new QPushButton ( bar ) ;
m_connecStatusLblIcon - > setFlat ( true ) ;
m_connecStatusLblIcon - > setFocusPolicy ( Qt : : NoFocus ) ;
m_connecStatusLblIcon - > setCursor ( Qt : : PointingHandCursor ) ;
m_connecStatusLblIcon - > setIcon ( QIcon ( " :/icons/skin/firewalled.png " ) ) ;
m_connecStatusLblIcon - > setToolTip ( QString : : fromUtf8 ( " <b> " ) + tr ( " Connection status: " ) + QString : : fromUtf8 ( " </b><br> " ) + QString : : fromUtf8 ( " <i> " ) + tr ( " No direct connections. This may indicate network configuration problems. " ) + QString : : fromUtf8 ( " </i> " ) ) ;
up SpeedLbl = new QPushButton ( bar ) ;
up SpeedLbl- > setIcon ( QIcon ( " :/icons/skin/seeding .png " ) ) ;
connect ( up SpeedLbl, SIGNAL ( clicked ( ) ) , this , SLOT ( capUp loadSpeed ( ) ) ) ;
up SpeedLbl- > setFlat ( true ) ;
up SpeedLbl- > setFocusPolicy ( Qt : : NoFocus ) ;
up SpeedLbl- > setCursor ( Qt : : PointingHandCursor ) ;
DHTLbl = new QLabel ( tr ( " DHT: %1 nodes " ) . arg ( 0 ) , bar ) ;
DHTLbl - > setSizePolicy ( QSizePolicy : : Maximum , QSizePolicy : : Preferred ) ;
m_dlSpeedLbl = new QPushButton ( bar ) ;
m_dlSpeedLbl - > setIcon ( QIcon ( " :/icons/skin/download.png " ) ) ;
connect ( m_dlSpeedLbl , SIGNAL ( clicked ( ) ) , this , SLOT ( capDownloadSpeed ( ) ) ) ;
m_dlSpeedLbl - > setFlat ( true ) ;
m_dlSpeedLbl - > setFocusPolicy ( Qt : : NoFocus ) ;
m_dl SpeedLbl- > setCursor ( Qt : : PointingHandCursor ) ;
m_dlSpeedLbl - > setStyleSheet ( " text-align:left; " ) ;
m_dlSpeedLbl - > setMinimumWidth ( 200 ) ;
altSpeedsBtn = new QPushButton ( bar ) ;
altSpeedsBtn - > setFlat ( true ) ;
altSpeedsBtn - > setFocusPolicy ( Qt : : NoFocus ) ;
altSpeedsBtn - > setCursor ( Qt : : PointingHandCursor ) ;
m_upSpeedLbl = new QPushButton ( bar ) ;
m_upSpeedLbl - > setIcon ( QIcon ( " :/icons/skin/seeding.png " ) ) ;
connect ( m_upSpeedLbl , SIGNAL ( clicked ( ) ) , this , SLOT ( capUploadSpeed ( ) ) ) ;
m_upSpeedLbl - > setFlat ( true ) ;
m_upSpeedLbl - > setFocusPolicy ( Qt : : NoFocus ) ;
m_upSpeedLbl - > setCursor ( Qt : : PointingHandCursor ) ;
m_upSpeedLbl - > setStyleSheet ( " text-align:left; " ) ;
m_upSpeedLbl - > setMinimumWidth ( 200 ) ;
m_DHTLbl = new QLabel ( tr ( " DHT: %1 nodes " ) . arg ( 0 ) , bar ) ;
m_DHTLbl - > setSizePolicy ( QSizePolicy : : Maximum , QSizePolicy : : Preferred ) ;
m_altSpeedsBtn = new QPushButton ( bar ) ;
m_altSpeedsBtn - > setFlat ( true ) ;
m_altSpeedsBtn - > setFocusPolicy ( Qt : : NoFocus ) ;
m_altSpeedsBtn - > setCursor ( Qt : : PointingHandCursor ) ;
updateAltSpeedsBtn ( pref - > isAltBandwidthEnabled ( ) ) ;
connect ( altSpeedsBtn , SIGNAL ( clicked ( ) ) , this , SLOT ( toggleAlternativeSpeeds ( ) ) ) ;
connect ( m_ altSpeedsBtn, SIGNAL ( clicked ( ) ) , this , SLOT ( toggleAlternativeSpeeds ( ) ) ) ;
// Because on some platforms the default icon size is bigger
// and it will result in taller/fatter statusbar, even if the
// icons are actually 16x16
connecStatusLblIcon - > setIconSize ( QSize ( 16 , 16 ) ) ;
dlSpeedLbl - > setIconSize ( QSize ( 16 , 16 ) ) ;
upSpeedLbl - > setIconSize ( QSize ( 16 , 16 ) ) ;
altSpeedsBtn - > setIconSize ( QSize ( 28 , 16 ) ) ;
m_ connecStatusLblIcon- > setIconSize ( QSize ( 16 , 16 ) ) ;
m_ dlSpeedLbl- > setIconSize ( QSize ( 16 , 16 ) ) ;
m_ upSpeedLbl- > setIconSize ( QSize ( 16 , 16 ) ) ;
m_ altSpeedsBtn- > setIconSize ( QSize ( 28 , 16 ) ) ;
// Set to the known maximum width(plus some padding)
// so the speed widgets will take the rest of the space
connecStatusLblIcon - > setMaximumWidth ( 16 + 6 ) ;
altSpeedsBtn - > setMaximumWidth ( 28 + 6 ) ;
m_ connecStatusLblIcon- > setMaximumWidth ( 16 + 6 ) ;
m_ altSpeedsBtn- > setMaximumWidth ( 28 + 6 ) ;
statusSep1 = new QFrame ( bar ) ;
statusSep1 - > setFrameStyle ( QFrame : : VLine ) ;
statusSep1 - > setFrameShadow ( QFrame : : Raised ) ;
statusSep2 = new QFrame ( bar ) ;
statusSep2 - > setFrameStyle ( QFrame : : VLine ) ;
statusSep2 - > setFrameShadow ( QFrame : : Raised ) ;
statusSep3 = new QFrame ( bar ) ;
statusSep3 - > setFrameStyle ( QFrame : : VLine ) ;
statusSep3 - > setFrameShadow ( QFrame : : Raised ) ;
statusSep4 = new QFrame ( bar ) ;
statusSep4 - > setFrameStyle ( QFrame : : VLine ) ;
statusSep4 - > setFrameShadow ( QFrame : : Raised ) ;
layout - > addWidget ( DHTLbl ) ;
layout - > addWidget ( statusSep1 ) ;
layout - > addWidget ( connecStatusLblIcon ) ;
layout - > addWidget ( statusSep2 ) ;
layout - > addWidget ( altSpeedsBtn ) ;
layout - > addWidget ( statusSep4 ) ;
layout - > addWidget ( dlSpeedLbl ) ;
layout - > addWidget ( statusSep3 ) ;
layout - > addWidget ( upSpeedLbl ) ;
m_ statusSep1 = new QFrame ( bar ) ;
m_ statusSep1- > setFrameStyle ( QFrame : : VLine ) ;
m_ statusSep1- > setFrameShadow ( QFrame : : Raised ) ;
m_ statusSep2 = new QFrame ( bar ) ;
m_ statusSep2- > setFrameStyle ( QFrame : : VLine ) ;
m_ statusSep2- > setFrameShadow ( QFrame : : Raised ) ;
m_ statusSep3 = new QFrame ( bar ) ;
m_ statusSep3- > setFrameStyle ( QFrame : : VLine ) ;
m_ statusSep3- > setFrameShadow ( QFrame : : Raised ) ;
m_ statusSep4 = new QFrame ( bar ) ;
m_ statusSep4- > setFrameStyle ( QFrame : : VLine ) ;
m_ statusSep4- > setFrameShadow ( QFrame : : Raised ) ;
m_ layout- > addWidget ( m_ DHTLbl) ;
m_ layout- > addWidget ( m_ statusSep1) ;
m_ layout- > addWidget ( m_ connecStatusLblIcon) ;
m_ layout- > addWidget ( m_ statusSep2) ;
m_ layout- > addWidget ( m_ altSpeedsBtn) ;
m_ layout- > addWidget ( m_ statusSep4) ;
m_ layout- > addWidget ( m_ dlSpeedLbl) ;
m_ layout- > addWidget ( m_ statusSep3) ;
m_ layout- > addWidget ( m_ upSpeedLbl) ;
bar - > addPermanentWidget ( container ) ;
container - > setSizePolicy ( QSizePolicy : : Expanding , QSizePolicy : : Preferred ) ;
bar - > addPermanentWidget ( m_container ) ;
bar - > setStyleSheet ( " QWidget {margin: 0;} " ) ;
container - > adjustSize ( ) ;
m_ container- > adjustSize ( ) ;
bar - > adjustSize ( ) ;
// Is DHT enabled
DHTLbl - > setVisible ( pref - > isDHTEnabled ( ) ) ;
refreshTimer = new QTimer ( bar ) ;
m_ DHTLbl- > setVisible ( pref - > isDHTEnabled ( ) ) ;
m_ refreshTimer = new QTimer ( bar ) ;
refreshStatusBar ( ) ;
connect ( refreshTimer , SIGNAL ( timeout ( ) ) , this , SLOT ( refreshStatusBar ( ) ) ) ;
refreshTimer - > start ( 1500 ) ;
connect ( m_ refreshTimer, SIGNAL ( timeout ( ) ) , this , SLOT ( refreshStatusBar ( ) ) ) ;
m_ refreshTimer- > start ( 1500 ) ;
}
StatusBar : : ~ StatusBar ( )
@ -143,83 +148,95 @@ StatusBar::~StatusBar()
@@ -143,83 +148,95 @@ StatusBar::~StatusBar()
QPushButton * StatusBar : : connectionStatusButton ( ) const
{
return connecStatusLblIcon ;
return m_ connecStatusLblIcon;
}
void StatusBar : : showRestartRequired ( )
{
// Restart required notification
const QString restart_t ext = tr ( " qBittorrent needs to be restarted " ) ;
const QString restartT ext = tr ( " qBittorrent needs to be restarted " ) ;
QLabel * restartIconLbl = new QLabel ( m_bar ) ;
restartIconLbl - > setPixmap ( QPixmap ( " :/icons/oxygen/dialog-warning.png " ) . scaled ( QSize ( 24 , 24 ) ) ) ;
restartIconLbl - > setToolTip ( restart_t ext ) ;
restartIconLbl - > setToolTip ( restartT ext ) ;
m_bar - > insertWidget ( 0 , restartIconLbl ) ;
QLabel * restartLbl = new QLabel ( m_bar ) ;
restartLbl - > setSizePolicy ( QSizePolicy : : MinimumExpanding , QSizePolicy : : Preferred ) ;
m_bar - > insertWidget ( 1 , restartLbl ) ;
QFontMetrics fm ( restartLbl - > font ( ) ) ;
restartLbl - > setText ( fm . elidedText ( restart_t ext , Qt : : ElideRight , restartLbl - > width ( ) ) ) ;
restartLbl - > setText ( fm . elidedText ( restartT ext , Qt : : ElideRight , restartLbl - > width ( ) ) ) ;
Logger : : instance ( ) - > addMessage ( tr ( " qBittorrent was just updated and needs to be restarted for the changes to be effective. " ) , Log : : CRITICAL ) ;
}
void StatusBar : : stopTimer ( )
{
refreshTimer - > stop ( ) ;
m_ refreshTimer- > stop ( ) ;
}
void StatusBar : : refreshStatusBar ( )
void StatusBar : : updateConnectionStatus ( const BitTorrent : : SessionStatus & sessionStatus )
{
// Update connection status
const BitTorrent : : SessionStatus sessionStatus = BitTorrent : : Session : : instance ( ) - > status ( ) ;
if ( ! BitTorrent : : Session : : instance ( ) - > isListening ( ) ) {
connecStatusLblIcon - > setIcon ( QIcon ( QString : : fromUtf8 ( " :/icons/skin/disconnected.png " ) ) ) ;
connecStatusLblIcon - > setToolTip ( QString : : fromUtf8 ( " <b> " ) + tr ( " Connection Status: " ) + QString : : fromUtf8 ( " </b><br> " ) + tr ( " Offline. This usually means that qBittorrent failed to listen on the selected port for incoming connections. " ) ) ;
m_connecStatusLblIcon - > setIcon ( QIcon ( QString : : fromUtf8 ( " :/icons/skin/disconnected.png " ) ) ) ;
m_ connecStatusLblIcon- > setToolTip ( QString : : fromUtf8 ( " <b> " ) + tr ( " Connection Status: " ) + QString : : fromUtf8 ( " </b><br> " ) + tr ( " Offline. This usually means that qBittorrent failed to listen on the selected port for incoming connections. " ) ) ;
}
else {
if ( sessionStatus . hasIncomingConnections ( ) ) {
// Connection OK
connecStatusLblIcon - > setIcon ( QIcon ( QString : : fromUtf8 ( " :/icons/skin/connected.png " ) ) ) ;
connecStatusLblIcon - > setToolTip ( QString : : fromUtf8 ( " <b> " ) + tr ( " Connection Status: " ) + QString : : fromUtf8 ( " </b><br> " ) + tr ( " Online " ) ) ;
m_ connecStatusLblIcon- > setIcon ( QIcon ( QString : : fromUtf8 ( " :/icons/skin/connected.png " ) ) ) ;
m_ connecStatusLblIcon- > setToolTip ( QString : : fromUtf8 ( " <b> " ) + tr ( " Connection Status: " ) + QString : : fromUtf8 ( " </b><br> " ) + tr ( " Online " ) ) ;
}
else {
connecStatusLblIcon - > setIcon ( QIcon ( QString : : fromUtf8 ( " :/icons/skin/firewalled.png " ) ) ) ;
connecStatusLblIcon - > setToolTip ( QString : : fromUtf8 ( " <b> " ) + tr ( " Connection status: " ) + QString : : fromUtf8 ( " </b><br> " ) + QString : : fromUtf8 ( " <i> " ) + tr ( " No direct connections. This may indicate network configuration problems. " ) + QString : : fromUtf8 ( " </i> " ) ) ;
m_ connecStatusLblIcon- > setIcon ( QIcon ( QString : : fromUtf8 ( " :/icons/skin/firewalled.png " ) ) ) ;
m_ connecStatusLblIcon- > setToolTip ( QString : : fromUtf8 ( " <b> " ) + tr ( " Connection status: " ) + QString : : fromUtf8 ( " </b><br> " ) + QString : : fromUtf8 ( " <i> " ) + tr ( " No direct connections. This may indicate network configuration problems. " ) + QString : : fromUtf8 ( " </i> " ) ) ;
}
}
// Update Number of DHT nodes
}
void StatusBar : : updateDHTNodesNumber ( const BitTorrent : : SessionStatus & sessionStatus )
{
if ( BitTorrent : : Session : : instance ( ) - > isDHTEnabled ( ) ) {
DHTLbl - > setVisible ( true ) ;
//statusSep1->setVisible(true);
DHTLbl - > setText ( tr ( " DHT: %1 nodes " ) . arg ( QString : : number ( sessionStatus . dhtNodes ( ) ) ) ) ;
m_DHTLbl - > setVisible ( true ) ;
m_DHTLbl - > setText ( tr ( " DHT: %1 nodes " ) . arg ( QString : : number ( sessionStatus . dhtNodes ( ) ) ) ) ;
}
else {
DHTLbl - > setVisible ( false ) ;
//statusSep1->setVisible(false);
m_ DHTLbl- > setVisible ( false ) ;
}
}
// Update speed labels
QString speedLbl = Utils : : Misc : : friendlyUnit ( sessionStatus . payloadDownloadRate ( ) , true ) + " ( " + Utils : : Misc : : friendlyUnit ( sessionStatus . totalPayloadDownload ( ) ) + " ) " ;
void StatusBar : : updateSpeedLabels ( const BitTorrent : : SessionStatus & sessionStatus )
{
QString speedLbl = Utils : : Misc : : friendlyUnit ( sessionStatus . payloadDownloadRate ( ) , true ) ;
int speedLimit = BitTorrent : : Session : : instance ( ) - > downloadRateLimit ( ) ;
if ( speedLimit )
speedLbl = " [ " + Utils : : Misc : : friendlyUnit ( speedLimit , true ) + " ] " + speedLbl ;
dlSpeedLbl - > setText ( speedLbl ) ;
speedLbl + = " [ " + Utils : : Misc : : friendlyUnit ( speedLimit , true ) + " ] " ;
speedLbl + = " ( " + Utils : : Misc : : friendlyUnit ( sessionStatus . totalPayloadDownload ( ) ) + " ) " ;
m_dlSpeedLbl - > setText ( speedLbl ) ;
speedLimit = BitTorrent : : Session : : instance ( ) - > uploadRateLimit ( ) ;
speedLbl = Utils : : Misc : : friendlyUnit ( sessionStatus . payloadUploadRate ( ) , true ) + " ( " + Utils : : Misc : : friendlyUnit ( sessionStatus . totalPayloadUpload ( ) ) + " ) " ;
speedLbl = Utils : : Misc : : friendlyUnit ( sessionStatus . payloadUploadRate ( ) , true ) ;
if ( speedLimit )
speedLbl = " [ " + Utils : : Misc : : friendlyUnit ( speedLimit , true ) + " ] " + speedLbl ;
upSpeedLbl - > setText ( speedLbl ) ;
speedLbl + = " [ " + Utils : : Misc : : friendlyUnit ( speedLimit , true ) + " ] " ;
speedLbl + = " ( " + Utils : : Misc : : friendlyUnit ( sessionStatus . totalPayloadUpload ( ) ) + " ) " ;
m_upSpeedLbl - > setText ( speedLbl ) ;
}
void StatusBar : : refreshStatusBar ( )
{
const BitTorrent : : SessionStatus sessionStatus = BitTorrent : : Session : : instance ( ) - > status ( ) ;
updateConnectionStatus ( sessionStatus ) ;
updateDHTNodesNumber ( sessionStatus ) ;
updateSpeedLabels ( sessionStatus ) ;
}
void StatusBar : : updateAltSpeedsBtn ( bool alternative )
{
if ( alternative ) {
altSpeedsBtn - > setIcon ( QIcon ( " :/icons/slow.png " ) ) ;
altSpeedsBtn - > setToolTip ( tr ( " Click to switch to regular speed limits " ) ) ;
altSpeedsBtn - > setDown ( true ) ;
m_ altSpeedsBtn- > setIcon ( QIcon ( " :/icons/slow.png " ) ) ;
m_ altSpeedsBtn- > setToolTip ( tr ( " Click to switch to regular speed limits " ) ) ;
m_ altSpeedsBtn- > setDown ( true ) ;
}
else {
altSpeedsBtn - > setIcon ( QIcon ( " :/icons/slow_off.png " ) ) ;
altSpeedsBtn - > setToolTip ( tr ( " Click to switch to alternative speed limits " ) ) ;
altSpeedsBtn - > setDown ( false ) ;
m_ altSpeedsBtn- > setIcon ( QIcon ( " :/icons/slow_off.png " ) ) ;
m_ altSpeedsBtn- > setToolTip ( tr ( " Click to switch to alternative speed limits " ) ) ;
m_ altSpeedsBtn- > setDown ( false ) ;
}
refreshStatusBar ( ) ;
}
@ -235,12 +252,12 @@ void StatusBar::toggleAlternativeSpeeds()
@@ -235,12 +252,12 @@ void StatusBar::toggleAlternativeSpeeds()
void StatusBar : : capDownloadSpeed ( )
{
bool ok = false ;
int cur_l imit = BitTorrent : : Session : : instance ( ) - > downloadRateLimit ( ) ;
long new_l imit = SpeedLimitDialog : : askSpeedLimit ( & ok , tr ( " Global Download Speed Limit " ) , cur_l imit ) ;
int curL imit = BitTorrent : : Session : : instance ( ) - > downloadRateLimit ( ) ;
long newL imit = SpeedLimitDialog : : askSpeedLimit ( & ok , tr ( " Global Download Speed Limit " ) , curL imit ) ;
if ( ok ) {
Preferences * const pref = Preferences : : instance ( ) ;
bool alt = pref - > isAltBandwidthEnabled ( ) ;
if ( new_l imit < = 0 ) {
if ( newL imit < = 0 ) {
qDebug ( " Setting global download rate limit to Unlimited " ) ;
BitTorrent : : Session : : instance ( ) - > setDownloadRateLimit ( - 1 ) ;
if ( ! alt )
@ -249,12 +266,12 @@ void StatusBar::capDownloadSpeed()
@@ -249,12 +266,12 @@ void StatusBar::capDownloadSpeed()
pref - > setAltGlobalDownloadLimit ( - 1 ) ;
}
else {
qDebug ( " Setting global download rate limit to %.1fKb/s " , new_l imit / 1024. ) ;
BitTorrent : : Session : : instance ( ) - > setDownloadRateLimit ( new_l imit ) ;
qDebug ( " Setting global download rate limit to %.1fKb/s " , newL imit / 1024. ) ;
BitTorrent : : Session : : instance ( ) - > setDownloadRateLimit ( newL imit ) ;
if ( ! alt )
pref - > setGlobalDownloadLimit ( new_l imit / 1024. ) ;
pref - > setGlobalDownloadLimit ( newL imit / 1024. ) ;
else
pref - > setAltGlobalDownloadLimit ( new_l imit / 1024. ) ;
pref - > setAltGlobalDownloadLimit ( newL imit / 1024. ) ;
}
refreshStatusBar ( ) ;
}
@ -263,12 +280,12 @@ void StatusBar::capDownloadSpeed()
@@ -263,12 +280,12 @@ void StatusBar::capDownloadSpeed()
void StatusBar : : capUploadSpeed ( )
{
bool ok = false ;
int cur_l imit = BitTorrent : : Session : : instance ( ) - > uploadRateLimit ( ) ;
long new_l imit = SpeedLimitDialog : : askSpeedLimit ( & ok , tr ( " Global Upload Speed Limit " ) , cur_l imit ) ;
int curL imit = BitTorrent : : Session : : instance ( ) - > uploadRateLimit ( ) ;
long newL imit = SpeedLimitDialog : : askSpeedLimit ( & ok , tr ( " Global Upload Speed Limit " ) , curL imit ) ;
if ( ok ) {
Preferences * const pref = Preferences : : instance ( ) ;
bool alt = pref - > isAltBandwidthEnabled ( ) ;
if ( new_l imit < = 0 ) {
if ( newL imit < = 0 ) {
qDebug ( " Setting global upload rate limit to Unlimited " ) ;
BitTorrent : : Session : : instance ( ) - > setUploadRateLimit ( - 1 ) ;
if ( ! alt )
@ -277,12 +294,12 @@ void StatusBar::capUploadSpeed()
@@ -277,12 +294,12 @@ void StatusBar::capUploadSpeed()
Preferences : : instance ( ) - > setAltGlobalUploadLimit ( - 1 ) ;
}
else {
qDebug ( " Setting global upload rate limit to %.1fKb/s " , new_l imit / 1024. ) ;
BitTorrent : : Session : : instance ( ) - > setUploadRateLimit ( new_l imit ) ;
qDebug ( " Setting global upload rate limit to %.1fKb/s " , newL imit / 1024. ) ;
BitTorrent : : Session : : instance ( ) - > setUploadRateLimit ( newL imit ) ;
if ( ! alt )
Preferences : : instance ( ) - > setGlobalUploadLimit ( new_l imit / 1024. ) ;
Preferences : : instance ( ) - > setGlobalUploadLimit ( newL imit / 1024. ) ;
else
Preferences : : instance ( ) - > setAltGlobalUploadLimit ( new_l imit / 1024. ) ;
Preferences : : instance ( ) - > setAltGlobalUploadLimit ( newL imit / 1024. ) ;
}
refreshStatusBar ( ) ;
}