summaryrefslogtreecommitdiff
path: root/core/launcher/launcher.cpp
authormickeyl <mickeyl>2004-04-07 13:36:16 (UTC)
committer mickeyl <mickeyl>2004-04-07 13:36:16 (UTC)
commit4f1d28a25ce6180850c3d26bac9b638f0f25532b (patch) (unidiff)
tree59b4879b1065086c9a2e28f16f7d48540c8a9456 /core/launcher/launcher.cpp
parent8af35b63a277ec14dcc4a0a6ca5bbe228e276b98 (diff)
downloadopie-4f1d28a25ce6180850c3d26bac9b638f0f25532b.zip
opie-4f1d28a25ce6180850c3d26bac9b638f0f25532b.tar.gz
opie-4f1d28a25ce6180850c3d26bac9b638f0f25532b.tar.bz2
use Opie debugging framework
Diffstat (limited to 'core/launcher/launcher.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp37
1 files changed, 17 insertions, 20 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 5d0c778..bf2287d 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -9,81 +9,78 @@
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "startmenu.h"
22#include "taskbar.h"
23#include "serverinterface.h"
24#include "launcherview.h"
25#include "launcher.h"
26#include "server.h"
27
28/* OPIE */
29#include <opie2/odebug.h>
21#include <qtopia/global.h> 30#include <qtopia/global.h>
22#ifdef Q_WS_QWS 31#ifdef Q_WS_QWS
23#include <qtopia/qcopenvelope_qws.h> 32#include <qtopia/qcopenvelope_qws.h>
24#endif 33#endif
25#include <qtopia/resource.h> 34#include <qtopia/resource.h>
26#include <qtopia/applnk.h> 35#include <qtopia/applnk.h>
27#include <qtopia/config.h> 36#include <qtopia/config.h>
28#include <qtopia/qpeapplication.h> 37#include <qtopia/qpeapplication.h>
29#include <qtopia/mimetype.h> 38#include <qtopia/mimetype.h>
30#include <qtopia/private/categories.h> 39#include <qtopia/private/categories.h>
31//#include <qtopia/custom.h> 40#define QTOPIA_INTERNAL_FSLP
41#include <qtopia/lnkproperties.h>
32 42
43/* QT */
33#include <qdir.h> 44#include <qdir.h>
34#ifdef Q_WS_QWS 45#ifdef Q_WS_QWS
46#include <qkeyboard_qws.h>
35#include <qwindowsystem_qws.h> 47#include <qwindowsystem_qws.h>
36#endif 48#endif
37#include <qtimer.h> 49#include <qtimer.h>
38#include <qcombobox.h> 50#include <qcombobox.h>
39#include <qvbox.h> 51#include <qvbox.h>
40#include <qlayout.h> 52#include <qlayout.h>
41#include <qstyle.h> 53#include <qstyle.h>
42#include <qpushbutton.h> 54#include <qpushbutton.h>
43#include <qtabbar.h> 55#include <qtabbar.h>
44#include <qwidgetstack.h> 56#include <qwidgetstack.h>
45#include <qregexp.h> 57#include <qregexp.h>
46#include <qmessagebox.h> 58#include <qmessagebox.h>
47#include <qframe.h> 59#include <qframe.h>
48#include <qpainter.h> 60#include <qpainter.h>
49#include <qlabel.h> 61#include <qlabel.h>
50#include <qtextstream.h> 62#include <qtextstream.h>
51#include <qpopupmenu.h> 63#include <qpopupmenu.h>
52 64
53#include "startmenu.h" 65/* STD */
54#include "taskbar.h"
55
56#include "serverinterface.h"
57#include "launcherview.h"
58#include "launcher.h"
59#include "server.h"
60
61#define QTOPIA_INTERNAL_FSLP
62#include <qtopia/lnkproperties.h>
63#include <stdlib.h> 66#include <stdlib.h>
64#include <assert.h> 67#include <assert.h>
65
66#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 68#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
67#include <unistd.h> 69#include <unistd.h>
68#include <stdio.h> 70#include <stdio.h>
69#include <sys/vfs.h> 71#include <sys/vfs.h>
70#include <mntent.h> 72#include <mntent.h>
71#endif 73#endif
72 74
73#ifdef Q_WS_QWS
74#include <qkeyboard_qws.h>
75#include <qpe/lnkproperties.h>
76#endif
77
78 75
79static bool isVisibleWindow( int ); 76static bool isVisibleWindow( int );
80//=========================================================================== 77//===========================================================================
81 78
82LauncherTabWidget::LauncherTabWidget( Launcher* parent ) : 79LauncherTabWidget::LauncherTabWidget( Launcher* parent ) :
83 QVBox( parent ), docview( 0 ) 80 QVBox( parent ), docview( 0 )
84{ 81{
85 docLoadingWidgetEnabled = false; 82 docLoadingWidgetEnabled = false;
86 docLoadingWidget = 0; 83 docLoadingWidget = 0;
87 docLoadingWidgetProgress = 0; 84 docLoadingWidgetProgress = 0;
88 launcher = parent; 85 launcher = parent;
89 categoryBar = new LauncherTabBar( this ); 86 categoryBar = new LauncherTabBar( this );
@@ -219,25 +216,25 @@ LauncherView* LauncherTabWidget::newView( const QString& id, const QPixmap& pm,
219 connect( view, SIGNAL(rightPressed(AppLnk*)), 216 connect( view, SIGNAL(rightPressed(AppLnk*)),
220 this, SIGNAL(rightPressed(AppLnk*))); 217 this, SIGNAL(rightPressed(AppLnk*)));
221 218
222 int n = categoryBar->count(); 219 int n = categoryBar->count();
223 stack->addWidget( view, n ); 220 stack->addWidget( view, n );
224 221
225 LauncherTab *tab = new LauncherTab( id, view, pm, label ); 222 LauncherTab *tab = new LauncherTab( id, view, pm, label );
226 categoryBar->insertTab( tab, n-1 ); 223 categoryBar->insertTab( tab, n-1 );
227 224
228 if ( id == "Documents" ) 225 if ( id == "Documents" )
229 docview = view; 226 docview = view;
230 227
231 qDebug("inserting %s at %d", id.latin1(), n-1 ); 228 odebug << "inserting " << id << " at " << n-1 << "" << oendl;
232 229
233 Config cfg("Launcher"); 230 Config cfg("Launcher");
234 setTabAppearance( tab, cfg ); 231 setTabAppearance( tab, cfg );
235 232
236 cfg.setGroup( "GUI" ); 233 cfg.setGroup( "GUI" );
237 view->setBusyIndicatorType( cfg.readEntry( "BusyType", QString::null ) ); 234 view->setBusyIndicatorType( cfg.readEntry( "BusyType", QString::null ) );
238 235
239 return view; 236 return view;
240} 237}
241 238
242LauncherView *LauncherTabWidget::view( const QString &id ) 239LauncherView *LauncherTabWidget::view( const QString &id )
243{ 240{
@@ -404,25 +401,25 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
404 stream >> id; 401 stream >> id;
405 QString fam; 402 QString fam;
406 stream >> fam; 403 stream >> fam;
407 int size; 404 int size;
408 stream >> size; 405 stream >> size;
409 int weight; 406 int weight;
410 stream >> weight; 407 stream >> weight;
411 int italic; 408 int italic;
412 stream >> italic; 409 stream >> italic;
413 if ( view(id) ) { 410 if ( view(id) ) {
414 if ( !fam.isEmpty() ) { 411 if ( !fam.isEmpty() ) {
415 view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); 412 view(id)->setViewFont( QFont(fam, size, weight, italic!=0) );
416 qDebug( "setFont: %s, %d, %d, %d", fam.latin1(), size, weight, italic ); 413 odebug << "setFont: " << fam << ", " << size << ", " << weight << ", " << italic << "" << oendl;
417 } else { 414 } else {
418 view(id)->clearViewFont(); 415 view(id)->clearViewFont();
419 } 416 }
420 } 417 }
421 }else if ( msg == "setBusyIndicatorType(QString)" ) { 418 }else if ( msg == "setBusyIndicatorType(QString)" ) {
422 QString type; 419 QString type;
423 stream >> type; 420 stream >> type;
424 setBusyIndicatorType( type ); 421 setBusyIndicatorType( type );
425 }else if ( msg == "home()" ) { 422 }else if ( msg == "home()" ) {
426 if ( isVisibleWindow( static_cast<QWidget*>(parent())->winId() ) ) { 423 if ( isVisibleWindow( static_cast<QWidget*>(parent())->winId() ) ) {
427 if (categoryBar) 424 if (categoryBar)
428 categoryBar->nextTab(); 425 categoryBar->nextTab();
@@ -675,25 +672,25 @@ void Launcher::applicationAdded( const QString& type, const AppLnk& app )
675 qWarning("addAppLnk: No view for type %s. Can't add app %s!", 672 qWarning("addAppLnk: No view for type %s. Can't add app %s!",
676 type.latin1(),app.name().latin1() ); 673 type.latin1(),app.name().latin1() );
677 674
678 MimeType::registerApp( app ); 675 MimeType::registerApp( app );
679} 676}
680 677
681void Launcher::applicationRemoved( const QString& type, const AppLnk& app ) 678void Launcher::applicationRemoved( const QString& type, const AppLnk& app )
682{ 679{
683 LauncherView *view = tabs->view( type ); 680 LauncherView *view = tabs->view( type );
684 if ( view ) 681 if ( view )
685 view->removeLink( app.linkFile() ); 682 view->removeLink( app.linkFile() );
686 else 683 else
687 qWarning("removeAppLnk: No view for %s!", type.latin1() ); 684 owarn << "removeAppLnk: No view for " << type << "!" << oendl;
688} 685}
689 686
690void Launcher::allApplicationsRemoved() 687void Launcher::allApplicationsRemoved()
691{ 688{
692 MimeType::clear(); 689 MimeType::clear();
693 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) 690 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it)
694 tabs->view( (*it) )->removeAllItems(); 691 tabs->view( (*it) )->removeAllItems();
695} 692}
696 693
697void Launcher::documentAdded( const DocLnk& doc ) 694void Launcher::documentAdded( const DocLnk& doc )
698{ 695{
699 tabs->docView()->addItem( new DocLnk( doc ), FALSE ); 696 tabs->docView()->addItem( new DocLnk( doc ), FALSE );