-rw-r--r-- | libopie/owait.cpp | 6 | ||||
-rw-r--r-- | pics/BigBusy.png | bin | 7789 -> 13564 bytes |
2 files changed, 3 insertions, 3 deletions
diff --git a/libopie/owait.cpp b/libopie/owait.cpp index ae25d7a..c7c4445 100644 --- a/libopie/owait.cpp +++ b/libopie/owait.cpp | |||
@@ -1,79 +1,79 @@ | |||
1 | /* This file is part of the OPIE libraries | 1 | /* This file is part of the OPIE libraries |
2 | Copyright (C) 2003 Maximilian Reiss (harlekin@handhelds.org) | 2 | Copyright (C) 2003 Maximilian Reiss (harlekin@handhelds.org) |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. |
8 | 8 | ||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 12 | Library General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qlabel.h> | 20 | #include <qlabel.h> |
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | #include <qtimer.h> | 22 | #include <qtimer.h> |
23 | #include <qpainter.h> | 23 | #include <qpainter.h> |
24 | 24 | ||
25 | #include "owait.h" | 25 | #include "owait.h" |
26 | 26 | ||
27 | #include <qpe/resource.h> | 27 | #include <qpe/resource.h> |
28 | 28 | ||
29 | static int frame = 0; | 29 | static int frame = 0; |
30 | 30 | ||
31 | OWait::OWait(QWidget *parent, const char* msg, bool dispIcon ) | 31 | OWait::OWait(QWidget *parent, const char* msg, bool dispIcon ) |
32 | :QDialog(parent, QObject::tr("Wait"), TRUE,WStyle_Customize) { | 32 | :QDialog(parent, QObject::tr("Wait"), TRUE,WStyle_Customize) { |
33 | 33 | ||
34 | QHBoxLayout *hbox = new QHBoxLayout( this ); | 34 | QHBoxLayout *hbox = new QHBoxLayout( this ); |
35 | 35 | ||
36 | m_lb = new QLabel( this ); | 36 | m_lb = new QLabel( this ); |
37 | m_lb->setBackgroundMode ( NoBackground ); | 37 | m_lb->setBackgroundMode ( NoBackground ); |
38 | 38 | ||
39 | hbox->addWidget( m_lb ); | 39 | hbox->addWidget( m_lb ); |
40 | hbox->activate(); | 40 | hbox->activate(); |
41 | 41 | ||
42 | m_pix = Resource::loadPixmap( "BigBusy" ); | 42 | m_pix = Resource::loadPixmap( "BigBusy" ); |
43 | resize( 32, 32 ); | 43 | resize( 48, 48 ); |
44 | 44 | ||
45 | m_timerLength = 10; | 45 | m_timerLength = 10; |
46 | 46 | ||
47 | m_waitTimer = new QTimer( this ); | 47 | m_waitTimer = new QTimer( this ); |
48 | connect( m_waitTimer, SIGNAL( timeout() ), this, SLOT( hide() ) ); | 48 | connect( m_waitTimer, SIGNAL( timeout() ), this, SLOT( hide() ) ); |
49 | } | 49 | } |
50 | 50 | ||
51 | void OWait::timerEvent( QTimerEvent * ) { | 51 | void OWait::timerEvent( QTimerEvent * ) { |
52 | frame = (++frame) % 3; | 52 | frame = (++frame) % 3; |
53 | repaint(); | 53 | repaint(); |
54 | } | 54 | } |
55 | 55 | ||
56 | void OWait::paintEvent( QPaintEvent * ) { | 56 | void OWait::paintEvent( QPaintEvent * ) { |
57 | QPainter p( m_lb ); | 57 | QPainter p( m_lb ); |
58 | p.drawPixmap( 0, 0, m_pix, 32 * frame, 0, 32, 32 ); | 58 | p.drawPixmap( 0, 0, m_pix, 48 * frame, 0, 48, 48 ); |
59 | } | 59 | } |
60 | 60 | ||
61 | void OWait::show() { | 61 | void OWait::show() { |
62 | startTimer( 500 ); | 62 | startTimer( 300 ); |
63 | m_waitTimer->start( m_timerLength * 1000, true ); | 63 | m_waitTimer->start( m_timerLength * 1000, true ); |
64 | QDialog::show(); | 64 | QDialog::show(); |
65 | } | 65 | } |
66 | 66 | ||
67 | void OWait::hide() { | 67 | void OWait::hide() { |
68 | killTimers(); | 68 | killTimers(); |
69 | m_waitTimer->stop(); | 69 | m_waitTimer->stop(); |
70 | frame = 0; | 70 | frame = 0; |
71 | QDialog::hide(); | 71 | QDialog::hide(); |
72 | } | 72 | } |
73 | 73 | ||
74 | void OWait::setTimerLength( int length ) { | 74 | void OWait::setTimerLength( int length ) { |
75 | m_timerLength = length; | 75 | m_timerLength = length; |
76 | } | 76 | } |
77 | 77 | ||
78 | OWait::~OWait() { | 78 | OWait::~OWait() { |
79 | } | 79 | } |
diff --git a/pics/BigBusy.png b/pics/BigBusy.png index d2ebb25..2dae71e 100644 --- a/pics/BigBusy.png +++ b/pics/BigBusy.png | |||
Binary files differ | |||