summaryrefslogtreecommitdiff
path: root/core/launcher/launcher.cpp
authormickeyl <mickeyl>2005-07-03 22:13:00 (UTC)
committer mickeyl <mickeyl>2005-07-03 22:13:00 (UTC)
commit2cabd9ad4b49eefccdf99ad59550c76546b473c9 (patch) (unidiff)
tree00bab275ac356aecc5a39b86ca22ce172d01f622 /core/launcher/launcher.cpp
parent47011752d4457a1055894479e5bf855e100fddac (diff)
downloadopie-2cabd9ad4b49eefccdf99ad59550c76546b473c9.zip
opie-2cabd9ad4b49eefccdf99ad59550c76546b473c9.tar.gz
opie-2cabd9ad4b49eefccdf99ad59550c76546b473c9.tar.bz2
Resource -> OResource
This is a large diff and I'd appreciate some additional pairs of eyes checking it
Diffstat (limited to 'core/launcher/launcher.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp60
1 files changed, 32 insertions, 28 deletions
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 @@
1/********************************************************************** 1/*
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2                 This file is part of the Opie Project
3** 3 =. (C) 2000-2002 Trolltech AS
4** This file is part of the Qtopia Environment. 4 .=l. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org>
5** 5           .>+-=
6** This file may be distributed and/or modified under the terms of the 6 _;:,     .>    :=|. This program is free software; you can
7** GNU General Public License version 2 as published by the Free Software 7.> <`_,   >  .   <= redistribute it and/or modify it under
8** Foundation and appearing in the file LICENSE.GPL included in the 8 :`=1 )Y*s>-.--   : the terms of the GNU Library General Public
9** packaging of this file. 9.="- .-=="i,     .._ License as published by the Free Software
10** 10 - .   .-<_>     .<> Foundation; version 2 of the License.
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11     ._= =}       :
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12    .%`+i>       _;_.
13** 13    .i_,=:_.      -<s. This program is distributed in the hope that
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15** 15 : ..    .:,     . . . without even the implied warranty of
16** Contact info@trolltech.com if any conditions of this licensing are 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17** not clear to you. 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
18** 18..}^=.=       =       ; Library General Public License for more
19**********************************************************************/ 19++=   -.     .`     .: details.
20 20 :     =  ...= . :.=-
21 -.   .:....=;==+<; You should have received a copy of the GNU
22  -_. . .   )=.  = Library General Public License along with
23    --        :-=` this library; see the file COPYING.LIB.
24 If not, write to the Free Software Foundation,
25 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27*/
21#include "startmenu.h" 28#include "startmenu.h"
22#include "taskbar.h" 29#include "taskbar.h"
23#include "serverinterface.h" 30#include "serverinterface.h"
24#include "launcherview.h" 31#include "launcherview.h"
25#include "launcher.h" 32#include "launcher.h"
26#include "server.h" 33#include "server.h"
27
28/* OPIE */ 34/* OPIE */
29#include <opie2/odebug.h> 35#include <opie2/odebug.h>
36#include <opie2/oresource.h>
37using namespace Opie::Core;
38
30#include <qtopia/global.h> 39#include <qtopia/global.h>
31#ifdef Q_WS_QWS 40#ifdef Q_WS_QWS
32#include <qtopia/qcopenvelope_qws.h> 41#include <qtopia/qcopenvelope_qws.h>
33#endif 42#endif
34#include <qtopia/resource.h>
35#include <qtopia/applnk.h> 43#include <qtopia/applnk.h>
36#include <qtopia/config.h> 44#include <qtopia/config.h>
37#include <qtopia/qpeapplication.h> 45#include <qtopia/qpeapplication.h>
38#include <qtopia/mimetype.h> 46#include <qtopia/mimetype.h>
39#include <qtopia/private/categories.h> 47#include <qtopia/private/categories.h>
40#define QTOPIA_INTERNAL_FSLP 48#define QTOPIA_INTERNAL_FSLP
41#include <qtopia/lnkproperties.h> 49#include <qtopia/lnkproperties.h>
42 50
43/* QT */ 51/* QT */
44#include <qdir.h> 52#include <qdir.h>
45#ifdef Q_WS_QWS 53#ifdef Q_WS_QWS
46#include <qkeyboard_qws.h> 54#include <qkeyboard_qws.h>
@@ -112,27 +120,26 @@ void LauncherTabWidget::createDocLoadingWidget()
112 // this widget can change its background similar to the iconviews 120 // this widget can change its background similar to the iconviews
113 // so the background for this matches 121 // so the background for this matches
114 docLoadingWidget = new LauncherView( stack ); 122 docLoadingWidget = new LauncherView( stack );
115 docLoadingWidget->hideIcons(); 123 docLoadingWidget->hideIcons();
116 QVBox *docLoadingVBox = new QVBox( docLoadingWidget ); 124 QVBox *docLoadingVBox = new QVBox( docLoadingWidget );
117 125
118 docLoadingVBox->setSpacing( 20 ); 126 docLoadingVBox->setSpacing( 20 );
119 docLoadingVBox->setMargin( 10 ); 127 docLoadingVBox->setMargin( 10 );
120 128
121 QWidget *space1 = new QWidget( docLoadingVBox ); 129 QWidget *space1 = new QWidget( docLoadingVBox );
122 docLoadingVBox->setStretchFactor( space1, 1 ); 130 docLoadingVBox->setStretchFactor( space1, 1 );
123 131
124 QLabel *waitPixmap = new QLabel( docLoadingVBox ); 132 QLabel *waitPixmap = new QLabel( "Please Wait...", docLoadingVBox );
125 waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) ); 133 waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) );
126 waitPixmap->setPixmap( Resource::loadPixmap( "bigwait" ) );
127 waitPixmap->setAlignment( int( QLabel::AlignCenter ) ); 134 waitPixmap->setAlignment( int( QLabel::AlignCenter ) );
128 135
129 Config cfg( "Launcher" ); 136 Config cfg( "Launcher" );
130 cfg.setGroup( "DocTab" ); 137 cfg.setGroup( "DocTab" );
131 docTabEnabled = cfg.readBoolEntry( "Enable", true ); 138 docTabEnabled = cfg.readBoolEntry( "Enable", true );
132 139
133 QLabel *textLabel = new QLabel( docLoadingVBox ); 140 QLabel *textLabel = new QLabel( docLoadingVBox );
134 textLabel->setAlignment( int( QLabel::AlignCenter ) ); 141 textLabel->setAlignment( int( QLabel::AlignCenter ) );
135 docLoadingWidgetProgress = new QProgressBar( docLoadingVBox ); 142 docLoadingWidgetProgress = new QProgressBar( docLoadingVBox );
136 docLoadingWidgetProgress->setProgress( 0 ); 143 docLoadingWidgetProgress->setProgress( 0 );
137 docLoadingWidgetProgress->setCenterIndicator( TRUE ); 144 docLoadingWidgetProgress->setCenterIndicator( TRUE );
138 docLoadingWidgetProgress->setBackgroundMode( NoBackground ); // No flicker 145 docLoadingWidgetProgress->setBackgroundMode( NoBackground ); // No flicker
@@ -520,29 +527,26 @@ void Launcher::createGUI()
520 connect( tabs, SIGNAL(clicked(const AppLnk*)), 527 connect( tabs, SIGNAL(clicked(const AppLnk*)),
521 this, SLOT(select(const AppLnk*))); 528 this, SLOT(select(const AppLnk*)));
522 connect( tabs, SIGNAL(rightPressed(AppLnk*)), 529 connect( tabs, SIGNAL(rightPressed(AppLnk*)),
523 this, SLOT(properties(AppLnk*))); 530 this, SLOT(properties(AppLnk*)));
524 531
525#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 532#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
526 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); 533 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this );
527 connect( sysChannel, SIGNAL(received(const QCString&,const QByteArray&)), 534 connect( sysChannel, SIGNAL(received(const QCString&,const QByteArray&)),
528 this, SLOT(systemMessage(const QCString&,const QByteArray&)) ); 535 this, SLOT(systemMessage(const QCString&,const QByteArray&)) );
529#endif 536#endif
530 537
531 // all documents 538 // all documents
532 QImage img( Resource::loadImage( "DocsIcon" ) ); 539 QPixmap pm = OResource::loadPixmap( "DocsIcon", OResource::SmallIcon );
533 QPixmap pm;
534 pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
535 // It could add this itself if it handles docs 540 // It could add this itself if it handles docs
536
537 tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE ); 541 tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE );
538 542
539 QTimer::singleShot( 0, tabs, SLOT( initLayout() ) ); 543 QTimer::singleShot( 0, tabs, SLOT( initLayout() ) );
540 qApp->setMainWidget( this ); 544 qApp->setMainWidget( this );
541 QTimer::singleShot( 500, this, SLOT( makeVisible() ) ); 545 QTimer::singleShot( 500, this, SLOT( makeVisible() ) );
542} 546}
543 547
544Launcher::~Launcher() 548Launcher::~Launcher()
545{ 549{
546 if ( tb ) 550 if ( tb )
547 destroyGUI(); 551 destroyGUI();
548} 552}