author | harlekin <harlekin> | 2002-02-15 16:58:37 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-02-15 16:58:37 (UTC) |
commit | 379e66393a2986e218baad0e585c1b4a0dd7d045 (patch) (unidiff) | |
tree | f274d64cd949fd894adcc4795d7e78aed40db76d | |
parent | bca491b8fbb2fe73abcf66c67ca0cd36099a714c (diff) | |
download | opie-379e66393a2986e218baad0e585c1b4a0dd7d045.zip opie-379e66393a2986e218baad0e585c1b4a0dd7d045.tar.gz opie-379e66393a2986e218baad0e585c1b4a0dd7d045.tar.bz2 |
brown paperbag release
-rw-r--r-- | core/pim/today/today.h | 22 | ||||
-rw-r--r-- | core/pim/today/today.pro | 10 | ||||
-rw-r--r-- | core/pim/today/todaybase.cpp | 55 | ||||
-rw-r--r-- | core/pim/today/todaybase.h | 5 |
4 files changed, 13 insertions, 79 deletions
diff --git a/core/pim/today/today.h b/core/pim/today/today.h index a85917a..50a10f1 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h | |||
@@ -1,81 +1,61 @@ | |||
1 | /* | 1 | /* |
2 | * today.h | 2 | * today.h |
3 | * | 3 | * |
4 | * --------------------- | 4 | * --------------------- |
5 | * | 5 | * |
6 | * begin : Sun 10 17:20:00 CEST 2002 | 6 | * begin : Sun 10 17:20:00 CEST 2002 |
7 | * copyright : (c) 2002 by Maximilian Reiß | 7 | * copyright : (c) 2002 by Maximilian Reiß |
8 | * email : max.reiss@gmx.de | 8 | * email : max.reiss@gmx.de |
9 | * | 9 | * |
10 | */ | 10 | */ |
11 | /*************************************************************************** | 11 | /*************************************************************************** |
12 | * * | 12 | * * |
13 | * This program is free software; you can redistribute it and/or modify * | 13 | * This program is free software; you can redistribute it and/or modify * |
14 | * it under the terms of the GNU General Public License as published by * | 14 | * it under the terms of the GNU General Public License as published by * |
15 | * the Free Software Foundation; either version 2 of the License, or * | 15 | * the Free Software Foundation; either version 2 of the License, or * |
16 | * (at your option) any later version. * | 16 | * (at your option) any later version. * |
17 | * * | 17 | * * |
18 | ***************************************************************************/ | 18 | ***************************************************************************/ |
19 | 19 | ||
20 | /* | 20 | |
21 | * todaybase.h | ||
22 | * | ||
23 | * --------------------- | ||
24 | * | ||
25 | * begin : Sun 10 17:20:00 CEST 2002 | ||
26 | * copyright : (c) 2002 by Maximilian Reiß | ||
27 | * email : max.reiss@gmx.de | ||
28 | * | ||
29 | */ | ||
30 | /*************************************************************************** | ||
31 | * * | ||
32 | * This program is free software; you can redistribute it and/or modify * | ||
33 | * it under the terms of the GNU General Public License as published by * | ||
34 | * the Free Software Foundation; either version 2 of the License, or * | ||
35 | * (at your option) any later version. * | ||
36 | * * | ||
37 | ***************************************************************************/ | ||
38 | #ifndef TODAY_H | 21 | #ifndef TODAY_H |
39 | #define TODAY_H | 22 | #define TODAY_H |
40 | #include "todaybase.h" | 23 | #include "todaybase.h" |
41 | 24 | ||
42 | #include <qpe/datebookdb.h> | 25 | #include <qpe/datebookdb.h> |
43 | 26 | ||
44 | #include <qdatetime.h> | 27 | #include <qdatetime.h> |
45 | #include <qlist.h> | 28 | #include <qlist.h> |
46 | #include "TodoItem.h" | 29 | #include "TodoItem.h" |
47 | #include "todayconfig.h" | 30 | #include "todayconfig.h" |
48 | 31 | ||
49 | class Today : public TodayBase | 32 | class Today : public TodayBase |
50 | { | 33 | { |
51 | Q_OBJECT | 34 | Q_OBJECT |
52 | 35 | ||
53 | public: | 36 | public: |
54 | Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 37 | Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
55 | ~Today(); | 38 | ~Today(); |
56 | 39 | ||
57 | private slots: | 40 | private slots: |
58 | void startConfig(); | 41 | void startConfig(); |
59 | void goodBye(); | ||
60 | void startTodo(); | 42 | void startTodo(); |
61 | void startDatebook(); | 43 | void startDatebook(); |
62 | 44 | ||
63 | private: | 45 | private: |
64 | void init(); | 46 | void init(); |
65 | void getDates(); | 47 | void getDates(); |
66 | void getTodo(); | 48 | void getTodo(); |
67 | QList<TodoItem> loadTodo(const char *filename); | 49 | QList<TodoItem> loadTodo(const char *filename); |
68 | private: | 50 | private: |
69 | DateBookDB *db; | 51 | DateBookDB *db; |
70 | todayconfig *conf; | 52 | todayconfig *conf; |
71 | //Config cfg; | 53 | //Config cfg; |
72 | int MAX_LINES_TASK; | 54 | int MAX_LINES_TASK; |
73 | int MAX_CHAR_CLIP; | 55 | int MAX_CHAR_CLIP; |
74 | int MAX_LINES_MEET; | 56 | int MAX_LINES_MEET; |
75 | int SHOW_LOCATION; | 57 | int SHOW_LOCATION; |
76 | int SHOW_NOTES; | 58 | int SHOW_NOTES; |
77 | |||
78 | |||
79 | }; | 59 | }; |
80 | #endif // TODAY_H | 60 | #endif // TODAY_H |
81 | 61 | ||
diff --git a/core/pim/today/today.pro b/core/pim/today/today.pro new file mode 100644 index 0000000..d8efe5a --- a/dev/null +++ b/core/pim/today/today.pro | |||
@@ -0,0 +1,10 @@ | |||
1 | TEMPLATE= app | ||
2 | #CONFIG = qt warn_on debug | ||
3 | CONFIG = qt warn_on release | ||
4 | HEADERS = today.h TodoItem.h minidom.h todaybase.h todayconfig.h | ||
5 | SOURCES = main.cpp today.cpp todaybase.cpp todayconfig.cpp minidom.c TodoItem.cpp | ||
6 | INCLUDEPATH+= $(QPEDIR)/include | ||
7 | DEPENDPATH+= $(QPEDIR)/include | ||
8 | LIBS += -lqpe | ||
9 | INTERFACES= | ||
10 | TARGET = today | ||
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index f61840b..a44f598 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp | |||
@@ -29,156 +29,103 @@ | |||
29 | #include <qpixmap.h> | 29 | #include <qpixmap.h> |
30 | #include <qscrollview.h> | 30 | #include <qscrollview.h> |
31 | 31 | ||
32 | #include <qpe/resource.h> | 32 | #include <qpe/resource.h> |
33 | 33 | ||
34 | /* | 34 | /* |
35 | * Constructs a TodayBase which is a child of 'parent', with the | 35 | * Constructs a TodayBase which is a child of 'parent', with the |
36 | * name 'name' and widget flags set to 'f' | 36 | * name 'name' and widget flags set to 'f' |
37 | */ | 37 | */ |
38 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | 38 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) |
39 | : QWidget( parent, name, fl ) | 39 | : QWidget( parent, name, fl ) |
40 | { | 40 | { |
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 | 49 | ||
50 | if ( !name ) | 50 | if ( !name ) |
51 | setName( "TodayBase" ); | 51 | setName( "TodayBase" ); |
52 | resize( 223, 307 ); | 52 | resize( 223, 307 ); |
53 | //setCaption( tr( "My Test App" ) ); | ||
54 | 53 | ||
55 | Frame4 = new QFrame( this, "Frame4" ); | 54 | Frame4 = new QFrame( this, "Frame4" ); |
56 | Frame4->setGeometry( QRect( -9, 50, 250, 150 ) ); | 55 | Frame4->setGeometry( QRect( -9, 50, 250, 150 ) ); |
57 | Frame4->setFrameShape( QScrollView::StyledPanel ); | 56 | Frame4->setFrameShape( QScrollView::StyledPanel ); |
58 | Frame4->setFrameShadow( QScrollView::Sunken ); | 57 | Frame4->setFrameShadow( QScrollView::Sunken ); |
59 | Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); | 58 | Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); |
60 | 59 | ||
61 | // hehe, qt is ... | 60 | // hehe, qt is ... |
62 | getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" ); | 61 | getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" ); |
63 | getridoffuckingstrippeldlinesbutton->setGeometry( QRect( 2, 10, 0, 0 ) ); | 62 | getridoffuckingstrippeldlinesbutton->setGeometry( QRect( 2, 10, 0, 0 ) ); |
64 | 63 | ||
65 | DatesButton = new QPushButton (Frame4, "DatesButton" ); | 64 | DatesButton = new QPushButton (Frame4, "DatesButton" ); |
66 | DatesButton->setGeometry( QRect( 10, 10, 36, 32 ) ); | 65 | DatesButton->setGeometry( QRect( 10, 10, 36, 32 ) ); |
67 | DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); | 66 | DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); |
68 | DatesButton->setPixmap( datebook ); | 67 | DatesButton->setPixmap( datebook ); |
69 | DatesButton->setFlat( TRUE ); | 68 | DatesButton->setFlat( TRUE ); |
70 | 69 | ||
71 | |||
72 | //PixmapLabel7 = new QLabel( Frame4, "PixmapLabel7" ); | ||
73 | //PixmapLabel7->setGeometry( QRect( 10, 10, 36, 32 ) ); | ||
74 | //PixmapLabel7->setPixmap( datebook ); | ||
75 | //PixmapLabel7->setScaledContents( FALSE ); | ||
76 | |||
77 | DatesField = new QLabel( Frame4, "DatesField" ); | 70 | DatesField = new QLabel( Frame4, "DatesField" ); |
78 | DatesField->setGeometry( QRect( 47, 10, 203, 120 ) ); | 71 | DatesField->setGeometry( QRect( 47, 10, 203, 120 ) ); |
79 | DatesField->setText( tr( "No appointments today" ) ); | 72 | DatesField->setText( tr( "No appointments today" ) ); |
80 | DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | 73 | DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); |
81 | 74 | ||
82 | Frame = new QLabel( this, "Frame" ); | 75 | Frame = new QLabel( this, "Frame" ); |
83 | Frame->setGeometry( QRect( 0, 0, 240, 50 ) ); | 76 | Frame->setGeometry( QRect( 0, 0, 240, 50 ) ); |
84 | QPalette pal; | 77 | QPalette pal; |
85 | QColorGroup cg; | 78 | QColorGroup cg; |
86 | //cg.setColor( QColorGroup::Foreground, white ); | ||
87 | // cg.setColor( QColorGroup::Button, QColor( 238, 234, 222) ); | ||
88 | //cg.setColor( QColorGroup::Light, white ); | ||
89 | //cg.setColor( QColorGroup::Midlight, QColor( 246, 244, 238) ); | ||
90 | // cg.setColor( QColorGroup::Dark, QColor( 119, 117, 111) ); | ||
91 | //cg.setColor( QColorGroup::Mid, QColor( 158, 155, 147) ); | ||
92 | cg.setColor( QColorGroup::Text, white ); | 79 | cg.setColor( QColorGroup::Text, white ); |
93 | //cg.setColor( QColorGroup::BrightText, white ); | ||
94 | //cg.setColor( QColorGroup::ButtonText, black ); | ||
95 | //cg.setColor( QColorGroup::Base, white ); | ||
96 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) ); | 80 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) ); |
97 | //cg.setColor( QColorGroup::Shadow, black ); | ||
98 | //cg.setColor( QColorGroup::Highlight, QColor( 74, 121, 205) ); | ||
99 | //cg.setColor( QColorGroup::HighlightedText, white ); | ||
100 | pal.setActive( cg ); | 81 | pal.setActive( cg ); |
101 | 82 | ||
102 | Frame->setPalette( pal ); | 83 | Frame->setPalette( pal ); |
103 | Frame->setFrameShape( QFrame::StyledPanel ); | 84 | Frame->setFrameShape( QFrame::StyledPanel ); |
104 | Frame->setFrameShadow( QFrame::Raised ); | 85 | Frame->setFrameShadow( QFrame::Raised ); |
105 | Frame->setLineWidth( 0 ); | 86 | Frame->setLineWidth( 0 ); |
106 | 87 | ||
107 | // datum | 88 | // datum |
108 | TextLabel1 = new QLabel( Frame, "TextLabel1" ); | 89 | TextLabel1 = new QLabel( Frame, "TextLabel1" ); |
109 | TextLabel1->setPalette( pal ); | 90 | TextLabel1->setPalette( pal ); |
110 | TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); | 91 | TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); |
111 | QFont TextLabel1_font( TextLabel1->font() ); | 92 | QFont TextLabel1_font( TextLabel1->font() ); |
112 | TextLabel1_font.setBold( TRUE ); | 93 | TextLabel1_font.setBold( TRUE ); |
113 | TextLabel1->setFont( TextLabel1_font ); | 94 | TextLabel1->setFont( TextLabel1_font ); |
114 | TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); | 95 | TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); |
115 | //TextLabel1->setText( tr( "" ) ); | ||
116 | TextLabel1->setTextFormat( QLabel::AutoText ); | 96 | TextLabel1->setTextFormat( QLabel::AutoText ); |
117 | //QToolTip::add( TextLabel1, tr( "Test" ) ); | 97 | |
118 | |||
119 | |||
120 | |||
121 | // todo | 98 | // todo |
122 | Frame15 = new QFrame( this, "Frame15" ); | 99 | Frame15 = new QFrame( this, "Frame15" ); |
123 | Frame15->setGeometry( QRect( -9, 200, 250, 130 ) ); | 100 | Frame15->setGeometry( QRect( -9, 200, 250, 130 ) ); |
124 | Frame15->setFrameShape( QFrame::StyledPanel ); | 101 | Frame15->setFrameShape( QFrame::StyledPanel ); |
125 | Frame15->setFrameShadow( QFrame::Sunken ); | 102 | Frame15->setFrameShadow( QFrame::Sunken ); |
126 | //Frame15->setBackgroundMode( PaletteBase ); | ||
127 | //Frame15->setBackgroundMode( PaletteBackground ); | ||
128 | |||
129 | |||
130 | // PixmapLabel1 = new QLabel( Frame15, "PixmapLabel1" ); | ||
131 | //PixmapLabel1->setGeometry( QRect( 10, 4, 36, 32 ) ); | ||
132 | //PixmapLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); | ||
133 | //PixmapLabel1->setPixmap( todo ); | ||
134 | //PixmapLabel1->setScaledContents( FALSE ); | ||
135 | 103 | ||
136 | |||
137 | TodoField = new QLabel( Frame15, "TodoButtonBack" ); | ||
138 | TodoField->setGeometry( QRect( 10, 4, 36, 32 ) ); | ||
139 | TodoField->setFrameShadow( QLabel::Plain ); | ||
140 | TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | ||
141 | |||
142 | TodoButton = new QPushButton (Frame15, "TodoButton" ); | 104 | TodoButton = new QPushButton (Frame15, "TodoButton" ); |
143 | TodoButton->setGeometry( QRect( 10, 4, 36, 32 ) ); | 105 | TodoButton->setGeometry( QRect( 10, 4, 36, 32 ) ); |
144 | TodoButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); | 106 | TodoButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); |
145 | TodoButton->setPixmap( todo ); | 107 | TodoButton->setPixmap( todo ); |
146 | TodoButton->setFlat( TRUE ); | 108 | TodoButton->setFlat( TRUE ); |
147 | 109 | ||
148 | TodoField = new QLabel( Frame15, "TodoField" ); | 110 | TodoField = new QLabel( Frame15, "TodoField" ); |
149 | TodoField->setGeometry( QRect( 47, 10, 196, 120 ) ); | 111 | TodoField->setGeometry( QRect( 47, 10, 196, 120 ) ); |
150 | TodoField->setFrameShadow( QLabel::Plain ); | 112 | TodoField->setFrameShadow( QLabel::Plain ); |
151 | TodoField->setText( tr( "No current todos" ) ); | 113 | TodoField->setText( tr( "No current todos" ) ); |
152 | TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | 114 | TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); |
153 | 115 | ||
154 | PushButton1 = new QPushButton (Frame15, "PushButton1" ); | 116 | PushButton1 = new QPushButton (Frame15, "PushButton1" ); |
155 | PushButton1->setGeometry( QRect( 225, 68, 25, 21 ) ); | 117 | PushButton1->setGeometry( QRect( 225, 68, 25, 21 ) ); |
156 | PushButton1->setBackgroundOrigin( QPushButton::WidgetOrigin ); | 118 | PushButton1->setBackgroundOrigin( QPushButton::WidgetOrigin ); |
157 | PushButton1->setPixmap( config ); | 119 | PushButton1->setPixmap( config ); |
158 | PushButton1->setAutoDefault( TRUE ); | 120 | PushButton1->setAutoDefault( TRUE ); |
159 | PushButton1->setFlat( TRUE ); | 121 | PushButton1->setFlat( TRUE ); |
160 | } | 122 | } |
161 | 123 | ||
162 | /* | 124 | /* |
163 | * Destroys the object and frees any allocated resources | 125 | * Destroys the object and frees any allocated resources |
164 | */ | 126 | */ |
165 | TodayBase::~TodayBase() | 127 | TodayBase::~TodayBase() |
166 | { | 128 | { |
167 | // no need to delete child widgets, Qt does it all for us | 129 | // no need to delete child widgets, Qt does it all for us |
168 | } | 130 | } |
169 | 131 | ||
170 | /* | ||
171 | * Main event handler. Reimplemented to handle application | ||
172 | * font changes | ||
173 | */ | ||
174 | bool TodayBase::event( QEvent* ev ) | ||
175 | { | ||
176 | bool ret = QWidget::event( ev ); | ||
177 | //if ( ev->type() == QEvent::ApplicationFontChange ) { | ||
178 | // QFont TextLabel1_font( TextLabel1->font() ); | ||
179 | // TextLabel1_font.setBold( TRUE ); | ||
180 | // TextLabel1->setFont( TextLabel1_font ); | ||
181 | // } | ||
182 | return ret; | ||
183 | } | ||
184 | |||
diff --git a/core/pim/today/todaybase.h b/core/pim/today/todaybase.h index 65d31de..947efc5 100644 --- a/core/pim/today/todaybase.h +++ b/core/pim/today/todaybase.h | |||
@@ -9,41 +9,38 @@ | |||
9 | #ifndef TODAYBASE_H | 9 | #ifndef TODAYBASE_H |
10 | #define TODAYBASE_H | 10 | #define TODAYBASE_H |
11 | 11 | ||
12 | #include <qvariant.h> | 12 | #include <qvariant.h> |
13 | #include <qwidget.h> | 13 | #include <qwidget.h> |
14 | #include <qscrollview.h> | 14 | #include <qscrollview.h> |
15 | 15 | ||
16 | class QVBoxLayout; | 16 | class QVBoxLayout; |
17 | class QHBoxLayout; | 17 | class QHBoxLayout; |
18 | class QGridLayout; | 18 | class QGridLayout; |
19 | class QFrame; | 19 | class QFrame; |
20 | class QLabel; | 20 | class QLabel; |
21 | class QPushButton; | 21 | class QPushButton; |
22 | 22 | ||
23 | class TodayBase : public QWidget | 23 | class TodayBase : public QWidget |
24 | { | 24 | { |
25 | Q_OBJECT | 25 | Q_OBJECT |
26 | 26 | ||
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* PixmapLabel7; | ||
34 | QLabel* DatesField; | 33 | QLabel* DatesField; |
35 | QFrame* Frame; | 34 | QFrame* Frame; |
36 | QLabel* TextLabel1; | 35 | QLabel* TextLabel1; |
37 | QFrame* Frame15; | 36 | QFrame* Frame15; |
38 | //QLabel* PixmapLabel1; | ||
39 | QLabel* TodoField; | 37 | QLabel* TodoField; |
40 | QPushButton* PushButton1; | 38 | QPushButton* PushButton1; |
41 | QPushButton* TodoButton; | 39 | QPushButton* TodoButton; |
42 | QLabel* todoback; | ||
43 | QPushButton* getridoffuckingstrippeldlinesbutton; | 40 | QPushButton* getridoffuckingstrippeldlinesbutton; |
44 | 41 | ||
45 | protected: | 42 | protected: |
46 | bool event( QEvent* ); | 43 | |
47 | }; | 44 | }; |
48 | 45 | ||
49 | #endif // TODAYBASE_H | 46 | #endif // TODAYBASE_H |