summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/today/changelog8
-rw-r--r--core/pim/today/opie-today.control4
-rw-r--r--core/pim/today/today.cpp46
-rw-r--r--core/pim/today/today.h4
-rw-r--r--core/pim/today/todaybase.cpp40
-rw-r--r--core/pim/today/todaybase.h4
6 files changed, 87 insertions, 19 deletions
diff --git a/core/pim/today/changelog b/core/pim/today/changelog
index 96a4163..dd4cfc1 100644
--- a/core/pim/today/changelog
+++ b/core/pim/today/changelog
@@ -1,6 +1,14 @@
10.2.4
2
3* added support for email
4* autoupdates after 1 min
5* QCopEnvelope instead of system()
6* starting to use qvbox in gui
7
8
10.2.3 90.2.3
2 10
3* the 4 am release 11* the 4 am release
4* several bugfixes 12* several bugfixes
5 13
6 14
diff --git a/core/pim/today/opie-today.control b/core/pim/today/opie-today.control
index 515632b..3362a54 100644
--- a/core/pim/today/opie-today.control
+++ b/core/pim/today/opie-today.control
@@ -1,10 +1,10 @@
1Files: bin/today apps/Applications/today.desktop pics/today_icon.png pics/today/today_logo.png pics/today/config.png 1Files: bin/today apps/Applications/today.desktop pics/today_icon.png pics/today/today_logo.png pics/today/config.png pics/today/mail.png
2Priority: optional 2Priority: optional
3Section: opie/applications 3Section: opie/applications
4Maintainer: Maximilian Reiß <max.reiss@gmx.de> 4Maintainer: Maximilian Reiß <max.reiss@gmx.de>
5Architecture: arm 5Architecture: arm
6Version: 0.2.3 6Version: 0.2.4
7Depends: opie-base ($QPE_VERSION) 7Depends: opie-base ($QPE_VERSION)
8License: GPL 8License: GPL
9Description: today screen 9Description: today screen
10 A short overview over current appointments and tasks. 10 A short overview over current appointments and tasks.
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 00a8842..eb8b50c 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -32,12 +32,13 @@
32#include <qdatetime.h> 32#include <qdatetime.h>
33#include <qtextstream.h> 33#include <qtextstream.h>
34#include <qcheckbox.h> 34#include <qcheckbox.h>
35#include <qspinbox.h> 35#include <qspinbox.h>
36#include <qpushbutton.h> 36#include <qpushbutton.h>
37#include <qlabel.h> 37#include <qlabel.h>
38#include <qtimer.h>
38 39
39//#include <iostream.h> 40//#include <iostream.h>
40//#include <unistd.h> 41//#include <unistd.h>
41#include <stdlib.h> 42#include <stdlib.h>
42 43
43int MAX_LINES_TASK; 44int MAX_LINES_TASK;
@@ -54,23 +55,32 @@ int ONLY_LATER = 1;
54Today::Today( QWidget* parent, const char* name, WFlags fl ) 55Today::Today( QWidget* parent, const char* name, WFlags fl )
55 : TodayBase( parent, name, fl ) 56 : TodayBase( parent, name, fl )
56{ 57{
57 QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) ); 58 QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) );
58 QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) ); 59 QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) );
59 QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); 60 QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) );
61 QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startMail() ) );
60 62
61 QDate date = QDate::currentDate(); 63 QDate date = QDate::currentDate();
62 QString time = (date.toString()); 64 QString time = (date.toString());
63 TextLabel1->setText(time); 65 TextLabel1->setText(time);
64 db = new DateBookDB; 66 db = new DateBookDB;
65 67
68 draw();
69}
70
71
72void Today::draw()
73{
66 init(); 74 init();
67 getDates(); 75 getDates();
76 getMail();
68 getTodo(); 77 getTodo();
69} 78 QTimer::singleShot( 60*1000, this, SLOT(draw()) );
70 79
80}
71 81
72void Today::init() 82void Today::init()
73{ 83{
74 // read config 84 // read config
75 Config cfg("today"); 85 Config cfg("today");
76 cfg.setGroup("BaseConfig"); 86 cfg.setGroup("BaseConfig");
@@ -123,16 +133,13 @@ void Today::startConfig()
123 cfg.writeEntry("maxlinesmeet",maxmeet); 133 cfg.writeEntry("maxlinesmeet",maxmeet);
124 cfg.writeEntry("showlocation",location); 134 cfg.writeEntry("showlocation",location);
125 cfg.writeEntry("shownotes", notes); 135 cfg.writeEntry("shownotes", notes);
126 // sync it to "disk" 136 // sync it to "disk"
127 cfg.write(); 137 cfg.write();
128 138
129 init(); 139 draw();
130 getDates();
131 getTodo();
132 //cout << location << endl;
133} 140}
134 141
135 142
136/* 143/*
137 * Get all events that are in the datebook xml file for today 144 * Get all events that are in the datebook xml file for today
138 */ 145 */
@@ -259,12 +266,28 @@ QList<TodoItem> Today::loadTodo(const char *filename)
259 minidom_free(todo); 266 minidom_free(todo);
260 267
261 return loadtodolist; 268 return loadtodolist;
262} 269}
263 270
264 271
272void Today::getMail()
273{
274 Config cfg("opiemail");
275 cfg.setGroup("today");
276
277 // how many lines should be showed in the task section
278 int NEW_MAILS = cfg.readNumEntry("newmails",0);
279 int OUTGOING = cfg.readNumEntry("outgoing",0);
280
281 QString output = tr("<b>%1</b> new mails, <b>%2</b> outgoing").arg(NEW_MAILS).arg(OUTGOING);
282
283
284 MailField->setText(output);
285}
286
287
265/* 288/*
266 * Get the todos 289 * Get the todos
267 * 290 *
268 */ 291 */
269void Today::getTodo() 292void Today::getTodo()
270{ 293{
@@ -305,30 +328,39 @@ void Today::getTodo()
305 } 328 }
306 329
307 TodoField->setText(output); 330 TodoField->setText(output);
308} 331}
309 332
310/* 333/*
311 * lanches datebook 334 * launches datebook
312 */ 335 */
313void Today::startDatebook() 336void Today::startDatebook()
314{ 337{
315 QCopEnvelope e("QPE/System", "execute(QString)"); 338 QCopEnvelope e("QPE/System", "execute(QString)");
316 e << QString("datebook"); 339 e << QString("datebook");
317} 340}
318 341
319/* 342/*
320 * lanches todolist 343 * launches todolist
321 */ 344 */
322void Today::startTodo() 345void Today::startTodo()
323{ 346{
324 QCopEnvelope e("QPE/System", "execute(QString)"); 347 QCopEnvelope e("QPE/System", "execute(QString)");
325 e << QString("todolist"); 348 e << QString("todolist");
326} 349}
327 350
328/* 351/*
352 * launch opiemail
353 */
354void Today::startMail()
355{
356 QCopEnvelope e("QPE/System", "execute(QString)");
357 e << QString("opiemail");
358}
359
360/*
329 * Destroys the object and frees any allocated resources 361 * Destroys the object and frees any allocated resources
330 */ 362 */
331Today::~Today() 363Today::~Today()
332{ 364{
333 // no need to delete child widgets, Qt does it all for us 365 // no need to delete child widgets, Qt does it all for us
334} 366}
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index 50a10f1..6b8c0bf 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -38,17 +38,19 @@ class Today : public TodayBase
38 ~Today(); 38 ~Today();
39 39
40 private slots: 40 private slots:
41 void startConfig(); 41 void startConfig();
42 void startTodo(); 42 void startTodo();
43 void startDatebook(); 43 void startDatebook();
44 44 void startMail();
45 void draw();
45 private: 46 private:
46 void init(); 47 void init();
47 void getDates(); 48 void getDates();
48 void getTodo(); 49 void getTodo();
50 void getMail();
49 QList<TodoItem> loadTodo(const char *filename); 51 QList<TodoItem> loadTodo(const char *filename);
50 private: 52 private:
51 DateBookDB *db; 53 DateBookDB *db;
52 todayconfig *conf; 54 todayconfig *conf;
53 //Config cfg; 55 //Config cfg;
54 int MAX_LINES_TASK; 56 int MAX_LINES_TASK;
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index b60c915..9331ee3 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -43,16 +43,19 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
43 // datebook 43 // datebook
44 QPixmap datebook = Resource::loadPixmap("DateBook"); 44 QPixmap datebook = Resource::loadPixmap("DateBook");
45 // todo 45 // todo
46 QPixmap todo = Resource::loadPixmap( "TodoList" ); 46 QPixmap todo = Resource::loadPixmap( "TodoList" );
47 // config icon 47 // config icon
48 QPixmap config = Resource::loadPixmap( "today/config" ); 48 QPixmap config = Resource::loadPixmap( "today/config" );
49 // mail icon
50 QPixmap mail = Resource::loadPixmap( "today/mail" );
49 51
50 if ( !name ) 52
51 setName( "TodayBase" ); 53 //if ( !name )
52 resize( 223, 307 ); 54 // setName( "TodayBase" );
55 //resize( 223, 307 );
53 56
54 QVBoxLayout * layout = new QVBoxLayout(this); 57 QVBoxLayout * layout = new QVBoxLayout(this);
55 58
56 Frame4 = new QFrame( this, "Frame4" ); 59 Frame4 = new QFrame( this, "Frame4" );
57 Frame4->setFrameShape( QScrollView::StyledPanel ); 60 Frame4->setFrameShape( QScrollView::StyledPanel );
58 Frame4->setFrameShadow( QScrollView::Sunken ); 61 Frame4->setFrameShadow( QScrollView::Sunken );
@@ -60,19 +63,19 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
60 63
61 // hehe, qt is ... 64 // hehe, qt is ...
62 getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" ); 65 getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" );
63 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); 66 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) );
64 67
65 DatesButton = new QPushButton (Frame4, "DatesButton" ); 68 DatesButton = new QPushButton (Frame4, "DatesButton" );
66 DatesButton->setGeometry( QRect( 2, 10, 36, 32 ) ); 69 DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) );
67 DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); 70 DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
68 DatesButton->setPixmap( datebook ); 71 DatesButton->setPixmap( datebook );
69 DatesButton->setFlat( TRUE ); 72 DatesButton->setFlat( TRUE );
70 73
71 DatesField = new QLabel( Frame4, "DatesField" ); 74 DatesField = new QLabel( Frame4, "DatesField" );
72 DatesField->setGeometry( QRect( 40, 10, 203, 120 ) ); 75 DatesField->setGeometry( QRect( 40, 4, 203, 120 ) );
73 DatesField->setText( tr( "No appointments today" ) ); 76 DatesField->setText( tr( "No appointments today" ) );
74 DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 77 DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
75 78
76 // today logo 79 // today logo
77 Frame = new QLabel( this, "Frame" ); 80 Frame = new QLabel( this, "Frame" );
78 QPalette pal; 81 QPalette pal;
@@ -106,30 +109,51 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
106 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) ); 109 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) );
107 TodoButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); 110 TodoButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
108 TodoButton->setPixmap( todo ); 111 TodoButton->setPixmap( todo );
109 TodoButton->setFlat( TRUE ); 112 TodoButton->setFlat( TRUE );
110 113
111 TodoField = new QLabel( Frame15, "TodoField" ); 114 TodoField = new QLabel( Frame15, "TodoField" );
112 TodoField->setGeometry( QRect( 40, 10, 196, 120 ) ); 115 TodoField->setGeometry( QRect( 40, 4, 196, 120 ) );
113 TodoField->setFrameShadow( QLabel::Plain ); 116 TodoField->setFrameShadow( QLabel::Plain );
114 TodoField->setText( tr( "No current todos" ) ); 117 TodoField->setText( tr( "No current todos" ) );
115 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 118 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
116 119
117 PushButton1 = new QPushButton (Frame15, "PushButton1" ); 120 PushButton1 = new QPushButton (Frame15, "PushButton1" );
118 PushButton1->setGeometry( QRect( 216, 68, 25, 21 ) ); 121 PushButton1->setGeometry( QRect( 216, 68, 25, 21 ) );
119 PushButton1->setBackgroundOrigin( QPushButton::WidgetOrigin ); 122 PushButton1->setBackgroundOrigin( QPushButton::WidgetOrigin );
120 PushButton1->setPixmap( config ); 123 PushButton1->setPixmap( config );
121 PushButton1->setAutoDefault( TRUE ); 124 PushButton1->setAutoDefault( TRUE );
122 PushButton1->setFlat( TRUE ); 125 PushButton1->setFlat( TRUE );
123 126
127 // mail
128 MailFrame = new QFrame( this, "MailFrame" );
129 MailFrame->setFrameShape( QScrollView::StyledPanel );
130 MailFrame->setFrameShadow( QScrollView::Sunken );
131 MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin );
132
133 MailButton = new QPushButton (MailFrame, "MailButton" );
134 MailButton->setGeometry( QRect( 2, 10, 36, 19 ) );
135 MailButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
136 MailButton->setPixmap( mail );
137 MailButton->setFlat( TRUE );
138
139 MailField = new QLabel( MailFrame, "DatesField" );
140 MailField->setGeometry( QRect( 40, 10, 203, 120 ) );
141 MailField->setText( tr( "Opiemail not installed" ) );
142 MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
143 MailField->setMaximumHeight(15);
144 MailField->setMinimumHeight(10);
145
124 layout->addWidget(Frame); 146 layout->addWidget(Frame);
125 layout->addWidget(Frame4); 147 layout->addWidget(Frame4);
148 layout->addWidget(MailFrame);
126 layout->addWidget(Frame15); 149 layout->addWidget(Frame15);
127 150
128 layout->setStretchFactor(Frame4,3); 151 layout->setStretchFactor(Frame4,4);
129 layout->setStretchFactor(Frame15,2); 152 layout->setStretchFactor(MailFrame,1);
153 layout->setStretchFactor(Frame15,3);
130} 154}
131 155
132/* 156/*
133 * Destroys the object and frees any allocated resources 157 * Destroys the object and frees any allocated resources
134 */ 158 */
135TodayBase::~TodayBase() 159TodayBase::~TodayBase()
diff --git a/core/pim/today/todaybase.h b/core/pim/today/todaybase.h
index 69c6363..15f021a 100644
--- a/core/pim/today/todaybase.h
+++ b/core/pim/today/todaybase.h
@@ -29,18 +29,20 @@ public:
29 ~TodayBase(); 29 ~TodayBase();
30 30
31 QFrame* Frame4; 31 QFrame* Frame4;
32 QPushButton* DatesButton; 32 QPushButton* DatesButton;
33 QLabel* DatesField; 33 QLabel* DatesField;
34 QLabel* Frame; 34 QLabel* Frame;
35 //QFrame* Frame; 35 QFrame* MailFrame;
36 QLabel* TextLabel1; 36 QLabel* TextLabel1;
37 QFrame* Frame15; 37 QFrame* Frame15;
38 QLabel* TodoField; 38 QLabel* TodoField;
39 QLabel* MailField;
39 QPushButton* PushButton1; 40 QPushButton* PushButton1;
40 QPushButton* TodoButton; 41 QPushButton* TodoButton;
42 QPushButton* MailButton;
41 QPushButton* getridoffuckingstrippeldlinesbutton; 43 QPushButton* getridoffuckingstrippeldlinesbutton;
42 44
43protected: 45protected:
44 46
45}; 47};
46 48