summaryrefslogtreecommitdiff
path: root/core/pim/today
authorharlekin <harlekin>2002-02-20 20:04:58 (UTC)
committer harlekin <harlekin>2002-02-20 20:04:58 (UTC)
commit17e96f64d6b66fac5f0e206492149d461e2ad900 (patch) (unidiff)
treea2af1d60dc0a44e6e7991fc25d5ed8d9646e3620 /core/pim/today
parentf5ce2ee04b4b9aed2a93e9a730ad22ced791dfd8 (diff)
downloadopie-17e96f64d6b66fac5f0e206492149d461e2ad900.zip
opie-17e96f64d6b66fac5f0e206492149d461e2ad900.tar.gz
opie-17e96f64d6b66fac5f0e206492149d461e2ad900.tar.bz2
new release fixing several bugs, look at changelog .-)
Diffstat (limited to 'core/pim/today') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/today/TODO8
-rw-r--r--core/pim/today/changelog9
-rw-r--r--core/pim/today/opie-today.control2
-rw-r--r--core/pim/today/today.cpp30
-rw-r--r--core/pim/today/todaybase.cpp29
-rw-r--r--core/pim/today/todaybase.h1
6 files changed, 47 insertions, 32 deletions
diff --git a/core/pim/today/TODO b/core/pim/today/TODO
index 91c933b..95b9b51 100644
--- a/core/pim/today/TODO
+++ b/core/pim/today/TODO
@@ -1,15 +1,17 @@
1TODO for today: 1TODO for today:
2 2
3* start the app on "resume" 3* start the app on "resume"
4 4
5* autoupdate 5* show alarm icons on alarm events
6 6
7 * fix 23 pm bug (done??) 7* problems with updating
8
9* add am/pm mode instead of 24 h, take system default
8 10
9* add mail support 11 * fix 23 pm bug (done??)
10 12
11* scrollbar? 13* scrollbar?
12 14
13* qcop integration for updating events? 15* qcop integration for updating events?
14 16
15* sort todos by pri. \ No newline at end of file 17* sort todos by pri. \ No newline at end of file
diff --git a/core/pim/today/changelog b/core/pim/today/changelog
index dd4cfc1..3f99052 100644
--- a/core/pim/today/changelog
+++ b/core/pim/today/changelog
@@ -1,6 +1,15 @@
10.2.5
2
3* some other minor fixes regarding autoupdate
4* fixed segfault with todolist > 7 entries
5* fixed the "ugly grey border around buttons" issue
6* fixed the "empty calendar field" "bug"
7* shown only later appointments as option
8
9
10.2.4 100.2.4
2 11
3* added support for email 12* added support for email
4* autoupdates after 1 min 13* autoupdates after 1 min
5* QCopEnvelope instead of system() 14* QCopEnvelope instead of system()
6* starting to use qvbox in gui 15* starting to use qvbox in gui
diff --git a/core/pim/today/opie-today.control b/core/pim/today/opie-today.control
index 3362a54..72e8f2b 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 pics/today/mail.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.4 6Version: 0.2.5
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 7a2d0c9..bed3a74 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -23,22 +23,24 @@
23 23
24#include <qpe/datebookdb.h> 24#include <qpe/datebookdb.h>
25#include <qpe/timestring.h> 25#include <qpe/timestring.h>
26#include <qpe/config.h> 26#include <qpe/config.h>
27#include <qpe/qcopenvelope_qws.h> 27#include <qpe/qcopenvelope_qws.h>
28#include <qpe/qprocess.h> 28#include <qpe/qprocess.h>
29#include <qpe/resource.h>
29 30
30#include <qdir.h> 31#include <qdir.h>
31#include <qfile.h> 32#include <qfile.h>
32#include <qdatetime.h> 33#include <qdatetime.h>
33#include <qtextstream.h> 34#include <qtextstream.h>
34#include <qcheckbox.h> 35#include <qcheckbox.h>
35#include <qspinbox.h> 36#include <qspinbox.h>
36#include <qpushbutton.h> 37#include <qpushbutton.h>
37#include <qlabel.h> 38#include <qlabel.h>
38#include <qtimer.h> 39#include <qtimer.h>
40#include <qpixmap.h>
39 41
40//#include <iostream.h> 42//#include <iostream.h>
41//#include <unistd.h> 43//#include <unistd.h>
42#include <stdlib.h> 44#include <stdlib.h>
43 45
44int MAX_LINES_TASK; 46int MAX_LINES_TASK;
@@ -55,36 +57,37 @@ int ONLY_LATER;
55Today::Today( QWidget* parent, const char* name, WFlags fl ) 57Today::Today( QWidget* parent, const char* name, WFlags fl )
56 : TodayBase( parent, name, fl ) 58 : TodayBase( parent, name, fl )
57{ 59{
58 QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) ); 60 QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) );
59 QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) ); 61 QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) );
60 QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); 62 QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) );
61 QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startMail() ) ); 63 QObject::connect( (QObject*)MailButton, SIGNAL( clicked() ), this, SLOT(startMail() ) );
62
63 QDate date = QDate::currentDate();
64 QString time = (date.toString());
65 TextLabel1->setText(time);
66 db = new DateBookDB;
67 64
68 draw(); 65 draw();
69} 66}
70 67
71 68
72void Today::draw() 69void Today::draw()
73{ 70{
74 init(); 71 init();
75 getDates(); 72 getDates();
76 getMail(); 73 getMail();
77 getTodo(); 74 getTodo();
78 // how often refresh 75 // how often refresh
79 QTimer::singleShot( 30*1000, this, SLOT(draw()) ); 76 QTimer::singleShot( 5*1000, this, SLOT(draw()) );
80 77
81} 78}
82 79
83void Today::init() 80void Today::init()
84{ 81{
82 QDate date = QDate::currentDate();
83 QString time = (date.toString());
84
85 TextLabel1->setText("<qt><font color=white>" +time + "<font></qt>");
86 db = new DateBookDB;
87
85 // read config 88 // read config
86 Config cfg("today"); 89 Config cfg("today");
87 cfg.setGroup("BaseConfig"); 90 cfg.setGroup("BaseConfig");
88 91
89 // how many lines should be showed in the task section 92 // how many lines should be showed in the task section
90 MAX_LINES_TASK = cfg.readNumEntry("maxlinestask",5); 93 MAX_LINES_TASK = cfg.readNumEntry("maxlinestask",5);
@@ -144,12 +147,13 @@ void Today::startConfig()
144 cfg.write(); 147 cfg.write();
145 148
146 draw(); 149 draw();
147} 150}
148 151
149 152
153
150/* 154/*
151 * Get all events that are in the datebook xml file for today 155 * Get all events that are in the datebook xml file for today
152 */ 156 */
153void Today::getDates() 157void Today::getDates()
154{ 158{
155 QDate date = QDate::currentDate(); 159 QDate date = QDate::currentDate();
@@ -178,12 +182,16 @@ void Today::getDates()
178 // still some bug in here, 1 h off 182 // still some bug in here, 1 h off
179 183
180 // decide if to get all day or only later appointments 184 // decide if to get all day or only later appointments
181 if (!ONLY_LATER) 185 if (!ONLY_LATER)
182 { 186 {
183 msg += "<B>" + (*it).description() + "</B>"; 187 msg += "<B>" + (*it).description() + "</B>";
188 if ( (*it).event().hasAlarm() )
189 {
190 msg += " <b>[with alarm]</b>";
191 }
184 // include location or not 192 // include location or not
185 if (SHOW_LOCATION == 1) 193 if (SHOW_LOCATION == 1)
186 { 194 {
187 msg+= "<BR>" + (*it).location(); 195 msg+= "<BR>" + (*it).location();
188 } 196 }
189 msg += "<BR>" 197 msg += "<BR>"
@@ -198,12 +206,16 @@ void Today::getDates()
198 msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; 206 msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>";
199 } 207 }
200 } 208 }
201 else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) 209 else if ((time.toString() <= TimeString::dateString((*it).event().end())) )
202 { 210 {
203 msg += "<B>" + (*it).description() + "</B>"; 211 msg += "<B>" + (*it).description() + "</B>";
212 if ( (*it).event().hasAlarm() )
213 {
214 msg += " <b>[with alarm]</b>";
215 }
204 // include location or not 216 // include location or not
205 if (SHOW_LOCATION == 1) 217 if (SHOW_LOCATION == 1)
206 { 218 {
207 msg+= "<BR>" + (*it).location(); 219 msg+= "<BR>" + (*it).location();
208 } 220 }
209 msg += "<BR>" 221 msg += "<BR>"
@@ -227,13 +239,12 @@ void Today::getDates()
227 DatesField->setText(msg); 239 DatesField->setText(msg);
228 } 240 }
229} 241}
230 242
231/* 243/*
232 * Parse in the todolist.xml 244 * Parse in the todolist.xml
233 *
234 */ 245 */
235QList<TodoItem> Today::loadTodo(const char *filename) 246QList<TodoItem> Today::loadTodo(const char *filename)
236{ 247{
237 DOM *todo; 248 DOM *todo;
238 ELE *tasks; 249 ELE *tasks;
239 ELE **tasklist; 250 ELE **tasklist;
@@ -259,13 +270,14 @@ QList<TodoItem> Today::loadTodo(const char *filename)
259 j = 0; 270 j = 0;
260 description = NULL; 271 description = NULL;
261 priority = -1; 272 priority = -1;
262 completed = -1; 273 completed = -1;
263 while((attlist) && (attlist[j])) 274 while((attlist) && (attlist[j]))
264 { 275 {
265 if(!attlist[i]->name) continue; 276 // SEGFAULT HERE WITH MORE THAN 7 ENTRIES
277 if(!attlist[j]->name) continue;
266 if(!strcmp(attlist[j]->name, "Description")) 278 if(!strcmp(attlist[j]->name, "Description"))
267 { 279 {
268 description = attlist[j]->value; 280 description = attlist[j]->value;
269 } 281 }
270 // get Completed tag (0 or 1) 282 // get Completed tag (0 or 1)
271 if(!strcmp(attlist[j]->name, "Completed")) 283 if(!strcmp(attlist[j]->name, "Completed"))
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index b0de1bf..32b45f7 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -24,13 +24,14 @@
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qvariant.h> 25#include <qvariant.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27#include <qwhatsthis.h> 27#include <qwhatsthis.h>
28#include <qimage.h> 28#include <qimage.h>
29#include <qpixmap.h> 29#include <qpixmap.h>
30//#include <qscrollview.h> 30#include <qscrollview.h>
31#include <qvbox.h>
31 32
32#include <qpe/resource.h> 33#include <qpe/resource.h>
33 34
34/* 35/*
35 * Constructs a TodayBase which is a child of 'parent', with the 36 * Constructs a TodayBase which is a child of 'parent', with the
36 * name 'name' and widget flags set to 'f' 37 * name 'name' and widget flags set to 'f'
@@ -61,14 +62,14 @@ QPalette pal = this->palette();
61QColor col = pal.color(QPalette::Active, QColorGroup::Background); 62QColor col = pal.color(QPalette::Active, QColorGroup::Background);
62pal.setColor(QPalette::Active, QColorGroup::Button, col); 63pal.setColor(QPalette::Active, QColorGroup::Button, col);
63this->setPalette(pal); 64this->setPalette(pal);
64 65
65 QVBoxLayout * layout = new QVBoxLayout(this); 66 QVBoxLayout * layout = new QVBoxLayout(this);
66 67
67
68 Frame4 = new QFrame( this, "Frame4" ); 68 Frame4 = new QFrame( this, "Frame4" );
69 Frame4->setPalette( pal );
69 Frame4->setFrameShape( QScrollView::StyledPanel ); 70 Frame4->setFrameShape( QScrollView::StyledPanel );
70 Frame4->setFrameShadow( QScrollView::Sunken ); 71 Frame4->setFrameShadow( QScrollView::Sunken );
71 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); 72 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin );
72 73
73 // hehe, qt is ... 74 // hehe, qt is ...
74 getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" ); 75 getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" );
@@ -99,77 +100,67 @@ this->setPalette(pal);
99 TextLabel1 = new QLabel( Frame, "TextLabel1" ); 100 TextLabel1 = new QLabel( Frame, "TextLabel1" );
100 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); 101 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) );
101 QFont TextLabel1_font( TextLabel1->font() ); 102 QFont TextLabel1_font( TextLabel1->font() );
102 TextLabel1_font.setBold( TRUE ); 103 TextLabel1_font.setBold( TRUE );
103 TextLabel1->setFont( TextLabel1_font ); 104 TextLabel1->setFont( TextLabel1_font );
104 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); 105 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin );
105 TextLabel1->setTextFormat( QLabel::AutoText ); 106 TextLabel1->setTextFormat( RichText );
106 107
107 // todo 108 // todo
108 Frame15 = new QFrame( this, "Frame15" ); 109 Frame15 = new QFrame( this, "Frame15" );
109 Frame15->setFrameShape( QFrame::StyledPanel ); 110 Frame15->setFrameShape( QFrame::StyledPanel );
110 Frame15->setFrameShadow( QFrame::Sunken ); 111 Frame15->setFrameShadow( QFrame::Sunken );
111 112
112 TodoButton = new QPushButton (Frame15, "TodoButton" ); 113 TodoButton = new QPushButton (Frame15, "TodoButton" );
113 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) ); 114 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) );
114 //TodoButton->setBackgroundMode(NoBackground);
115 TodoButton->setPalette( pal ); 115 TodoButton->setPalette( pal );
116 //TodoButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
117 TodoButton->setPixmap( todo ); 116 TodoButton->setPixmap( todo );
118 TodoButton->setFlat( TRUE ); 117 TodoButton->setFlat( TRUE );
119 118
120 TodoField = new QLabel( Frame15, "TodoField" ); 119 TodoField = new QLabel( Frame15, "TodoField" );
121 TodoField->setGeometry( QRect( 40, 4, 196, 120 ) ); 120 TodoField->setGeometry( QRect( 40, 4, 196, 120 ) );
122 TodoField->setFrameShadow( QLabel::Plain ); 121 TodoField->setFrameShadow( QLabel::Plain );
123 TodoField->setText( tr( "No current todos" ) ); 122 TodoField->setText( tr( "No current todos" ) );
124 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 123 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
125 124
126 PushButton1 = new QPushButton (Frame15, "PushButton1" ); 125 PushButton1 = new QPushButton (Frame15, "PushButton1" );
127 PushButton1->setGeometry( QRect( 216, 68, 25, 21 ) ); 126 PushButton1->setGeometry( QRect( 216, 68, 25, 21 ) );
128 //PushButton1->setBackgroundOrigin( QPushButton::WidgetOrigin );
129 PushButton1->setPixmap( config ); 127 PushButton1->setPixmap( config );
130 PushButton1->setPalette( pal ); 128 PushButton1->setPalette( pal );
131 PushButton1->setAutoDefault( TRUE ); 129 PushButton1->setAutoDefault( TRUE );
132 PushButton1->setFlat( TRUE ); 130 PushButton1->setFlat( TRUE );
133 131
134 // mail 132 // mail
135 MailFrame = new QFrame( this ,"MailFrame" ); 133 MailFrame = new QFrame( this ,"MailFrame" );
136 MailFrame->setFrameShape( QScrollView::StyledPanel ); 134 MailFrame->setFrameShape( QScrollView::StyledPanel );
137 MailFrame->setFrameShadow( QScrollView::Sunken ); 135 MailFrame->setFrameShadow( QScrollView::Sunken );
138 //MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin );
139 136
140 MailButton = new QPushButton (MailFrame, "MailButton" ); 137 MailButton = new QPushButton (MailFrame, "MailButton" );
141 MailButton->setGeometry( QRect( 2, 10, 36, 19 ) ); 138 MailButton->setGeometry( QRect( 2, 3, 36, 19 ) );
142 //MailButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
143 MailButton->setPalette( pal ); 139 MailButton->setPalette( pal );
144 MailButton->setPixmap( mail ); 140 MailButton->setPixmap( mail );
145 MailButton->setFlat( TRUE ); 141 MailButton->setFlat( TRUE );
146 142
147 MailField = new QLabel( MailFrame, "DatesField" ); 143 MailField = new QLabel( MailFrame, "DatesField" );
148 MailField->setGeometry( QRect( 40, 10, 203, 120 ) ); 144 MailField->setGeometry( QRect( 40, 4, 203, 120 ) );
149 MailField->setText( tr( "Opiemail not installed" ) ); 145 MailField->setText( tr( "Opiemail not installed" ) );
150 MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 146 MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
151 MailField->setMaximumHeight(15); 147 MailField->setMaximumHeight(40);
152 MailField->setMinimumHeight(10); 148 MailField->setMinimumHeight(30);
153
154
155
156 149
157 layout->addWidget(Frame); 150 layout->addWidget(Frame);
158 layout->addWidget(Frame4); 151 layout->addWidget(Frame4);
159 layout->addWidget(MailFrame); 152 layout->addWidget(MailFrame);
160 layout->addWidget(Frame15); 153 layout->addWidget(Frame15);
161 //layout->addWidget(split);
162 154
163 layout->setStretchFactor(Frame4,4); 155 layout->setStretchFactor(Frame4,5);
164 layout->setStretchFactor(MailFrame,1); 156 layout->setStretchFactor(MailFrame,1);
165 layout->setStretchFactor(Frame15,3); 157 layout->setStretchFactor(Frame15,4);
166} 158}
167 159
168/* 160/*
169 * Destroys the object and frees any allocated resources 161 * Destroys the object and frees any allocated resources
170 */ 162 */
171TodayBase::~TodayBase() 163TodayBase::~TodayBase()
172{ 164{
173
174} 165}
175 166
diff --git a/core/pim/today/todaybase.h b/core/pim/today/todaybase.h
index c84cc67..13fbb8d 100644
--- a/core/pim/today/todaybase.h
+++ b/core/pim/today/todaybase.h
@@ -26,12 +26,13 @@ class TodayBase : public QWidget
26 Q_OBJECT 26 Q_OBJECT
27 27
28public: 28public:
29 TodayBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 29 TodayBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
30 ~TodayBase(); 30 ~TodayBase();
31 31
32 //QScrollView* Frame4;
32 QFrame* Frame4; 33 QFrame* Frame4;
33 QPushButton* DatesButton; 34 QPushButton* DatesButton;
34 QLabel* DatesField; 35 QLabel* DatesField;
35 QLabel* Frame; 36 QLabel* Frame;
36 QFrame* MailFrame; 37 QFrame* MailFrame;
37 QLabel* TextLabel1; 38 QLabel* TextLabel1;