summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 83d8601..f213943 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -7,385 +7,391 @@
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17 17
18 18
19#define QTOPIA_INTERNAL_LANGLIST 19#define QTOPIA_INTERNAL_LANGLIST
20 20
21#include "today.h" 21#include "today.h"
22 22
23#include <qpe/config.h> 23#include <qpe/config.h>
24#include <qpe/qcopenvelope_qws.h> 24#include <qpe/qcopenvelope_qws.h>
25#include <qpe/resource.h> 25#include <qpe/resource.h>
26#include <qpe/global.h> 26#include <qpe/global.h>
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28#include <qpe/contact.h> 28#include <qpe/contact.h>
29#include <qpe/timestring.h> 29#include <qpe/timestring.h>
30 30
31#include <qdir.h> 31#include <qdir.h>
32#include <qfile.h> 32#include <qfile.h>
33#include <qtimer.h> 33#include <qtimer.h>
34#include <qwhatsthis.h> 34#include <qwhatsthis.h>
35#include <qtranslator.h> 35#include <qtranslator.h>
36 36
37struct TodayPlugin { 37struct TodayPlugin {
38 TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} 38 TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {}
39 QLibrary *library; 39 QLibrary *library;
40 QInterfacePtr<TodayPluginInterface> iface; 40 QInterfacePtr<TodayPluginInterface> iface;
41 TodayPluginObject *guiPart; 41 TodayPluginObject *guiPart;
42 QWidget *guiBox; 42 QWidget *guiBox;
43 QString name; 43 QString name;
44 bool active; 44 bool active;
45 bool excludeRefresh; 45 bool excludeRefresh;
46 int pos; 46 int pos;
47}; 47};
48 48
49static QValueList<TodayPlugin> pluginList; 49static QValueList<TodayPlugin> pluginList;
50 50
51Today::Today( QWidget* parent, const char* name, WFlags fl ) 51Today::Today( QWidget* parent, const char* name, WFlags fl )
52 : TodayBase( parent, name, fl ) { 52 : TodayBase( parent, name, fl ) {
53 53
54 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); 54 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) );
55 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); 55 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) );
56 56
57#if defined(Q_WS_QWS) 57#if defined(Q_WS_QWS)
58#if !defined(QT_NO_COP) 58#if !defined(QT_NO_COP)
59 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); 59 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this );
60 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 60 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
61 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); 61 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
62#endif 62#endif
63#endif 63#endif
64 64
65 setOwnerField(); 65 setOwnerField();
66 m_refreshTimer = new QTimer( this ); 66 m_refreshTimer = new QTimer( this );
67 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 67 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
68 m_refreshTimer->start( 15000 ); 68 m_refreshTimer->start( 15000 );
69 //init(); 69 //init();
70 loadPlugins(); 70 loadPlugins();
71 showMaximized(); 71 showMaximized();
72} 72}
73 73
74/** 74/**
75 * Qcop receive method. 75 * Qcop receive method.
76 */ 76 */
77void Today::channelReceived( const QCString &msg, const QByteArray & data ) { 77void Today::channelReceived( const QCString &msg, const QByteArray & data ) {
78 QDataStream stream( data, IO_ReadOnly ); 78 QDataStream stream( data, IO_ReadOnly );
79 if ( msg == "message(QString)" ) { 79 if ( msg == "message(QString)" ) {
80 QString message; 80 QString message;
81 stream >> message; 81 stream >> message;
82 setOwnerField( message ); 82 setOwnerField( message );
83 } 83 }
84} 84}
85 85
86void Today::setRefreshTimer( int interval ) { 86void Today::setRefreshTimer( int interval ) {
87 87
88 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 88 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
89 89
90 // 0 is "never" case 90 // 0 is "never" case
91 if ( !interval == 0 ) { 91 if ( !interval == 0 ) {
92 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 92 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
93 m_refreshTimer->changeInterval( interval ); 93 m_refreshTimer->changeInterval( interval );
94 } 94 }
95} 95}
96 96
97 97
98/** 98/**
99 * Initialises the owner field with the default value, the username 99 * Initialises the owner field with the default value, the username
100 */ 100 */
101void Today::setOwnerField() { 101void Today::setOwnerField() {
102 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); 102 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" );
103 if ( QFile::exists( file ) ) { 103 if ( QFile::exists( file ) ) {
104 Contact cont = Contact::readVCard( file )[0]; 104 Contact cont = Contact::readVCard( file )[0];
105 QString returnString = cont.fullName(); 105 QString returnString = cont.fullName();
106 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); 106 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" );
107 } else { 107 } else {
108 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); 108 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" );
109 } 109 }
110} 110}
111 111
112/** 112/**
113 * Set the owner field with a given QString, for example per qcop. 113 * Set the owner field with a given QString, for example per qcop.
114 */ 114 */
115void Today::setOwnerField( QString &message ) { 115void Today::setOwnerField( QString &message ) {
116 if ( !message.isEmpty() ) { 116 if ( !message.isEmpty() ) {
117 OwnerField->setText( "<b>" + message + "</b>" ); 117 OwnerField->setText( "<b>" + message + "</b>" );
118 } 118 }
119} 119}
120 120
121/** 121/**
122 * Init stuff needed for today. Reads the config file. 122 * Init stuff needed for today. Reads the config file.
123 */ 123 */
124void Today::init() { 124void Today::init() {
125 // read config 125 // read config
126 Config cfg( "today" ); 126 Config cfg( "today" );
127 127
128 cfg.setGroup( "Plugins" ); 128 cfg.setGroup( "Plugins" );
129 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 129 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
130 m_allApplets = cfg.readListEntry( "AllApplets", ',' ); 130 m_allApplets = cfg.readListEntry( "AllApplets", ',' );
131 131
132 cfg.setGroup( "General" ); 132 cfg.setGroup( "General" );
133 m_iconSize = cfg.readNumEntry( "IconSize", 18 ); 133 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
134 m_hideBanner = cfg.readNumEntry( "HideBanner", 0 ); 134 m_hideBanner = cfg.readNumEntry( "HideBanner", 0 );
135 setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); 135 setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) );
136 136
137 // set the date in top label 137 // set the date in top label
138 QDate date = QDate::currentDate(); 138 QDate date = QDate::currentDate();
139 DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) ); 139 DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) );
140 140
141 if ( layout ) { 141 if ( layout ) {
142 delete layout; 142 delete layout;
143 } 143 }
144 144
145 if ( m_hideBanner ) { 145 if ( m_hideBanner ) {
146 Opiezilla->hide(); 146 Opiezilla->hide();
147 TodayLabel->hide(); 147 TodayLabel->hide();
148 } else { 148 } else {
149 Opiezilla->show(); 149 Opiezilla->show();
150 TodayLabel->show(); 150 TodayLabel->show();
151 } 151 }
152 152
153 layout = new QVBoxLayout( this ); 153 layout = new QVBoxLayout( this );
154 layout->addWidget( Frame ); 154 layout->addWidget( Frame );
155 layout->addWidget( OwnerField ); 155 layout->addWidget( OwnerField );
156} 156}
157 157
158/** 158/**
159 * Load the plugins 159 * Load the plugins
160 */ 160 */
161void Today::loadPlugins() { 161void Today::loadPlugins() {
162 162
163 init(); 163 init();
164 QValueList<TodayPlugin>::Iterator tit; 164 QValueList<TodayPlugin>::Iterator tit;
165 if ( !pluginList.isEmpty() ) { 165 if ( !pluginList.isEmpty() ) {
166 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { 166 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) {
167 (*tit).guiBox->hide(); 167 (*tit).guiBox->hide();
168 (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); 168 (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) );
169 delete (*tit).guiBox; 169 delete (*tit).guiBox;
170 (*tit).library->unload(); 170 (*tit).library->unload();
171 delete (*tit).library; 171 delete (*tit).library;
172 } 172 }
173 pluginList.clear(); 173 pluginList.clear();
174 } 174 }
175 175
176 QString path = QPEApplication::qpeDir() + "/plugins/today"; 176 QString path = QPEApplication::qpeDir() + "/plugins/today";
177 QDir dir( path, "lib*.so" ); 177 QDir dir( path, "lib*.so" );
178 178
179 QStringList list = dir.entryList(); 179 QStringList list = dir.entryList();
180 QStringList::Iterator it; 180 QStringList::Iterator it;
181 181
182 QMap<QString, TodayPlugin> tempList; 182 QMap<QString, TodayPlugin> tempList;
183 183
184 for ( it = list.begin(); it != list.end(); ++it ) { 184 for ( it = list.begin(); it != list.end(); ++it ) {
185 QInterfacePtr<TodayPluginInterface> iface; 185 QInterfacePtr<TodayPluginInterface> iface;
186 QLibrary *lib = new QLibrary( path + "/" + *it ); 186 QLibrary *lib = new QLibrary( path + "/" + *it );
187 187
188 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); 188 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() );
189 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { 189 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
190 qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); 190 qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() );
191 qDebug( QString(*it) ); 191 qDebug( QString(*it) );
192 192
193 TodayPlugin plugin; 193 TodayPlugin plugin;
194 plugin.library = lib; 194 plugin.library = lib;
195 plugin.iface = iface; 195 plugin.iface = iface;
196 plugin.name = QString(*it); 196 plugin.name = QString(*it);
197 197
198 QString type = (*it).left( (*it).find(".") ); 198 QString type = (*it).left( (*it).find(".") );
199 QStringList langs = Global::languageList(); 199
200 // grr, sharp rom does not know Global::languageList();
201 // QStringList langs = Global::languageList();
202 QString tfn = QPEApplication::qpeDir() + "/i18n/";
203 QDir langDir = tfn;
204 QStringList langs = langDir.entryList("*", QDir::Dirs );
205
200 for (QStringList::ConstIterator lit = langs.begin(); lit!=langs.end(); ++lit) { 206 for (QStringList::ConstIterator lit = langs.begin(); lit!=langs.end(); ++lit) {
201 QString lang = *lit; 207 QString lang = *lit;
202 qDebug( "Languages: " + lang ); 208 qDebug( "Languages: " + lang );
203 QTranslator * trans = new QTranslator( qApp ); 209 QTranslator * trans = new QTranslator( qApp );
204 QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm"; 210 QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm";
205 if ( trans->load( tfn ) ) { 211 if ( trans->load( tfn ) ) {
206 qApp->installTranslator( trans ); 212 qApp->installTranslator( trans );
207 } else { 213 } else {
208 delete trans; 214 delete trans;
209 } 215 }
210 } 216 }
211 217
212 // find out if plugins should be shown 218 // find out if plugins should be shown
213 if ( m_excludeApplets.grep( *it ).isEmpty() ) { 219 if ( m_excludeApplets.grep( *it ).isEmpty() ) {
214 plugin.active = true; 220 plugin.active = true;
215 } else { 221 } else {
216 plugin.active = false; 222 plugin.active = false;
217 } 223 }
218 224
219 plugin.guiPart = plugin.iface->guiPart(); 225 plugin.guiPart = plugin.iface->guiPart();
220 plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); 226 plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh();
221 227
222 // package the whole thing into a qwidget so it can be shown and hidden 228 // package the whole thing into a qwidget so it can be shown and hidden
223 plugin.guiBox = new QWidget( this ); 229 plugin.guiBox = new QWidget( this );
224 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); 230 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox );
225 QPixmap plugPix; 231 QPixmap plugPix;
226 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 ); 232 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 );
227 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); 233 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox );
228 plugIcon->setPixmap( plugPix ); 234 plugIcon->setPixmap( plugPix );
229 QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") ); 235 QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") );
230 plugIcon->setName( plugin.guiPart->appName() ); 236 plugIcon->setName( plugin.guiPart->appName() );
231 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) ); 237 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) );
232 // a scrollview for each plugin 238 // a scrollview for each plugin
233 QScrollView* sv = new QScrollView( plugin.guiBox ); 239 QScrollView* sv = new QScrollView( plugin.guiBox );
234 QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); 240 QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() );
235 // not sure if that is good .-) 241 // not sure if that is good .-)
236 sv->setMinimumHeight( 12 ); 242 sv->setMinimumHeight( 12 );
237 sv->setResizePolicy( QScrollView::AutoOneFit ); 243 sv->setResizePolicy( QScrollView::AutoOneFit );
238 sv->setHScrollBarMode( QScrollView::AlwaysOff ); 244 sv->setHScrollBarMode( QScrollView::AlwaysOff );
239 sv->setFrameShape( QFrame::NoFrame ); 245 sv->setFrameShape( QFrame::NoFrame );
240 sv->addChild( plugWidget ); 246 sv->addChild( plugWidget );
241 // make sure the icon is on the top alligned 247 // make sure the icon is on the top alligned
242 boxLayout->addWidget( plugIcon, 0, AlignTop ); 248 boxLayout->addWidget( plugIcon, 0, AlignTop );
243 boxLayout->addWidget( sv, 0, AlignTop ); 249 boxLayout->addWidget( sv, 0, AlignTop );
244 boxLayout->setStretchFactor( plugIcon, 1 ); 250 boxLayout->setStretchFactor( plugIcon, 1 );
245 boxLayout->setStretchFactor( sv, 9 ); 251 boxLayout->setStretchFactor( sv, 9 );
246 // "prebuffer" it in one more list, to get the sorting done 252 // "prebuffer" it in one more list, to get the sorting done
247 tempList.insert( plugin.name, plugin ); 253 tempList.insert( plugin.name, plugin );
248 254
249 // on first start the list is off course empty 255 // on first start the list is off course empty
250 if ( m_allApplets.isEmpty() ) { 256 if ( m_allApplets.isEmpty() ) {
251 layout->addWidget( plugin.guiBox ); 257 layout->addWidget( plugin.guiBox );
252 pluginList.append( plugin ); 258 pluginList.append( plugin );
253 } 259 }
254 260
255 // if plugin is not yet in the list, add it to the layout too 261 // if plugin is not yet in the list, add it to the layout too
256 else if ( !m_allApplets.contains( plugin.name ) ) { 262 else if ( !m_allApplets.contains( plugin.name ) ) {
257 layout->addWidget( plugin.guiBox ); 263 layout->addWidget( plugin.guiBox );
258 pluginList.append( plugin ); 264 pluginList.append( plugin );
259 } 265 }
260 } else { 266 } else {
261 qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); 267 qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() );
262 delete lib; 268 delete lib;
263 } 269 }
264 } 270 }
265 271
266 if ( !m_allApplets.isEmpty() ) { 272 if ( !m_allApplets.isEmpty() ) {
267 TodayPlugin tempPlugin; 273 TodayPlugin tempPlugin;
268 QStringList::Iterator stringit; 274 QStringList::Iterator stringit;
269 275
270 for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { 276 for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) {
271 tempPlugin = ( tempList.find( *stringit ) ).data(); 277 tempPlugin = ( tempList.find( *stringit ) ).data();
272 if ( !( (tempPlugin.name).isEmpty() ) ) { 278 if ( !( (tempPlugin.name).isEmpty() ) ) {
273 layout->addWidget( tempPlugin.guiBox ); 279 layout->addWidget( tempPlugin.guiBox );
274 pluginList.append( tempPlugin ); 280 pluginList.append( tempPlugin );
275 } 281 }
276 } 282 }
277 } 283 }
278 draw(); 284 draw();
279} 285}
280 286
281 287
282/** 288/**
283 * Repaint method. Reread all fields. 289 * Repaint method. Reread all fields.
284 */ 290 */
285void Today::draw() { 291void Today::draw() {
286 292
287 if ( pluginList.count() == 0 ) { 293 if ( pluginList.count() == 0 ) {
288 QLabel *noPlugins = new QLabel( this ); 294 QLabel *noPlugins = new QLabel( this );
289 noPlugins->setText( tr( "No plugins found" ) ); 295 noPlugins->setText( tr( "No plugins found" ) );
290 layout->addWidget( noPlugins ); 296 layout->addWidget( noPlugins );
291 return; 297 return;
292 } 298 }
293 299
294 uint count = 0; 300 uint count = 0;
295 TodayPlugin plugin; 301 TodayPlugin plugin;
296 for ( uint i = 0; i < pluginList.count(); i++ ) { 302 for ( uint i = 0; i < pluginList.count(); i++ ) {
297 plugin = pluginList[i]; 303 plugin = pluginList[i];
298 304
299 if ( plugin.active ) { 305 if ( plugin.active ) {
300 // qDebug( plugin.name + " is ACTIVE " ); 306 // qDebug( plugin.name + " is ACTIVE " );
301 plugin.guiBox->show(); 307 plugin.guiBox->show();
302 } else { 308 } else {
303 // qDebug( plugin.name + " is INACTIVE" ); 309 // qDebug( plugin.name + " is INACTIVE" );
304 plugin.guiBox->hide(); 310 plugin.guiBox->hide();
305 } 311 }
306 count++; 312 count++;
307 } 313 }
308 314
309 if ( count == 0 ) { 315 if ( count == 0 ) {
310 QLabel *noPluginsActive = new QLabel( this ); 316 QLabel *noPluginsActive = new QLabel( this );
311 noPluginsActive->setText( tr( "No plugins activated" ) ); 317 noPluginsActive->setText( tr( "No plugins activated" ) );
312 layout->addWidget( noPluginsActive ); 318 layout->addWidget( noPluginsActive );
313 } 319 }
314 layout->addStretch(0); 320 layout->addStretch(0);
315} 321}
316 322
317 323
318/** 324/**
319 * The method for the configuration dialog. 325 * The method for the configuration dialog.
320 */ 326 */
321void Today::startConfig() { 327void Today::startConfig() {
322 328
323 // disconnect timer to prevent problems while being on config dialog 329 // disconnect timer to prevent problems while being on config dialog
324 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 330 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
325 m_refreshTimer->stop( ); 331 m_refreshTimer->stop( );
326 332
327 TodayConfig conf( this, "dialog", true ); 333 TodayConfig conf( this, "dialog", true );
328 334
329 TodayPlugin plugin; 335 TodayPlugin plugin;
330 QList<TodayConfigWidget> configWidgetList; 336 QList<TodayConfigWidget> configWidgetList;
331 337
332 for ( int i = pluginList.count() - 1; i >= 0; i-- ) { 338 for ( int i = pluginList.count() - 1; i >= 0; i-- ) {
333 plugin = pluginList[i]; 339 plugin = pluginList[i];
334 340
335 // load the config widgets in the tabs 341 // load the config widgets in the tabs
336 if ( plugin.guiPart->configWidget( this ) != 0l ) { 342 if ( plugin.guiPart->configWidget( this ) != 0l ) {
337 TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); 343 TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 );
338 configWidgetList.append( widget ); 344 configWidgetList.append( widget );
339 conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() 345 conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig()
340 , plugin.guiPart->appName() ); 346 , plugin.guiPart->appName() );
341 } 347 }
342 // set the order/activate tab 348 // set the order/activate tab
343 conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), 349 conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(),
344 Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); 350 Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) );
345 } 351 }
346 352
347 if ( conf.exec() == QDialog::Accepted ) { 353 if ( conf.exec() == QDialog::Accepted ) {
348 conf.writeConfig(); 354 conf.writeConfig();
349 TodayConfigWidget *confWidget; 355 TodayConfigWidget *confWidget;
350 for ( confWidget = configWidgetList.first(); confWidget != 0; 356 for ( confWidget = configWidgetList.first(); confWidget != 0;
351 confWidget = configWidgetList.next() ) { 357 confWidget = configWidgetList.next() ) {
352 confWidget->writeConfig(); 358 confWidget->writeConfig();
353 } 359 }
354 loadPlugins(); 360 loadPlugins();
355 } else { 361 } else {
356 // since refresh is not called in that case , reconnect the signal 362 // since refresh is not called in that case , reconnect the signal
357 m_refreshTimer->start( 15000 ); // get the config value in here later 363 m_refreshTimer->start( 15000 ); // get the config value in here later
358 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 364 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
359 } 365 }
360} 366}
361 367
362 368
363/** 369/**
364 * Refresh for the view. Reload all applets 370 * Refresh for the view. Reload all applets
365 * 371 *
366 */ 372 */
367void Today::refresh() { 373void Today::refresh() {
368 374
369 init(); 375 init();
370 376
371 QValueList<TodayPlugin>::Iterator it; 377 QValueList<TodayPlugin>::Iterator it;
372 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { 378 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) {
373 if ( !(*it).excludeRefresh ) { 379 if ( !(*it).excludeRefresh ) {
374 (*it).guiPart->refresh(); 380 (*it).guiPart->refresh();
375 layout->addWidget( (*it).guiBox ); 381 layout->addWidget( (*it).guiBox );
376 qDebug( "refresh" ); 382 qDebug( "refresh" );
377 } 383 }
378 } 384 }
379 layout->addStretch(0); 385 layout->addStretch(0);
380} 386}
381 387
382void Today::startApplication() { 388void Today::startApplication() {
383 QCopEnvelope e( "QPE/System", "execute(QString)" ); 389 QCopEnvelope e( "QPE/System", "execute(QString)" );
384 e << QString( sender()->name() ); 390 e << QString( sender()->name() );
385} 391}
386 392
387/** 393/**
388 * launch addressbook (personal card) 394 * launch addressbook (personal card)
389 */ 395 */
390void Today::editCard() { 396void Today::editCard() {
391 QCopEnvelope env( "QPE/Application/addressbook", "editPersonalAndClose()" ); 397 QCopEnvelope env( "QPE/Application/addressbook", "editPersonalAndClose()" );