Loading src/gui/common/vclicklabel.cpp +20 −0 Changes for src/gui/common/vclicklabel.cpp: 20 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ VClickLabel::VClickLabel(QWidget *parent) : QWidget(parent) { setCursor(Qt::PointingHandCursor); connect(&_anim, SIGNAL(frameChanged(int)), this, SLOT(animationFrameChanged(int))); } /** Returns the current size hint for this widget's current contents. */ Loading Loading @@ -66,6 +68,23 @@ VClickLabel::paintEvent(QPaintEvent *e) e->accept(); } /** Sets the widget's image to the animated image file <b>animFile</b>. */ void VClickLabel::setAnimation(const QPixmap &animPixmap) { _anim.setPixmap(animPixmap); _anim.start(); } /** Responds to a frame change on the animation. */ void VClickLabel::animationFrameChanged(int frameNumber) { Q_UNUSED(frameNumber); _pixmap = _anim.currentFrame(); update(); } /** Overloaded mouse event to catch left mouse button clicks. */ void VClickLabel::mouseReleaseEvent(QMouseEvent *e) Loading @@ -88,6 +107,7 @@ VClickLabel::setText(const QString &text) void VClickLabel::setPixmap(const QPixmap &pixmap) { _anim.stop(); _pixmap = pixmap; update(); } Loading src/gui/common/vclicklabel.h +9 −0 Changes for src/gui/common/vclicklabel.h: 9 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ #include <QMouseEvent> #include <QSize> #include "animatedpixmap.h" class VClickLabel : public QWidget { Loading @@ -51,6 +53,8 @@ public: void setText(const QString &text); /** Sets the widget's image to <b>img</b>. */ void setPixmap(const QPixmap &img); /** Sets the widget's image to the animated image file <b>animFile</b>. */ void setAnimation(const QPixmap &animPixmap); signals: /** Emitted when the widget is left-clicked. */ Loading @@ -62,9 +66,14 @@ protected: /** Overloaded mouse event to catch left mouse button clicks. */ virtual void mouseReleaseEvent(QMouseEvent *e); private slots: /** Responds to a frame change on the animation. */ void animationFrameChanged(int frameNumber); private: QString _text; /**< Text label to display in the widget. */ QPixmap _pixmap; /**< Image to display in the widget. */ AnimatedPixmap _anim; /**< Animated pixmap to display. */ }; #endif Loading src/gui/mainwindow.cpp +4 −0 Changes for src/gui/mainwindow.cpp: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include <util/html.h> #include "common/vmessagebox.h" #include "common/animatedpixmap.h" #include "mainwindow.h" Loading @@ -57,6 +58,8 @@ #define IMG_TOR_STARTING_48 ":/images/48x48/tor-starting.png" #define IMG_TOR_STOPPING_48 ":/images/48x48/tor-stopping.png" #define ANIM_PROCESS_WORKING ":/images/32x32/process-working.png" /* Decide which of our four sets of tray icons to use. */ #if defined(USE_QSYSTEMTRAYICON) /* QSystemTrayIcon is available */ Loading Loading @@ -376,6 +379,7 @@ MainWindow::updateTorStatus(TorStatus status) _startStopAct->setEnabled(false); ui.lblStartStopTor->setEnabled(false); ui.lblStartStopTor->setStatusTip(statusText); ui.lblStartStopTor->setAnimation(QPixmap(ANIM_PROCESS_WORKING)); } /* Update the tray icon */ Loading src/gui/res/32x32/process-working.png 0 → 100644 +9.54 KiB Loading image diff... src/gui/res/vidalia_common.qrc +1 −0 Changes for src/gui/res/vidalia_common.qrc: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ <file>22x22/zoom-to-fit.png</file> </qresource> <qresource prefix="/images"> <file>32x32/process-working.png</file> <file>32x32/tor-off.png</file> <file>32x32/tor-on.png</file> <file>32x32/tor-starting.png</file> Loading Loading
src/gui/common/vclicklabel.cpp +20 −0 Changes for src/gui/common/vclicklabel.cpp: 20 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ VClickLabel::VClickLabel(QWidget *parent) : QWidget(parent) { setCursor(Qt::PointingHandCursor); connect(&_anim, SIGNAL(frameChanged(int)), this, SLOT(animationFrameChanged(int))); } /** Returns the current size hint for this widget's current contents. */ Loading Loading @@ -66,6 +68,23 @@ VClickLabel::paintEvent(QPaintEvent *e) e->accept(); } /** Sets the widget's image to the animated image file <b>animFile</b>. */ void VClickLabel::setAnimation(const QPixmap &animPixmap) { _anim.setPixmap(animPixmap); _anim.start(); } /** Responds to a frame change on the animation. */ void VClickLabel::animationFrameChanged(int frameNumber) { Q_UNUSED(frameNumber); _pixmap = _anim.currentFrame(); update(); } /** Overloaded mouse event to catch left mouse button clicks. */ void VClickLabel::mouseReleaseEvent(QMouseEvent *e) Loading @@ -88,6 +107,7 @@ VClickLabel::setText(const QString &text) void VClickLabel::setPixmap(const QPixmap &pixmap) { _anim.stop(); _pixmap = pixmap; update(); } Loading
src/gui/common/vclicklabel.h +9 −0 Changes for src/gui/common/vclicklabel.h: 9 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ #include <QMouseEvent> #include <QSize> #include "animatedpixmap.h" class VClickLabel : public QWidget { Loading @@ -51,6 +53,8 @@ public: void setText(const QString &text); /** Sets the widget's image to <b>img</b>. */ void setPixmap(const QPixmap &img); /** Sets the widget's image to the animated image file <b>animFile</b>. */ void setAnimation(const QPixmap &animPixmap); signals: /** Emitted when the widget is left-clicked. */ Loading @@ -62,9 +66,14 @@ protected: /** Overloaded mouse event to catch left mouse button clicks. */ virtual void mouseReleaseEvent(QMouseEvent *e); private slots: /** Responds to a frame change on the animation. */ void animationFrameChanged(int frameNumber); private: QString _text; /**< Text label to display in the widget. */ QPixmap _pixmap; /**< Image to display in the widget. */ AnimatedPixmap _anim; /**< Animated pixmap to display. */ }; #endif Loading
src/gui/mainwindow.cpp +4 −0 Changes for src/gui/mainwindow.cpp: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include <util/html.h> #include "common/vmessagebox.h" #include "common/animatedpixmap.h" #include "mainwindow.h" Loading @@ -57,6 +58,8 @@ #define IMG_TOR_STARTING_48 ":/images/48x48/tor-starting.png" #define IMG_TOR_STOPPING_48 ":/images/48x48/tor-stopping.png" #define ANIM_PROCESS_WORKING ":/images/32x32/process-working.png" /* Decide which of our four sets of tray icons to use. */ #if defined(USE_QSYSTEMTRAYICON) /* QSystemTrayIcon is available */ Loading Loading @@ -376,6 +379,7 @@ MainWindow::updateTorStatus(TorStatus status) _startStopAct->setEnabled(false); ui.lblStartStopTor->setEnabled(false); ui.lblStartStopTor->setStatusTip(statusText); ui.lblStartStopTor->setAnimation(QPixmap(ANIM_PROCESS_WORKING)); } /* Update the tray icon */ Loading
src/gui/res/vidalia_common.qrc +1 −0 Changes for src/gui/res/vidalia_common.qrc: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ <file>22x22/zoom-to-fit.png</file> </qresource> <qresource prefix="/images"> <file>32x32/process-working.png</file> <file>32x32/tor-off.png</file> <file>32x32/tor-on.png</file> <file>32x32/tor-starting.png</file> Loading