[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r1700: Add a "spinning wheel" animation, displayed when we're start (in trunk: . src/gui src/gui/common src/gui/res src/gui/res/32x32)
Author: edmanm
Date: 2007-04-08 21:51:15 -0400 (Sun, 08 Apr 2007)
New Revision: 1700
Added:
trunk/src/gui/res/32x32/process-working.png
Modified:
trunk/
trunk/src/gui/common/vclicklabel.cpp
trunk/src/gui/common/vclicklabel.h
trunk/src/gui/mainwindow.cpp
trunk/src/gui/res/vidalia_common.qrc
Log:
r1782@adrastea: edmanm | 2007-04-08 21:44:59 -0400
Add a "spinning wheel" animation, displayed when we're starting Tor.
Property changes on: trunk
___________________________________________________________________
svk:merge ticket from /vidalia/local/trunk [r1782] on 54b3572a-7227-0410-958f-53ecd705b71a
Modified: trunk/src/gui/common/vclicklabel.cpp
===================================================================
--- trunk/src/gui/common/vclicklabel.cpp 2007-04-09 01:50:59 UTC (rev 1699)
+++ trunk/src/gui/common/vclicklabel.cpp 2007-04-09 01:51:15 UTC (rev 1700)
@@ -35,6 +35,8 @@
: 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. */
@@ -66,6 +68,23 @@
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)
@@ -88,6 +107,7 @@
void
VClickLabel::setPixmap(const QPixmap &pixmap)
{
+ _anim.stop();
_pixmap = pixmap;
update();
}
Modified: trunk/src/gui/common/vclicklabel.h
===================================================================
--- trunk/src/gui/common/vclicklabel.h 2007-04-09 01:50:59 UTC (rev 1699)
+++ trunk/src/gui/common/vclicklabel.h 2007-04-09 01:51:15 UTC (rev 1700)
@@ -33,7 +33,9 @@
#include <QMouseEvent>
#include <QSize>
+#include "animatedpixmap.h"
+
class VClickLabel : public QWidget
{
Q_OBJECT
@@ -51,6 +53,8 @@
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. */
@@ -62,9 +66,14 @@
/** 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
Modified: trunk/src/gui/mainwindow.cpp
===================================================================
--- trunk/src/gui/mainwindow.cpp 2007-04-09 01:50:59 UTC (rev 1699)
+++ trunk/src/gui/mainwindow.cpp 2007-04-09 01:51:15 UTC (rev 1700)
@@ -35,6 +35,7 @@
#include <util/html.h>
#include "common/vmessagebox.h"
+#include "common/animatedpixmap.h"
#include "mainwindow.h"
@@ -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 */
@@ -376,6 +379,7 @@
_startStopAct->setEnabled(false);
ui.lblStartStopTor->setEnabled(false);
ui.lblStartStopTor->setStatusTip(statusText);
+ ui.lblStartStopTor->setAnimation(QPixmap(ANIM_PROCESS_WORKING));
}
/* Update the tray icon */
Added: trunk/src/gui/res/32x32/process-working.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/gui/res/32x32/process-working.png
___________________________________________________________________
Name: svn:mime-type
+ image/x-png
Modified: trunk/src/gui/res/vidalia_common.qrc
===================================================================
--- trunk/src/gui/res/vidalia_common.qrc 2007-04-09 01:50:59 UTC (rev 1699)
+++ trunk/src/gui/res/vidalia_common.qrc 2007-04-09 01:51:15 UTC (rev 1700)
@@ -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>