-rw-r--r-- | core/pim/today/today.cpp | 41 |
1 files changed, 32 insertions, 9 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; | |||
52 | int ONLY_LATER; | 52 | int ONLY_LATER; |
53 | int 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 | ||
71 | void 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 | |||
68 | void Today::draw() { | 86 | void 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 | } |