summaryrefslogtreecommitdiff
authorzecke <zecke>2003-08-28 14:48:13 (UTC)
committer zecke <zecke>2003-08-28 14:48:13 (UTC)
commit6ae5aaad2dec2470940f83f1e8629aec48f284a7 (patch) (unidiff)
tree4b8c3c19351966849c591a855473043448cd5d48
parente284d63306cd3b00baff8e464a8eaf2eb64ea49a (diff)
downloadopie-6ae5aaad2dec2470940f83f1e8629aec48f284a7.zip
opie-6ae5aaad2dec2470940f83f1e8629aec48f284a7.tar.gz
opie-6ae5aaad2dec2470940f83f1e8629aec48f284a7.tar.bz2
Plugin loading changes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/systray.cpp70
-rw-r--r--core/launcher/systray.h12
2 files changed, 35 insertions, 47 deletions
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp
index be55791..64356ca 100644
--- a/core/launcher/systray.cpp
+++ b/core/launcher/systray.cpp
@@ -20,5 +20,5 @@
20 20
21#include <qpe/qpeapplication.h> 21#include <qtopia/qpeapplication.h>
22#include <qpe/qlibrary.h> 22#include <qtopia/qlibrary.h>
23#include <qpe/config.h> 23#include <qtopia/config.h>
24 24
@@ -26,5 +26,5 @@
26#include <qdir.h> 26#include <qdir.h>
27#include <qmessagebox.h>
27#include <qtranslator.h> 28#include <qtranslator.h>
28 29
29#include "quicklauncher.h"
30#include "systray.h" 30#include "systray.h"
@@ -33,4 +33,7 @@
33 33
34#ifdef SINGLE_APP 34/* ### Single build floppies ### */
35#include "clockappletimpl.h" 35#if 0
36#ifdef QT_NO_COMPONENTS
37#include "../plugins/applets/clockapplet/clockappletimpl.h"
38#endif
36#endif 39#endif
@@ -39,3 +42,2 @@ SysTray::SysTray( QWidget *parent ) : QFrame( parent ), layout(0)
39{ 42{
40 safety_tid = 0;
41 //setFrameStyle( QFrame::Panel | QFrame::Sunken ); 43 //setFrameStyle( QFrame::Panel | QFrame::Sunken );
@@ -44,2 +46,7 @@ SysTray::SysTray( QWidget *parent ) : QFrame( parent ), layout(0)
44 46
47SysTray::~SysTray()
48{
49 clearApplets();
50}
51
45static int compareAppletPositions(const void *a, const void *b) 52static int compareAppletPositions(const void *a, const void *b)
@@ -50,3 +57,3 @@ static int compareAppletPositions(const void *a, const void *b)
50 if ( d ) return d; 57 if ( d ) return d;
51 return QString::compare(ab->library->library(),aa->library->library()); 58 return QString::compare(ab->name,aa->name);
52} 59}
@@ -55,2 +62,3 @@ void SysTray::loadApplets()
55{ 62{
63 hide();
56 clearApplets(); 64 clearApplets();
@@ -61,7 +69,7 @@ void SysTray::clearApplets()
61{ 69{
62 hide(); 70#ifndef QT_NO_COMPONENTS
63#ifndef SINGLE_APP 71
64 QValueList<TaskbarApplet>::Iterator mit; 72 QValueList<TaskbarApplet>::Iterator mit;
65 for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) { 73 for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) {
66 (*mit).iface->release(); 74 (*mit).iface->release();
67 (*mit).library->unload(); 75 (*mit).library->unload();
@@ -69,2 +77,3 @@ void SysTray::clearApplets()
69 } 77 }
78
70#endif 79#endif
@@ -79,14 +88,6 @@ void SysTray::addApplets()
79{ 88{
80#ifndef SINGLE_APP 89 hide();
90#ifndef QT_NO_COMPONENTS
81 Config cfg( "Taskbar" ); 91 Config cfg( "Taskbar" );
82 cfg.setGroup( "Applets" ); 92 cfg.setGroup( "Applets" );
83
84 // SafeMode causes too much problems, so we disable it for now --
85 // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02
86
87 bool safe = false; //cfg.readBoolEntry("SafeMode",FALSE);
88 if ( safe && !safety_tid )
89 return;
90 cfg.writeEntry("SafeMode",TRUE);
91 cfg.write();
92 QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); 93 QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' );
@@ -110,3 +111,3 @@ void SysTray::addApplets()
110 applet->iface = iface; 111 applet->iface = iface;
111 112
112 QTranslator *trans = new QTranslator(qApp); 113 QTranslator *trans = new QTranslator(qApp);
@@ -117,3 +118,3 @@ void SysTray::addApplets()
117 else 118 else
118 delete trans; 119 delete trans;
119 } else { 120 } else {
@@ -131,23 +132,10 @@ void SysTray::addApplets()
131 delete [] applets; 132 delete [] applets;
132#else 133#else /* ## FIXME single app */
133 TaskbarApplet applet; 134 TaskbarApplet * const applet = new TaskbarApplet();
134 applet.iface = new ClockAppletImpl(); 135 applet->iface = new ClockAppletImpl();
135 applet.applet = applet.iface->applet( this ); 136 applet->applet = applet->iface->applet( this );
136 appletList.append( a ); 137 appletList.append( applet );
137#endif 138#endif
138 show(); 139 show();
139
140 if ( !safety_tid )
141 safety_tid = startTimer(2000); // TT has 5000, but this is a PITA for a developer ;) (sandman)
142} 140}
143 141
144void SysTray::timerEvent(QTimerEvent* e)
145{
146 if ( e->timerId() == safety_tid ) {
147 Config cfg( "Taskbar" );
148 cfg.setGroup( "Applets" );
149 cfg.writeEntry( "SafeMode", FALSE );
150 killTimer(safety_tid);
151 safety_tid = 0;
152 }
153}
diff --git a/core/launcher/systray.h b/core/launcher/systray.h
index 5a6849a..77c581f 100644
--- a/core/launcher/systray.h
+++ b/core/launcher/systray.h
@@ -23,3 +23,5 @@
23 23
24#include <qpe/taskbarappletinterface.h> 24#ifndef QT_NO_COMPONENT
25#include <qtopia/taskbarappletinterface.h>
26#endif
25 27
@@ -35,5 +37,6 @@ struct TaskbarApplet
35 QLibrary *library; 37 QLibrary *library;
36#endif
37 TaskbarAppletInterface *iface; 38 TaskbarAppletInterface *iface;
39#endif
38 QWidget *applet; 40 QWidget *applet;
41 QString name;
39}; 42};
@@ -44,2 +47,3 @@ public:
44 SysTray( QWidget *parent ); 47 SysTray( QWidget *parent );
48 ~SysTray();
45 49
@@ -48,8 +52,4 @@ public:
48 52
49protected:
50 void timerEvent(QTimerEvent* e);
51
52private: 53private:
53 void loadApplets(); 54 void loadApplets();
54 int safety_tid;
55 QHBoxLayout *layout; 55 QHBoxLayout *layout;