summaryrefslogtreecommitdiff
path: root/libopie/owait.cpp
Unidiff
Diffstat (limited to 'libopie/owait.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/owait.cpp91
1 files changed, 0 insertions, 91 deletions
diff --git a/libopie/owait.cpp b/libopie/owait.cpp
deleted file mode 100644
index a0f3834..0000000
--- a/libopie/owait.cpp
+++ b/dev/null
@@ -1,91 +0,0 @@
1/* This file is part of the OPIE libraries
2 Copyright (C) 2003 Maximilian Reiss (harlekin@handhelds.org)
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
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
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18*/
19
20#include <qlayout.h>
21#include <qpe/qpeapplication.h>
22#include <qpainter.h>
23
24#include "owait.h"
25
26#include <qpe/resource.h>
27
28static int frame = 0;
29
30/**
31 * This will construct a modal dialog.
32 *
33 * The default timer length is 10.
34 *
35 * @param parent The parent of the widget
36 * @param msg The name of the object
37 * @param dispIcon Display Icon?
38 */
39OWait::OWait(QWidget *parent, const char* msg, bool dispIcon )
40 :QDialog(parent, msg, TRUE,WStyle_Customize) {
41
42
43 QHBoxLayout *hbox = new QHBoxLayout( this );
44
45 m_lb = new QLabel( this );
46 m_lb->setBackgroundMode ( NoBackground );
47
48 hbox->addWidget( m_lb );
49 hbox->activate();
50
51 m_pix = Resource::loadPixmap( "BigBusy" );
52 m_aniSize = m_pix.height();
53 resize( m_aniSize, m_aniSize );
54
55 m_timerLength = 10;
56
57 m_waitTimer = new QTimer( this );
58 connect( m_waitTimer, SIGNAL( timeout() ), this, SLOT( hide() ) );
59}
60
61void OWait::timerEvent( QTimerEvent * ) {
62 frame = (++frame) % 4;
63 repaint();
64}
65
66void OWait::paintEvent( QPaintEvent * ) {
67 QPainter p( m_lb );
68 p.drawPixmap( 0, 0, m_pix, m_aniSize * frame, 0, m_aniSize, m_aniSize );
69}
70
71void OWait::show() {
72
73 move( ( ( qApp->desktop()->width() ) / 2 ) - ( m_aniSize / 2 ), ( ( qApp->desktop()->height() ) / 2 ) - ( m_aniSize / 2 ) );
74 startTimer( 300 );
75 m_waitTimer->start( m_timerLength * 1000, true );
76 QDialog::show();
77}
78
79void OWait::hide() {
80 killTimers();
81 m_waitTimer->stop();
82 frame = 0;
83 QDialog::hide();
84}
85
86void OWait::setTimerLength( int length ) {
87 m_timerLength = length;
88}
89
90OWait::~OWait() {
91}