summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-03-30 22:05:20 (UTC)
committer harlekin <harlekin>2003-03-30 22:05:20 (UTC)
commit608a9f1537af0f0f679ec5f7358e9a9716604f8b (patch) (unidiff)
tree7b08904230c170f9679937e3419149e3a82cee96
parent9f185c144aa92c08d4d24721e1eba7782b51d366 (diff)
downloadopie-608a9f1537af0f0f679ec5f7358e9a9716604f8b.zip
opie-608a9f1537af0f0f679ec5f7358e9a9716604f8b.tar.gz
opie-608a9f1537af0f0f679ec5f7358e9a9716604f8b.tar.bz2
changed header (gui) to layouts
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/changelog7
-rw-r--r--core/pim/today/opie-today.control2
-rw-r--r--core/pim/today/today.cpp8
-rw-r--r--core/pim/today/todaybase.cpp28
4 files changed, 22 insertions, 23 deletions
diff --git a/core/pim/today/changelog b/core/pim/today/changelog
index 500090d..a77e581 100644
--- a/core/pim/today/changelog
+++ b/core/pim/today/changelog
@@ -1,122 +1,127 @@
10.6.2
2
3* header can now be made smaller
4* changed header to different layout mode to play nicer with life rotation
5
10.6.1 60.6.1
2 7
3* datebook plugin now can now also show following days 8* datebook plugin now can now also show following days
4+ changed refresh 9* changed refresh
5* fixed one mem leak 10* fixed one mem leak
6 11
70.6 120.6
8 13
9* longer refresh intervals possible 14* longer refresh intervals possible
10* plugins can decide now if they want to take part in refresh cycles 15* plugins can decide now if they want to take part in refresh cycles
11 16
120.5.2 170.5.2
13 18
14* refresh settings 19* refresh settings
15* only launch datebook config when clicked on a date ( opie only ) 20* only launch datebook config when clicked on a date ( opie only )
16* less qcop trouble on sharps retail rom 21* less qcop trouble on sharps retail rom
17 22
180.5.1 230.5.1
19 24
20* icons scalable and clickable again 25* icons scalable and clickable again
21 26
220.5 270.5
23 28
24* now fully plugin based 29* now fully plugin based
25 30
260.3.4 310.3.4
27 32
28* "fill our business card now a clickable label" 33* "fill our business card now a clickable label"
29* Several bugfixes regarding todo section. 34* Several bugfixes regarding todo section.
30 35
310.3.3 360.3.3
32 37
33* Changed the logo so it better scales to bigger display and also 38* Changed the logo so it better scales to bigger display and also
34 made the "Today" string translatable. 39 made the "Today" string translatable.
35* some am/pm fixes 40* some am/pm fixes
36* clickable labels now in libopie 41* clickable labels now in libopie
37 42
380.3.2 430.3.2
39 44
40* Autostart is now more configurable. You can decide how long 45* Autostart is now more configurable. You can decide how long
41 the ipaq has to has been suspended, before autostart is triggered.(Opie 46 the ipaq has to has been suspended, before autostart is triggered.(Opie
42 only) 47 only)
43* am/pm time optinal (autodetect) 48* am/pm time optinal (autodetect)
44 49
450.3.1 500.3.1
46 51
47* fixed the wrong color of the buttons 52* fixed the wrong color of the buttons
48* better translation (thanks carsten and others) 53* better translation (thanks carsten and others)
49* fixes memory leaks 54* fixes memory leaks
50* bugfixes in calendar part, now location and note are working again. 55* bugfixes in calendar part, now location and note are working again.
51 56
520.3.0 570.3.0
53 58
54* today uses now tododb from libopie. So major changes in the todo part: 59* today uses now tododb from libopie. So major changes in the todo part:
55 - overdue items on top 60 - overdue items on top
56 - then sorted by date, then by priority 61 - then sorted by date, then by priority
57* some cleanups 62* some cleanups
58* speed optimisations 63* speed optimisations
59 64
600.2.9 650.2.9
61 66
62* Many bugfixes. 67* Many bugfixes.
63* Today now apparently sorts the dates _allways_ right, i would assume it 68* Today now apparently sorts the dates _allways_ right, i would assume it
64to be a qt bug 69to be a qt bug
65 70
660.2.8 710.2.8
67 72
68* Appointments are now clickable (connection to datebook still missing) 73* Appointments are now clickable (connection to datebook still missing)
69* autostart support (opie only) 74* autostart support (opie only)
70 75
710.2.7 760.2.7
72 77
73* check if todolist.xml was changed before parsing it 78* check if todolist.xml was changed before parsing it
74* check only every 30 sec for changes. 79* check only every 30 sec for changes.
75* some visual stuff 80* some visual stuff
76* as usual many little improvements .-) 81* as usual many little improvements .-)
77 82
780.2.6 830.2.6
79 84
80* added scrollbars to dates and todo 85* added scrollbars to dates and todo
81* all day detection 86* all day detection
82* some smaller bugfixes 87* some smaller bugfixes
83 88
840.2.5 890.2.5
85 90
86* some other minor fixes regarding autoupdate 91* some other minor fixes regarding autoupdate
87* fixed segfault with todolist > 7 entries 92* fixed segfault with todolist > 7 entries
88* fixed the "ugly grey border around buttons" issue 93* fixed the "ugly grey border around buttons" issue
89* fixed the "empty calendar field" "bug" 94* fixed the "empty calendar field" "bug"
90* shown only later appointments as option 95* shown only later appointments as option
91 96
92 97
930.2.4 980.2.4
94 99
95* added support for email 100* added support for email
96* autoupdates after 1 min 101* autoupdates after 1 min
97* QCopEnvelope instead of system() 102* QCopEnvelope instead of system()
98* starting to use qvbox in gui 103* starting to use qvbox in gui
99 104
100 105
1010.2.3 1060.2.3
102 107
103* the 4 am release 108* the 4 am release
104* several bugfixes 109* several bugfixes
105 110
106 111
1070.2.2 1120.2.2
108 113
109* started working on calling other apps 114* started working on calling other apps
110* and finished it 115* and finished it
111 116
1120.2.1 1170.2.1
113 118
114* images no more inline 119* images no more inline
115* config dialog 120* config dialog
116 121
1170.1.1 1220.1.1
118 123
119* started changelog. 124* started changelog.
120* fixed segfault on empty/nonexistant todolist.xml 125* fixed segfault on empty/nonexistant todolist.xml
121* better handling for file location 126* better handling for file location
122 127
diff --git a/core/pim/today/opie-today.control b/core/pim/today/opie-today.control
index 40c2cdf..0e79d69 100644
--- a/core/pim/today/opie-today.control
+++ b/core/pim/today/opie-today.control
@@ -1,16 +1,16 @@
1Files: bin/today apps/1Pim/today.desktop pics/today/* 1Files: bin/today apps/1Pim/today.desktop pics/today/*
2Priority: optional 2Priority: optional
3Section: opie/applications 3Section: opie/applications
4Maintainer: Maximilian Reiß <harlekin@handhelds.org> 4Maintainer: Maximilian Reiß <harlekin@handhelds.org>
5Architecture: arm 5Architecture: arm
6Version: 0.6-$SUB_VERSION 6Version: 0.6,2-$SUB_VERSION
7Depends: opie-base, libopie1 7Depends: opie-base, libopie1
8License: GPL 8License: GPL
9Description: today screen 9Description: today screen
10 This today screen app gives an overview of appointments 10 This today screen app gives an overview of appointments
11 and todos. 11 and todos.
12 It also shows incoming and outgoing mails from opiemail. 12 It also shows incoming and outgoing mails from opiemail.
13 When using Opie (opie.handhelds.org) today can be autostarted 13 When using Opie (opie.handhelds.org) today can be autostarted
14 on resume. 14 on resume.
15 It is highly configurable. 15 It is highly configurable.
16 16
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 0b61bf8..d0cdd18 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -20,267 +20,259 @@
20 20
21#include "today.h" 21#include "today.h"
22 22
23#include <qpe/config.h> 23#include <qpe/config.h>
24#include <qpe/qcopenvelope_qws.h> 24#include <qpe/qcopenvelope_qws.h>
25#include <qpe/resource.h> 25#include <qpe/resource.h>
26#include <qpe/global.h> 26#include <qpe/global.h>
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28#include <qpe/contact.h> 28#include <qpe/contact.h>
29#include <qpe/timestring.h> 29#include <qpe/timestring.h>
30 30
31#include <qdir.h> 31#include <qdir.h>
32#include <qfile.h> 32#include <qfile.h>
33#include <qtimer.h> 33#include <qtimer.h>
34#include <qwhatsthis.h> 34#include <qwhatsthis.h>
35#include <qtranslator.h> 35#include <qtranslator.h>
36 36
37struct TodayPlugin { 37struct TodayPlugin {
38 TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} 38 TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {}
39 QLibrary *library; 39 QLibrary *library;
40 QInterfacePtr<TodayPluginInterface> iface; 40 QInterfacePtr<TodayPluginInterface> iface;
41 TodayPluginObject *guiPart; 41 TodayPluginObject *guiPart;
42 QWidget *guiBox; 42 QWidget *guiBox;
43 QString name; 43 QString name;
44 bool active; 44 bool active;
45 bool excludeRefresh; 45 bool excludeRefresh;
46 int pos; 46 int pos;
47}; 47};
48 48
49static QValueList<TodayPlugin> pluginList; 49static QValueList<TodayPlugin> pluginList;
50 50
51Today::Today( QWidget* parent, const char* name, WFlags fl ) 51Today::Today( QWidget* parent, const char* name, WFlags fl )
52 : TodayBase( parent, name, fl ) { 52 : TodayBase( parent, name, fl ) {
53 53
54 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); 54 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) );
55 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); 55 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) );
56 56
57#if defined(Q_WS_QWS) 57#if defined(Q_WS_QWS)
58#if !defined(QT_NO_COP) 58#if !defined(QT_NO_COP)
59 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); 59 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this );
60 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 60 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
61 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); 61 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
62#endif 62#endif
63#endif 63#endif
64 64
65 setOwnerField(); 65 setOwnerField();
66 m_refreshTimer = new QTimer( this ); 66 m_refreshTimer = new QTimer( this );
67 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 67 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
68 m_refreshTimer->start( 15000 ); 68 m_refreshTimer->start( 15000 );
69 //init(); 69 //init();
70 loadPlugins(); 70 loadPlugins();
71 showMaximized(); 71 showMaximized();
72} 72}
73 73
74/** 74/**
75 * Qcop receive method. 75 * Qcop receive method.
76 */ 76 */
77void Today::channelReceived( const QCString &msg, const QByteArray & data ) { 77void Today::channelReceived( const QCString &msg, const QByteArray & data ) {
78 QDataStream stream( data, IO_ReadOnly ); 78 QDataStream stream( data, IO_ReadOnly );
79 if ( msg == "message(QString)" ) { 79 if ( msg == "message(QString)" ) {
80 QString message; 80 QString message;
81 stream >> message; 81 stream >> message;
82 setOwnerField( message ); 82 setOwnerField( message );
83 } 83 }
84} 84}
85 85
86void Today::setRefreshTimer( int interval ) { 86void Today::setRefreshTimer( int interval ) {
87 87
88 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 88 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
89 89
90 // 0 is "never" case 90 // 0 is "never" case
91 if ( !interval == 0 ) { 91 if ( !interval == 0 ) {
92 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 92 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
93 m_refreshTimer->changeInterval( interval ); 93 m_refreshTimer->changeInterval( interval );
94 } 94 }
95} 95}
96 96
97 97
98/** 98/**
99 * Initialises the owner field with the default value, the username 99 * Initialises the owner field with the default value, the username
100 */ 100 */
101void Today::setOwnerField() { 101void Today::setOwnerField() {
102 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); 102 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" );
103 if ( QFile::exists( file ) ) { 103 if ( QFile::exists( file ) ) {
104 Contact cont = Contact::readVCard( file )[0]; 104 Contact cont = Contact::readVCard( file )[0];
105 QString returnString = cont.fullName(); 105 QString returnString = cont.fullName();
106 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); 106 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" );
107 } else { 107 } else {
108 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); 108 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" );
109 } 109 }
110} 110}
111 111
112/** 112/**
113 * Set the owner field with a given QString, for example per qcop. 113 * Set the owner field with a given QString, for example per qcop.
114 */ 114 */
115void Today::setOwnerField( QString &message ) { 115void Today::setOwnerField( QString &message ) {
116 if ( !message.isEmpty() ) { 116 if ( !message.isEmpty() ) {
117 OwnerField->setText( "<b>" + message + "</b>" ); 117 OwnerField->setText( "<b>" + message + "</b>" );
118 } 118 }
119} 119}
120 120
121/** 121/**
122 * Init stuff needed for today. Reads the config file. 122 * Init stuff needed for today. Reads the config file.
123 */ 123 */
124void Today::init() { 124void Today::init() {
125 // read config 125 // read config
126 Config cfg( "today" ); 126 Config cfg( "today" );
127 127
128 cfg.setGroup( "Plugins" ); 128 cfg.setGroup( "Plugins" );
129 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 129 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
130 m_allApplets = cfg.readListEntry( "AllApplets", ',' ); 130 m_allApplets = cfg.readListEntry( "AllApplets", ',' );
131 131
132 cfg.setGroup( "General" ); 132 cfg.setGroup( "General" );
133 m_iconSize = cfg.readNumEntry( "IconSize", 18 ); 133 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
134 m_hideBanner = cfg.readNumEntry( "HideBanner", 0 ); 134 m_hideBanner = cfg.readNumEntry( "HideBanner", 0 );
135 setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); 135 setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) );
136 136
137 // set the date in top label 137 // set the date in top label
138 QDate date = QDate::currentDate(); 138 QDate date = QDate::currentDate();
139 DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) ); 139 DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) );
140 140
141 if ( layout ) { 141 if ( layout ) {
142 delete layout; 142 delete layout;
143 } 143 }
144 144
145 if ( m_hideBanner ) { 145 if ( m_hideBanner ) {
146 Opiezilla->hide(); 146 Opiezilla->hide();
147 TodayLabel->hide(); 147 TodayLabel->hide();
148 Frame->setMaximumHeight( 18 );
149 Frame->setMinimumHeight( 18 );
150 DateLabel->setGeometry( QRect( 10, 2, 168, 12 ) );
151 ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-20, 0, 25, 20 ) );
152 } else { 148 } else {
153 Opiezilla->show(); 149 Opiezilla->show();
154 TodayLabel->show(); 150 TodayLabel->show();
155 Frame->setMaximumHeight( 50 );
156 Frame->setMinimumHeight( 50 );
157 DateLabel->setGeometry( QRect( 10, 35, 168, 12 ) );
158 ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 29, 25, 20 ) );
159 } 151 }
160 152
161 layout = new QVBoxLayout( this ); 153 layout = new QVBoxLayout( this );
162 layout->addWidget( Frame ); 154 layout->addWidget( Frame );
163 layout->addWidget( OwnerField ); 155 layout->addWidget( OwnerField );
164} 156}
165 157
166/** 158/**
167 * Load the plugins 159 * Load the plugins
168 */ 160 */
169void Today::loadPlugins() { 161void Today::loadPlugins() {
170 162
171 init(); 163 init();
172 QValueList<TodayPlugin>::Iterator tit; 164 QValueList<TodayPlugin>::Iterator tit;
173 if ( !pluginList.isEmpty() ) { 165 if ( !pluginList.isEmpty() ) {
174 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { 166 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) {
175 (*tit).guiBox->hide(); 167 (*tit).guiBox->hide();
176 (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); 168 (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) );
177 delete (*tit).guiBox; 169 delete (*tit).guiBox;
178 (*tit).library->unload(); 170 (*tit).library->unload();
179 delete (*tit).library; 171 delete (*tit).library;
180 } 172 }
181 pluginList.clear(); 173 pluginList.clear();
182 } 174 }
183 175
184 QString path = QPEApplication::qpeDir() + "/plugins/today"; 176 QString path = QPEApplication::qpeDir() + "/plugins/today";
185 QDir dir( path, "lib*.so" ); 177 QDir dir( path, "lib*.so" );
186 178
187 QStringList list = dir.entryList(); 179 QStringList list = dir.entryList();
188 QStringList::Iterator it; 180 QStringList::Iterator it;
189 181
190 QMap<QString, TodayPlugin> tempList; 182 QMap<QString, TodayPlugin> tempList;
191 183
192 for ( it = list.begin(); it != list.end(); ++it ) { 184 for ( it = list.begin(); it != list.end(); ++it ) {
193 QInterfacePtr<TodayPluginInterface> iface; 185 QInterfacePtr<TodayPluginInterface> iface;
194 QLibrary *lib = new QLibrary( path + "/" + *it ); 186 QLibrary *lib = new QLibrary( path + "/" + *it );
195 187
196 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); 188 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() );
197 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { 189 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
198 qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); 190 qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() );
199 qDebug( QString(*it) ); 191 qDebug( QString(*it) );
200 192
201 TodayPlugin plugin; 193 TodayPlugin plugin;
202 plugin.library = lib; 194 plugin.library = lib;
203 plugin.iface = iface; 195 plugin.iface = iface;
204 plugin.name = QString(*it); 196 plugin.name = QString(*it);
205 197
206 QString type = (*it).left( (*it).find(".") ); 198 QString type = (*it).left( (*it).find(".") );
207 QStringList langs = Global::languageList(); 199 QStringList langs = Global::languageList();
208 for (QStringList::ConstIterator lit = langs.begin(); lit!=langs.end(); ++lit) { 200 for (QStringList::ConstIterator lit = langs.begin(); lit!=langs.end(); ++lit) {
209 QString lang = *lit; 201 QString lang = *lit;
210 qDebug( "Languages: " + lang ); 202 qDebug( "Languages: " + lang );
211 QTranslator * trans = new QTranslator( qApp ); 203 QTranslator * trans = new QTranslator( qApp );
212 QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm"; 204 QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm";
213 if ( trans->load( tfn ) ) { 205 if ( trans->load( tfn ) ) {
214 qApp->installTranslator( trans ); 206 qApp->installTranslator( trans );
215 } else { 207 } else {
216 delete trans; 208 delete trans;
217 } 209 }
218 } 210 }
219 211
220 // find out if plugins should be shown 212 // find out if plugins should be shown
221 if ( m_excludeApplets.grep( *it ).isEmpty() ) { 213 if ( m_excludeApplets.grep( *it ).isEmpty() ) {
222 plugin.active = true; 214 plugin.active = true;
223 } else { 215 } else {
224 plugin.active = false; 216 plugin.active = false;
225 } 217 }
226 218
227 plugin.guiPart = plugin.iface->guiPart(); 219 plugin.guiPart = plugin.iface->guiPart();
228 plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); 220 plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh();
229 221
230 // package the whole thing into a qwidget so it can be shown and hidden 222 // package the whole thing into a qwidget so it can be shown and hidden
231 plugin.guiBox = new QWidget( this ); 223 plugin.guiBox = new QWidget( this );
232 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); 224 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox );
233 QPixmap plugPix; 225 QPixmap plugPix;
234 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 ); 226 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 );
235 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); 227 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox );
236 plugIcon->setPixmap( plugPix ); 228 plugIcon->setPixmap( plugPix );
237 QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") ); 229 QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") );
238 plugIcon->setName( plugin.guiPart->appName() ); 230 plugIcon->setName( plugin.guiPart->appName() );
239 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) ); 231 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) );
240 // a scrollview for each plugin 232 // a scrollview for each plugin
241 QScrollView* sv = new QScrollView( plugin.guiBox ); 233 QScrollView* sv = new QScrollView( plugin.guiBox );
242 QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); 234 QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() );
243 // not sure if that is good .-) 235 // not sure if that is good .-)
244 sv->setMinimumHeight( 12 ); 236 sv->setMinimumHeight( 12 );
245 sv->setResizePolicy( QScrollView::AutoOneFit ); 237 sv->setResizePolicy( QScrollView::AutoOneFit );
246 sv->setHScrollBarMode( QScrollView::AlwaysOff ); 238 sv->setHScrollBarMode( QScrollView::AlwaysOff );
247 sv->setFrameShape( QFrame::NoFrame ); 239 sv->setFrameShape( QFrame::NoFrame );
248 sv->addChild( plugWidget ); 240 sv->addChild( plugWidget );
249 // make sure the icon is on the top alligned 241 // make sure the icon is on the top alligned
250 boxLayout->addWidget( plugIcon, 0, AlignTop ); 242 boxLayout->addWidget( plugIcon, 0, AlignTop );
251 boxLayout->addWidget( sv, 0, AlignTop ); 243 boxLayout->addWidget( sv, 0, AlignTop );
252 boxLayout->setStretchFactor( plugIcon, 1 ); 244 boxLayout->setStretchFactor( plugIcon, 1 );
253 boxLayout->setStretchFactor( sv, 9 ); 245 boxLayout->setStretchFactor( sv, 9 );
254 // "prebuffer" it in one more list, to get the sorting done 246 // "prebuffer" it in one more list, to get the sorting done
255 tempList.insert( plugin.name, plugin ); 247 tempList.insert( plugin.name, plugin );
256 248
257 // on first start the list is off course empty 249 // on first start the list is off course empty
258 if ( m_allApplets.isEmpty() ) { 250 if ( m_allApplets.isEmpty() ) {
259 layout->addWidget( plugin.guiBox ); 251 layout->addWidget( plugin.guiBox );
260 pluginList.append( plugin ); 252 pluginList.append( plugin );
261 } 253 }
262 254
263 // if plugin is not yet in the list, add it to the layout too 255 // if plugin is not yet in the list, add it to the layout too
264 else if ( !m_allApplets.contains( plugin.name ) ) { 256 else if ( !m_allApplets.contains( plugin.name ) ) {
265 layout->addWidget( plugin.guiBox ); 257 layout->addWidget( plugin.guiBox );
266 pluginList.append( plugin ); 258 pluginList.append( plugin );
267 } 259 }
268 } else { 260 } else {
269 qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); 261 qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() );
270 delete lib; 262 delete lib;
271 } 263 }
272 } 264 }
273 265
274 if ( !m_allApplets.isEmpty() ) { 266 if ( !m_allApplets.isEmpty() ) {
275 TodayPlugin tempPlugin; 267 TodayPlugin tempPlugin;
276 QStringList::Iterator stringit; 268 QStringList::Iterator stringit;
277 269
278 for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { 270 for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) {
279 tempPlugin = ( tempList.find( *stringit ) ).data(); 271 tempPlugin = ( tempList.find( *stringit ) ).data();
280 if ( !( (tempPlugin.name).isEmpty() ) ) { 272 if ( !( (tempPlugin.name).isEmpty() ) ) {
281 layout->addWidget( tempPlugin.guiBox ); 273 layout->addWidget( tempPlugin.guiBox );
282 pluginList.append( tempPlugin ); 274 pluginList.append( tempPlugin );
283 } 275 }
284 } 276 }
285 } 277 }
286 draw(); 278 draw();
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index a36ecaa..c896463 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -1,105 +1,107 @@
1/* 1/*
2 * todaybase.cpp 2 * todaybase.cpp
3 * 3 *
4 * copyright : (c) 2002 by Maximilian Reiß 4 * copyright : (c) 2002, 2003 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#include "todaybase.h" 17#include "todaybase.h"
18 18
19#include <qvbox.h>
19#include <qlabel.h> 20#include <qlabel.h>
20#include <qimage.h>
21#include <qpixmap.h>
22#include <qapplication.h>
23#include <qwhatsthis.h> 21#include <qwhatsthis.h>
24 22
25#include <qpe/resource.h> 23#include <qpe/resource.h>
26 24
27 25
28TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) 26TodayBase::TodayBase( QWidget* parent, const char* name, WFlags )
29 : QWidget( parent, name, WStyle_ContextHelp ) { 27 : QWidget( parent, name, WStyle_ContextHelp ) {
30 28
31 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo 29 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo
32 QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla 30 QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla
33 QPixmap config = Resource::loadPixmap( "SettingsIcon" ); // config icon 31 QPixmap config = Resource::loadPixmap( "SettingsIcon" ); // config icon
34 32
35 layout = new QVBoxLayout( this ); 33 layout = new QVBoxLayout( this );
36 34
37 QPalette pal = this->palette(); 35 QPalette pal = this->palette();
38 QColor col = pal.color( QPalette::Active, QColorGroup::Background ); 36 QColor col = pal.color( QPalette::Active, QColorGroup::Background );
39 pal.setColor( QPalette::Active, QColorGroup::Button, col ); 37 pal.setColor( QPalette::Active, QColorGroup::Button, col );
40 pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); 38 pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
41 pal.setColor( QPalette::Normal, QColorGroup::Button, col ); 39 pal.setColor( QPalette::Normal, QColorGroup::Button, col );
42 pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); 40 pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
43 this->setPalette( pal ); 41 this->setPalette( pal );
44 42
45 // --- logo Section --- 43 // --- logo Section ---
46 QPalette pal2; 44 QPalette pal2;
47 QColorGroup cg; 45 QColorGroup cg;
48 cg.setColor( QColorGroup::Text, white ); 46 cg.setColor( QColorGroup::Text, white );
49 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); 47 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) );
50 pal2.setActive( cg ); 48 pal2.setActive( cg );
51 // today logo 49
50// today logo
52 Frame = new QLabel( this, "Frame" ); 51 Frame = new QLabel( this, "Frame" );
53 Frame->setPalette( pal2 ); 52 Frame->setPalette( pal2 );
54 Frame->setFrameShape( QFrame::StyledPanel ); 53 Frame->setFrameShape( QFrame::StyledPanel );
55 Frame->setFrameShadow( QFrame::Raised ); 54 Frame->setFrameShadow( QFrame::Raised );
56 Frame->setLineWidth( 0 ); 55 Frame->setLineWidth( 0 );
57 Frame->setMaximumHeight( 50 );
58 Frame->setMinimumHeight( 50 );
59 56
57 QHBoxLayout *frameLayout = new QHBoxLayout( Frame );
58 QVBox *box1 = new QVBox( Frame );
60 // Today text 59 // Today text
61 TodayLabel = new QLabel( Frame, "TodayText" ); 60 TodayLabel = new QLabel( box1, "TodayText" );
62 TodayLabel->setGeometry( QRect( 10, 1, 168, 40 ) );
63 QFont TodayLabel_font( TodayLabel->font() ); 61 QFont TodayLabel_font( TodayLabel->font() );
64 TodayLabel_font.setBold( TRUE ); 62 TodayLabel_font.setBold( TRUE );
65 TodayLabel_font.setPointSize( 40 ); 63 TodayLabel_font.setPointSize( 40 );
66 TodayLabel->setFont( TodayLabel_font ); 64 TodayLabel->setFont( TodayLabel_font );
67 TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); 65 TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin );
68 TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); 66 TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" );
69 67
70 // date 68 // date
71 DateLabel = new QLabel( Frame, "TextLabel1" ); 69 DateLabel = new QLabel( box1, "TextLabel1" );
72 DateLabel->setGeometry( QRect( 10, 35, 168, 12 ) );
73 QFont DateLabel_font( DateLabel->font() ); 70 QFont DateLabel_font( DateLabel->font() );
74 DateLabel_font.setBold( TRUE ); 71 DateLabel_font.setBold( TRUE );
75 DateLabel->setFont( DateLabel_font ); 72 DateLabel->setFont( DateLabel_font );
76 DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); 73 DateLabel->setBackgroundOrigin( QLabel::ParentOrigin );
77 DateLabel->setTextFormat( RichText ); 74 DateLabel->setTextFormat( RichText );
78 75
79 // Opiezilla 76 // Opiezilla
80 Opiezilla = new QLabel( Frame, "OpieZilla" ); 77 Opiezilla = new QLabel( Frame, "OpieZilla" );
81 Opiezilla->setPixmap( opiezilla ); 78 Opiezilla->setPixmap( opiezilla );
82 Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47 );
83 QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); 79 QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) );
84 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); 80 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin );
85 81
82
86 // Ownerfield 83 // Ownerfield
87 OwnerField = new OClickableLabel( this , "Owner" ); 84 OwnerField = new OClickableLabel( this , "Owner" );
88 OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) ); 85 OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) );
89 OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); 86 OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) );
90 OwnerField->setMaximumHeight(12); 87 OwnerField->setMaximumHeight(12);
91 88
92 // config 89 // config
93 ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); 90 ConfigButton = new OClickableLabel ( Frame, "PushButton1" );
94 ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 29, 25, 20 ) );
95 ConfigButton->setPixmap( config ); 91 ConfigButton->setPixmap( config );
96 QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) ); 92 QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) );
97 ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); 93 ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin );
94
95 frameLayout->addWidget( box1 );
96 frameLayout->addStretch( 2 );
97 frameLayout->addWidget( ConfigButton, 0, AlignBottom );
98 frameLayout->addWidget( Opiezilla );
98} 99}
99 100
101
100/** 102/**
101 * D' tor 103 * D' tor
102 */ 104 */
103TodayBase::~TodayBase() { 105TodayBase::~TodayBase() {
104} 106}
105 107