summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie/libopie.pro4
-rw-r--r--libopie/owait.cpp79
-rw-r--r--libopie/owait.h68
3 files changed, 149 insertions, 2 deletions
diff --git a/libopie/libopie.pro b/libopie/libopie.pro
index 2bf9985..e39c80d 100644
--- a/libopie/libopie.pro
+++ b/libopie/libopie.pro
@@ -21,90 +21,90 @@ HEADERS = ofontmenu.h \
21 pim/ocontact.h \ 21 pim/ocontact.h \
22 pim/ocontactaccess.h \ 22 pim/ocontactaccess.h \
23 pim/ocontactaccessbackend.h \ 23 pim/ocontactaccessbackend.h \
24 pim/ocontactaccessbackend_xml.h \ 24 pim/ocontactaccessbackend_xml.h \
25 pim/ocontactaccessbackend_vcard.h \ 25 pim/ocontactaccessbackend_vcard.h \
26 pim/obackendfactory.h \ 26 pim/obackendfactory.h \
27 pim/opimcache.h \ 27 pim/opimcache.h \
28 pim/otodoaccessvcal.h \ 28 pim/otodoaccessvcal.h \
29 pim/orecur.h \ 29 pim/orecur.h \
30 pim/opimstate.h \ 30 pim/opimstate.h \
31 pim/opimxrefpartner.h \ 31 pim/opimxrefpartner.h \
32 pim/opimxref.h \ 32 pim/opimxref.h \
33 pim/opimxrefmanager.h \ 33 pim/opimxrefmanager.h \
34 pim/opimmaintainer.h \ 34 pim/opimmaintainer.h \
35 pim/opimnotify.h \ 35 pim/opimnotify.h \
36 pim/opimnotifymanager.h \ 36 pim/opimnotifymanager.h \
37 pim/opimmainwindow.h \ 37 pim/opimmainwindow.h \
38 pim/opimresolver.h \ 38 pim/opimresolver.h \
39 pim/oevent.h \ 39 pim/oevent.h \
40 pim/otimezone.h \ 40 pim/otimezone.h \
41 pim/odatebookaccess.h \ 41 pim/odatebookaccess.h \
42 pim/odatebookaccessbackend.h \ 42 pim/odatebookaccessbackend.h \
43 pim/odatebookaccessbackend_xml.h \ 43 pim/odatebookaccessbackend_xml.h \
44 orecurrancewidget.h \ 44 orecurrancewidget.h \
45 oticker.h 45 oticker.h owait.h
46# pim/otodoaccesssql.h \ 46# pim/otodoaccesssql.h \
47 47
48SOURCES = ofontmenu.cc \ 48SOURCES = ofontmenu.cc \
49 ocolorbutton.cpp \ 49 ocolorbutton.cpp \
50 sharp_compat.cpp \ 50 sharp_compat.cpp \
51 xmltree.cc \ 51 xmltree.cc \
52 ofiledialog.cc ofileselector.cc \ 52 ofiledialog.cc ofileselector.cc \
53 ocheckitem.cpp \ 53 ocheckitem.cpp \
54 colordialog.cpp \ 54 colordialog.cpp \
55 colorpopupmenu.cpp oclickablelabel.cpp \ 55 colorpopupmenu.cpp oclickablelabel.cpp \
56 oprocctrl.cpp oprocess.cpp \ 56 oprocctrl.cpp oprocess.cpp \
57 odevice.cpp odevicebutton.cpp otimepicker.cpp \ 57 odevice.cpp odevicebutton.cpp otimepicker.cpp \
58 otabwidget.cpp otabbar.cpp \ 58 otabwidget.cpp otabbar.cpp \
59 ofontselector.cpp \ 59 ofontselector.cpp \
60 pim/otodo.cpp \ 60 pim/otodo.cpp \
61 pim/opimrecord.cpp \ 61 pim/opimrecord.cpp \
62 pim/otodoaccess.cpp \ 62 pim/otodoaccess.cpp \
63 pim/otodoaccessbackend.cpp \ 63 pim/otodoaccessbackend.cpp \
64 pim/otodoaccessxml.cpp \ 64 pim/otodoaccessxml.cpp \
65 pim/ocontact.cpp \ 65 pim/ocontact.cpp \
66 pim/ocontactaccess.cpp \ 66 pim/ocontactaccess.cpp \
67 pim/ocontactaccessbackend_vcard.cpp \ 67 pim/ocontactaccessbackend_vcard.cpp \
68 pim/ocontactaccessbackend_xml.cpp \ 68 pim/ocontactaccessbackend_xml.cpp \
69 pim/otodoaccessvcal.cpp \ 69 pim/otodoaccessvcal.cpp \
70 pim/orecur.cpp \ 70 pim/orecur.cpp \
71 pim/opimstate.cpp \ 71 pim/opimstate.cpp \
72 pim/opimxrefpartner.cpp \ 72 pim/opimxrefpartner.cpp \
73 pim/opimxref.cpp \ 73 pim/opimxref.cpp \
74 pim/opimxrefmanager.cpp \ 74 pim/opimxrefmanager.cpp \
75 pim/opimmaintainer.cpp \ 75 pim/opimmaintainer.cpp \
76 pim/opimnotify.cpp \ 76 pim/opimnotify.cpp \
77 pim/opimnotifymanager.cpp \ 77 pim/opimnotifymanager.cpp \
78 pim/opimmainwindow.cpp \ 78 pim/opimmainwindow.cpp \
79 pim/opimresolver.cpp \ 79 pim/opimresolver.cpp \
80 pim/oevent.cpp \ 80 pim/oevent.cpp \
81 pim/otimezone.cpp \ 81 pim/otimezone.cpp \
82 pim/odatebookaccess.cpp \ 82 pim/odatebookaccess.cpp \
83 pim/odatebookaccessbackend.cpp \ 83 pim/odatebookaccessbackend.cpp \
84 pim/odatebookaccessbackend_xml.cpp \ 84 pim/odatebookaccessbackend_xml.cpp \
85 orecurrancewidget.cpp \ 85 orecurrancewidget.cpp \
86 oticker.cpp 86 oticker.cpp owait.cpp \
87# pim/otodoaccesssql.cpp \ 87# pim/otodoaccesssql.cpp \
88 88
89TARGET = opie 89TARGET = opie
90INCLUDEPATH += $(OPIEDIR)/include 90INCLUDEPATH += $(OPIEDIR)/include
91DESTDIR = $(OPIEDIR)/lib$(PROJMAK) 91DESTDIR = $(OPIEDIR)/lib$(PROJMAK)
92#VERSION = 1.0.0 92#VERSION = 1.0.0
93 93
94LIBS += -lqpe 94LIBS += -lqpe
95 95
96# LIBS += -lopiesql 96# LIBS += -lopiesql
97 97
98INTERFACES = otimepickerbase.ui orecurrancebase.ui 98INTERFACES = otimepickerbase.ui orecurrancebase.ui
99 99
100TRANSLATIONS = ../i18n/de/libopie.ts \ 100TRANSLATIONS = ../i18n/de/libopie.ts \
101 ../i18n/xx/libopie.ts \ 101 ../i18n/xx/libopie.ts \
102 ../i18n/en/libopie.ts \ 102 ../i18n/en/libopie.ts \
103 ../i18n/es/libopie.ts \ 103 ../i18n/es/libopie.ts \
104 ../i18n/fr/libopie.ts \ 104 ../i18n/fr/libopie.ts \
105 ../i18n/hu/libopie.ts \ 105 ../i18n/hu/libopie.ts \
106 ../i18n/ja/libopie.ts \ 106 ../i18n/ja/libopie.ts \
107 ../i18n/ko/libopie.ts \ 107 ../i18n/ko/libopie.ts \
108 ../i18n/no/libopie.ts \ 108 ../i18n/no/libopie.ts \
109 ../i18n/pl/libopie.ts \ 109 ../i18n/pl/libopie.ts \
110 ../i18n/pt/libopie.ts \ 110 ../i18n/pt/libopie.ts \
diff --git a/libopie/owait.cpp b/libopie/owait.cpp
new file mode 100644
index 0000000..ae25d7a
--- a/dev/null
+++ b/libopie/owait.cpp
@@ -0,0 +1,79 @@
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 <qlabel.h>
21#include <qlayout.h>
22#include <qtimer.h>
23#include <qpainter.h>
24
25#include "owait.h"
26
27#include <qpe/resource.h>
28
29static int frame = 0;
30
31OWait::OWait(QWidget *parent, const char* msg, bool dispIcon )
32 :QDialog(parent, QObject::tr("Wait"), TRUE,WStyle_Customize) {
33
34 QHBoxLayout *hbox = new QHBoxLayout( this );
35
36 m_lb = new QLabel( this );
37 m_lb->setBackgroundMode ( NoBackground );
38
39 hbox->addWidget( m_lb );
40 hbox->activate();
41
42 m_pix = Resource::loadPixmap( "BigBusy" );
43 resize( 32, 32 );
44
45 m_timerLength = 10;
46
47 m_waitTimer = new QTimer( this );
48 connect( m_waitTimer, SIGNAL( timeout() ), this, SLOT( hide() ) );
49}
50
51void OWait::timerEvent( QTimerEvent * ) {
52 frame = (++frame) % 3;
53 repaint();
54}
55
56void OWait::paintEvent( QPaintEvent * ) {
57 QPainter p( m_lb );
58 p.drawPixmap( 0, 0, m_pix, 32 * frame, 0, 32, 32 );
59}
60
61void OWait::show() {
62 startTimer( 500 );
63 m_waitTimer->start( m_timerLength * 1000, true );
64 QDialog::show();
65}
66
67void OWait::hide() {
68 killTimers();
69 m_waitTimer->stop();
70 frame = 0;
71 QDialog::hide();
72}
73
74void OWait::setTimerLength( int length ) {
75 m_timerLength = length;
76}
77
78OWait::~OWait() {
79}
diff --git a/libopie/owait.h b/libopie/owait.h
new file mode 100644
index 0000000..98409cf
--- a/dev/null
+++ b/libopie/owait.h
@@ -0,0 +1,68 @@
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
21
22#ifndef WAITPOPUP_H
23#define WAITPOPUP_H
24
25#include <qdialog.h>
26#include <qpixmap.h>
27#include <qlabel.h>
28#include <qtimer.h>
29
30/**
31 * This class displays a animated waiting icon in the middle of the screen.
32 */
33class OWait : public QDialog {
34
35 Q_OBJECT
36
37public:
38 OWait(QWidget *parent=0,const char* msg=0,bool dispIcon=TRUE);
39 ~OWait();
40
41 /**
42 * reimplemented for control reasons
43 */
44 void show();
45
46 /**
47 * Set the time before the icon will be automaticly hidden
48 * @param length - time in seconds
49 */
50 void setTimerLength( int length );
51
52 public slots:
53 /**
54 * reimplemented for control reasons
55 */
56 void hide();
57
58 private:
59 void timerEvent( QTimerEvent * ) ;
60 void paintEvent( QPaintEvent * );
61
62 QPixmap m_pix;
63 QLabel *m_lb;
64 QTimer *m_waitTimer;
65 int m_timerLength;
66};
67
68#endif