-rw-r--r-- | core/launcher/documentlist.cpp | 72 | ||||
-rw-r--r-- | core/launcher/firstuse.cpp | 62 | ||||
-rw-r--r-- | core/launcher/launcher.cpp | 60 | ||||
-rw-r--r-- | core/launcher/launcherview.cpp | 53 | ||||
-rw-r--r-- | core/launcher/startmenu.cpp | 79 | ||||
-rw-r--r-- | core/launcher/syncdialog.cpp | 59 | ||||
-rw-r--r-- | core/launcher/taskbar.cpp | 52 | ||||
-rw-r--r-- | core/launcher/wait.cpp | 54 |
8 files changed, 260 insertions, 231 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp index b8bf4e0..fd385d6 100644 --- a/core/launcher/documentlist.cpp +++ b/core/launcher/documentlist.cpp @@ -1,53 +1,61 @@ -/********************************************************************** -** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. -** -** This file is part of the Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ +/* + This file is part of the Opie Project + =. (C) 2000-2002 Trolltech AS + .=l. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> + .>+-= + _;:, .> :=|. 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; version 2 of the License. + ._= =} : + .%`+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 "documentlist.h" #include "serverinterface.h" #include "mediadlg.h" /* OPIE */ #include <opie2/oglobal.h> #include <opie2/odebug.h> +#include <opie2/oresource.h> #include <qtopia/config.h> #include <qtopia/mimetype.h> -#include <qtopia/resource.h> #include <qtopia/private/categories.h> #include <qtopia/qpeapplication.h> #include <qtopia/applnk.h> #include <qtopia/storage.h> #ifdef Q_WS_QWS #include <qtopia/qcopenvelope_qws.h> #endif using namespace Opie::Core; /* QT */ #include <qtimer.h> #include <qfileinfo.h> #include <qtextstream.h> #include <qfile.h> #include <qdir.h> #include <qpainter.h> #include <qimage.h> #include <qcopchannel_qws.h> #include <qlistview.h> #include <qlist.h> #include <qpixmap.h> AppLnkSet *DocumentList::appLnkSet = 0; @@ -211,64 +219,61 @@ void DocumentList::timerEvent( QTimerEvent *te ) } } void DocumentList::reloadAppLnks() { if ( d->sendAppLnks && d->serverGui ) { d->serverGui->applicationScanningProgress( 0 ); d->serverGui->allApplicationsRemoved(); } delete appLnkSet; appLnkSet = new AppLnkSet( MimeType::appsFolderName() ); if ( d->sendAppLnks && d->serverGui ) { static QStringList prevTypeList; QStringList types = appLnkSet->types(); for ( QStringList::Iterator ittypes=types.begin(); ittypes!=types.end(); ++ittypes) { if ( !(*ittypes).isEmpty() ) { if ( !prevTypeList.contains(*ittypes) ) { QString name = appLnkSet->typeName(*ittypes); QPixmap pm = appLnkSet->typePixmap(*ittypes); QPixmap bgPm = appLnkSet->typeBigPixmap(*ittypes); - if (pm.isNull()) { - QImage img( Resource::loadImage( "UnknownDocument" ) ); - pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); - bgPm = img.smoothScale( AppLnk::bigIconSize(), AppLnk::bigIconSize() ); + if (pm.isNull()) + { + pm = OResource::loadImage( "UnknownDocument", OResource::SmallIcon ); + bgPm = OResource::loadImage( "UnknownDocument", OResource::BigIcon ); } - //odebug << "adding type " << (*ittypes) << "" << oendl; - - // ### our current launcher expects docs tab to be last + //FIXME our current launcher expects docs tab to be last d->serverGui->typeAdded( *ittypes, name.isNull() ? (*ittypes) : name, pm, bgPm ); } prevTypeList.remove(*ittypes); } } for ( QStringList::Iterator ittypes=prevTypeList.begin(); ittypes!=prevTypeList.end(); ++ittypes) { - //odebug << "removing type " << (*ittypes) << "" << oendl; d->serverGui->typeRemoved(*ittypes); } prevTypeList = types; } QListIterator<AppLnk> itapp( appLnkSet->children() ); AppLnk* l; while ( (l=itapp.current()) ) { ++itapp; if ( d->sendAppLnks && d->serverGui ) d->serverGui->applicationAdded( l->type(), *l ); } if ( d->sendAppLnks && d->serverGui ) d->serverGui->applicationScanningProgress( 100 ); } void DocumentList::reloadDocLnks() { if ( !d->scanDocs ) return; if ( d->sendDocLnks && d->serverGui ) { d->serverGui->documentScanningProgress( 0 ); @@ -336,64 +341,61 @@ void DocumentList::linkChanged( QString arg ) } void DocumentList::restoreDone() { reloadAppLnks(); reloadDocLnks(); } void DocumentList::DiffAppLnks() { static AppLnkSet *appLnkSet2; appLnkSet2 = new AppLnkSet( MimeType::appsFolderName() ); if ( d->sendAppLnks && d->serverGui ) { static QStringList prevTypeList = appLnkSet->types(); QStringList types = appLnkSet2->types(); for ( QStringList::Iterator ittypes=types.begin(); ittypes!=types.end(); ++ittypes) { if ( !(*ittypes).isEmpty() ) { if ( !prevTypeList.contains(*ittypes) ) { QString name = appLnkSet2->typeName(*ittypes); QPixmap pm = appLnkSet2->typePixmap(*ittypes); QPixmap bgPm = appLnkSet2->typeBigPixmap(*ittypes); - if (pm.isNull()) { - QImage img( Resource::loadImage( "UnknownDocument" ) ); - pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); - bgPm = img.smoothScale( AppLnk::bigIconSize(), AppLnk::bigIconSize() ); + if (pm.isNull()) + { + pm = OResource::loadImage( "UnknownDocument", OResource::SmallIcon ); + bgPm = OResource::loadImage( "UnknownDocument", OResource::BigIcon ); } - odebug << "adding type " << (*ittypes) << "" << oendl; - // ### our current launcher expects docs tab to be last d->serverGui->typeAdded( *ittypes, name.isNull() ? (*ittypes) : name, pm, bgPm ); } prevTypeList.remove(*ittypes); } } for ( QStringList::Iterator ittypes=prevTypeList.begin(); ittypes!=prevTypeList.end(); ++ittypes) { - odebug << "removing type " << (*ittypes) << "" << oendl; d->serverGui->typeRemoved(*ittypes); } prevTypeList = types; } QListIterator<AppLnk> it1( appLnkSet->children() ); QListIterator<AppLnk> it2( appLnkSet2->children() ); AppLnk *i; AppLnk *j; bool found; while ( (j=it2.current()) ) { it1 = appLnkSet->children(); found = false; while ( (i=it1.current()) ){ if (j->name().ascii() && i->name().ascii() && strcmp(i->name().ascii(),j->name().ascii()) == 0) found = true; ++it1; } if (!found) { odebug << "Item " << j->name().ascii() << " needs to be added" << oendl; d->serverGui->applicationAdded( j->type(), *j ); diff --git a/core/launcher/firstuse.cpp b/core/launcher/firstuse.cpp index 8344787..8c02ab0 100644 --- a/core/launcher/firstuse.cpp +++ b/core/launcher/firstuse.cpp @@ -1,61 +1,68 @@ -/********************************************************************** -** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. -** -** This file is part of the Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ +/* + This file is part of the Opie Project + =. (C) 2000-2002 Trolltech AS + .=l. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> + .>+-= + _;:, .> :=|. 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; version 2 of the License. + ._= =} : + .%`+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. +*/ // I need access to some things you don't normally get access to. - #ifndef _MSC_VER //### revise to allow removal of translators under MSVC #define private public #define protected public #endif #include "firstuse.h" #include "inputmethods.h" #include "applauncher.h" #include "serverapp.h" #include "calibrate.h" #include "documentlist.h" /* OPIE */ #include <opie2/odebug.h> -#include <qtopia/resource.h> +#include <opie2/oresource.h> #include <qtopia/qcopenvelope_qws.h> #include <qtopia/config.h> #include <qtopia/fontmanager.h> using namespace Opie::Core; /* QT */ #include <qfile.h> #include <qpainter.h> #include <qsimplerichtext.h> #include <qpushbutton.h> #include <qlabel.h> #include <qtimer.h> #if defined( Q_WS_QWS ) #include <qwsdisplay_qws.h> #include <qgfx_qws.h> #endif /* STD */ #include <stdlib.h> #include <sys/types.h> #if defined(Q_OS_LINUX) || defined(_OS_LINUX_) #include <unistd.h> #endif @@ -220,54 +227,52 @@ void FirstUse::calcMaxWindowRect() #endif } /* cancel current dialog, and bring up next */ void FirstUse::nextDialog() { int prevApp = currApp; do { currApp++; odebug << "currApp = " << currApp << "" << oendl; if ( settingsTable[currApp].app == 0 ) { if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) { // The last application is still running. // Tell it to stop, and when its done we'll come back // to nextDialog and exit. odebug << "Waiting for " << settingsTable[prevApp].app << " to exit" << oendl; QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app, settingsTable[prevApp].stop ); currApp = prevApp; } else { odebug << "Done!" << oendl; Config config( "qpe" ); config.setGroup( "Startup" ); config.writeEntry( "FirstUse", FALSE ); - QPixmap pix = Resource::loadPixmap("bigwait"); - QLabel *lblWait = new QLabel(0, "wait hack!", // No tr + QLabel *lblWait = new QLabel("Please Wait...", 0, "wait hack!", // No tr QWidget::WStyle_Customize | QWidget::WDestructiveClose | QWidget::WStyle_NoBorder | QWidget::WStyle_Tool | QWidget::WStyle_StaysOnTop); - lblWait->setPixmap( pix ); lblWait->setAlignment( QWidget::AlignCenter ); lblWait->setGeometry( qApp->desktop()->geometry() ); lblWait->show(); qApp->processEvents(); QTimer::singleShot( 1000, lblWait, SLOT(close()) ); repaint(); close(); ServerApplication::allowRestart = TRUE; } return; } } while ( !settingsTable[currApp].enabled ); if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) { odebug << "Shutdown: " << settingsTable[prevApp].app << "" << oendl; QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app, settingsTable[prevApp].stop ); waitForExit = prevApp; } else { odebug << "Startup: " << settingsTable[currApp].app << "" << oendl; QCopEnvelope e(QCString("QPE/Application/") + settingsTable[currApp].app, settingsTable[currApp].start ); waitingForLaunch = TRUE; } @@ -409,70 +414,63 @@ void FirstUse::reloadLanguages() owarn << "loading " + tfn << oendl; if ( transLib->load(tfn) ) { owarn << "installing translator library" << oendl; qApp->installTranslator( transLib ); } else { delete transLib; transLib = 0; } loadPixmaps(); //###language/font hack; should look it up somewhere #ifdef Q_WS_QWS if ( l == "ja" || l == "zh_CN" || l == "zh_TW" || l == "ko" ) { QFont fn = FontManager::unicodeFont( FontManager::Proportional ); qApp->setFont( fn, TRUE ); } else { qApp->setFont( defaultFont, TRUE ); } #endif #endif } void FirstUse::paintEvent( QPaintEvent * ) { QPainter p( this ); - p.drawPixmap(0,0, splash); - QFont f = p.font(); - f.setPointSize(15); - f.setItalic(FALSE); - f.setBold(FALSE); - p.setFont(f); - if ( currApp < 0 ) { drawText(p, tr( "Tap anywhere on the screen to continue." )); } else if ( settingsTable[currApp].app ) { if ( waitingForLaunch ) drawText(p, tr("Please wait, loading %1 settings.").arg(tr(settingsTable[currApp].desc)) ); } else { drawText(p, tr("Please wait...")); } } void FirstUse::loadPixmaps() { - splash.convertFromImage( Resource::loadImage("launcher/firstuse") + splash.convertFromImage( OResource::loadImage("launcher/firstuse", OResource::NoScale ) .smoothScale( width(), height() ) ); setBackgroundPixmap(splash); } void FirstUse::drawText(QPainter &p, const QString &text) { QString altered = "<CENTER>" + text + "</CENTER>"; QSimpleRichText rt(altered, p.font()); rt.setWidth(width() - 20); int h = (height() * 3) / 10; // start at 30% if (rt.height() < height() / 2) h += ((height() / 2) - rt.height()) / 2; rt.draw(&p, 10, h, QRegion(0,0, width()-20, height()), palette()); } void FirstUse::updateButtons() { if ( currApp >= 0 ) { taskBar->show(); } diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 4ec5f4c..361a159 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp @@ -1,58 +1,66 @@ -/********************************************************************** -** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. -** -** This file is part of the Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - +/* + This file is part of the Opie Project + =. (C) 2000-2002 Trolltech AS + .=l. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> + .>+-= + _;:, .> :=|. 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; version 2 of the License. + ._= =} : + .%`+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 "startmenu.h" #include "taskbar.h" #include "serverinterface.h" #include "launcherview.h" #include "launcher.h" #include "server.h" - /* OPIE */ #include <opie2/odebug.h> +#include <opie2/oresource.h> +using namespace Opie::Core; + #include <qtopia/global.h> #ifdef Q_WS_QWS #include <qtopia/qcopenvelope_qws.h> #endif -#include <qtopia/resource.h> #include <qtopia/applnk.h> #include <qtopia/config.h> #include <qtopia/qpeapplication.h> #include <qtopia/mimetype.h> #include <qtopia/private/categories.h> #define QTOPIA_INTERNAL_FSLP #include <qtopia/lnkproperties.h> /* QT */ #include <qdir.h> #ifdef Q_WS_QWS #include <qkeyboard_qws.h> #include <qwindowsystem_qws.h> #endif #include <qtimer.h> #include <qcombobox.h> #include <qvbox.h> #include <qlayout.h> #include <qstyle.h> #include <qpushbutton.h> #include <qtabbar.h> #include <qwidgetstack.h> #include <qregexp.h> #include <qmessagebox.h> @@ -100,51 +108,50 @@ LauncherTabWidget::LauncherTabWidget( Launcher* parent ) : connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), this, SLOT(appMessage(const QCString&,const QByteArray&))); #endif createDocLoadingWidget(); } void LauncherTabWidget::createDocLoadingWidget() { // Construct the 'doc loading widget' shown when finding documents // ### LauncherView class needs changing to be more generic so // this widget can change its background similar to the iconviews // so the background for this matches docLoadingWidget = new LauncherView( stack ); docLoadingWidget->hideIcons(); QVBox *docLoadingVBox = new QVBox( docLoadingWidget ); docLoadingVBox->setSpacing( 20 ); docLoadingVBox->setMargin( 10 ); QWidget *space1 = new QWidget( docLoadingVBox ); docLoadingVBox->setStretchFactor( space1, 1 ); - QLabel *waitPixmap = new QLabel( docLoadingVBox ); + QLabel *waitPixmap = new QLabel( "Please Wait...", docLoadingVBox ); waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) ); - waitPixmap->setPixmap( Resource::loadPixmap( "bigwait" ) ); waitPixmap->setAlignment( int( QLabel::AlignCenter ) ); Config cfg( "Launcher" ); cfg.setGroup( "DocTab" ); docTabEnabled = cfg.readBoolEntry( "Enable", true ); QLabel *textLabel = new QLabel( docLoadingVBox ); textLabel->setAlignment( int( QLabel::AlignCenter ) ); docLoadingWidgetProgress = new QProgressBar( docLoadingVBox ); docLoadingWidgetProgress->setProgress( 0 ); docLoadingWidgetProgress->setCenterIndicator( TRUE ); docLoadingWidgetProgress->setBackgroundMode( NoBackground ); // No flicker setProgressStyle(); if ( docTabEnabled ) { textLabel->setText( tr( "<b>Finding Documents...</b>" ) ); } else { textLabel->setText( tr( "<b>The Documents Tab<p>has been disabled.<p>" "Use Settings->Launcher->DocTab<p>to reenable it.</b></center>" ) ); docLoadingWidgetProgress->hide(); docLoadingWidgetEnabled = true; @@ -508,53 +515,50 @@ void Launcher::createGUI() tabs = new LauncherTabWidget( this ); setCentralWidget( tabs ); ServerInterface::dockWidget( tb, ServerInterface::Bottom ); tb->show(); qApp->installEventFilter( this ); connect( tb, SIGNAL(tabSelected(const QString&)), this, SLOT(showTab(const QString&)) ); connect( tabs, SIGNAL(selected(const QString&)), this, SLOT(viewSelected(const QString&)) ); connect( tabs, SIGNAL(clicked(const AppLnk*)), this, SLOT(select(const AppLnk*))); connect( tabs, SIGNAL(rightPressed(AppLnk*)), this, SLOT(properties(AppLnk*))); #if defined(Q_WS_QWS) && !defined(QT_NO_COP) QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); connect( sysChannel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(systemMessage(const QCString&,const QByteArray&)) ); #endif // all documents - QImage img( Resource::loadImage( "DocsIcon" ) ); - QPixmap pm; - pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); + QPixmap pm = OResource::loadPixmap( "DocsIcon", OResource::SmallIcon ); // It could add this itself if it handles docs - tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE ); QTimer::singleShot( 0, tabs, SLOT( initLayout() ) ); qApp->setMainWidget( this ); QTimer::singleShot( 500, this, SLOT( makeVisible() ) ); } Launcher::~Launcher() { if ( tb ) destroyGUI(); } bool Launcher::requiresDocuments() const { Config cfg( "Launcher" ); cfg.setGroup( "DocTab" ); return cfg.readBoolEntry( "Enable", true ); } void Launcher::makeVisible() { showMaximized(); } diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index d960908..6275fcb 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp @@ -1,54 +1,61 @@ -/********************************************************************** -** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. -** -** This file is part of the Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - +/* + This file is part of the Opie Project + =. (C) 2000-2002 Trolltech AS + .=l. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> + .>+-= + _;:, .> :=|. 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; version 2 of the License. + ._= =} : + .%`+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 "launcherview.h" /* OPIE */ #include <opie2/odebug.h> +#include <opie2/oresource.h> #include <qpe/config.h> #include <qtopia/qpeapplication.h> #include <qtopia/private/categories.h> #include <qtopia/categoryselect.h> #include <qtopia/mimetype.h> -#include <qtopia/resource.h> using namespace Opie::Core; #include <qpe/qcopenvelope_qws.h> /* QT */ #include <qtimer.h> #include <qfileinfo.h> #include <qiconview.h> #include <qobjectlist.h> // These define how the busy icon is animated and highlighted #define BRIGHTEN_BUSY_ICON //#define ALPHA_FADE_BUSY_ICON //#define USE_ANIMATED_BUSY_ICON_OVERLAY #define BOUNCE_BUSY_ICON typedef QMap<QString,QPixmap>::Iterator pixiter; class BgPixmap { public: BgPixmap( const QPixmap &p ) : pm(p), ref(1) {} QPixmap pm; @@ -405,49 +412,49 @@ void LauncherIconView::drawBackground( QPainter *p, const QRect &r ) } } } void LauncherIconView::addCatsAndMimes(AppLnk* app) { // QStringList c = app->categories(); // for (QStringList::ConstIterator cit=c.begin(); cit!=c.end(); ++cit) { // cats.replace(*cit,(void*)1); // } QString maj=app->type(); int sl=maj.find('/'); if (sl>=0) { QString k; k = maj.left(12) == "application/" ? maj : maj.left(sl); mimes.replace(k,(void*)1); } } void LauncherIconView::setBusy(bool on) { #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY if ( busyPix.isNull() ) { int size = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize(); - busyPix.convertFromImage( Resource::loadImage( "busy" ).smoothScale( size * 16, size ) ); + busyPix.convertFromImage( OResource::loadImage( "busy", OResource::NoScale ).smoothScale( size * 16, size ) ); } #endif if ( on ) { busyTimer = startTimer( 100 ); } else { if ( busyTimer ) { killTimer( busyTimer ); busyTimer = 0; } } LauncherItem *c = on ? (LauncherItem*)currentItem() : 0; if ( bsy != c ) { LauncherItem *oldBusy = bsy; bsy = c; if ( oldBusy ) { oldBusy->resetIcon(); } if ( bsy ) { bsy->setBusyIndicatorType( busyType ) ; bsy->animateIcon(); } @@ -980,49 +987,49 @@ void LauncherView::setBackgroundType( BackgroundType t, const QString &val ) QPainter painter( &bg ); for ( int i = 0; i < 3; i++ ) { painter.setPen( white ); painter.drawLine( 0, i*3, width()-1, i*3 ); painter.drawLine( 0, i*3+1, width()-1, i*3+1 ); painter.setPen( colorGroup().background().light(105) ); painter.drawLine( 0, i*3+2, width()-1, i*3+2 ); } painter.end(); bgCache->insert( bgName, new BgPixmap(bg) ); } break; } case Image: if (!val.isEmpty()) { bgName = val; if ( bgCache->contains( bgName ) ) { (*bgCache)[bgName]->ref++; bg = (*bgCache)[bgName]->pm; } else { QString imgFile = bgName; bool tile = FALSE; if ( imgFile[0]!='/' || !QFile::exists(imgFile) ) { - imgFile = Resource::findPixmap( imgFile ); + imgFile = OResource::findPixmap( imgFile ); tile = TRUE; } QImage img = loadBackgroundImage(imgFile); if ( img.depth() == 1 ) img = img.convertDepth(8); img.setAlphaBuffer(FALSE); bg.convertFromImage(img); bgCache->insert( bgName, new BgPixmap(bg) ); } } break; case SolidColor: default: break; } const QObjectList *list = queryList( "QWidget", 0, FALSE ); QObject *obj; for ( QObjectListIt it( *list ); (obj=it.current()); ++it ) { if ( obj->isWidgetType() ) { QWidget *w = (QWidget*)obj; diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp index ce7840e..24a9d7e 100644 --- a/core/launcher/startmenu.cpp +++ b/core/launcher/startmenu.cpp @@ -1,88 +1,92 @@ -/**********************************************************************
-** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
-**
-** This file is part of the Qtopia Environment.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
+/*
+ This file is part of the Opie Project
+ =. (C) 2000-2002 Trolltech AS
+ .=l. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. 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; version 2 of the License.
+ ._= =} :
+ .%`+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.
+*/
// TODO. During startup
// Launcher::typeAdded
// is called for each new tab and calls then each time the refresh of startmenu
// suboptimal
#define INCLUDE_MENUITEM_DEF
#include "startmenu.h"
+/* OPIE */
+#include <opie2/oresource.h>
+using namespace Opie::Core;
#include <qtopia/qpeapplication.h>
#include <qtopia/config.h>
-#include <qtopia/resource.h>
#include <qtopia/mimetype.h>
#include <qtopia/qlibrary.h>
-//#include <qpainter.h>
-
-//#include <stdlib.h>
-
-
#define APPLNK_ID_OFFSET 250
#define NO_ID -1
void StartPopupMenu::keyPressEvent( QKeyEvent *e )
{
if ( e->key() == Key_F33 || e->key() == Key_Space ) {
// "OK" button, little hacky
QKeyEvent ke(QEvent::KeyPress, Key_Enter, 13, 0);
QPopupMenu::keyPressEvent( &ke );
} else {
QPopupMenu::keyPressEvent( e );
}
}
//---------------------------------------------------------------------------
StartMenu::StartMenu(QWidget *parent) : QLabel( parent )
{
startButtonPixmap = "go"; // No tr
int sz = AppLnk::smallIconSize()+3;
QPixmap pm;
- pm.convertFromImage(Resource::loadImage( startButtonPixmap).smoothScale( sz,sz) );
+ pm.convertFromImage(OResource::loadImage( startButtonPixmap, OResource::NoScale ).smoothScale( sz,sz) );
setPixmap(pm);
setFocusPolicy( NoFocus );
useWidePopupMenu = true;
launchMenu = 0;
currentItem = 0;
refreshMenu();
}
void StartMenu::mousePressEvent( QMouseEvent * )
{
launch();
}
StartMenu::~StartMenu()
{
clearApplets();
}
void StartMenu::createMenu()
{
clearApplets();
@@ -124,112 +128,103 @@ void StartMenu::itemSelected( int id ) if ( appLnk ) {
appLnk->execute();
}
} else {
QString *tabName = tabNames.find( id );
if ( tabName ) {
emit tabSelected( *tabName );
}
}
}
void StartMenu::createAppEntry( QPopupMenu *menu, QDir dir, QString file )
{
if ( file.right(8) == ".desktop" ) {
AppLnk* applnk = new AppLnk( dir.path() + "/" + file );
if ( !applnk->isValid() ) {
delete applnk;
return;
}
if ( applnk->type() == "Separator" ) { // No tr
menu->insertSeparator();
delete applnk;
} else {
- QPixmap test;
- QImage img = Resource::loadImage( applnk->icon() );
- if(!img.isNull() )
- test.convertFromImage(
- img.smoothScale(
- AppLnk::smallIconSize(), AppLnk::smallIconSize() ), 0 );
-
+ QPixmap pixmap = OResource::loadPixmap( applnk->icon(), OResource::SmallIcon );
// Insert items ordered lexically
int current, left = 0, right = currentItem;
while( left != right ) {
current = ( left + right ) / 2;
if ( menu->text(menu->idAt( ( current ) ) ) < applnk->name() )
left = ++current;
else
right = current;
}
-
- menu->insertItem( test, applnk->name(),
+
+ menu->insertItem( pixmap, applnk->name(),
currentItem + APPLNK_ID_OFFSET, current );
appLnks.insert( currentItem + APPLNK_ID_OFFSET, applnk );
currentItem++;
}
}
}
void StartMenu::createDirEntry( QPopupMenu *menu, QDir dir, QString file, bool lot )
{
// do some sanity checks and collect information
if ( file == "." || file == ".." ) return;
Config cfg( dir.path() + "/" + file + "/.directory", Config::File );
if ( !cfg.isValid() ) return;
QString name = cfg.readEntry( "Name" );
QString icon = cfg.readEntry( "Icon" );
if ( !name || !icon ) return;
QDir subdir = QDir( dir );
subdir.cd( file );
subdir.setFilter( QDir::Files );
subdir.setNameFilter( "*.desktop" );
// we don' t show the menu if there are no entries
// perhaps one should check if there exist subsubdirs with entries...
if ( subdir.entryList().isEmpty() ) return;
// checks were ok
- QPixmap test;
- test.convertFromImage( Resource::loadImage( icon ).smoothScale(
- AppLnk::smallIconSize(), AppLnk::smallIconSize() ), 0 );
-
+ QPixmap pixmap = OResource::loadPixmap( icon, OResource::SmallIcon );
if ( useWidePopupMenu ) {
// generate submenu
QPopupMenu *submenu = new QPopupMenu( menu );
connect( submenu, SIGNAL(activated(int)), SLOT(itemSelected(int)) );
- menu->insertItem( test, name, submenu, NO_ID );
+ menu->insertItem( pixmap, name, submenu, NO_ID );
// ltabs is true cause else we wouldn't stuck around..
createMenuEntries( submenu, subdir, true, lot );
} else {
// no submenus - just bring corresponding tab to front
- menu->insertItem( test, name, currentItem );
+ menu->insertItem( pixmap, name, currentItem );
tabNames.insert( currentItem, new QString( file ) );
currentItem++;
}
}
void StartMenu::createMenuEntries( QPopupMenu *menu, QDir dir, bool ltabs, bool lot )
{
if ( lot ) {
dir.setFilter( QDir::Files );
dir.setNameFilter( "*.desktop" );
QStringList files = dir.entryList();
files.sort();
for ( QStringList::Iterator it = files.begin(); it != files.end(); it++ ) {
createAppEntry( menu, dir, *it );
}
}
if ( ltabs ) {
dir.setNameFilter( "*" );
dir.setFilter( QDir::Dirs );
QStringList dirs = dir.entryList();
dirs.sort();
for ( QStringList::Iterator it = dirs.begin(); it != dirs.end(); it++ ) {
diff --git a/core/launcher/syncdialog.cpp b/core/launcher/syncdialog.cpp index 4a2b8ff..d90b2ea 100644 --- a/core/launcher/syncdialog.cpp +++ b/core/launcher/syncdialog.cpp @@ -1,72 +1,81 @@ -/********************************************************************** -** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. -** -** This file is part of the Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - +/* + This file is part of the Opie Project + =. (C) 2000-2002 Trolltech AS + .=l. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> + .>+-= + _;:, .> :=|. 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; version 2 of the License. + ._= =} : + .%`+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 "syncdialog.h" -#include <qtopia/resource.h> +/* OPIE */ +#include <opie2/oresource.h> +using namespace Opie::Core; +/* QT */ #include <qpainter.h> #include <qapplication.h> #include <qpushbutton.h> #include <qfile.h> - SyncDialog::SyncDialog( QWidget *parent, const QString &w ) : QDialog( parent, "SyncDialog", FALSE, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop ), what(w), nextPt(0), rev(FALSE), hideDot(TRUE) { QFont f( font() ); f.setPointSize( 16 ); setFont(f); loadPath(); QSize ds = qApp->desktop()->size(); setGeometry( 0, 0, ds.width(), ds.height() ); - img = Resource::loadImage( "SyncScreen" ); + img = OResource::loadImage( "SyncScreen", OResource::NoScale ); if ( img.width() > ds.width() || img.height() > ds.height() ) { path = scalePath( path, ds.width(), img.width(), ds.height(), img.height() ); img = img.smoothScale( ds.width(), ds.height() ); } - dot = Resource::loadImage( "syncdot" ); + dot = OResource::loadImage( "syncdot", OResource::NoScale ); setBackgroundColor( white ); QPushButton *pb = new QPushButton( tr("Abort"), this, "CancelSync" ); QSize bs = pb->sizeHint(); bs.rwidth() += 10; bs.rheight() += 5; pb->setGeometry( (ds.width()-bs.width())/2, 4*ds.height()/5, bs.width(), bs.height() ); connect( pb, SIGNAL(clicked()), this, SIGNAL(cancel()) ); if ( path.count() >= 2 ) { path = generatePath( path, 8 ); startTimer( 200 ); } } void SyncDialog::paintEvent( QPaintEvent *pe ) { QPainter p(this ); p.setClipRect( pe->rect() ); int ox = (width() - img.width())/2; int oy = (height() - img.height())/2; QRect ir = QRect(ox, oy, img.width(), img.height()) & pe->rect(); @@ -97,49 +106,49 @@ void SyncDialog::timerEvent( QTimerEvent * ) if ( !rev ) { nextPt++; if ( nextPt == (int)path.count() ) { nextPt -= 2; rev = TRUE; } } else { nextPt--; if ( nextPt < 0 ) { nextPt = 1; rev = FALSE; } } hideDot = FALSE; repaint( ox+path[nextPt].x()-dot.width()/2, oy+path[nextPt].y()-dot.height()/2, dot.width(), dot.height() ); hideDot = TRUE; repaint( ox+path[oldPt].x()-dot.width()/2, oy+path[oldPt].y()-dot.height()/2, dot.width(), dot.height() ); } void SyncDialog::loadPath() { - QString pfile = Resource::findPixmap( "syncdot" ); + QString pfile = OResource::findPixmap( "syncdot" ); if ( pfile.isEmpty() ) return; int dp = pfile.findRev('.'); pfile.replace( dp, pfile.length()-dp, ".path" ); int count = 0; QFile file( pfile ); if ( file.open( IO_ReadOnly ) ) { QString line; while ( file.readLine( line, 256 ) > 0 ) { int x, y; if ( sscanf( line.latin1(), "%d %d", &x, &y ) == 2 ) { path.resize( count+1 ); path[count++] = QPoint(x, y); } } } } QPointArray SyncDialog::scalePath( const QPointArray &pa, int xn, int xd, int yn, int yd ) { QPointArray sa( pa.size() ); for ( unsigned i = 0; i < pa.count(); i++ ) { diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp index 7cbfe13..1356c77 100644 --- a/core/launcher/taskbar.cpp +++ b/core/launcher/taskbar.cpp @@ -1,56 +1,64 @@ -/********************************************************************** -** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. -** -** This file is part of the Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - +/* + This file is part of the Opie Project + =. (C) 2000-2002 Trolltech AS + .=l. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> + .>+-= + _;:, .> :=|. 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; version 2 of the License. + ._= =} : + .%`+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 "startmenu.h" #include "inputmethods.h" #include "runningappbar.h" #include "systray.h" #include "wait.h" #include "appicons.h" #include "taskbar.h" #include "server.h" /* OPIE */ #include <opie2/odebug.h> +#include <opie2/oresource.h> #include <qtopia/config.h> #include <qtopia/qpeapplication.h> #ifdef QWS #include <qtopia/qcopenvelope_qws.h> #endif #include <qtopia/global.h> using namespace Opie::Core; /* QT */ #include <qlabel.h> #include <qlayout.h> #include <qtimer.h> #ifdef QWS #include <qwindowsystem_qws.h> #endif #include <qwidgetstack.h> #if defined( Q_WS_QWS ) #include <qwsdisplay_qws.h> #include <qgfx_qws.h> #endif static bool initNumLock() @@ -117,50 +125,50 @@ void SafeMode::action(int i) } QSize SafeMode::sizeHint() const { QFontMetrics fm = fontMetrics(); return QSize( fm.width(message), fm.height() ); } void SafeMode::paintEvent( QPaintEvent* ) { QPainter p(this); p.drawText( rect(), AlignCenter, message ); } //--------------------------------------------------------------------------- class LockKeyState : public QWidget { public: LockKeyState( QWidget *parent ) : QWidget(parent), nl(initNumLock()), cl(FALSE) { - nl_pm = Resource::loadPixmap("numlock"); - cl_pm = Resource::loadPixmap("capslock"); + nl_pm = OResource::loadPixmap("numlock", OResource::NoScale); + cl_pm = OResource::loadPixmap("capslock", OResource::NoScale); } QSize sizeHint() const { return QSize(nl_pm.width()+2,nl_pm.width()+nl_pm.height()+1); } void toggleNumLockState() { nl = !nl; repaint(); } void toggleCapsLockState() { cl = !cl; repaint(); } void paintEvent( QPaintEvent * ) { int y = (height()-sizeHint().height())/2; QPainter p(this); if ( nl ) p.drawPixmap(1,y,nl_pm); if ( cl ) p.drawPixmap(1,y+nl_pm.height()+1,cl_pm); } private: QPixmap nl_pm, cl_pm; diff --git a/core/launcher/wait.cpp b/core/launcher/wait.cpp index 523819d..f872218 100644 --- a/core/launcher/wait.cpp +++ b/core/launcher/wait.cpp @@ -1,65 +1,71 @@ -/********************************************************************** -** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. -** -** This file is part of the Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - +/* + This file is part of the Opie Project + =. (C) 2000-2002 Trolltech AS + .=l. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> + .>+-= + _;:, .> :=|. 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; version 2 of the License. + ._= =} : + .%`+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 "wait.h" #include <opie2/owait.h> +#include <opie2/oresource.h> +using namespace Opie::Core; #include <qtopia/config.h> #include <qtopia/applnk.h> Wait *lastWaitObject = NULL; using namespace Opie::Ui; Wait::Wait( QWidget *parent ) : QWidget( parent ), waiting( FALSE ) { QSize size( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); setFixedSize( size ); - - QImage img = Resource::loadImage( "wait" ); - img = img.smoothScale( size.width(), size.height() ); - pm.convertFromImage( img ); + pm = OResource::loadPixmap( "wait", OResource::SmallIcon ); lastWaitObject = this; m_centralWait = new OWait( 0l ); m_centralWait->hide(); hide(); } Wait *Wait::getWaitObject() { return lastWaitObject; } void Wait::setWaiting( bool w ) { Config cfg ( "Launcher" ); cfg.setGroup("GUI"); waiting = w; if ( w ) { if ( cfg. readBoolEntry( "BigBusy" ) ) m_centralWait->show(); |