author | harlekin <harlekin> | 2002-09-17 09:40:51 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-09-17 09:40:51 (UTC) |
commit | 92b88813ad8d6352fbf74964fc56dfc1a2aada8c (patch) (unidiff) | |
tree | 2a9681d21cc354e66d5fd823018f45d9ac9a32d9 | |
parent | 03abe825f26678c34142e14f93cabd8f097d5bea (diff) | |
download | opie-92b88813ad8d6352fbf74964fc56dfc1a2aada8c.zip opie-92b88813ad8d6352fbf74964fc56dfc1a2aada8c.tar.gz opie-92b88813ad8d6352fbf74964fc56dfc1a2aada8c.tar.bz2 |
only start config dialog once
-rw-r--r-- | core/pim/today/today.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index d78b5b5..066a5a8 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -197,122 +197,121 @@ void Today::loadPlugins() { | |||
197 | 197 | ||
198 | /** | 198 | /** |
199 | * Repaint method. Reread all fields. | 199 | * Repaint method. Reread all fields. |
200 | */ | 200 | */ |
201 | void Today::draw() { | 201 | void Today::draw() { |
202 | 202 | ||
203 | if ( pluginList.count() == 0 ) { | 203 | if ( pluginList.count() == 0 ) { |
204 | QLabel *noPlugins = new QLabel( this ); | 204 | QLabel *noPlugins = new QLabel( this ); |
205 | noPlugins->setText( tr( "No plugins found" ) ); | 205 | noPlugins->setText( tr( "No plugins found" ) ); |
206 | layout->addWidget( noPlugins ); | 206 | layout->addWidget( noPlugins ); |
207 | return; | 207 | return; |
208 | } | 208 | } |
209 | 209 | ||
210 | uint count = 0; | 210 | uint count = 0; |
211 | TodayPlugin plugin; | 211 | TodayPlugin plugin; |
212 | for ( uint i = 0; i < pluginList.count(); i++ ) { | 212 | for ( uint i = 0; i < pluginList.count(); i++ ) { |
213 | plugin = pluginList[i]; | 213 | plugin = pluginList[i]; |
214 | 214 | ||
215 | if ( plugin.active ) { | 215 | if ( plugin.active ) { |
216 | qDebug( plugin.name + " is ACTIVE " ); | 216 | qDebug( plugin.name + " is ACTIVE " ); |
217 | // QHBoxLayout* plugLayout = new QHBoxLayout( this ); | 217 | // QHBoxLayout* plugLayout = new QHBoxLayout( this ); |
218 | plugin.guiBox->show(); | 218 | plugin.guiBox->show(); |
219 | } else { | 219 | } else { |
220 | // plugin.guiWidget->hide(); | 220 | // plugin.guiWidget->hide(); |
221 | qDebug( plugin.name + " is INACTIVE" ); | 221 | qDebug( plugin.name + " is INACTIVE" ); |
222 | plugin.guiBox->hide(); | 222 | plugin.guiBox->hide(); |
223 | } | 223 | } |
224 | count++; | 224 | count++; |
225 | } | 225 | } |
226 | 226 | ||
227 | if ( count == 0 ) { | 227 | if ( count == 0 ) { |
228 | QLabel *noPluginsActive = new QLabel( this ); | 228 | QLabel *noPluginsActive = new QLabel( this ); |
229 | noPluginsActive->setText( tr( "No plugins activated" ) ); | 229 | noPluginsActive->setText( tr( "No plugins activated" ) ); |
230 | layout->addWidget( noPluginsActive ); | 230 | layout->addWidget( noPluginsActive ); |
231 | } | 231 | } |
232 | 232 | ||
233 | layout->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); | 233 | layout->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); |
234 | } | 234 | } |
235 | 235 | ||
236 | 236 | ||
237 | /** | 237 | /** |
238 | * The method for the configuration dialog. | 238 | * The method for the configuration dialog. |
239 | */ | 239 | */ |
240 | void Today::startConfig() { | 240 | void Today::startConfig() { |
241 | 241 | ||
242 | TodayConfig conf( this, "dialog", true ); | 242 | TodayConfig conf( this, "dialog", true ); |
243 | 243 | ||
244 | TodayPlugin plugin; | 244 | TodayPlugin plugin; |
245 | 245 | ||
246 | QList<ConfigWidget> configWidgetList; | 246 | QList<ConfigWidget> configWidgetList; |
247 | for ( uint i = 0; i < pluginList.count(); i++ ) { | 247 | for ( uint i = 0; i < pluginList.count(); i++ ) { |
248 | plugin = pluginList[i]; | 248 | plugin = pluginList[i]; |
249 | 249 | ||
250 | // load the config widgets in the tabs | 250 | // load the config widgets in the tabs |
251 | if ( plugin.guiPart->configWidget( this ) != 0l ) { | 251 | if ( plugin.guiPart->configWidget( this ) != 0l ) { |
252 | ConfigWidget* widget = plugin.guiPart->configWidget( this ); | 252 | ConfigWidget* widget = plugin.guiPart->configWidget( this ); |
253 | configWidgetList.append( widget ); | 253 | configWidgetList.append( widget ); |
254 | conf.TabWidget3->insertTab( widget, plugin.guiPart->appName() ); | 254 | conf.TabWidget3->insertTab( widget, plugin.guiPart->appName() ); |
255 | } | 255 | } |
256 | // set the order/activate tab | 256 | // set the order/activate tab |
257 | conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), | 257 | conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), |
258 | Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); | 258 | Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); |
259 | } | 259 | } |
260 | 260 | ||
261 | conf.exec(); | ||
262 | if ( conf.exec() == QDialog::Accepted ) { | 261 | if ( conf.exec() == QDialog::Accepted ) { |
263 | conf.writeConfig(); | 262 | conf.writeConfig(); |
264 | ConfigWidget *confWidget; | 263 | ConfigWidget *confWidget; |
265 | for ( confWidget = configWidgetList.first(); confWidget != 0; | 264 | for ( confWidget = configWidgetList.first(); confWidget != 0; |
266 | confWidget = configWidgetList.next() ) { | 265 | confWidget = configWidgetList.next() ) { |
267 | confWidget->writeConfig(); | 266 | confWidget->writeConfig(); |
268 | } | 267 | } |
269 | init(); | ||
270 | 268 | ||
269 | init(); | ||
271 | 270 | ||
272 | TodayPlugin plugin; | 271 | TodayPlugin plugin; |
273 | for ( uint i = 0; i < pluginList.count(); i++ ) { | 272 | for ( uint i = 0; i < pluginList.count(); i++ ) { |
274 | plugin = pluginList[i]; | 273 | plugin = pluginList[i]; |
275 | 274 | ||
276 | if ( m_excludeApplets.grep( plugin.name ).isEmpty() ) { | 275 | if ( m_excludeApplets.grep( plugin.name ).isEmpty() ) { |
277 | qDebug("CONFIG" + plugin.name + "ACTIVE"); | 276 | qDebug("CONFIG " + plugin.name + " ACTIVE"); |
278 | plugin.active = true; | 277 | plugin.active = true; |
279 | } else { | 278 | } else { |
280 | qDebug("CONFIG" + plugin.name + "INACTIVE"); | 279 | qDebug("CONFIG " + plugin.name + " INACTIVE"); |
281 | 280 | ||
282 | plugin.active = false; | 281 | plugin.active = false; |
283 | } | 282 | } |
284 | } | 283 | } |
285 | 284 | ||
286 | draw(); | 285 | draw(); |
287 | } | 286 | } |
288 | } | 287 | } |
289 | 288 | ||
290 | 289 | ||
291 | void Today::startAddressbook() { | 290 | void Today::startAddressbook() { |
292 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 291 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
293 | e << QString( "addressbook" ); | 292 | e << QString( "addressbook" ); |
294 | } | 293 | } |
295 | 294 | ||
296 | 295 | ||
297 | /** | 296 | /** |
298 | * launch addressbook (personal card) | 297 | * launch addressbook (personal card) |
299 | */ | 298 | */ |
300 | void Today::editCard() { | 299 | void Today::editCard() { |
301 | startAddressbook(); | 300 | startAddressbook(); |
302 | while( !QCopChannel::isRegistered( "QPE/Addressbook" ) ) { | 301 | while( !QCopChannel::isRegistered( "QPE/Addressbook" ) ) { |
303 | qApp->processEvents(); | 302 | qApp->processEvents(); |
304 | } | 303 | } |
305 | QCopEnvelope v( "QPE/Addressbook", "editPersonalAndClose()" ); | 304 | QCopEnvelope v( "QPE/Addressbook", "editPersonalAndClose()" ); |
306 | } | 305 | } |
307 | 306 | ||
308 | /* | 307 | /* |
309 | * launches an App | 308 | * launches an App |
310 | */ | 309 | */ |
311 | void Today::launchApp( QString appName ) { | 310 | void Today::launchApp( QString appName ) { |
312 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 311 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
313 | e << QString( appName ); | 312 | e << QString( appName ); |
314 | } | 313 | } |
315 | 314 | ||
316 | Today::~Today() { | 315 | Today::~Today() { |
317 | } | 316 | } |
318 | 317 | ||