author | harlekin <harlekin> | 2002-09-17 09:40:51 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-09-17 09:40:51 (UTC) |
commit | 92b88813ad8d6352fbf74964fc56dfc1a2aada8c (patch) (side-by-side diff) | |
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() { /** * Repaint method. Reread all fields. */ void Today::draw() { if ( pluginList.count() == 0 ) { QLabel *noPlugins = new QLabel( this ); noPlugins->setText( tr( "No plugins found" ) ); layout->addWidget( noPlugins ); return; } uint count = 0; TodayPlugin plugin; for ( uint i = 0; i < pluginList.count(); i++ ) { plugin = pluginList[i]; if ( plugin.active ) { qDebug( plugin.name + " is ACTIVE " ); // QHBoxLayout* plugLayout = new QHBoxLayout( this ); plugin.guiBox->show(); } else { // plugin.guiWidget->hide(); qDebug( plugin.name + " is INACTIVE" ); plugin.guiBox->hide(); } count++; } if ( count == 0 ) { QLabel *noPluginsActive = new QLabel( this ); noPluginsActive->setText( tr( "No plugins activated" ) ); layout->addWidget( noPluginsActive ); } layout->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); } /** * The method for the configuration dialog. */ void Today::startConfig() { TodayConfig conf( this, "dialog", true ); TodayPlugin plugin; QList<ConfigWidget> configWidgetList; for ( uint i = 0; i < pluginList.count(); i++ ) { plugin = pluginList[i]; // load the config widgets in the tabs if ( plugin.guiPart->configWidget( this ) != 0l ) { ConfigWidget* widget = plugin.guiPart->configWidget( this ); configWidgetList.append( widget ); conf.TabWidget3->insertTab( widget, plugin.guiPart->appName() ); } // set the order/activate tab conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); } - conf.exec(); if ( conf.exec() == QDialog::Accepted ) { conf.writeConfig(); ConfigWidget *confWidget; for ( confWidget = configWidgetList.first(); confWidget != 0; confWidget = configWidgetList.next() ) { confWidget->writeConfig(); } - init(); + init(); TodayPlugin plugin; for ( uint i = 0; i < pluginList.count(); i++ ) { plugin = pluginList[i]; if ( m_excludeApplets.grep( plugin.name ).isEmpty() ) { - qDebug("CONFIG" + plugin.name + "ACTIVE"); + qDebug("CONFIG " + plugin.name + " ACTIVE"); plugin.active = true; } else { - qDebug("CONFIG" + plugin.name + "INACTIVE"); + qDebug("CONFIG " + plugin.name + " INACTIVE"); plugin.active = false; } } draw(); } } void Today::startAddressbook() { QCopEnvelope e( "QPE/System", "execute(QString)" ); e << QString( "addressbook" ); } /** * launch addressbook (personal card) */ void Today::editCard() { startAddressbook(); while( !QCopChannel::isRegistered( "QPE/Addressbook" ) ) { qApp->processEvents(); } QCopEnvelope v( "QPE/Addressbook", "editPersonalAndClose()" ); } /* * launches an App */ void Today::launchApp( QString appName ) { QCopEnvelope e( "QPE/System", "execute(QString)" ); e << QString( appName ); } Today::~Today() { } |