@ -55,12 +55,10 @@ StatusBar::StatusBar(QStatusBar *bar)
connecStatusLblIcon = new QPushButton ( bar ) ;
connecStatusLblIcon = new QPushButton ( bar ) ;
connecStatusLblIcon - > setFlat ( true ) ;
connecStatusLblIcon - > setFlat ( true ) ;
connecStatusLblIcon - > setFocusPolicy ( Qt : : NoFocus ) ;
connecStatusLblIcon - > setFocusPolicy ( Qt : : NoFocus ) ;
connecStatusLblIcon - > setFixedWidth ( 32 ) ;
connecStatusLblIcon - > setCursor ( Qt : : PointingHandCursor ) ;
connecStatusLblIcon - > setCursor ( Qt : : PointingHandCursor ) ;
connecStatusLblIcon - > setIcon ( QIcon ( " :/Icons/skin/firewalled.png " ) ) ;
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> " ) ) ;
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 = new QPushButton ( bar ) ;
dlSpeedLbl - > setIconSize ( QSize ( 16 , 16 ) ) ;
dlSpeedLbl - > setIcon ( QIcon ( " :/Icons/skin/download.png " ) ) ;
dlSpeedLbl - > setIcon ( QIcon ( " :/Icons/skin/download.png " ) ) ;
//dlSpeedLbl->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
//dlSpeedLbl->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
connect ( dlSpeedLbl , SIGNAL ( clicked ( ) ) , this , SLOT ( capDownloadSpeed ( ) ) ) ;
connect ( dlSpeedLbl , SIGNAL ( clicked ( ) ) , this , SLOT ( capDownloadSpeed ( ) ) ) ;
@ -69,8 +67,6 @@ StatusBar::StatusBar(QStatusBar *bar)
dlSpeedLbl - > setCursor ( Qt : : PointingHandCursor ) ;
dlSpeedLbl - > setCursor ( Qt : : PointingHandCursor ) ;
altSpeedsBtn = new QPushButton ( bar ) ;
altSpeedsBtn = new QPushButton ( bar ) ;
altSpeedsBtn - > setFixedWidth ( 36 ) ;
altSpeedsBtn - > setIconSize ( QSize ( 32 , 32 ) ) ;
altSpeedsBtn - > setFlat ( true ) ;
altSpeedsBtn - > setFlat ( true ) ;
altSpeedsBtn - > setFocusPolicy ( Qt : : NoFocus ) ;
altSpeedsBtn - > setFocusPolicy ( Qt : : NoFocus ) ;
altSpeedsBtn - > setCursor ( Qt : : PointingHandCursor ) ;
altSpeedsBtn - > setCursor ( Qt : : PointingHandCursor ) ;
@ -79,7 +75,6 @@ StatusBar::StatusBar(QStatusBar *bar)
connect ( altSpeedsBtn , SIGNAL ( clicked ( ) ) , this , SLOT ( toggleAlternativeSpeeds ( ) ) ) ;
connect ( altSpeedsBtn , SIGNAL ( clicked ( ) ) , this , SLOT ( toggleAlternativeSpeeds ( ) ) ) ;
upSpeedLbl = new QPushButton ( bar ) ;
upSpeedLbl = new QPushButton ( bar ) ;
upSpeedLbl - > setIconSize ( QSize ( 16 , 16 ) ) ;
upSpeedLbl - > setIcon ( QIcon ( " :/Icons/skin/seeding.png " ) ) ;
upSpeedLbl - > setIcon ( QIcon ( " :/Icons/skin/seeding.png " ) ) ;
//upSpeedLbl->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
//upSpeedLbl->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
connect ( upSpeedLbl , SIGNAL ( clicked ( ) ) , this , SLOT ( capUploadSpeed ( ) ) ) ;
connect ( upSpeedLbl , SIGNAL ( clicked ( ) ) , this , SLOT ( capUploadSpeed ( ) ) ) ;
@ -88,20 +83,32 @@ StatusBar::StatusBar(QStatusBar *bar)
upSpeedLbl - > setCursor ( Qt : : PointingHandCursor ) ;
upSpeedLbl - > setCursor ( Qt : : PointingHandCursor ) ;
DHTLbl = new QLabel ( tr ( " DHT: %1 nodes " ) . arg ( 0 ) , bar ) ;
DHTLbl = new QLabel ( tr ( " DHT: %1 nodes " ) . arg ( 0 ) , bar ) ;
DHTLbl - > setSizePolicy ( QSizePolicy : : Maximum , QSizePolicy : : Preferred ) ;
DHTLbl - > setSizePolicy ( QSizePolicy : : Maximum , QSizePolicy : : Preferred ) ;
QRect labelRect = dlSpeedLbl - > fontMetrics ( ) . boundingRect ( " XX 0.000,00 XiX/s (000,0 XiX) " ) ;
if ( labelRect . height ( ) < 26 )
labelRect . setHeight ( 26 ) ;
dlSpeedLbl - > setIconSize ( QSize ( 16 , 16 ) ) ;
upSpeedLbl - > setIconSize ( QSize ( 16 , 16 ) ) ;
connecStatusLblIcon - > setFixedHeight ( labelRect . height ( ) ) ;
altSpeedsBtn - > setIconSize ( QSize ( 30 , 30 ) ) ; // cut out blank parts
altSpeedsBtn - > setFixedHeight ( labelRect . height ( ) ) ;
dlSpeedLbl - > setMinimumSize ( labelRect . width ( ) , labelRect . height ( ) ) ;
upSpeedLbl - > setMinimumSize ( labelRect . width ( ) , labelRect . height ( ) ) ;
statusSep1 = new QFrame ( bar ) ;
statusSep1 = new QFrame ( bar ) ;
statusSep1 - > setFixedSize ( 3 , dlSpeedLbl - > fontMetrics ( ) . height ( ) ) ;
statusSep1 - > setFixedSize ( 3 , labelRect . height ( ) ) ;
statusSep1 - > setFrameStyle ( QFrame : : VLine ) ;
statusSep1 - > setFrameStyle ( QFrame : : VLine ) ;
statusSep1 - > setFrameShadow ( QFrame : : Raised ) ;
statusSep1 - > setFrameShadow ( QFrame : : Raised ) ;
statusSep2 = new QFrame ( bar ) ;
statusSep2 = new QFrame ( bar ) ;
statusSep2 - > setFixedSize ( 3 , dlSpeedLbl - > fontMetrics ( ) . height ( ) ) ;
statusSep2 - > setFixedSize ( 3 , labelRect . height ( ) ) ;
statusSep2 - > setFrameStyle ( QFrame : : VLine ) ;
statusSep2 - > setFrameStyle ( QFrame : : VLine ) ;
statusSep2 - > setFrameShadow ( QFrame : : Raised ) ;
statusSep2 - > setFrameShadow ( QFrame : : Raised ) ;
statusSep3 = new QFrame ( bar ) ;
statusSep3 = new QFrame ( bar ) ;
statusSep3 - > setFixedSize ( 3 , dlSpeedLbl - > fontMetrics ( ) . height ( ) ) ;
statusSep3 - > setFixedSize ( 3 , labelRect . height ( ) ) ;
statusSep3 - > setFrameStyle ( QFrame : : VLine ) ;
statusSep3 - > setFrameStyle ( QFrame : : VLine ) ;
statusSep3 - > setFrameShadow ( QFrame : : Raised ) ;
statusSep3 - > setFrameShadow ( QFrame : : Raised ) ;
statusSep4 = new QFrame ( bar ) ;
statusSep4 = new QFrame ( bar ) ;
statusSep4 - > setFixedSize ( 3 , dlSpeedLbl - > fontMetrics ( ) . height ( ) ) ;
statusSep4 - > setFixedSize ( 3 , labelRect . height ( ) ) ;
statusSep4 - > setFrameStyle ( QFrame : : VLine ) ;
statusSep4 - > setFrameStyle ( QFrame : : VLine ) ;
statusSep4 - > setFrameShadow ( QFrame : : Raised ) ;
statusSep4 - > setFrameShadow ( QFrame : : Raised ) ;
layout - > addWidget ( DHTLbl ) ;
layout - > addWidget ( DHTLbl ) ;
@ -116,11 +123,9 @@ StatusBar::StatusBar(QStatusBar *bar)
bar - > addPermanentWidget ( container ) ;
bar - > addPermanentWidget ( container ) ;
container - > setSizePolicy ( QSizePolicy : : Expanding , QSizePolicy : : Preferred ) ;
container - > setSizePolicy ( QSizePolicy : : Expanding , QSizePolicy : : Preferred ) ;
//bar->setStyleSheet("QWidget {padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0;}\n");
bar - > setStyleSheet ( " QWidget {padding: 0; margin: 0;} \n QPushButton {padding: 3px;} \n " ) ;
container - > setContentsMargins ( 0 , 0 , 0 , 1 ) ;
container - > adjustSize ( ) ;
bar - > setContentsMargins ( 0 , 0 , 0 , 0 ) ;
bar - > adjustSize ( ) ;
container - > setFixedHeight ( dlSpeedLbl - > fontMetrics ( ) . height ( ) + 7 ) ;
bar - > setFixedHeight ( dlSpeedLbl - > fontMetrics ( ) . height ( ) + 9 ) ;
// Is DHT enabled
// Is DHT enabled
DHTLbl - > setVisible ( pref - > isDHTEnabled ( ) ) ;
DHTLbl - > setVisible ( pref - > isDHTEnabled ( ) ) ;
refreshTimer = new QTimer ( bar ) ;
refreshTimer = new QTimer ( bar ) ;