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 | |
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/plugins/datebook/datebookevent.cpp | 4 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookpluginwidget.cpp | 6 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 54 | ||||
-rw-r--r-- | core/pim/today/today.h | 7 | ||||
-rw-r--r-- | core/pim/today/todaybase.cpp | 6 | ||||
-rw-r--r-- | core/pim/today/todayconfig.cpp | 2 |
6 files changed, 31 insertions, 48 deletions
diff --git a/core/pim/today/plugins/datebook/datebookevent.cpp b/core/pim/today/plugins/datebook/datebookevent.cpp index 1caf061..d4e8e1e 100644 --- a/core/pim/today/plugins/datebook/datebookevent.cpp +++ b/core/pim/today/plugins/datebook/datebookevent.cpp @@ -32,2 +32,4 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, + setAlignment( AlignTop ); + QString msg; @@ -92,4 +94,2 @@ QString DateBookEvent::ampmTime( QTime tm ) { -//extern QPEApplication *todayApp; - /* diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp index e4667ae..7948656 100644 --- a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp @@ -61,2 +61,4 @@ void DatebookPluginWidget::getDates() { QVBoxLayout* layoutDates = new QVBoxLayout( this ); + layoutDates->setSpacing( 1 ); + layoutDates->setMargin( 1 ); @@ -107,4 +109,4 @@ void DatebookPluginWidget::getDates() { } - - layoutDates->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + //layoutDates->addStretch(0); +// layoutDates->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); 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]; +/** + * Refresh for the view. Reload all applets + * + */ +void Today::refresh() { + init(); - if ( m_excludeApplets.grep( plugin.name ).isEmpty() ) { - qDebug("CONFIG " + plugin.name + " ACTIVE"); - plugin.active = true; - } else { - qDebug("CONFIG " + plugin.name + " INACTIVE"); - plugin.active = false; + if ( layout ) { + delete layout; } - plugList.append( plugin ); - } - pluginList = plugList; + 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() { diff --git a/core/pim/today/today.h b/core/pim/today/today.h index 0a9a705..672adc4 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h @@ -47,5 +47,4 @@ class Today : public TodayBase { void startAddressbook(); - void launchApp( QString appName ); void editCard(); - void draw(); + void refresh(); @@ -56,2 +55,4 @@ private: void loadPlugins(); + void draw(); + @@ -64,4 +65,2 @@ private slots: - QVBoxLayout *pluginLayout; - // QString m_autoStartTimer; diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index 74f4fa0..800ca5d 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp @@ -36,2 +36,4 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) + QVBoxLayout *mainLayout = new QVBoxLayout( this ); + QPalette pal = this->palette(); @@ -95,6 +97,2 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); - - // -- layout -- - layout->addWidget( Frame ); - layout->addWidget( OwnerField ); } diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index 79c4d1f..4f23471 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp @@ -59,4 +59,2 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags TabWidget3 = new QTabWidget( this, "TabWidget3" ); - // TabWidget3->setFrameShape( QFrame::NoFrame ); - //TabWidget3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, TabWidget3->sizePolicy().hasHeightForWidth() ) ); TabWidget3->setAutoMask( FALSE ); |