summaryrefslogtreecommitdiff
path: root/core/pim/today
authorharlekin <harlekin>2002-02-17 18:34:25 (UTC)
committer harlekin <harlekin>2002-02-17 18:34:25 (UTC)
commit687d0c760684392c89f4e99fbf803c8f4d67b2b1 (patch) (unidiff)
treebb0a80e71a3272ab222a36836cc24c9fc9471f46 /core/pim/today
parentf47194f17380a4af76d185036eff2dc4d1a44bed (diff)
downloadopie-687d0c760684392c89f4e99fbf803c8f4d67b2b1.zip
opie-687d0c760684392c89f4e99fbf803c8f4d67b2b1.tar.gz
opie-687d0c760684392c89f4e99fbf803c8f4d67b2b1.tar.bz2
new config option to decide if to show all appointments, also fixes the empty calendar part -bug-
Diffstat (limited to 'core/pim/today') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp44
-rw-r--r--core/pim/today/todayconfig.cpp18
-rw-r--r--core/pim/today/todayconfig.h1
3 files changed, 53 insertions, 10 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index eb8b50c..0f6e598 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -49,3 +49,3 @@ int SHOW_NOTES;
49// show only later dates 49// show only later dates
50int ONLY_LATER = 1; 50int ONLY_LATER;
51/* 51/*
@@ -77,3 +77,4 @@ void Today::draw()
77 getTodo(); 77 getTodo();
78 QTimer::singleShot( 60*1000, this, SLOT(draw()) ); 78 // how often refresh
79 QTimer::singleShot( 30*1000, this, SLOT(draw()) );
79 80
@@ -97,2 +98,4 @@ void Today::init()
97 SHOW_NOTES = cfg.readNumEntry("shownotes",0); 98 SHOW_NOTES = cfg.readNumEntry("shownotes",0);
99 ONLY_LATER = cfg.readNumEntry("onlylater",1);
100
98} 101}
@@ -121,3 +124,5 @@ void Today::startConfig()
121 conf->SpinBox7->setValue(MAX_CHAR_CLIP); 124 conf->SpinBox7->setValue(MAX_CHAR_CLIP);
122 125 // only later
126 conf->CheckBox3->setChecked(ONLY_LATER);
127
123 conf->exec(); 128 conf->exec();
@@ -129,3 +134,4 @@ void Today::startConfig()
129 int maxcharclip = conf->SpinBox7->value(); 134 int maxcharclip = conf->SpinBox7->value();
130 135 int onlylater = conf->CheckBox3->isChecked();
136
131 cfg.writeEntry("maxlinestask",maxlinestask); 137 cfg.writeEntry("maxlinestask",maxlinestask);
@@ -135,2 +141,3 @@ void Today::startConfig()
135 cfg.writeEntry("shownotes", notes); 141 cfg.writeEntry("shownotes", notes);
142 cfg.writeEntry("onlylater", onlylater);
136 // sync it to "disk" 143 // sync it to "disk"
@@ -171,3 +178,25 @@ void Today::getDates()
171 // still some bug in here, 1 h off 178 // still some bug in here, 1 h off
172 if ((time.toString() <= TimeString::dateString((*it).event().end())) && ONLY_LATER ) 179
180 // decide if to get all day or only later appointments
181 if (!ONLY_LATER)
182 {
183 msg += "<B>" + (*it).description() + "</B>";
184 // include location or not
185 if (SHOW_LOCATION == 1)
186 {
187 msg+= "<BR>" + (*it).location();
188 }
189 msg += "<BR>"
190 // start time of event
191 + TimeString::timeString(QTime((*it).event().start().time()) )
192 // end time of event
193 + "<b> - </b>" + TimeString::timeString(QTime((*it).event().end().time()) )
194 + "<BR>";
195 // include possible note or not
196 if (SHOW_NOTES == 1)
197 {
198 msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>";
199 }
200 }
201 else if ((time.toString() <= TimeString::dateString((*it).event().end())) && ONLY_LATER )
173 { 202 {
@@ -192,2 +221,7 @@ void Today::getDates()
192 } 221 }
222
223 if (msg.isEmpty())
224 {
225 msg = "No more appointments today";
226 }
193 } 227 }
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp
index 0f00802..4f2633d 100644
--- a/core/pim/today/todayconfig.cpp
+++ b/core/pim/today/todayconfig.cpp
@@ -50,3 +50,3 @@ todayconfig::todayconfig( QWidget* parent, const char* name, bool modal, WFlags
50 TextLabel4 = new QLabel( Frame8, "TextLabel4" ); 50 TextLabel4 = new QLabel( Frame8, "TextLabel4" );
51 TextLabel4->setGeometry( QRect( 20, 89, 100, 60 ) ); 51 TextLabel4->setGeometry( QRect( 20, 65, 100, 60 ) );
52 TextLabel4->setText( tr( "Should the \n" 52 TextLabel4->setText( tr( "Should the \n"
@@ -62,7 +62,15 @@ todayconfig::todayconfig( QWidget* parent, const char* name, bool modal, WFlags
62 CheckBox2->setGeometry( QRect( 158, 170, 27, 21 ) ); 62 CheckBox2->setGeometry( QRect( 158, 170, 27, 21 ) );
63 CheckBox2->setText( tr( "" ) ); 63 //CheckBox2->setText( tr( "" ) );
64 64
65 CheckBox1 = new QCheckBox( Frame8, "CheckBox1" ); 65 CheckBox1 = new QCheckBox( Frame8, "CheckBox1" );
66 CheckBox1->setGeometry( QRect( 158, 90, 27, 50 ) ); 66 CheckBox1->setGeometry( QRect( 158, 65, 27, 50 ) );
67 CheckBox1->setText( tr( "" ) ); 67 //CheckBox1->setText( tr( "" ) );
68
69 CheckBox3 = new QCheckBox (Frame8, "CheckBox3" );
70 CheckBox3->setGeometry( QRect( 158, 125, 27, 21 ) );
71
72 TextLabel6 = new QLabel( Frame8, "All Day");
73 TextLabel6->setGeometry( QRect( 20, 120, 100, 30 ) );
74 TextLabel6->setText( tr( "Show only later\n"
75 "appointments") );
68 76
@@ -74,3 +82,3 @@ todayconfig::todayconfig( QWidget* parent, const char* name, bool modal, WFlags
74 TextLabel3 = new QLabel( Frame8, "TextLabel3" ); 82 TextLabel3 = new QLabel( Frame8, "TextLabel3" );
75 TextLabel3->setGeometry( QRect( 20, 10, 90, 70 ) ); 83 TextLabel3->setGeometry( QRect( 20, 10, 90, 60 ) );
76 TextLabel3->setText( tr( "How many \n" 84 TextLabel3->setText( tr( "How many \n"
diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h
index 38e9beb..7facf85 100644
--- a/core/pim/today/todayconfig.h
+++ b/core/pim/today/todayconfig.h
@@ -36,2 +36,3 @@ public:
36 QLabel* TextLabel5; 36 QLabel* TextLabel5;
37 QCheckBox* CheckBox3;
37 QCheckBox* CheckBox2; 38 QCheckBox* CheckBox2;