summaryrefslogtreecommitdiff
path: root/libopie2/opieui
authormickeyl <mickeyl>2004-02-21 12:25:50 (UTC)
committer mickeyl <mickeyl>2004-02-21 12:25:50 (UTC)
commit6155f1be5c19fc51a4929c9e173f9e5a24d193e6 (patch) (unidiff)
treec18ca863f82a559c60728f922519ac696387ec53 /libopie2/opieui
parenta570c2824fcecaf1c278e1b5a592fa14cc0647f8 (diff)
downloadopie-6155f1be5c19fc51a4929c9e173f9e5a24d193e6.zip
opie-6155f1be5c19fc51a4929c9e173f9e5a24d193e6.tar.gz
opie-6155f1be5c19fc51a4929c9e173f9e5a24d193e6.tar.bz2
the usual cosmetics
Diffstat (limited to 'libopie2/opieui') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/otabwidget.h14
-rw-r--r--libopie2/opieui/owait.cpp91
-rw-r--r--libopie2/opieui/owait.h67
3 files changed, 98 insertions, 74 deletions
diff --git a/libopie2/opieui/otabwidget.h b/libopie2/opieui/otabwidget.h
index 51d1c6d..c7d32c2 100644
--- a/libopie2/opieui/otabwidget.h
+++ b/libopie2/opieui/otabwidget.h
@@ -1,7 +1,6 @@
1/* 1/*
2                This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3              Copyright (C) 2002 Dan Williams <williamsdr@acm.org>
4              Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
5 =. 4 =.
6 .=l. 5 .=l.
7           .>+-= 6           .>+-=
@@ -69,8 +68,8 @@ class OTabBar;
69class OTabWidget : public QWidget 68class OTabWidget : public QWidget
70{ 69{
71 Q_OBJECT 70 Q_OBJECT
72public: 71
73 72 public:
74/** 73/**
75 * @enum TabStyle 74 * @enum TabStyle
76 * @brief Defines how the widget selection control is displayed. 75 * @brief Defines how the widget selection control is displayed.
@@ -107,7 +106,6 @@ public:
107 * Constructs a new OTabWidget control with parent and name. The style and position parameters 106 * Constructs a new OTabWidget control with parent and name. The style and position parameters
108 * determine how the widget selection control will be displayed. 107 * determine how the widget selection control will be displayed.
109 */ 108 */
110 // FIXME WFlags? -zecke
111 OTabWidget( QWidget * = 0, const char * = 0, TabStyle = Global, TabPosition = Top ); 109 OTabWidget( QWidget * = 0, const char * = 0, TabStyle = Global, TabPosition = Top );
112 110
113/** 111/**
@@ -262,7 +260,7 @@ private:
262 void setUpLayout(); 260 void setUpLayout();
263 261
264 262
265signals: 263 signals:
266/** 264/**
267 * @fn currentChanegd( QWidget *widget ) 265 * @fn currentChanegd( QWidget *widget )
268 * @brief This signal is emitted whenever the widget has changed. 266 * @brief This signal is emitted whenever the widget has changed.
@@ -271,7 +269,7 @@ signals:
271 */ 269 */
272 void currentChanged( QWidget * ); 270 void currentChanged( QWidget * );
273 271
274private slots: 272 private slots:
275 273
276/** 274/**
277 * @fn slotTabBarSelected( int id ) 275 * @fn slotTabBarSelected( int id )
diff --git a/libopie2/opieui/owait.cpp b/libopie2/opieui/owait.cpp
index 0fdf08d..8bb4ed6 100644
--- a/libopie2/opieui/owait.cpp
+++ b/libopie2/opieui/owait.cpp
@@ -1,32 +1,43 @@
1/* This file is part of the OPIE libraries 1/*
2 Copyright (C) 2003 Maximilian Reiss (harlekin@handhelds.org) 2                This file is part of the Opie Project
3 3              Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org>
4 This library is free software; you can redistribute it and/or 4 =.
5 modify it under the terms of the GNU Library General Public 5 .=l.
6 License as published by the Free Software Foundation; either 6           .>+-=
7 version 2 of the License, or (at your option) any later version. 7 _;:,     .>    :=|. This program is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9 This library is distributed in the hope that it will be useful, 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10.="- .-=="i,     .._ License as published by the Free Software
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 Library General Public License for more details. 12     ._= =}       : or (at your option) any later version.
13 13    .%`+i>       _;_.
14 You should have received a copy of the GNU Library General Public License 14    .i_,=:_.      -<s. This program is distributed in the hope that
15 along with this library; see the file COPYING.LIB. If not, write to 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16    : ..    .:,     . . . without even the implied warranty of
17 Boston, MA 02111-1307, USA. 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18*/ 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details.
21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
19 28
20#include <qlabel.h> 29*/
21#include <qlayout.h>
22#include <qtimer.h>
23#include <qpe/qpeapplication.h>
24#include <qpainter.h>
25 30
26#include "owait.h" 31#include "owait.h"
27 32
33/* OPIE */
34#include <qpe/qpeapplication.h>
28#include <qpe/resource.h> 35#include <qpe/resource.h>
29 36
37/* QT */
38#include <qlayout.h>
39#include <qpainter.h>
40
30static int frame = 0; 41static int frame = 0;
31 42
32/** 43/**
@@ -38,11 +49,12 @@ static int frame = 0;
38 * @param msg The name of the object 49 * @param msg The name of the object
39 * @param dispIcon Display Icon? 50 * @param dispIcon Display Icon?
40 */ 51 */
41OWait::OWait(QWidget *parent, const char* msg, bool dispIcon ) 52OWait::OWait( QWidget *parent, const char* msg, bool dispIcon )
42 :QDialog(parent, msg, TRUE,WStyle_Customize) { 53 :QDialog( parent, msg, TRUE, WStyle_Customize )
54{
43 55
44 56
45 QHBoxLayout *hbox = new QHBoxLayout( this ); 57 QHBoxLayout * hbox = new QHBoxLayout( this );
46 58
47 m_lb = new QLabel( this ); 59 m_lb = new QLabel( this );
48 m_lb->setBackgroundMode ( NoBackground ); 60 m_lb->setBackgroundMode ( NoBackground );
@@ -60,34 +72,39 @@ OWait::OWait(QWidget *parent, const char* msg, bool dispIcon )
60 connect( m_waitTimer, SIGNAL( timeout() ), this, SLOT( hide() ) ); 72 connect( m_waitTimer, SIGNAL( timeout() ), this, SLOT( hide() ) );
61} 73}
62 74
63void OWait::timerEvent( QTimerEvent * ) { 75void OWait::timerEvent( QTimerEvent * )
64 frame = (++frame) % 4; 76{
77 frame = ( ++frame ) % 4;
65 repaint(); 78 repaint();
66} 79}
67 80
68void OWait::paintEvent( QPaintEvent * ) { 81void OWait::paintEvent( QPaintEvent * )
69 QPainter p( m_lb ); 82{
70 p.drawPixmap( 0, 0, m_pix, m_aniSize * frame, 0, m_aniSize, m_aniSize ); 83 QPainter p( m_lb );
84 p.drawPixmap( 0, 0, m_pix, m_aniSize * frame, 0, m_aniSize, m_aniSize );
71} 85}
72 86
73void OWait::show() { 87void OWait::show()
88{
74 89
75 move( ( ( qApp->desktop()->width() ) / 2 ) - ( m_aniSize / 2 ), ( ( qApp->desktop()->height() ) / 2 ) - ( m_aniSize / 2 ) ); 90 move( ( ( qApp->desktop() ->width() ) / 2 ) - ( m_aniSize / 2 ), ( ( qApp->desktop() ->height() ) / 2 ) - ( m_aniSize / 2 ) );
76 startTimer( 300 ); 91 startTimer( 300 );
77 m_waitTimer->start( m_timerLength * 1000, true ); 92 m_waitTimer->start( m_timerLength * 1000, true );
78 QDialog::show(); 93 QDialog::show();
79} 94}
80 95
81void OWait::hide() { 96void OWait::hide()
97{
82 killTimers(); 98 killTimers();
83 m_waitTimer->stop(); 99 m_waitTimer->stop();
84 frame = 0; 100 frame = 0;
85 QDialog::hide(); 101 QDialog::hide();
86} 102}
87 103
88void OWait::setTimerLength( int length ) { 104void OWait::setTimerLength( int length )
105{
89 m_timerLength = length; 106 m_timerLength = length;
90} 107}
91 108
92OWait::~OWait() { 109OWait::~OWait()
93} 110{}
diff --git a/libopie2/opieui/owait.h b/libopie2/opieui/owait.h
index cbfc8d6..3267064 100644
--- a/libopie2/opieui/owait.h
+++ b/libopie2/opieui/owait.h
@@ -1,30 +1,40 @@
1/* This file is part of the OPIE libraries 1/*
2 Copyright (C) 2003 Maximilian Reiss (harlekin@handhelds.org) 2                This file is part of the Opie Project
3              Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org>
4 =.
5 .=l.
6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details.
21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
3 28
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*/ 29*/
19 30
31#ifndef OWAIT_H
32#define OWAIT_H
20 33
21 34/* QT */
22#ifndef WAITPOPUP_H
23#define WAITPOPUP_H
24
25#include <qdialog.h> 35#include <qdialog.h>
26#include <qpixmap.h>
27#include <qlabel.h> 36#include <qlabel.h>
37#include <qpixmap.h>
28#include <qtimer.h> 38#include <qtimer.h>
29 39
30/** 40/**
@@ -34,13 +44,12 @@
34 * @see QDialog 44 * @see QDialog
35 * @author Maximilian Reiß 45 * @author Maximilian Reiß
36 */ 46 */
37class OWait : public QDialog { 47class OWait : public QDialog
38 48{
39 Q_OBJECT 49 Q_OBJECT
40 50
41public: 51 public:
42 // FIXME Wflags -zecke? 52 OWait( QWidget *parent = 0, const char* name = 0, bool dispIcon = TRUE );
43 OWait(QWidget *parent=0,const char* name=0, bool dispIcon=TRUE);
44 ~OWait(); 53 ~OWait();
45 54
46 /** 55 /**
@@ -55,14 +64,14 @@ public:
55 */ 64 */
56 void setTimerLength( int length ); 65 void setTimerLength( int length );
57 66
58 public slots: 67 public slots:
59 /** 68 /**
60 * reimplemented for control reasons 69 * reimplemented for control reasons
61 */ 70 */
62 void hide(); 71 void hide();
63 72
64 private: 73 private:
65 void timerEvent( QTimerEvent * ) ; 74 void timerEvent( QTimerEvent * );
66 void paintEvent( QPaintEvent * ); 75 void paintEvent( QPaintEvent * );
67 76
68 QPixmap m_pix; 77 QPixmap m_pix;