summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp72
-rw-r--r--core/launcher/firstuse.cpp62
-rw-r--r--core/launcher/launcher.cpp60
-rw-r--r--core/launcher/launcherview.cpp53
-rw-r--r--core/launcher/startmenu.cpp79
-rw-r--r--core/launcher/syncdialog.cpp59
-rw-r--r--core/launcher/taskbar.cpp52
-rw-r--r--core/launcher/wait.cpp54
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,41 +1,49 @@
-/**********************************************************************
-** 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>
@@ -223,40 +231,37 @@ void DocumentList::reloadAppLnks()
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 );
}
@@ -348,40 +353,37 @@ void DocumentList::DiffAppLnks()
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;
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,49 +1,56 @@
-/**********************************************************************
-** 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>
@@ -232,30 +239,28 @@ void FirstUse::nextDialog()
// 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 );
@@ -421,46 +426,39 @@ void FirstUse::reloadLanguages()
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);
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,46 +1,54 @@
-/**********************************************************************
-** 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>
@@ -112,27 +120,26 @@ void LauncherTabWidget::createDocLoadingWidget()
// 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
@@ -520,29 +527,26 @@ void Launcher::createGUI()
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();
}
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,42 +1,49 @@
-/**********************************************************************
-** 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
@@ -417,25 +424,25 @@ void LauncherIconView::addCatsAndMimes(AppLnk* app)
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;
}
}
@@ -992,25 +999,25 @@ void LauncherView::setBackgroundType( BackgroundType t, const QString &val )
}
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) );
}
}
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,76 +1,80 @@
-/**********************************************************************
-** 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 * )
{
@@ -136,42 +140,36 @@ 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
@@ -185,39 +183,36 @@ void StartMenu::createDirEntry( QPopupMenu *menu, QDir dir, QString file, bool l
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();
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,60 +1,69 @@
-/**********************************************************************
-** 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 );
@@ -109,25 +118,25 @@ void SyncDialog::timerEvent( QTimerEvent * )
}
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 ) {
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,44 +1,52 @@
-/**********************************************************************
-** 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>
@@ -129,26 +137,26 @@ void SafeMode::paintEvent( QPaintEvent* )
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();
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,53 +1,59 @@
-/**********************************************************************
-** 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;
}