From 3b898c52d3c17f551aa1e32b3746429eca03c289 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 13 Mar 2011 12:48:53 +0000 Subject: [PATCH] Code clean up --- src/Icons/downarrow.png | Bin 722 -> 0 bytes src/Icons/oxygen/arrow-down.png | Bin 0 -> 1006 bytes src/Icons/oxygen/arrow-up.png | Bin 0 -> 927 bytes src/Icons/uparrow.png | Bin 787 -> 0 bytes src/icons.qrc | 4 +-- src/statusbar.h | 44 ++++++++++++-------------------- 6 files changed, 18 insertions(+), 30 deletions(-) delete mode 100644 src/Icons/downarrow.png create mode 100644 src/Icons/oxygen/arrow-down.png create mode 100644 src/Icons/oxygen/arrow-up.png delete mode 100644 src/Icons/uparrow.png diff --git a/src/Icons/downarrow.png b/src/Icons/downarrow.png deleted file mode 100644 index ea9c00cf8b9d01f54408eeff0b636eb1a7a5e834..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 722 zcmV;@0xkWCP)ld|NFQ8-|s&PK+FKb|9}4l)BpZJ z_z?V;0U?jdN2vP?l6&y)&)-0R0Ac|d`jJOmK}1uXft! z>FsA=Hb4LY4gNFX|AmtUZOm2-ah3uM93(jWT zK#U+#)@RNBzyFyW{@J)OcxrPqurlK}@cj=4hT}koJ^73z_~SbRLsu(^KES}x=Lir$ zVE2Jyk>U5R{lAayH`v1L#$Y7PhGEzrUE37YGsp z2p~q7oP^yX0iXr@e{t~}FgbfOi14Et{`Vimu%|%p|3xkZz5@-N12pvcGmxQ7UQ=`4N6YK>#3t7zt$pW{wJw%hv<5z5`U~ z03=D_HWUN^0*H}TH3&ce(X2cM2q2mn3=lvxGZ-Mi0DSlsJ-%(kVgLXD07*qoM6N<$ Ef{v9g@Bjb+ diff --git a/src/Icons/oxygen/arrow-down.png b/src/Icons/oxygen/arrow-down.png new file mode 100644 index 0000000000000000000000000000000000000000..7c9274f30c627b15bd8bb867ffc7a5180000e3a5 GIT binary patch literal 1006 zcmV3n@jf>Vp&zse#g9O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@ls z32QBkHN_T+?%M_=0F}l|qx%p=!UES&4R~cTh{Ct{t~!REQoaA}i1EqU6K8|b-J@9l za~)c0_`*j^wh*N4=s-n?v}M+QnwA7T<_P)(ODuj30RqAZpbeNL!PMwO-VeC;5rB(# z0Pro`%Ev3b`r}ocJAZCNmB#-^vSDgtm=d5AfFPjKNEXjR04xBY1RP*MH2mMQ=UeEh zzV8AqQ=oxiXl#A8P}JAB>3W6^K1>FH0bs`ge*@hA6<0(7Ze#!e002ovPDHLkV1j#5 Bmqq{p literal 0 HcmV?d00001 diff --git a/src/Icons/uparrow.png b/src/Icons/uparrow.png deleted file mode 100644 index d6c2b99cc71b6c08c7d4acfb08d60df506883cff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 787 zcmV+u1MK{XP)chFW`8hR?qkz}QBfnc+53m zGGXviLpAj0UkJ^P=Etqqe=^*kyNrS1#WQe({(Rd2HXI;;zy_-&gA9eZ^q-~)gOwb1 zmx2sOH~1Ye08Tvk!SH+OA_j(MPk@I1b^PH5F_nGD{_n=q*IurS>F zfIn@214iPjuM7-tzr#d07#O|67?|fzHu(4b=X#)kBR~K#0>icc-+!ip7m~&d%)Gn| z%&d44J+Qp`2{iQQZyX9J9Z{H>W1P~)I6a4?FXw2}JM-VLc52*PU5dZ$i z!0;DHvjS5(Gcdr|fS8Gqa8~|(_b$Wh>C+eh0*D2e&>2L8c^H^jsZ&P$QI%qN4Wt1A zh~?j(zYqT2y`mtlufxE?Mw#iqzJ6!8vVJ3o`2Zk*80CXDg0km&U{X z|A&eF`GX=3QwNs+^B39t2S6MM5I~HyszCq(h-T$6KmgIqV1NLknZW=71^~9qG6x3P R4r>4a002ovPDHLkV1mCmX)^!- diff --git a/src/icons.qrc b/src/icons.qrc index 597850985..4ea915026 100644 --- a/src/icons.qrc +++ b/src/icons.qrc @@ -3,9 +3,7 @@ Icons/url.png Icons/loading.png Icons/3-state-checkbox.gif - Icons/uparrow.png Icons/sphere.png - Icons/downarrow.png Icons/slow_off.png Icons/sphere2.png Icons/magnet.png @@ -305,10 +303,12 @@ Icons/oxygen/user-group-delete.png Icons/oxygen/edit-find-user.png Icons/oxygen/media-playback-pause.png + Icons/oxygen/arrow-down.png Icons/oxygen/tab-close.png Icons/oxygen/inode-directory.png Icons/oxygen/tools-report-bug.png Icons/oxygen/view-filter.png + Icons/oxygen/arrow-up.png Icons/oxygen/services.png Icons/oxygen/view-preview.png Icons/oxygen/view-refresh.png diff --git a/src/statusbar.h b/src/statusbar.h index 58111fbb8..4087a939c 100644 --- a/src/statusbar.h +++ b/src/statusbar.h @@ -48,30 +48,30 @@ class StatusBar: public QObject { Q_OBJECT public: - StatusBar(QStatusBar *bar): bar(bar) { + StatusBar(QStatusBar *bar): m_bar(bar) { Preferences pref; connect(QBtSession::instance(), SIGNAL(alternativeSpeedsModeChanged(bool)), this, SLOT(updateAltSpeedsBtn(bool))); - container = new QWidget(); + container = new QWidget(bar); layout = new QGridLayout(container); layout->setVerticalSpacing(0); layout->setContentsMargins(0,0,0,0); container->setLayout(layout); - connecStatusLblIcon = new QPushButton(); + connecStatusLblIcon = new QPushButton(bar); connecStatusLblIcon->setFlat(true); connecStatusLblIcon->setFocusPolicy(Qt::NoFocus); connecStatusLblIcon->setFixedWidth(22); connecStatusLblIcon->setCursor(Qt::PointingHandCursor); connecStatusLblIcon->setIcon(QIcon(":/Icons/skin/firewalled.png")); connecStatusLblIcon->setToolTip(QString::fromUtf8("")+tr("Connection status:")+QString::fromUtf8("
")+QString::fromUtf8("")+tr("No direct connections. This may indicate network configuration problems.")+QString::fromUtf8("")); - dlSpeedLbl = new QPushButton(tr("D: %1 B/s - T: %2", "Download speed: x B/s - Transferred: x MiB").arg("0.0").arg(misc::friendlyUnit(0))); + dlSpeedLbl = new QPushButton(tr("D: %1 B/s - T: %2", "Download speed: x B/s - Transferred: x MiB").arg("0.0").arg(misc::friendlyUnit(0)), bar); //dlSpeedLbl->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); connect(dlSpeedLbl, SIGNAL(clicked()), this, SLOT(capDownloadSpeed())); dlSpeedLbl->setFlat(true); dlSpeedLbl->setFocusPolicy(Qt::NoFocus); dlSpeedLbl->setCursor(Qt::PointingHandCursor); - altSpeedsBtn = new QPushButton(); + altSpeedsBtn = new QPushButton(bar); altSpeedsBtn->setFixedWidth(32); altSpeedsBtn->setIconSize(QSize(32,32)); altSpeedsBtn->setFlat(true); @@ -81,27 +81,27 @@ public: connect(altSpeedsBtn, SIGNAL(clicked()), this, SLOT(toggleAlternativeSpeeds())); - upSpeedLbl = new QPushButton(tr("U: %1 B/s - T: %2", "Upload speed: x B/s - Transferred: x MiB").arg("0.0").arg(misc::friendlyUnit(0))); + upSpeedLbl = new QPushButton(tr("U: %1 B/s - T: %2", "Upload speed: x B/s - Transferred: x MiB").arg("0.0").arg(misc::friendlyUnit(0)), bar); //upSpeedLbl->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); connect(upSpeedLbl, SIGNAL(clicked()), this, SLOT(capUploadSpeed())); upSpeedLbl->setFlat(true); upSpeedLbl->setFocusPolicy(Qt::NoFocus); upSpeedLbl->setCursor(Qt::PointingHandCursor); - DHTLbl = new QLabel(tr("DHT: %1 nodes").arg(0)); + DHTLbl = new QLabel(tr("DHT: %1 nodes").arg(0), bar); DHTLbl->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); - statusSep1 = new QFrame(); + statusSep1 = new QFrame(bar); statusSep1->setFixedSize(3, dlSpeedLbl->fontMetrics().height()); statusSep1->setFrameStyle(QFrame::VLine); statusSep1->setFrameShadow(QFrame::Raised); - statusSep2 = new QFrame(); + statusSep2 = new QFrame(bar); statusSep2->setFixedSize(3, dlSpeedLbl->fontMetrics().height()); statusSep2->setFrameStyle(QFrame::VLine); statusSep2->setFrameShadow(QFrame::Raised); - statusSep3 = new QFrame(); + statusSep3 = new QFrame(bar); statusSep3->setFixedSize(3, dlSpeedLbl->fontMetrics().height()); statusSep3->setFrameStyle(QFrame::VLine); statusSep3->setFrameShadow(QFrame::Raised); - statusSep4 = new QFrame(); + statusSep4 = new QFrame(bar); statusSep4->setFixedSize(3, dlSpeedLbl->fontMetrics().height()); statusSep4->setFrameStyle(QFrame::VLine); statusSep4->setFrameShadow(QFrame::Raised); @@ -138,18 +138,6 @@ public: } ~StatusBar() { - delete refreshTimer; - delete dlSpeedLbl; - delete upSpeedLbl; - delete DHTLbl; - delete statusSep1; - delete statusSep2; - delete statusSep3; - delete statusSep4; - delete connecStatusLblIcon; - delete altSpeedsBtn; - delete layout; - delete container; } QPushButton* connectionStatusButton() const { @@ -160,13 +148,13 @@ public slots: void showRestartRequired() { // Restart required notification const QString restart_text = tr("qBittorrent needs to be restarted"); - QLabel *restartIconLbl = new QLabel(); + QLabel *restartIconLbl = new QLabel(m_bar); restartIconLbl->setPixmap(QPixmap(":/Icons/oxygen/dialog-warning.png").scaled(QSize(24,24))); restartIconLbl->setToolTip(restart_text); - bar->insertWidget(0,restartIconLbl); - QLabel *restartLbl = new QLabel(); + m_bar->insertWidget(0,restartIconLbl); + QLabel *restartLbl = new QLabel(m_bar); restartLbl->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); - bar->insertWidget(1, restartLbl); + m_bar->insertWidget(1, restartLbl); QFontMetrics fm(restartLbl->font()); restartLbl->setText(fm.elidedText(restart_text, Qt::ElideRight, restartLbl->width())); QBtSession::instance()->addConsoleMessage(tr("qBittorrent was just updated and needs to be restarted for the changes to be effective."), "red"); @@ -259,7 +247,7 @@ public slots: } private: - QStatusBar *bar; + QStatusBar *m_bar; QPushButton *dlSpeedLbl; QPushButton *upSpeedLbl; QLabel *DHTLbl;