summaryrefslogtreecommitdiff
path: root/core
authorharlekin <harlekin>2003-02-11 21:26:39 (UTC)
committer harlekin <harlekin>2003-02-11 21:26:39 (UTC)
commit39f9441dabcb094be258240f7ec3c53ed038133e (patch) (side-by-side diff)
tree7d6e7f49ce18c6c3723cbc59358c58a252011133 /core
parentaf398bd4c280e7c27754b409851fbe8189d08819 (diff)
downloadopie-39f9441dabcb094be258240f7ec3c53ed038133e.zip
opie-39f9441dabcb094be258240f7ec3c53ed038133e.tar.gz
opie-39f9441dabcb094be258240f7ec3c53ed038133e.tar.bz2
now when coming back from the config dialog ALL plugins get restarted
Diffstat (limited to 'core') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/today/today.cpp35
-rw-r--r--core/pim/today/today.h2
2 files changed, 6 insertions, 31 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,7 +1,7 @@
/*
* today.cpp
*
- * copyright : (c) 2002 by Maximilian Reiß
+ * copyright : (c) 2002,2003 by Maximilian Reiß
* email : harlekin@handhelds.org
*
*/
@@ -70,7 +70,7 @@ Today::Today( QWidget* parent, const char* name, WFlags fl )
m_refreshTimer = new QTimer( this );
connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
m_refreshTimer->start( 15000 );
- init();
+ //init();
loadPlugins();
showMaximized();
}
@@ -122,7 +122,6 @@ void Today::setOwnerField( QString &message ) {
}
}
-
/**
* Init stuff needed for today. Reads the config file.
*/
@@ -138,12 +137,9 @@ void Today::init() {
m_iconSize = cfg.readNumEntry( "IconSize", 18 );
setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) );
-
- // qDebug(" refresh ");
// set the date in top label
QDate date = QDate::currentDate();
QString time = ( tr( date.toString() ) );
-
DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) );
if ( layout ) {
@@ -154,29 +150,21 @@ void Today::init() {
layout->addWidget( OwnerField );
}
-
/**
* Load the plugins
*/
void Today::loadPlugins() {
- // extra list for plugins that exclude themself from periodic refresh
- QMap<QString, TodayPlugin> pluginListRefreshExclude;
-
+ init();
QValueList<TodayPlugin>::Iterator tit;
if ( !pluginList.isEmpty() ) {
for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) {
- if ( (*tit).excludeRefresh ) {
- pluginListRefreshExclude.insert( (*tit).name , (*tit) );
- qDebug( "Found a plugin that does not want refresh feature" );
- } else {
(*tit).guiBox->hide();
(*tit).guiBox->reparent( 0, QPoint( 0, 0 ) );
(*tit).library->unload();
delete (*tit).guiBox;
delete (*tit).library;
}
- }
pluginList.clear();
}
@@ -189,7 +177,6 @@ void Today::loadPlugins() {
QMap<QString, TodayPlugin> tempList;
for ( it = list.begin(); it != list.end(); ++it ) {
-// TodayPluginInterface *iface = 0;
QInterfacePtr<TodayPluginInterface> iface;
QLibrary *lib = new QLibrary( path + "/" + *it );
@@ -198,18 +185,6 @@ void Today::loadPlugins() {
qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() );
qDebug( QString(*it) );
- // If plugin is exludes from refresh, get it in the list again here.
-
- if ( pluginListRefreshExclude.contains( (*it) ) ) {
- // if its not in allApplets list, add it to a layout
- if ( !m_allApplets.contains( pluginListRefreshExclude[(*it)].name ) ) {
- layout->addWidget( pluginListRefreshExclude[(*it)].guiBox );
- pluginList.append( pluginListRefreshExclude[(*it)] );
- } else {
- tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] );
- }
- } else {
-
TodayPlugin plugin;
plugin.library = lib;
plugin.iface = iface;
@@ -239,7 +214,7 @@ void Today::loadPlugins() {
QScrollView* sv = new QScrollView( plugin.guiBox );
QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() );
// not sure if that is good .-)
- sv->setMinimumHeight( 10 );
+ sv->setMinimumHeight( 12 );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setHScrollBarMode( QScrollView::AlwaysOff );
sv->setFrameShape( QFrame::NoFrame );
@@ -263,7 +238,6 @@ void Today::loadPlugins() {
layout->addWidget( plugin.guiBox );
pluginList.append( plugin );
}
- }
} else {
qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() );
delete lib;
@@ -370,6 +344,7 @@ void Today::startConfig() {
*
*/
void Today::refresh() {
+
init();
QValueList<TodayPlugin>::Iterator it;
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,7 +1,7 @@
/*
* today.h
*
- * copyright : (c) 2002 by Maximilian Reiß
+ * copyright : (c) 2002,2003 by Maximilian Reiß
* email : harlekin@handhelds.org
*
*/