summaryrefslogtreecommitdiff
path: root/core
Unidiff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp41
-rw-r--r--core/pim/today/today.h1
-rw-r--r--core/pim/today/todayconfig.cpp14
-rw-r--r--core/pim/today/todayconfig.h2
4 files changed, 48 insertions, 10 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 6a0e9fc..0fa7ad5 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -52,2 +52,3 @@ int SHOW_NOTES;
52int ONLY_LATER; 52int ONLY_LATER;
53int AUTOSTART;
53/* 54/*
@@ -63,2 +64,4 @@ Today::Today( QWidget* parent, const char* name, WFlags fl )
63 64
65
66 autoStart();
64 draw(); 67 draw();
@@ -67,2 +70,17 @@ Today::Today( QWidget* parent, const char* name, WFlags fl )
67 70
71void Today::autoStart() {
72 Config cfg("today");
73 cfg.setGroup("Autostart");
74 AUTOSTART = cfg.readNumEntry("autostart",1);
75 if (AUTOSTART) {
76 QCopEnvelope e("QPE/System", "autoStart(QString,QString)");
77 e << QString("add");
78 e << QString("today");
79 } else {
80 QCopEnvelope e("QPE/System", "autoStart(QString,QString)");
81 e << QString("remove");
82 e << QString("today");
83 }
84}
85
68void Today::draw() { 86void Today::draw() {
@@ -78,5 +96,5 @@ void Today::init() {
78 QDate date = QDate::currentDate(); 96 QDate date = QDate::currentDate();
79 QString time = (date.toString()); 97 QString time = (tr( date.toString() ), white);
80 98
81 TextLabel1->setText("<qt><font color=white>" +time + "<font></qt>"); 99 TextLabel1->setText(time);
82 db = new DateBookDB; 100 db = new DateBookDB;
@@ -125,2 +143,4 @@ void Today::startConfig() {
125 143
144 conf->CheckBoxAuto->setChecked(AUTOSTART);
145
126 conf->exec(); 146 conf->exec();
@@ -133,3 +153,4 @@ void Today::startConfig() {
133 int onlylater = conf->CheckBox3->isChecked(); 153 int onlylater = conf->CheckBox3->isChecked();
134 154 int autostart =conf->CheckBoxAuto->isChecked();
155
135 cfg.writeEntry("maxlinestask",maxlinestask); 156 cfg.writeEntry("maxlinestask",maxlinestask);
@@ -140,5 +161,7 @@ void Today::startConfig() {
140 cfg.writeEntry("onlylater", onlylater); 161 cfg.writeEntry("onlylater", onlylater);
162 cfg.setGroup("Autostart");
163 cfg.writeEntry("autostart", autostart);
141 // sync it to "disk" 164 // sync it to "disk"
142 cfg.write(); 165 cfg.write();
143 166 autoStart();
144 draw(); 167 draw();
@@ -226,3 +249,3 @@ void Today::getDates() {
226 if (msg.isEmpty()) { 249 if (msg.isEmpty()) {
227 msg = "No more appointments today"; 250 msg = tr("No more appointments today");
228 } 251 }
@@ -342,5 +365,5 @@ void Today::getTodo() {
342 if( count == 1 ) { 365 if( count == 1 ) {
343 output = QString("There is <b> 1</b> active task: <br>" ); 366 output = tr("There is <b> 1</b> active task: <br>" );
344 } else { 367 } else {
345 output = QString("There are <b> %1</b> active tasks: <br>").arg(count); 368 output = tr("There are <b> %1</b> active tasks: <br>").arg(count);
346 } 369 }
@@ -348,6 +371,6 @@ void Today::getTodo() {
348 } else { 371 } else {
349 output = ("No active tasks"); 372 output = tr("No active tasks");
350 } 373 }
351 374
352 TodoField->setText(output); 375 TodoField->setText(tr(output));
353} 376}
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index 6b8c0bf..07bfd61 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -50,2 +50,3 @@ class Today : public TodayBase
50 void getMail(); 50 void getMail();
51 void autoStart();
51 QList<TodoItem> loadTodo(const char *filename); 52 QList<TodoItem> loadTodo(const char *filename);
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp
index 4f2633d..7c690a7 100644
--- a/core/pim/today/todayconfig.cpp
+++ b/core/pim/today/todayconfig.cpp
@@ -124,3 +124,15 @@ todayconfig::todayconfig( QWidget* parent, const char* name, bool modal, WFlags
124 SpinBox7->setValue( 30 ); 124 SpinBox7->setValue( 30 );
125 TabWidget3->insertTab( tab_3, tr( "All" ) ); 125
126 TextLabel2 = new QLabel( Frame14, "AutoStart" );
127 TextLabel2->setGeometry( QRect( 20, 60, 100, 45 ) );
128 TextLabel2->setText( tr( "Should today be\n"
129 "autostarted on\n"
130 "resume ?"
131 " (Opie only)" ) );
132
133 CheckBoxAuto = new QCheckBox (Frame14, "CheckBoxAuto" );
134 CheckBoxAuto->setGeometry( QRect( 158, 60, 27, 21 ) );
135
136 TabWidget3->insertTab( tab_3, tr( "Misc" ) );
137
126} 138}
diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h
index 7facf85..020097d 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 QLabel* TextLabel2;
37 QCheckBox* CheckBox3; 38 QCheckBox* CheckBox3;
@@ -39,2 +40,3 @@ public:
39 QCheckBox* CheckBox1; 40 QCheckBox* CheckBox1;
41 QCheckBox* CheckBoxAuto;
40 QSpinBox* SpinBox1; 42 QSpinBox* SpinBox1;