Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

wait.cpp

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003               =.             (C) 2000-2002 Trolltech AS
00004             .=l.             (C) 2002-2005 The Opie Team <opie-devel@handhelds.org>
00005            .>+-=
00006  _;:,     .>    :=|.         This program is free software; you can
00007 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00008     :`=1 )Y*s>-.--   :       the terms of the GNU Library General Public
00009 .="- .-=="i,     .._         License as published by the Free Software
00010  - .   .-<_>     .<>         Foundation; version 2 of the License.
00011      ._= =}       :
00012     .%`+i>       _;_.
00013     .i_,=:_.      -<s.       This program is distributed in the hope that
00014      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00015     : ..    .:,     . . .    without even the implied warranty of
00016     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00017   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00018 ..}^=.=       =       ;      Library General Public License for more
00019 ++=   -.     .`     .:       details.
00020     :     =  ...= . :.=-
00021  -.   .:....=;==+<;          You should have received a copy of the GNU
00022   -_. . .   )=.  =           Library General Public License along with
00023     --        :-=`           this library; see the file COPYING.LIB.
00024                              If not, write to the Free Software Foundation,
00025                              Inc., 59 Temple Place - Suite 330,
00026                              Boston, MA 02111-1307, USA.
00027 */
00028 #include "wait.h"
00029 
00030 #include <opie2/owait.h>
00031 #include <opie2/oresource.h>
00032 using namespace Opie::Core;
00033 
00034 #include <qtopia/config.h>
00035 #include <qtopia/applnk.h>
00036 
00037 Wait *lastWaitObject = NULL;
00038 
00039 
00040 using namespace Opie::Ui;
00041 Wait::Wait( QWidget *parent ) : QWidget( parent ),
00042                                 waiting( FALSE )
00043 {
00044 
00045     QSize size( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
00046     setFixedSize( size );
00047     pm = OResource::loadPixmap( "wait", OResource::SmallIcon );
00048 
00049     lastWaitObject = this;
00050     m_centralWait = new OWait( 0l );
00051     m_centralWait->hide();
00052     hide();
00053 }
00054 
00055 
00056 Wait *Wait::getWaitObject()
00057 {
00058     return lastWaitObject;
00059 }
00060 
00061 
00062 void Wait::setWaiting( bool w )
00063 {
00064     Config cfg ( "Launcher" );
00065     cfg.setGroup("GUI");
00066 
00067 
00068     waiting = w;
00069     if ( w ) {
00070         if ( cfg. readBoolEntry( "BigBusy" ) )
00071             m_centralWait->show();
00072         else
00073             show();
00074     }else{
00075         m_centralWait->hide();
00076         hide();
00077     }
00078 }
00079 
00080 
00081 void Wait::paintEvent( QPaintEvent * )
00082 {
00083     QPainter p( this );
00084     p.drawPixmap( 0, 0, pm );
00085 }
00086 
00087 

Generated on Sat Nov 5 16:15:34 2005 for OPIE by  doxygen 1.4.2