-rw-r--r-- | core/pim/today/changelog | 8 | ||||
-rw-r--r-- | core/pim/today/opie-today.control | 4 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 48 | ||||
-rw-r--r-- | core/pim/today/today.h | 4 | ||||
-rw-r--r-- | core/pim/today/todaybase.cpp | 40 | ||||
-rw-r--r-- | core/pim/today/todaybase.h | 4 |
6 files changed, 88 insertions, 20 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,8 +1,16 @@ | |||
1 | 0.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 | |||
1 | 0.2.3 | 9 | 0.2.3 |
2 | 10 | ||
3 | * the 4 am release | 11 | * the 4 am release |
4 | * several bugfixes | 12 | * several bugfixes |
5 | 13 | ||
6 | 14 | ||
7 | 0.2.2 | 15 | 0.2.2 |
8 | 16 | ||
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 @@ | |||
1 | Files: bin/today apps/Applications/today.desktop pics/today_icon.png pics/today/today_logo.png pics/today/config.png | 1 | Files: bin/today apps/Applications/today.desktop pics/today_icon.png pics/today/today_logo.png pics/today/config.png pics/today/mail.png |
2 | Priority: optional | 2 | Priority: optional |
3 | Section: opie/applications | 3 | Section: opie/applications |
4 | Maintainer: Maximilian Reiß <max.reiss@gmx.de> | 4 | Maintainer: Maximilian Reiß <max.reiss@gmx.de> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: 0.2.3 | 6 | Version: 0.2.4 |
7 | Depends: opie-base ($QPE_VERSION) | 7 | Depends: opie-base ($QPE_VERSION) |
8 | License: GPL | 8 | License: GPL |
9 | Description: today screen | 9 | Description: 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 | |||
@@ -30,16 +30,17 @@ | |||
30 | #include <qdir.h> | 30 | #include <qdir.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
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 | ||
43 | int MAX_LINES_TASK; | 44 | int MAX_LINES_TASK; |
44 | int MAX_CHAR_CLIP; | 45 | int MAX_CHAR_CLIP; |
45 | int MAX_LINES_MEET; | 46 | int MAX_LINES_MEET; |
@@ -52,27 +53,36 @@ int ONLY_LATER = 1; | |||
52 | * name 'name' and widget flags set to 'f' | 53 | * name 'name' and widget flags set to 'f' |
53 | */ | 54 | */ |
54 | Today::Today( QWidget* parent, const char* name, WFlags fl ) | 55 | Today::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 | |||
72 | void Today::draw() | ||
73 | { | ||
66 | init(); | 74 | init(); |
67 | getDates(); | 75 | getDates(); |
68 | getTodo(); | 76 | getMail(); |
69 | } | 77 | getTodo(); |
78 | QTimer::singleShot( 60*1000, this, SLOT(draw()) ); | ||
70 | 79 | ||
80 | } | ||
71 | 81 | ||
72 | void Today::init() | 82 | void 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"); |
77 | 87 | ||
78 | // how many lines should be showed in the task section | 88 | // how many lines should be showed in the task section |
@@ -121,20 +131,17 @@ void Today::startConfig() | |||
121 | cfg.writeEntry("maxlinestask",maxlinestask); | 131 | cfg.writeEntry("maxlinestask",maxlinestask); |
122 | cfg.writeEntry("maxcharclip", maxcharclip); | 132 | cfg.writeEntry("maxcharclip", maxcharclip); |
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 | */ |
139 | void Today::getDates() | 146 | void Today::getDates() |
140 | { | 147 | { |
@@ -257,16 +264,32 @@ QList<TodoItem> Today::loadTodo(const char *filename) | |||
257 | } | 264 | } |
258 | 265 | ||
259 | minidom_free(todo); | 266 | minidom_free(todo); |
260 | 267 | ||
261 | return loadtodolist; | 268 | return loadtodolist; |
262 | } | 269 | } |
263 | 270 | ||
264 | 271 | ||
272 | void 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 | */ |
269 | void Today::getTodo() | 292 | void Today::getTodo() |
270 | { | 293 | { |
271 | QString output; | 294 | QString output; |
272 | QString tmpout; | 295 | QString tmpout; |
@@ -303,32 +326,41 @@ void Today::getTodo() | |||
303 | { | 326 | { |
304 | output = ("No active tasks"); | 327 | output = ("No active tasks"); |
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 | */ |
313 | void Today::startDatebook() | 336 | void 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 | */ |
322 | void Today::startTodo() | 345 | void 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 | ||
351 | /* | ||
352 | * launch opiemail | ||
353 | */ | ||
354 | void Today::startMail() | ||
355 | { | ||
356 | QCopEnvelope e("QPE/System", "execute(QString)"); | ||
357 | e << QString("opiemail"); | ||
358 | } | ||
359 | |||
328 | /* | 360 | /* |
329 | * Destroys the object and frees any allocated resources | 361 | * Destroys the object and frees any allocated resources |
330 | */ | 362 | */ |
331 | Today::~Today() | 363 | Today::~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 | |||
@@ -36,21 +36,23 @@ class Today : public TodayBase | |||
36 | public: | 36 | public: |
37 | Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 37 | Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
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; |
55 | int MAX_CHAR_CLIP; | 57 | int MAX_CHAR_CLIP; |
56 | int MAX_LINES_MEET; | 58 | int MAX_LINES_MEET; |
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 | |||
@@ -41,40 +41,43 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
41 | // logo | 41 | // logo |
42 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); | 42 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); |
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 ); |
59 | Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); | 62 | Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); |
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; |
79 | QColorGroup cg; | 82 | QColorGroup cg; |
80 | cg.setColor( QColorGroup::Text, white ); | 83 | cg.setColor( QColorGroup::Text, white ); |
@@ -104,34 +107,55 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
104 | 107 | ||
105 | TodoButton = new QPushButton (Frame15, "TodoButton" ); | 108 | TodoButton = new QPushButton (Frame15, "TodoButton" ); |
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 | |||
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 | */ |
135 | TodayBase::~TodayBase() | 159 | TodayBase::~TodayBase() |
136 | { | 160 | { |
137 | // no need to delete child widgets, Qt does it all for us | 161 | // no need to delete child widgets, Qt does it all for us |
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 | |||
@@ -27,21 +27,23 @@ class TodayBase : public QWidget | |||
27 | public: | 27 | public: |
28 | TodayBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 28 | TodayBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
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 | ||
43 | protected: | 45 | protected: |
44 | 46 | ||
45 | }; | 47 | }; |
46 | 48 | ||
47 | #endif // TODAYBASE_H | 49 | #endif // TODAYBASE_H |