author | harlekin <harlekin> | 2003-02-11 21:26:39 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-02-11 21:26:39 (UTC) |
commit | 39f9441dabcb094be258240f7ec3c53ed038133e (patch) (unidiff) | |
tree | 7d6e7f49ce18c6c3723cbc59358c58a252011133 | |
parent | af398bd4c280e7c27754b409851fbe8189d08819 (diff) | |
download | opie-39f9441dabcb094be258240f7ec3c53ed038133e.zip opie-39f9441dabcb094be258240f7ec3c53ed038133e.tar.gz opie-39f9441dabcb094be258240f7ec3c53ed038133e.tar.bz2 |
now when coming back from the config dialog ALL plugins get restarted
-rw-r--r-- | core/pim/today/today.cpp | 145 | ||||
-rw-r--r-- | core/pim/today/today.h | 2 |
2 files changed, 61 insertions, 86 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 1f758f2..2f6907d 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -1,28 +1,28 @@ | |||
1 | /* | 1 | /* |
2 | * today.cpp | 2 | * today.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002,2003 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
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 | #include "today.h" | 18 | #include "today.h" |
19 | #include <opie/todayconfigwidget.h> | 19 | #include <opie/todayconfigwidget.h> |
20 | 20 | ||
21 | #include <qpe/config.h> | 21 | #include <qpe/config.h> |
22 | #include <qpe/qcopenvelope_qws.h> | 22 | #include <qpe/qcopenvelope_qws.h> |
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/global.h> | 24 | #include <qpe/global.h> |
25 | #include <qpe/qpeapplication.h> | 25 | #include <qpe/qpeapplication.h> |
26 | #include <qpe/contact.h> | 26 | #include <qpe/contact.h> |
27 | 27 | ||
28 | #include <qdir.h> | 28 | #include <qdir.h> |
@@ -49,49 +49,49 @@ struct TodayPlugin { | |||
49 | bool excludeRefresh; | 49 | bool excludeRefresh; |
50 | int pos; | 50 | int pos; |
51 | }; | 51 | }; |
52 | 52 | ||
53 | static QValueList<TodayPlugin> pluginList; | 53 | static QValueList<TodayPlugin> pluginList; |
54 | 54 | ||
55 | Today::Today( QWidget* parent, const char* name, WFlags fl ) | 55 | Today::Today( QWidget* parent, const char* name, WFlags fl ) |
56 | : TodayBase( parent, name, fl ) { | 56 | : TodayBase( parent, name, fl ) { |
57 | 57 | ||
58 | QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); | 58 | QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); |
59 | QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); | 59 | QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); |
60 | 60 | ||
61 | #if defined(Q_WS_QWS) | 61 | #if defined(Q_WS_QWS) |
62 | #if !defined(QT_NO_COP) | 62 | #if !defined(QT_NO_COP) |
63 | QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); | 63 | QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); |
64 | connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), | 64 | connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), |
65 | this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); | 65 | this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); |
66 | #endif | 66 | #endif |
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | setOwnerField(); | 69 | setOwnerField(); |
70 | m_refreshTimer = new QTimer( this ); | 70 | m_refreshTimer = new QTimer( this ); |
71 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 71 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
72 | m_refreshTimer->start( 15000 ); | 72 | m_refreshTimer->start( 15000 ); |
73 | init(); | 73 | //init(); |
74 | loadPlugins(); | 74 | loadPlugins(); |
75 | showMaximized(); | 75 | showMaximized(); |
76 | } | 76 | } |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * Qcop receive method. | 79 | * Qcop receive method. |
80 | */ | 80 | */ |
81 | void Today::channelReceived( const QCString &msg, const QByteArray & data ) { | 81 | void Today::channelReceived( const QCString &msg, const QByteArray & data ) { |
82 | QDataStream stream( data, IO_ReadOnly ); | 82 | QDataStream stream( data, IO_ReadOnly ); |
83 | if ( msg == "message(QString)" ) { | 83 | if ( msg == "message(QString)" ) { |
84 | QString message; | 84 | QString message; |
85 | stream >> message; | 85 | stream >> message; |
86 | setOwnerField( message ); | 86 | setOwnerField( message ); |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | void Today::setRefreshTimer( int interval ) { | 90 | void Today::setRefreshTimer( int interval ) { |
91 | 91 | ||
92 | disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 92 | disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
93 | 93 | ||
94 | // 0 is "never" case | 94 | // 0 is "never" case |
95 | if ( !interval == 0 ) { | 95 | if ( !interval == 0 ) { |
96 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 96 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
97 | m_refreshTimer->changeInterval( interval ); | 97 | m_refreshTimer->changeInterval( interval ); |
@@ -101,189 +101,163 @@ void Today::setRefreshTimer( int interval ) { | |||
101 | 101 | ||
102 | /** | 102 | /** |
103 | * Initialises the owner field with the default value, the username | 103 | * Initialises the owner field with the default value, the username |
104 | */ | 104 | */ |
105 | void Today::setOwnerField() { | 105 | void Today::setOwnerField() { |
106 | QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); | 106 | QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); |
107 | if ( QFile::exists( file ) ) { | 107 | if ( QFile::exists( file ) ) { |
108 | Contact cont = Contact::readVCard( file )[0]; | 108 | Contact cont = Contact::readVCard( file )[0]; |
109 | QString returnString = cont.fullName(); | 109 | QString returnString = cont.fullName(); |
110 | OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); | 110 | OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); |
111 | } else { | 111 | } else { |
112 | OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); | 112 | OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | /** | 116 | /** |
117 | * Set the owner field with a given QString, for example per qcop. | 117 | * Set the owner field with a given QString, for example per qcop. |
118 | */ | 118 | */ |
119 | void Today::setOwnerField( QString &message ) { | 119 | void Today::setOwnerField( QString &message ) { |
120 | if ( !message.isEmpty() ) { | 120 | if ( !message.isEmpty() ) { |
121 | OwnerField->setText( "<b>" + message + "</b>" ); | 121 | OwnerField->setText( "<b>" + message + "</b>" ); |
122 | } | 122 | } |
123 | } | 123 | } |
124 | 124 | ||
125 | |||
126 | /** | 125 | /** |
127 | * Init stuff needed for today. Reads the config file. | 126 | * Init stuff needed for today. Reads the config file. |
128 | */ | 127 | */ |
129 | void Today::init() { | 128 | void Today::init() { |
130 | // read config | 129 | // read config |
131 | Config cfg( "today" ); | 130 | Config cfg( "today" ); |
132 | 131 | ||
133 | cfg.setGroup( "Plugins" ); | 132 | cfg.setGroup( "Plugins" ); |
134 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); | 133 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); |
135 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); | 134 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); |
136 | 135 | ||
137 | cfg.setGroup( "General" ); | 136 | cfg.setGroup( "General" ); |
138 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); | 137 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); |
139 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); | 138 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); |
140 | 139 | ||
141 | |||
142 | // qDebug(" refresh "); | ||
143 | // set the date in top label | 140 | // set the date in top label |
144 | QDate date = QDate::currentDate(); | 141 | QDate date = QDate::currentDate(); |
145 | QString time = ( tr( date.toString() ) ); | 142 | QString time = ( tr( date.toString() ) ); |
146 | |||
147 | DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); | 143 | DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); |
148 | 144 | ||
149 | if ( layout ) { | 145 | if ( layout ) { |
150 | delete layout; | 146 | delete layout; |
151 | } | 147 | } |
152 | layout = new QVBoxLayout( this ); | 148 | layout = new QVBoxLayout( this ); |
153 | layout->addWidget( Frame ); | 149 | layout->addWidget( Frame ); |
154 | layout->addWidget( OwnerField ); | 150 | layout->addWidget( OwnerField ); |
155 | } | 151 | } |
156 | 152 | ||
157 | |||
158 | /** | 153 | /** |
159 | * Load the plugins | 154 | * Load the plugins |
160 | */ | 155 | */ |
161 | void Today::loadPlugins() { | 156 | void Today::loadPlugins() { |
162 | 157 | ||
163 | // extra list for plugins that exclude themself from periodic refresh | 158 | init(); |
164 | QMap<QString, TodayPlugin> pluginListRefreshExclude; | ||
165 | |||
166 | QValueList<TodayPlugin>::Iterator tit; | 159 | QValueList<TodayPlugin>::Iterator tit; |
167 | if ( !pluginList.isEmpty() ) { | 160 | if ( !pluginList.isEmpty() ) { |
168 | for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { | 161 | for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { |
169 | if ( (*tit).excludeRefresh ) { | 162 | (*tit).guiBox->hide(); |
170 | pluginListRefreshExclude.insert( (*tit).name , (*tit) ); | 163 | (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); |
171 | qDebug( "Found a plugin that does not want refresh feature" ); | 164 | (*tit).library->unload(); |
172 | } else { | 165 | delete (*tit).guiBox; |
173 | (*tit).guiBox->hide(); | 166 | delete (*tit).library; |
174 | (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); | ||
175 | (*tit).library->unload(); | ||
176 | delete (*tit).guiBox; | ||
177 | delete (*tit).library; | ||
178 | } | ||
179 | } | 167 | } |
180 | pluginList.clear(); | 168 | pluginList.clear(); |
181 | } | 169 | } |
182 | 170 | ||
183 | QString path = QPEApplication::qpeDir() + "/plugins/today"; | 171 | QString path = QPEApplication::qpeDir() + "/plugins/today"; |
184 | QDir dir( path, "lib*.so" ); | 172 | QDir dir( path, "lib*.so" ); |
185 | 173 | ||
186 | QStringList list = dir.entryList(); | 174 | QStringList list = dir.entryList(); |
187 | QStringList::Iterator it; | 175 | QStringList::Iterator it; |
188 | 176 | ||
189 | QMap<QString, TodayPlugin> tempList; | 177 | QMap<QString, TodayPlugin> tempList; |
190 | 178 | ||
191 | for ( it = list.begin(); it != list.end(); ++it ) { | 179 | for ( it = list.begin(); it != list.end(); ++it ) { |
192 | //TodayPluginInterface *iface = 0; | ||
193 | QInterfacePtr<TodayPluginInterface> iface; | 180 | QInterfacePtr<TodayPluginInterface> iface; |
194 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 181 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
195 | 182 | ||
196 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); | 183 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); |
197 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | 184 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { |
198 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); | 185 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); |
199 | qDebug( QString(*it) ); | 186 | qDebug( QString(*it) ); |
200 | 187 | ||
201 | // If plugin is exludes from refresh, get it in the list again here. | 188 | TodayPlugin plugin; |
189 | plugin.library = lib; | ||
190 | plugin.iface = iface; | ||
191 | plugin.name = QString(*it); | ||
202 | 192 | ||
203 | if ( pluginListRefreshExclude.contains( (*it) ) ) { | 193 | // find out if plugins should be shown |
204 | // if its not in allApplets list, add it to a layout | 194 | if ( m_excludeApplets.grep( *it ).isEmpty() ) { |
205 | if ( !m_allApplets.contains( pluginListRefreshExclude[(*it)].name ) ) { | 195 | plugin.active = true; |
206 | layout->addWidget( pluginListRefreshExclude[(*it)].guiBox ); | ||
207 | pluginList.append( pluginListRefreshExclude[(*it)] ); | ||
208 | } else { | ||
209 | tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] ); | ||
210 | } | ||
211 | } else { | 196 | } else { |
197 | plugin.active = false; | ||
198 | } | ||
212 | 199 | ||
213 | TodayPlugin plugin; | 200 | plugin.guiPart = plugin.iface->guiPart(); |
214 | plugin.library = lib; | 201 | plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); |
215 | plugin.iface = iface; | 202 | |
216 | plugin.name = QString(*it); | 203 | // package the whole thing into a qwidget so it can be shown and hidden |
217 | 204 | plugin.guiBox = new QWidget( this ); | |
218 | // find out if plugins should be shown | 205 | QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); |
219 | if ( m_excludeApplets.grep( *it ).isEmpty() ) { | 206 | QPixmap plugPix; |
220 | plugin.active = true; | 207 | plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 ); |
221 | } else { | 208 | OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); |
222 | plugin.active = false; | 209 | plugIcon->setPixmap( plugPix ); |
223 | } | 210 | QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") ); |
224 | 211 | plugIcon->setName( plugin.guiPart->appName() ); | |
225 | plugin.guiPart = plugin.iface->guiPart(); | 212 | connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) ); |
226 | plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); | 213 | // a scrollview for each plugin |
227 | 214 | QScrollView* sv = new QScrollView( plugin.guiBox ); | |
228 | // package the whole thing into a qwidget so it can be shown and hidden | 215 | QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); |
229 | plugin.guiBox = new QWidget( this ); | 216 | // not sure if that is good .-) |
230 | QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); | 217 | sv->setMinimumHeight( 12 ); |
231 | QPixmap plugPix; | 218 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
232 | plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 ); | 219 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); |
233 | OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); | 220 | sv->setFrameShape( QFrame::NoFrame ); |
234 | plugIcon->setPixmap( plugPix ); | 221 | sv->addChild( plugWidget ); |
235 | QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") ); | 222 | // make sure the icon is on the top alligned |
236 | plugIcon->setName( plugin.guiPart->appName() ); | 223 | boxLayout->addWidget( plugIcon, 0, AlignTop ); |
237 | connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) ); | 224 | boxLayout->addWidget( sv, 0, AlignTop ); |
238 | // a scrollview for each plugin | 225 | boxLayout->setStretchFactor( plugIcon, 1 ); |
239 | QScrollView* sv = new QScrollView( plugin.guiBox ); | 226 | boxLayout->setStretchFactor( sv, 9 ); |
240 | QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); | 227 | // "prebuffer" it in one more list, to get the sorting done |
241 | // not sure if that is good .-) | 228 | tempList.insert( plugin.name, plugin ); |
242 | sv->setMinimumHeight( 10 ); | 229 | |
243 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 230 | // on first start the list is off course empty |
244 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); | 231 | if ( m_allApplets.isEmpty() ) { |
245 | sv->setFrameShape( QFrame::NoFrame ); | 232 | layout->addWidget( plugin.guiBox ); |
246 | sv->addChild( plugWidget ); | 233 | pluginList.append( plugin ); |
247 | // make sure the icon is on the top alligned | 234 | } |
248 | boxLayout->addWidget( plugIcon, 0, AlignTop ); | 235 | |
249 | boxLayout->addWidget( sv, 0, AlignTop ); | 236 | // if plugin is not yet in the list, add it to the layout too |
250 | boxLayout->setStretchFactor( plugIcon, 1 ); | 237 | else if ( !m_allApplets.contains( plugin.name ) ) { |
251 | boxLayout->setStretchFactor( sv, 9 ); | 238 | layout->addWidget( plugin.guiBox ); |
252 | // "prebuffer" it in one more list, to get the sorting done | 239 | pluginList.append( plugin ); |
253 | tempList.insert( plugin.name, plugin ); | ||
254 | |||
255 | // on first start the list is off course empty | ||
256 | if ( m_allApplets.isEmpty() ) { | ||
257 | layout->addWidget( plugin.guiBox ); | ||
258 | pluginList.append( plugin ); | ||
259 | } | ||
260 | |||
261 | // if plugin is not yet in the list, add it to the layout too | ||
262 | else if ( !m_allApplets.contains( plugin.name ) ) { | ||
263 | layout->addWidget( plugin.guiBox ); | ||
264 | pluginList.append( plugin ); | ||
265 | } | ||
266 | } | 240 | } |
267 | } else { | 241 | } else { |
268 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); | 242 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); |
269 | delete lib; | 243 | delete lib; |
270 | } | 244 | } |
271 | } | 245 | } |
272 | 246 | ||
273 | if ( !m_allApplets.isEmpty() ) { | 247 | if ( !m_allApplets.isEmpty() ) { |
274 | TodayPlugin tempPlugin; | 248 | TodayPlugin tempPlugin; |
275 | QStringList::Iterator stringit; | 249 | QStringList::Iterator stringit; |
276 | 250 | ||
277 | for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { | 251 | for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { |
278 | tempPlugin = ( tempList.find( *stringit ) ).data(); | 252 | tempPlugin = ( tempList.find( *stringit ) ).data(); |
279 | if ( !( (tempPlugin.name).isEmpty() ) ) { | 253 | if ( !( (tempPlugin.name).isEmpty() ) ) { |
280 | layout->addWidget( tempPlugin.guiBox ); | 254 | layout->addWidget( tempPlugin.guiBox ); |
281 | pluginList.append( tempPlugin ); | 255 | pluginList.append( tempPlugin ); |
282 | } | 256 | } |
283 | } | 257 | } |
284 | } | 258 | } |
285 | draw(); | 259 | draw(); |
286 | } | 260 | } |
287 | 261 | ||
288 | 262 | ||
289 | /** | 263 | /** |
@@ -349,50 +323,51 @@ void Today::startConfig() { | |||
349 | conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), | 323 | conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), |
350 | Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); | 324 | Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); |
351 | } | 325 | } |
352 | 326 | ||
353 | if ( conf.exec() == QDialog::Accepted ) { | 327 | if ( conf.exec() == QDialog::Accepted ) { |
354 | conf.writeConfig(); | 328 | conf.writeConfig(); |
355 | TodayConfigWidget *confWidget; | 329 | TodayConfigWidget *confWidget; |
356 | for ( confWidget = configWidgetList.first(); confWidget != 0; | 330 | for ( confWidget = configWidgetList.first(); confWidget != 0; |
357 | confWidget = configWidgetList.next() ) { | 331 | confWidget = configWidgetList.next() ) { |
358 | confWidget->writeConfig(); | 332 | confWidget->writeConfig(); |
359 | } | 333 | } |
360 | loadPlugins(); | 334 | loadPlugins(); |
361 | } else { | 335 | } else { |
362 | // since refresh is not called in that case , reconnect the signal | 336 | // since refresh is not called in that case , reconnect the signal |
363 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 337 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
364 | } | 338 | } |
365 | } | 339 | } |
366 | 340 | ||
367 | 341 | ||
368 | /** | 342 | /** |
369 | * Refresh for the view. Reload all applets | 343 | * Refresh for the view. Reload all applets |
370 | * | 344 | * |
371 | */ | 345 | */ |
372 | void Today::refresh() { | 346 | void Today::refresh() { |
347 | |||
373 | init(); | 348 | init(); |
374 | 349 | ||
375 | QValueList<TodayPlugin>::Iterator it; | 350 | QValueList<TodayPlugin>::Iterator it; |
376 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { | 351 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { |
377 | if ( !(*it).excludeRefresh ) { | 352 | if ( !(*it).excludeRefresh ) { |
378 | (*it).guiPart->refresh(); | 353 | (*it).guiPart->refresh(); |
379 | qDebug( "refresh" ); | 354 | qDebug( "refresh" ); |
380 | } | 355 | } |
381 | } | 356 | } |
382 | } | 357 | } |
383 | 358 | ||
384 | void Today::startApplication() { | 359 | void Today::startApplication() { |
385 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 360 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
386 | e << QString( sender()->name() ); | 361 | e << QString( sender()->name() ); |
387 | } | 362 | } |
388 | 363 | ||
389 | /** | 364 | /** |
390 | * launch addressbook (personal card) | 365 | * launch addressbook (personal card) |
391 | */ | 366 | */ |
392 | void Today::editCard() { | 367 | void Today::editCard() { |
393 | QCopEnvelope env( "QPE/Application/addressbook", "editPersonalAndClose()" ); | 368 | QCopEnvelope env( "QPE/Application/addressbook", "editPersonalAndClose()" ); |
394 | } | 369 | } |
395 | 370 | ||
396 | Today::~Today() { | 371 | Today::~Today() { |
397 | } | 372 | } |
398 | 373 | ||
diff --git a/core/pim/today/today.h b/core/pim/today/today.h index 35b7ee3..24f5611 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h | |||
@@ -1,28 +1,28 @@ | |||
1 | /* | 1 | /* |
2 | * today.h | 2 | * today.h |
3 | * | 3 | * |
4 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002,2003 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
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 | #ifndef TODAY_H | 18 | #ifndef TODAY_H |
19 | #define TODAY_H | 19 | #define TODAY_H |
20 | 20 | ||
21 | #include <opie/tododb.h> | 21 | #include <opie/tododb.h> |
22 | 22 | ||
23 | #include <qdatetime.h> | 23 | #include <qdatetime.h> |
24 | #include <qlist.h> | 24 | #include <qlist.h> |
25 | #include <qhbox.h> | 25 | #include <qhbox.h> |
26 | 26 | ||
27 | #include <qpe/qlibrary.h> | 27 | #include <qpe/qlibrary.h> |
28 | #include <qpe/event.h> | 28 | #include <qpe/event.h> |