author | harlekin <harlekin> | 2002-02-16 19:59:21 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-02-16 19:59:21 (UTC) |
commit | 4e6ec847f469a3669be864db69dee0d8b0e4a93b (patch) (unidiff) | |
tree | db92798a54f2eca93aa71fcf4d9aab3d116f0c5e | |
parent | be1704ffdb21c6d304ba36bfd5ef1f5db622baea (diff) | |
download | opie-4e6ec847f469a3669be864db69dee0d8b0e4a93b.zip opie-4e6ec847f469a3669be864db69dee0d8b0e4a93b.tar.gz opie-4e6ec847f469a3669be864db69dee0d8b0e4a93b.tar.bz2 |
new features: auto update and opiemail support
-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,4 +1,12 @@ | |||
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 |
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 | |||
@@ -34,8 +34,9 @@ | |||
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> |
@@ -56,19 +57,28 @@ Today::Today( QWidget* parent, const char* name, WFlags 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 |
@@ -125,12 +135,9 @@ void Today::startConfig() | |||
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 | /* |
@@ -261,8 +268,24 @@ QList<TodoItem> Today::loadTodo(const char *filename) | |||
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 | */ |
@@ -307,25 +330,34 @@ void Today::getTodo() | |||
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() |
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 | |||
@@ -40,13 +40,15 @@ class Today : public TodayBase | |||
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; |
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 | |||
@@ -45,12 +45,15 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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" ); |
@@ -62,15 +65,15 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 |
@@ -108,9 +111,9 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 | ||
@@ -120,14 +123,35 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 |
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 | |||
@@ -31,14 +31,16 @@ public: | |||
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 | ||