author | harlekin <harlekin> | 2002-09-18 09:52:51 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-09-18 09:52:51 (UTC) |
commit | 15ecc4aa71878039ad40ce270fae06282d8e98c2 (patch) (side-by-side diff) | |
tree | 1b1cae7b89bdd3960da222542e99c05332610231 /core/pim/today/today.cpp | |
parent | 01d31aeaa8d513bde8237a07ea0a48ac1b85c3c0 (diff) | |
download | opie-15ecc4aa71878039ad40ce270fae06282d8e98c2.zip opie-15ecc4aa71878039ad40ce270fae06282d8e98c2.tar.gz opie-15ecc4aa71878039ad40ce270fae06282d8e98c2.tar.bz2 |
reload plugins now on config change
-rw-r--r-- | core/pim/today/today.cpp | 58 |
1 files changed, 22 insertions, 36 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index f052a9f..7537631 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -66,5 +66,3 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) setOwnerField(); - init(); - loadPlugins(); - draw(); + refresh(); showMaximized(); @@ -120,3 +118,2 @@ void Today::init() { Config cfg( "today" ); - cfg.setGroup( "Applets" ); @@ -138,2 +135,3 @@ void Today::loadPlugins() { + QString path = QPEApplication::qpeDir() + "/plugins/today"; @@ -144,3 +142,2 @@ void Today::loadPlugins() { - uint count = 0; for ( it = list.begin(); it != list.end(); ++it ) { @@ -158,2 +155,3 @@ void Today::loadPlugins() { + // find out if plugins should be shown if ( m_excludeApplets.grep( *it ).isEmpty() ) { @@ -178,3 +176,2 @@ void Today::loadPlugins() { sv->setMinimumHeight( plugin.guiPart->minHeight() ); - //sv->setMaximumHeight( plugin.guiPart->maxHeight() ); sv->setResizePolicy( QScrollView::AutoOneFit ); @@ -192,3 +189,2 @@ void Today::loadPlugins() { pluginList.append( plugin ); - count++; } else { @@ -233,4 +229,4 @@ void Today::draw() { } - - layout->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + //layout->addStretch(0); + //layout->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); } @@ -246,3 +242,2 @@ void Today::startConfig() { TodayPlugin plugin; - QList<ConfigWidget> configWidgetList; @@ -269,25 +264,24 @@ void Today::startConfig() { } + refresh(); + } +} - init(); - - TodayPlugin plugin; - QValueList<TodayPlugin> plugList; - for ( uint i = 0; i < pluginList.count(); i++ ) { - plugin = pluginList[i]; - if ( m_excludeApplets.grep( plugin.name ).isEmpty() ) { - qDebug("CONFIG " + plugin.name + " ACTIVE"); - plugin.active = true; - } else { - qDebug("CONFIG " + plugin.name + " INACTIVE"); - plugin.active = false; - } - plugList.append( plugin ); - } - pluginList = plugList; +/** + * Refresh for the view. Reload all applets + * + */ +void Today::refresh() { + init(); - draw(); + if ( layout ) { + delete layout; } -} + layout = new QVBoxLayout( this ); + layout->addWidget( Frame ); + layout->addWidget( OwnerField ); + loadPlugins(); + draw(); +} @@ -310,10 +304,2 @@ void Today::editCard() { -/* - * launches an App - */ -void Today::launchApp( QString appName ) { - QCopEnvelope e( "QPE/System", "execute(QString)" ); - e << QString( appName ); -} - Today::~Today() { |