summaryrefslogtreecommitdiff
path: root/core/pim
authorharlekin <harlekin>2002-09-18 09:52:51 (UTC)
committer harlekin <harlekin>2002-09-18 09:52:51 (UTC)
commit15ecc4aa71878039ad40ce270fae06282d8e98c2 (patch) (unidiff)
tree1b1cae7b89bdd3960da222542e99c05332610231 /core/pim
parent01d31aeaa8d513bde8237a07ea0a48ac1b85c3c0 (diff)
downloadopie-15ecc4aa71878039ad40ce270fae06282d8e98c2.zip
opie-15ecc4aa71878039ad40ce270fae06282d8e98c2.tar.gz
opie-15ecc4aa71878039ad40ce270fae06282d8e98c2.tar.bz2
reload plugins now on config change
Diffstat (limited to 'core/pim') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/datebook/datebookevent.cpp4
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginwidget.cpp6
-rw-r--r--core/pim/today/today.cpp58
-rw-r--r--core/pim/today/today.h9
-rw-r--r--core/pim/today/todaybase.cpp16
-rw-r--r--core/pim/today/todayconfig.cpp4
6 files changed, 40 insertions, 57 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,
32 32
33 setAlignment( AlignTop );
34
33 QString msg; 35 QString msg;
@@ -92,4 +94,2 @@ QString DateBookEvent::ampmTime( QTime tm ) {
92 94
93//extern QPEApplication *todayApp;
94
95/* 95/*
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() {
61 QVBoxLayout* layoutDates = new QVBoxLayout( this ); 61 QVBoxLayout* layoutDates = new QVBoxLayout( this );
62 layoutDates->setSpacing( 1 );
63 layoutDates->setMargin( 1 );
62 64
@@ -107,4 +109,4 @@ void DatebookPluginWidget::getDates() {
107 } 109 }
108 110 //layoutDates->addStretch(0);
109 layoutDates->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); 111// layoutDates->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
110 112
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 )
66 setOwnerField(); 66 setOwnerField();
67 init(); 67 refresh();
68 loadPlugins();
69 draw();
70 showMaximized(); 68 showMaximized();
@@ -120,3 +118,2 @@ void Today::init() {
120 Config cfg( "today" ); 118 Config cfg( "today" );
121
122 cfg.setGroup( "Applets" ); 119 cfg.setGroup( "Applets" );
@@ -138,2 +135,3 @@ void Today::loadPlugins() {
138 135
136
139 QString path = QPEApplication::qpeDir() + "/plugins/today"; 137 QString path = QPEApplication::qpeDir() + "/plugins/today";
@@ -144,3 +142,2 @@ void Today::loadPlugins() {
144 142
145 uint count = 0;
146 for ( it = list.begin(); it != list.end(); ++it ) { 143 for ( it = list.begin(); it != list.end(); ++it ) {
@@ -158,2 +155,3 @@ void Today::loadPlugins() {
158 155
156 // find out if plugins should be shown
159 if ( m_excludeApplets.grep( *it ).isEmpty() ) { 157 if ( m_excludeApplets.grep( *it ).isEmpty() ) {
@@ -178,3 +176,2 @@ void Today::loadPlugins() {
178 sv->setMinimumHeight( plugin.guiPart->minHeight() ); 176 sv->setMinimumHeight( plugin.guiPart->minHeight() );
179 //sv->setMaximumHeight( plugin.guiPart->maxHeight() );
180 sv->setResizePolicy( QScrollView::AutoOneFit ); 177 sv->setResizePolicy( QScrollView::AutoOneFit );
@@ -192,3 +189,2 @@ void Today::loadPlugins() {
192 pluginList.append( plugin ); 189 pluginList.append( plugin );
193 count++;
194 } else { 190 } else {
@@ -233,4 +229,4 @@ void Today::draw() {
233 } 229 }
234 230 //layout->addStretch(0);
235 layout->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); 231 //layout->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
236} 232}
@@ -246,3 +242,2 @@ void Today::startConfig() {
246 TodayPlugin plugin; 242 TodayPlugin plugin;
247
248 QList<ConfigWidget> configWidgetList; 243 QList<ConfigWidget> configWidgetList;
@@ -269,25 +264,24 @@ void Today::startConfig() {
269 } 264 }
265 refresh();
266 }
267}
270 268
271 init();
272
273 TodayPlugin plugin;
274 QValueList<TodayPlugin> plugList;
275 for ( uint i = 0; i < pluginList.count(); i++ ) {
276 plugin = pluginList[i];
277 269
278 if ( m_excludeApplets.grep( plugin.name ).isEmpty() ) { 270/**
279 qDebug("CONFIG " + plugin.name + " ACTIVE"); 271 * Refresh for the view. Reload all applets
280 plugin.active = true; 272 *
281 } else { 273 */
282 qDebug("CONFIG " + plugin.name + " INACTIVE"); 274void Today::refresh() {
283 plugin.active = false; 275 init();
284 }
285 plugList.append( plugin );
286 }
287 pluginList = plugList;
288 276
289 draw(); 277 if ( layout ) {
278 delete layout;
290 } 279 }
291} 280 layout = new QVBoxLayout( this );
281 layout->addWidget( Frame );
282 layout->addWidget( OwnerField );
292 283
284 loadPlugins();
285 draw();
286}
293 287
@@ -310,10 +304,2 @@ void Today::editCard() {
310 304
311/*
312 * launches an App
313 */
314void Today::launchApp( QString appName ) {
315 QCopEnvelope e( "QPE/System", "execute(QString)" );
316 e << QString( appName );
317}
318
319Today::~Today() { 305Today::~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
@@ -44,8 +44,7 @@ class Today : public TodayBase {
44 44
45 private slots: 45private slots:
46 void startConfig(); 46 void startConfig();
47 void startAddressbook(); 47 void startAddressbook();
48 void launchApp( QString appName );
49 void editCard(); 48 void editCard();
50 void draw(); 49 void refresh();
51 50
@@ -56,2 +55,4 @@ private:
56 void loadPlugins(); 55 void loadPlugins();
56 void draw();
57
57 58
@@ -64,4 +65,2 @@ private slots:
64 65
65 QVBoxLayout *pluginLayout;
66
67 // QString m_autoStartTimer; 66 // 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 )
36 36
37 QVBoxLayout *mainLayout = new QVBoxLayout( this );
38
37 QPalette pal = this->palette(); 39 QPalette pal = this->palette();
@@ -79,5 +81,5 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
79 // Opiezilla 81 // Opiezilla
80 QLabel* Opiezilla = new QLabel( Frame, "OpieZilla"); 82 QLabel* Opiezilla = new QLabel( Frame, "OpieZilla" );
81 Opiezilla->setPixmap( opiezilla ); 83 Opiezilla->setPixmap( opiezilla );
82 Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47); 84 Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47 );
83 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); 85 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin );
@@ -86,3 +88,3 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
86 OwnerField = new OClickableLabel( this , "Owner" ); 88 OwnerField = new OClickableLabel( this , "Owner" );
87 OwnerField->setGeometry( QRect( 0,0, this->width(), 12 )); 89 OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) );
88 OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); 90 OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) );
@@ -92,9 +94,5 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
92 ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); 94 ConfigButton = new OClickableLabel ( Frame, "PushButton1" );
93 ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 30, 25, 21 ) ); 95 ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 30, 25, 21 ) );
94 ConfigButton->setPixmap( config ); 96 ConfigButton->setPixmap( config );
95 ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); 97 ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin );
96
97 // -- layout --
98 layout->addWidget( Frame );
99 layout->addWidget( OwnerField );
100} 98}
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
59 TabWidget3 = new QTabWidget( this, "TabWidget3" ); 59 TabWidget3 = new QTabWidget( this, "TabWidget3" );
60 // TabWidget3->setFrameShape( QFrame::NoFrame );
61 //TabWidget3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, TabWidget3->sizePolicy().hasHeightForWidth() ) );
62 TabWidget3->setAutoMask( FALSE ); 60 TabWidget3->setAutoMask( FALSE );
@@ -124,3 +122,3 @@ void TodayConfig::setAutoStart() {
124 QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" ); 122 QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" );
125 e << QString( "remove"); 123 e << QString( "remove" );
126 e << QString( "today" ); 124 e << QString( "today" );