summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/today/today.cpp4
-rw-r--r--core/pim/today/todaybase.cpp161
2 files changed, 100 insertions, 65 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index bed3a74..9e5c27e 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -150,7 +150,6 @@ void Today::startConfig()
150} 150}
151 151
152 152
153
154/* 153/*
155 * Get all events that are in the datebook xml file for today 154 * Get all events that are in the datebook xml file for today
156 */ 155 */
@@ -176,10 +175,8 @@ void Today::getDates()
176 175
177 if ( count <= MAX_LINES_MEET ) 176 if ( count <= MAX_LINES_MEET )
178 { 177 {
179 //only get events past current time (start or end??)
180 //cout << time.toString() << endl; 178 //cout << time.toString() << endl;
181 //cout << TimeString::dateString((*it).event().end()) << endl; 179 //cout << TimeString::dateString((*it).event().end()) << endl;
182 // still some bug in here, 1 h off
183 180
184 // decide if to get all day or only later appointments 181 // decide if to get all day or only later appointments
185 if (!ONLY_LATER) 182 if (!ONLY_LATER)
@@ -195,6 +192,7 @@ void Today::getDates()
195 msg+= "<BR>" + (*it).location(); 192 msg+= "<BR>" + (*it).location();
196 } 193 }
197 msg += "<BR>" 194 msg += "<BR>"
195
198 // start time of event 196 // start time of event
199 + TimeString::timeString(QTime((*it).event().start().time()) ) 197 + TimeString::timeString(QTime((*it).event().start().time()) )
200 // end time of event 198 // end time of event
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index 32b45f7..ff6001a 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -29,6 +29,7 @@
29#include <qpixmap.h> 29#include <qpixmap.h>
30#include <qscrollview.h> 30#include <qscrollview.h>
31#include <qvbox.h> 31#include <qvbox.h>
32#include <qapplication.h>
32 33
33#include <qpe/resource.h> 34#include <qpe/resource.h>
34 35
@@ -39,54 +40,38 @@
39TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) 40TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
40 : QWidget( parent, name, fl ) 41 : QWidget( parent, name, fl )
41{ 42{
42 // logo 43 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo
43 QPixmap logo = Resource::loadPixmap( "today/today_logo"); 44 QPixmap datebook = Resource::loadPixmap("DateBook"); // datebook
44 // datebook 45 QPixmap todo = Resource::loadPixmap( "TodoList" ); // todo
45 QPixmap datebook = Resource::loadPixmap("DateBook"); 46 QPixmap config = Resource::loadPixmap( "today/config" ); // config icon
46 // todo 47 QPixmap mail = Resource::loadPixmap( "today/mail" ); // mail icon
47 QPixmap todo = Resource::loadPixmap( "TodoList" );
48 // config icon
49 QPixmap config = Resource::loadPixmap( "today/config" );
50 // mail icon
51 QPixmap mail = Resource::loadPixmap( "today/mail" );
52
53
54 QPalette pal2;
55 QColorGroup cg;
56 cg.setColor( QColorGroup::Text, white );
57 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) );
58 pal2.setActive( cg );
59
60 48
61 QPalette pal = this->palette(); 49 QPalette pal = this->palette();
62 QColor col = pal.color(QPalette::Active, QColorGroup::Background); 50 QColor col = pal.color(QPalette::Active, QColorGroup::Background);
63 pal.setColor(QPalette::Active, QColorGroup::Button, col); 51 pal.setColor(QPalette::Active, QColorGroup::Button, col);
64 this->setPalette(pal); 52 this->setPalette(pal);
65 53
66 QVBoxLayout * layout = new QVBoxLayout(this); 54 QWidget *d = QApplication::desktop();
67 55 int w=d->width();
68 Frame4 = new QFrame( this, "Frame4" ); 56 int h=d->height();
69 Frame4->setPalette( pal ); 57 resize( w , h ); // not good, what happens on rotation
70 Frame4->setFrameShape( QScrollView::StyledPanel );
71 Frame4->setFrameShadow( QScrollView::Sunken );
72 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin );
73 58
74 // hehe, qt is ... 59 // hehe, qt is ...
75 getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" ); 60 getridoffuckingstrippeldlinesbutton = new QPushButton (this, "asdfsad" );
76 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); 61 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) );
77 62
78 DatesButton = new QPushButton (Frame4, "DatesButton" );
79 DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) );
80 DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
81 DatesButton->setPalette( pal );
82 DatesButton->setPixmap( datebook );
83 DatesButton->setFlat( TRUE );
84 63
85 DatesField = new QLabel( Frame4, "DatesField" );
86 DatesField->setGeometry( QRect( 40, 4, 203, 120 ) );
87 DatesField->setText( tr( "No appointments today" ) );
88 DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
89 64
65 QVBoxLayout * layout = new QVBoxLayout(this);
66
67
68
69 // --- logo Section ---
70 QPalette pal2;
71 QColorGroup cg;
72 cg.setColor( QColorGroup::Text, white );
73 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) );
74 pal2.setActive( cg );
90 // today logo 75 // today logo
91 Frame = new QLabel( this, "Frame" ); 76 Frame = new QLabel( this, "Frame" );
92 Frame->setPalette( pal2 ); 77 Frame->setPalette( pal2 );
@@ -95,7 +80,6 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
95 Frame->setLineWidth( 0 ); 80 Frame->setLineWidth( 0 );
96 Frame->setMaximumHeight(50); 81 Frame->setMaximumHeight(50);
97 Frame->setMinimumHeight(50); 82 Frame->setMinimumHeight(50);
98
99 // date 83 // date
100 TextLabel1 = new QLabel( Frame, "TextLabel1" ); 84 TextLabel1 = new QLabel( Frame, "TextLabel1" );
101 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); 85 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) );
@@ -105,10 +89,73 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
105 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); 89 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin );
106 TextLabel1->setTextFormat( RichText ); 90 TextLabel1->setTextFormat( RichText );
107 91
108 // todo 92
93 // --- dates section ---
94 Frame4 = new QFrame( this, "Frame4" );
95 Frame4->setPalette( pal );
96 Frame4->setFrameShape( QScrollView::StyledPanel );
97 Frame4->setFrameShadow( QScrollView::Sunken );
98 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin );
99 Frame4->setFrameStyle( QFrame::NoFrame );
100 Frame4->setGeometry (QRect( 0, 0, this->width() , this->height()) );
101
102 QScrollView* sv1 = new QScrollView( Frame4 );
103 sv1->setResizePolicy(QScrollView::AutoOneFit);
104 sv1->setHScrollBarMode( QScrollView::AlwaysOff );
105 // need to find a better way!!!
106 sv1->setGeometry (QRect( 40, 2, Frame4->width()-40 , (Frame4->height()/3)+20 ) );
107 sv1->setFrameShape(QFrame::NoFrame);
108
109 DatesButton = new QPushButton (Frame4, "DatesButton" );
110 DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) );
111 DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
112 DatesButton->setPalette( pal );
113 DatesButton->setPixmap( datebook );
114 DatesButton->setFlat( TRUE );
115
116 DatesField = new QLabel( sv1->viewport(), "DatesField" );
117 sv1->addChild(DatesField);
118 DatesField->setText( tr( "No appointments today" ) );
119 DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
120
121
122 // --- mail section ---
123 MailFrame = new QFrame( this ,"MailFrame" );
124 //MailFrame->setPalette( pal );
125 MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin );
126 //MailFrame->setFrameShape( QScrollView::StyledPanel );
127 //MailFrame->setFrameShadow( QScrollView::Sunken );
128 MailFrame->setGeometry (QRect( 0, 0, this->width() , 15) );
129 MailFrame->setFrameStyle( QFrame::NoFrame );
130
131 QFrame* Line1 = new QFrame( MailFrame);
132 Line1->setGeometry( QRect( 0, 0, MailFrame->width(), 5 ) );
133 Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken );
134
135 MailButton = new QPushButton (MailFrame, "MailButton" );
136 MailButton->setGeometry( QRect( 2, 3, 36, 19 ) );
137 MailButton->setPalette( pal );
138 MailButton->setPixmap( mail );
139 MailButton->setFlat( TRUE );
140
141 MailField = new QLabel( MailFrame, "MailField" );
142 MailField->setGeometry( QRect( 40, 4, MailFrame->width(), 12) );
143 MailField->setText( tr( "Opiemail not installed" ) );
144 MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
145 MailField->setMaximumHeight(40);
146 MailField->setMinimumHeight(15);
147
148
149 // --- todo section --
109 Frame15 = new QFrame( this, "Frame15" ); 150 Frame15 = new QFrame( this, "Frame15" );
110 Frame15->setFrameShape( QFrame::StyledPanel ); 151 //Frame15->setFrameShape( QFrame::StyledPanel );
111 Frame15->setFrameShadow( QFrame::Sunken ); 152 //Frame15->setFrameShadow( QFrame::Sunken );
153 Frame15->setFrameStyle( QFrame::NoFrame );
154 Frame15->setGeometry (QRect( 40, 3, this->width() , this->height()) );
155
156 QFrame* Line2 = new QFrame( Frame15);
157 Line2->setGeometry( QRect( 0, 0, MailFrame->width(), 5 ) );
158 Line2->setFrameStyle( QFrame::HLine | QFrame::Sunken );
112 159
113 TodoButton = new QPushButton (Frame15, "TodoButton" ); 160 TodoButton = new QPushButton (Frame15, "TodoButton" );
114 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) ); 161 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) );
@@ -116,37 +163,27 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
116 TodoButton->setPixmap( todo ); 163 TodoButton->setPixmap( todo );
117 TodoButton->setFlat( TRUE ); 164 TodoButton->setFlat( TRUE );
118 165
119 TodoField = new QLabel( Frame15, "TodoField" ); 166 QScrollView* sv2 = new QScrollView( Frame15 );
120 TodoField->setGeometry( QRect( 40, 4, 196, 120 ) ); 167 sv2->setResizePolicy(QScrollView::AutoOneFit);
168 sv2->setHScrollBarMode( QScrollView::AlwaysOff );
169 sv2->setGeometry (QRect( 40, 3, Frame15->width()-40 , (Frame15->height()/3) ) );
170 sv2->setFrameShape(QFrame::NoFrame);
171
172 TodoField = new QLabel( sv2->viewport(), "TodoField" );
173 sv2->addChild(TodoField);
174 //TodoField->setGeometry( QRect( 40, 4, 196, 120 ) );
121 TodoField->setFrameShadow( QLabel::Plain ); 175 TodoField->setFrameShadow( QLabel::Plain );
122 TodoField->setText( tr( "No current todos" ) ); 176 //TodoField->setText( tr( "No current todos" ) );
123 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 177 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
124 178
125 PushButton1 = new QPushButton (Frame15, "PushButton1" ); 179 PushButton1 = new QPushButton (Frame15, "PushButton1" );
126 PushButton1->setGeometry( QRect( 216, 68, 25, 21 ) ); 180 PushButton1->setGeometry( QRect( 2, 68, 25, 21 ) );
127 PushButton1->setPixmap( config ); 181 PushButton1->setPixmap( config );
128 PushButton1->setPalette( pal ); 182 PushButton1->setPalette( pal );
129 PushButton1->setAutoDefault( TRUE ); 183 PushButton1->setAutoDefault( TRUE );
130 PushButton1->setFlat( TRUE ); 184 PushButton1->setFlat( TRUE );
131 185
132 // mail 186 // -- layout --
133 MailFrame = new QFrame( this ,"MailFrame" );
134 MailFrame->setFrameShape( QScrollView::StyledPanel );
135 MailFrame->setFrameShadow( QScrollView::Sunken );
136
137 MailButton = new QPushButton (MailFrame, "MailButton" );
138 MailButton->setGeometry( QRect( 2, 3, 36, 19 ) );
139 MailButton->setPalette( pal );
140 MailButton->setPixmap( mail );
141 MailButton->setFlat( TRUE );
142
143 MailField = new QLabel( MailFrame, "DatesField" );
144 MailField->setGeometry( QRect( 40, 4, 203, 120 ) );
145 MailField->setText( tr( "Opiemail not installed" ) );
146 MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
147 MailField->setMaximumHeight(40);
148 MailField->setMinimumHeight(30);
149
150 layout->addWidget(Frame); 187 layout->addWidget(Frame);
151 layout->addWidget(Frame4); 188 layout->addWidget(Frame4);
152 layout->addWidget(MailFrame); 189 layout->addWidget(MailFrame);