summaryrefslogtreecommitdiff
path: root/libopie2/opieui
Side-by-side diff
Diffstat (limited to 'libopie2/opieui') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opieui/otabwidget.h6
-rw-r--r--libopie2/opieui/owait.cpp77
-rw-r--r--libopie2/opieui/owait.h57
3 files changed, 82 insertions, 58 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,16 +1,15 @@
/*
                This file is part of the Opie Project
-
-              Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
+              Copyright (C) 2002 Dan Williams <williamsdr@acm.org>
=.
.=l.
           .>+-=
 _;:,     .>    :=|. This program is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This program is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
@@ -60,26 +59,26 @@ class OTabBar;
* drop down list box.
*
* The normal way to use OTabWidget is to do the following in the
* constructor:
* - Create a OTabWidget.
* - Create a QWidget for each of the pages in the control, insert
* children into it, set up geometry management for it, and use addTab()
* to add the widget.
*/
class OTabWidget : public QWidget
{
Q_OBJECT
-public:
+ public:
/**
* @enum TabStyle
* @brief Defines how the widget selection control is displayed.
*
* Valid values:
* - Global: use globally selected options (qpe.conf - TabStyle & TabPosition)
* - TextTab: Tabbed widget selection with text labels
* - IconTab: Tabbed widget selection with icon labels, text label for active widget
* (similar to Opie launcher)
* - TextList: Drop down list widget selection with text labels
* - IconList: Drop down list widget selection with icon & text labels
*/
@@ -98,25 +97,24 @@ public:
/**
* @fn OTabWidget( QWidget *parent = 0, const char *name = 0, TabStyle s = Global, TabPosition p = Top )
* @brief Object constructor.
*
* @param parent Pointer to parent of this control.
* @param name Name of control.
* @param s Style of widget selection control.
* @param p Position of the widget selection control.
*
* Constructs a new OTabWidget control with parent and name. The style and position parameters
* determine how the widget selection control will be displayed.
*/
- // FIXME WFlags? -zecke
OTabWidget( QWidget * = 0, const char * = 0, TabStyle = Global, TabPosition = Top );
/**
* @fn ~OTabWidget()
* @brief Object destructor.
*/
~OTabWidget();
/**
* @fn addTab( QWidget *child, const QString &icon, const QString &label )
* @brief Add new widget to control.
*
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,93 +1,110 @@
-/* This file is part of the OPIE libraries
- Copyright (C) 2003 Maximilian Reiss (harlekin@handhelds.org)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+/*
+                This file is part of the Opie Project
+              Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org>
+ =.
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+.="- .-=="i,     .._ License as published by the Free Software
+ - .   .-<_>     .<> Foundation; either version 2 of the License,
+     ._= =}       : or (at your option) any later version.
+    .%`+i>       _;_.
+    .i_,=:_.      -<s. This program is distributed in the hope that
+     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    : ..    .:,     . . . without even the implied warranty of
+    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
+  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.=       =       ; Library General Public License for more
+++=   -.     .`     .: details.
+ :     =  ...= . :.=-
+ -.   .:....=;==+<; You should have received a copy of the GNU
+  -_. . .   )=.  = Library General Public License along with
+    --        :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-*/
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qtimer.h>
-#include <qpe/qpeapplication.h>
-#include <qpainter.h>
+*/
#include "owait.h"
+/* OPIE */
+#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
+/* QT */
+#include <qlayout.h>
+#include <qpainter.h>
+
static int frame = 0;
/**
* This will construct a modal dialog.
*
* The default timer length is 10.
*
* @param parent The parent of the widget
* @param msg The name of the object
* @param dispIcon Display Icon?
*/
OWait::OWait(QWidget *parent, const char* msg, bool dispIcon )
- :QDialog(parent, msg, TRUE,WStyle_Customize) {
+ :QDialog( parent, msg, TRUE, WStyle_Customize )
+{
QHBoxLayout *hbox = new QHBoxLayout( this );
m_lb = new QLabel( this );
m_lb->setBackgroundMode ( NoBackground );
hbox->addWidget( m_lb );
hbox->activate();
m_pix = Resource::loadPixmap( "BigBusy" );
m_aniSize = m_pix.height();
resize( m_aniSize, m_aniSize );
m_timerLength = 10;
m_waitTimer = new QTimer( this );
connect( m_waitTimer, SIGNAL( timeout() ), this, SLOT( hide() ) );
}
-void OWait::timerEvent( QTimerEvent * ) {
+void OWait::timerEvent( QTimerEvent * )
+{
frame = (++frame) % 4;
repaint();
}
-void OWait::paintEvent( QPaintEvent * ) {
+void OWait::paintEvent( QPaintEvent * )
+{
QPainter p( m_lb );
p.drawPixmap( 0, 0, m_pix, m_aniSize * frame, 0, m_aniSize, m_aniSize );
}
-void OWait::show() {
+void OWait::show()
+{
move( ( ( qApp->desktop()->width() ) / 2 ) - ( m_aniSize / 2 ), ( ( qApp->desktop()->height() ) / 2 ) - ( m_aniSize / 2 ) );
startTimer( 300 );
m_waitTimer->start( m_timerLength * 1000, true );
QDialog::show();
}
-void OWait::hide() {
+void OWait::hide()
+{
killTimers();
m_waitTimer->stop();
frame = 0;
QDialog::hide();
}
-void OWait::setTimerLength( int length ) {
+void OWait::setTimerLength( int length )
+{
m_timerLength = length;
}
-OWait::~OWait() {
-}
+OWait::~OWait()
+{}
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,54 +1,63 @@
-/* This file is part of the OPIE libraries
- Copyright (C) 2003 Maximilian Reiss (harlekin@handhelds.org)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+/*
+                This file is part of the Opie Project
+              Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org>
+ =.
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+.="- .-=="i,     .._ License as published by the Free Software
+ - .   .-<_>     .<> Foundation; either version 2 of the License,
+     ._= =}       : or (at your option) any later version.
+    .%`+i>       _;_.
+    .i_,=:_.      -<s. This program is distributed in the hope that
+     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    : ..    .:,     . . . without even the implied warranty of
+    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
+  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.=       =       ; Library General Public License for more
+++=   -.     .`     .: details.
+ :     =  ...= . :.=-
+ -.   .:....=;==+<; You should have received a copy of the GNU
+  -_. . .   )=.  = Library General Public License along with
+    --        :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-*/
-
+*/
-#ifndef WAITPOPUP_H
-#define WAITPOPUP_H
+#ifndef OWAIT_H
+#define OWAIT_H
+/* QT */
#include <qdialog.h>
-#include <qpixmap.h>
#include <qlabel.h>
+#include <qpixmap.h>
#include <qtimer.h>
/**
* This class displays a animated waiting icon in the middle of the screen.
*
* @short modal hour glass dialog
* @see QDialog
* @author Maximilian Reiß
*/
-class OWait : public QDialog {
-
+class OWait : public QDialog
+{
Q_OBJECT
public:
- // FIXME Wflags -zecke?
OWait(QWidget *parent=0,const char* name=0, bool dispIcon=TRUE);
~OWait();
/**
* reimplemented for control reasons
*/
void show();
/**
* Set the time before the icon will be automaticly hidden
* The timer will be started once the widget will be shown.
* @param length - time in seconds