Merge lp:~knny-myer/timer-applet/interval-timer into lp:timer-applet
- interval-timer
- Merge into timer-applet
Proposed by
Kenny Meyer
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 342 | ||||
Proposed branch: | lp:~knny-myer/timer-applet/interval-timer | ||||
Merge into: | lp:timer-applet | ||||
Diff against target: |
2351 lines (+895/-326) (has conflicts) 16 files modified
timer-applet/THANKS (+1/-0) timer-applet/data/TimerApplet.xml (+1/-0) timer-applet/data/timer-applet.glade (+164/-11) timer-applet/po/bn.po (+140/-69) timer-applet/po/es.po (+107/-69) timer-applet/po/messages.pot (+96/-69) timer-applet/src/timerapplet/controllers/GlobalController.py (+18/-6) timer-applet/src/timerapplet/controllers/TimerApplet.py (+135/-69) timer-applet/src/timerapplet/core/PresetsStore.py (+41/-13) timer-applet/src/timerapplet/core/Timer.py (+25/-2) timer-applet/src/timerapplet/ui/AddEditPresetDialog.py (+12/-2) timer-applet/src/timerapplet/ui/Makefile.am (+1/-0) timer-applet/src/timerapplet/ui/StartNextTimerDialog.py (+66/-0) timer-applet/src/timerapplet/ui/StartTimerDialog.py (+49/-14) timer-applet/src/timerapplet/ui/__init__.py (+1/-0) timer-applet/src/timerapplet/utils.py (+38/-2) Text conflict in timer-applet/po/es.po |
||||
To merge this branch: | bzr merge lp:~knny-myer/timer-applet/interval-timer | ||||
Related bugs: |
|
||||
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kenny Meyer | Approve | ||
Review via email: mp+35571@code.launchpad.net |
Commit message
Description of the change
Added feature for defining a next timer in the presets menu.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'timer-applet/THANKS' |
2 | --- timer-applet/THANKS 2010-07-23 23:21:41 +0000 |
3 | +++ timer-applet/THANKS 2010-09-15 19:27:52 +0000 |
4 | @@ -1,5 +1,6 @@ |
5 | Timer Applet THANKS: |
6 | |
7 | +Dave Atkins |
8 | Ben Harrison |
9 | Philipp Kern |
10 | Paco Molinero |
11 | |
12 | === modified file 'timer-applet/data/TimerApplet.xml' |
13 | --- timer-applet/data/TimerApplet.xml 2007-04-15 05:04:58 +0000 |
14 | +++ timer-applet/data/TimerApplet.xml 2010-09-15 19:27:52 +0000 |
15 | @@ -6,6 +6,7 @@ |
16 | <menuitem verb="ContinueTimer" name="Continue Item" _label="_Continue"/> |
17 | <menuitem verb="StopTimer" name="Stop Item" _label="_Stop"/> |
18 | <menuitem verb="RestartTimer" name="Restart Item" _label="R_estart"/> |
19 | + <menuitem verb="StartNextTimer" name="Start next item" _label="Next"/> |
20 | <submenu name="Presets" _label="Pre_sets"> |
21 | </submenu> |
22 | <separator name="Separator1"/> |
23 | |
24 | === modified file 'timer-applet/data/timer-applet.glade' |
25 | --- timer-applet/data/timer-applet.glade 2010-08-02 00:21:28 +0000 |
26 | +++ timer-applet/data/timer-applet.glade 2010-09-15 19:27:52 +0000 |
27 | @@ -74,33 +74,131 @@ |
28 | <widget class="GtkVBox" id="vbox1"> |
29 | <property name="visible">True</property> |
30 | <child> |
31 | - <widget class="GtkHBox" id="hbox1"> |
32 | + <widget class="GtkFrame" id="frame1"> |
33 | <property name="visible">True</property> |
34 | - <child> |
35 | - <widget class="GtkEntry" id="command_entry"> |
36 | - <property name="visible">True</property> |
37 | - <property name="can_focus">True</property> |
38 | - <signal name="changed" handler="command_entry_changed_cb"/> |
39 | + <property name="label_xalign">0</property> |
40 | + <property name="shadow_type">none</property> |
41 | + <child> |
42 | + <widget class="GtkAlignment" id="alignment1"> |
43 | + <property name="visible">True</property> |
44 | + <property name="left_padding">12</property> |
45 | + <child> |
46 | + <widget class="GtkVBox" id="vbox2"> |
47 | + <property name="visible">True</property> |
48 | + <child> |
49 | + <widget class="GtkTable" id="table1"> |
50 | + <property name="visible">True</property> |
51 | + <property name="n_rows">2</property> |
52 | + <child> |
53 | + <widget class="GtkComboBoxEntry" id="next_timer_combo_entry"> |
54 | + <property name="visible">True</property> |
55 | + </widget> |
56 | + <packing> |
57 | + <property name="y_padding">3</property> |
58 | + </packing> |
59 | + </child> |
60 | + <child> |
61 | + <widget class="GtkCheckButton" id="auto_start_check"> |
62 | + <property name="label" translatable="yes">Start automatically</property> |
63 | + <property name="visible">True</property> |
64 | + <property name="sensitive">False</property> |
65 | + <property name="can_focus">True</property> |
66 | + <property name="receives_default">False</property> |
67 | + <property name="draw_indicator">True</property> |
68 | + </widget> |
69 | + <packing> |
70 | + <property name="top_attach">1</property> |
71 | + <property name="bottom_attach">2</property> |
72 | + <property name="y_padding">3</property> |
73 | + </packing> |
74 | + </child> |
75 | + </widget> |
76 | + <packing> |
77 | + <property name="position">0</property> |
78 | + </packing> |
79 | + </child> |
80 | + </widget> |
81 | + </child> |
82 | + </widget> |
83 | + </child> |
84 | + <child> |
85 | + <widget class="GtkLabel" id="label2"> |
86 | + <property name="visible">True</property> |
87 | + <property name="label" translatable="yes"><b>Define next timer</b></property> |
88 | + <property name="use_markup">True</property> |
89 | </widget> |
90 | <packing> |
91 | - <property name="padding">5</property> |
92 | - <property name="position">0</property> |
93 | + <property name="type">label_item</property> |
94 | </packing> |
95 | </child> |
96 | </widget> |
97 | <packing> |
98 | - <property name="padding">2</property> |
99 | <property name="position">0</property> |
100 | </packing> |
101 | </child> |
102 | <child> |
103 | + <widget class="GtkFrame" id="frame2"> |
104 | + <property name="visible">True</property> |
105 | + <property name="label_xalign">0</property> |
106 | + <property name="shadow_type">none</property> |
107 | + <child> |
108 | + <widget class="GtkAlignment" id="alignment2"> |
109 | + <property name="visible">True</property> |
110 | + <property name="left_padding">12</property> |
111 | + <child> |
112 | + <widget class="GtkHBox" id="hbox2"> |
113 | + <property name="visible">True</property> |
114 | + <property name="border_width">3</property> |
115 | + <child> |
116 | + <widget class="GtkLabel" id="command_label"> |
117 | + <property name="width_request">50</property> |
118 | + <property name="visible">True</property> |
119 | + <property name="has_tooltip">True</property> |
120 | + <property name="ypad">5</property> |
121 | + <property name="label" translatable="yes">Execute:</property> |
122 | + </widget> |
123 | + <packing> |
124 | + <property name="position">0</property> |
125 | + </packing> |
126 | + </child> |
127 | + <child> |
128 | + <widget class="GtkEntry" id="command_entry"> |
129 | + <property name="visible">True</property> |
130 | + <property name="can_focus">True</property> |
131 | + <signal name="changed" handler="command_entry_changed_cb"/> |
132 | + </widget> |
133 | + <packing> |
134 | + <property name="padding">5</property> |
135 | + <property name="position">1</property> |
136 | + </packing> |
137 | + </child> |
138 | + </widget> |
139 | + </child> |
140 | + </widget> |
141 | + </child> |
142 | + <child> |
143 | + <widget class="GtkLabel" id="label3"> |
144 | + <property name="visible">True</property> |
145 | + <property name="label" translatable="yes"><b>Run custom command</b></property> |
146 | + <property name="use_markup">True</property> |
147 | + </widget> |
148 | + <packing> |
149 | + <property name="type">label_item</property> |
150 | + </packing> |
151 | + </child> |
152 | + </widget> |
153 | + <packing> |
154 | + <property name="position">1</property> |
155 | + </packing> |
156 | + </child> |
157 | + <child> |
158 | <widget class="GtkLabel" id="invalid_command_label"> |
159 | <property name="visible">True</property> |
160 | <property name="app_paintable">True</property> |
161 | <property name="use_markup">True</property> |
162 | </widget> |
163 | <packing> |
164 | - <property name="position">1</property> |
165 | + <property name="position">2</property> |
166 | </packing> |
167 | </child> |
168 | </widget> |
169 | @@ -109,7 +207,7 @@ |
170 | <widget class="GtkLabel" id="label_command"> |
171 | <property name="visible">True</property> |
172 | <property name="tooltip" translatable="yes">Run executable after timer finished.</property> |
173 | - <property name="label" translatable="yes">Run executable</property> |
174 | + <property name="label" translatable="yes">Advanced</property> |
175 | </widget> |
176 | <packing> |
177 | <property name="type">label_item</property> |
178 | @@ -632,6 +730,7 @@ |
179 | <widget class="GtkAlignment" id="alignment2"> |
180 | <property name="visible">True</property> |
181 | <property name="left_padding">12</property> |
182 | + <property name="right_padding">12</property> |
183 | <child> |
184 | <widget class="GtkEntry" id="name_entry"> |
185 | <property name="visible">True</property> |
186 | @@ -704,6 +803,7 @@ |
187 | <widget class="GtkAlignment" id="alignment1"> |
188 | <property name="visible">True</property> |
189 | <property name="left_padding">12</property> |
190 | + <property name="right_padding">12</property> |
191 | <child> |
192 | <widget class="GtkEntry" id="command_entry"> |
193 | <property name="visible">True</property> |
194 | @@ -728,6 +828,59 @@ |
195 | <property name="position">2</property> |
196 | </packing> |
197 | </child> |
198 | + <child> |
199 | + <widget class="GtkFrame" id="frame4"> |
200 | + <property name="visible">True</property> |
201 | + <property name="label_xalign">0</property> |
202 | + <property name="shadow_type">none</property> |
203 | + <child> |
204 | + <widget class="GtkAlignment" id="alignment4"> |
205 | + <property name="visible">True</property> |
206 | + <property name="left_padding">12</property> |
207 | + <property name="right_padding">12</property> |
208 | + <child> |
209 | + <widget class="GtkVBox" id="vbox1"> |
210 | + <property name="visible">True</property> |
211 | + <child> |
212 | + <widget class="GtkEntry" id="next_timer_entry"> |
213 | + <property name="visible">True</property> |
214 | + <property name="can_focus">True</property> |
215 | + </widget> |
216 | + <packing> |
217 | + <property name="position">0</property> |
218 | + </packing> |
219 | + </child> |
220 | + <child> |
221 | + <widget class="GtkCheckButton" id="auto_start_check"> |
222 | + <property name="label" translatable="yes">Initiate automatically</property> |
223 | + <property name="visible">True</property> |
224 | + <property name="can_focus">True</property> |
225 | + <property name="receives_default">False</property> |
226 | + <property name="draw_indicator">True</property> |
227 | + </widget> |
228 | + <packing> |
229 | + <property name="position">1</property> |
230 | + </packing> |
231 | + </child> |
232 | + </widget> |
233 | + </child> |
234 | + </widget> |
235 | + </child> |
236 | + <child> |
237 | + <widget class="GtkLabel" id="label2"> |
238 | + <property name="visible">True</property> |
239 | + <property name="label" translatable="yes"><b>Interval timer</b></property> |
240 | + <property name="use_markup">True</property> |
241 | + </widget> |
242 | + <packing> |
243 | + <property name="type">label_item</property> |
244 | + </packing> |
245 | + </child> |
246 | + </widget> |
247 | + <packing> |
248 | + <property name="position">3</property> |
249 | + </packing> |
250 | + </child> |
251 | </widget> |
252 | <packing> |
253 | <property name="position">1</property> |
254 | |
255 | === modified file 'timer-applet/po/bn.po' |
256 | --- timer-applet/po/bn.po 2010-07-11 03:37:51 +0000 |
257 | +++ timer-applet/po/bn.po 2010-09-15 19:27:52 +0000 |
258 | @@ -7,7 +7,7 @@ |
259 | msgstr "" |
260 | "Project-Id-Version: timer-applet\n" |
261 | "Report-Msgid-Bugs-To: \n" |
262 | -"POT-Creation-Date: 2010-07-10 05:19+0000\n" |
263 | +"POT-Creation-Date: 2010-09-15 15:16-0400\n" |
264 | "PO-Revision-Date: 2010-07-10 05:12+0000\n" |
265 | "Last-Translator: Khandakar Mujahidul Islam <suzan229@gmail.com>\n" |
266 | "Language-Team: Bengali <bn@li.org>\n" |
267 | @@ -39,123 +39,175 @@ |
268 | msgstr "" |
269 | |
270 | #: ../data/TimerApplet.xml.h:2 |
271 | +msgid "Next" |
272 | +msgstr "" |
273 | + |
274 | +#: ../data/TimerApplet.xml.h:3 |
275 | msgid "Pa_use" |
276 | msgstr "স্থগিত (_ত)" |
277 | |
278 | -#: ../data/TimerApplet.xml.h:3 |
279 | +#: ../data/TimerApplet.xml.h:4 |
280 | msgid "Pre_sets" |
281 | msgstr "" |
282 | |
283 | -#: ../data/TimerApplet.xml.h:4 |
284 | +#: ../data/TimerApplet.xml.h:5 |
285 | msgid "R_estart" |
286 | msgstr "পুনরায় চালু (_ল)" |
287 | |
288 | -#: ../data/TimerApplet.xml.h:5 |
289 | +#: ../data/TimerApplet.xml.h:6 |
290 | msgid "_About" |
291 | msgstr "পরিচিতি (_প)" |
292 | |
293 | -#: ../data/TimerApplet.xml.h:6 |
294 | +#: ../data/TimerApplet.xml.h:7 |
295 | msgid "_Continue" |
296 | msgstr "এগিয়ে যান" |
297 | |
298 | -#: ../data/TimerApplet.xml.h:7 |
299 | +#: ../data/TimerApplet.xml.h:8 |
300 | msgid "_Preferences" |
301 | msgstr "পছন্দ (_ছ)" |
302 | |
303 | -#: ../data/TimerApplet.xml.h:8 |
304 | +#: ../data/TimerApplet.xml.h:9 |
305 | msgid "_Stop" |
306 | msgstr "থামাও(_ও)" |
307 | |
308 | #: ../data/timer-applet.glade.h:1 |
309 | +msgid "<b>Custom command</b>" |
310 | +msgstr "" |
311 | + |
312 | +#: ../data/timer-applet.glade.h:2 |
313 | +msgid "<b>Define next timer</b>" |
314 | +msgstr "" |
315 | + |
316 | +#: ../data/timer-applet.glade.h:3 |
317 | +msgid "<b>Interval timer</b>" |
318 | +msgstr "" |
319 | + |
320 | +#: ../data/timer-applet.glade.h:4 |
321 | +msgid "<b>Run custom command</b>" |
322 | +msgstr "" |
323 | + |
324 | +#: ../data/timer-applet.glade.h:5 |
325 | msgid "<b>_Duration</b>" |
326 | msgstr "" |
327 | |
328 | -#: ../data/timer-applet.glade.h:2 |
329 | +#: ../data/timer-applet.glade.h:6 |
330 | msgid "<b>_Name</b>" |
331 | msgstr "" |
332 | |
333 | -#: ../data/timer-applet.glade.h:3 |
334 | +#: ../data/timer-applet.glade.h:7 |
335 | msgid "<b>_Presets</b>" |
336 | msgstr "" |
337 | |
338 | -#: ../data/timer-applet.glade.h:4 |
339 | +#: ../data/timer-applet.glade.h:8 |
340 | msgid "A timer applet for the perfect egg and beyond!" |
341 | msgstr "" |
342 | |
343 | -#: ../data/timer-applet.glade.h:5 |
344 | +#: ../data/timer-applet.glade.h:9 |
345 | #: ../src/timerapplet/controllers/GlobalController.py:47 |
346 | msgid "Add Preset" |
347 | msgstr "" |
348 | |
349 | -#: ../data/timer-applet.glade.h:6 |
350 | +#: ../data/timer-applet.glade.h:10 |
351 | +msgid "Advanced" |
352 | +msgstr "" |
353 | + |
354 | +#: ../data/timer-applet.glade.h:11 |
355 | msgid "Choose A Sound File" |
356 | msgstr "" |
357 | |
358 | -#: ../data/timer-applet.glade.h:7 |
359 | +#: ../data/timer-applet.glade.h:12 |
360 | +msgid "Execute:" |
361 | +msgstr "" |
362 | + |
363 | +#: ../data/timer-applet.glade.h:13 |
364 | +msgid "Initiate automatically" |
365 | +msgstr "" |
366 | + |
367 | +#: ../data/timer-applet.glade.h:14 |
368 | msgid "Mana_ge Presets" |
369 | msgstr "" |
370 | |
371 | -#: ../data/timer-applet.glade.h:8 |
372 | +#: ../data/timer-applet.glade.h:15 |
373 | msgid "Manage Presets" |
374 | msgstr "" |
375 | |
376 | -#. TRANSLATORS: Replace this string with your names, one name per line. |
377 | -#: ../data/timer-applet.glade.h:10 |
378 | -msgid "" |
379 | -"Miguel Anxo Bouzada\n" |
380 | -"Bundo\n" |
381 | -"Cédric VALMARY (Tot en òc) 16 points" |
382 | -msgstr "" |
383 | - |
384 | -#: ../data/timer-applet.glade.h:13 |
385 | +#: ../data/timer-applet.glade.h:16 |
386 | +msgid "Run custom command after timer has ended." |
387 | +msgstr "" |
388 | + |
389 | +#: ../data/timer-applet.glade.h:17 |
390 | +msgid "Run executable after timer finished." |
391 | +msgstr "" |
392 | + |
393 | +#: ../data/timer-applet.glade.h:18 |
394 | msgid "S_ave as Preset" |
395 | msgstr "" |
396 | |
397 | -#: ../data/timer-applet.glade.h:14 |
398 | +#: ../data/timer-applet.glade.h:19 |
399 | +msgid "S_how pulsing panel icon" |
400 | +msgstr "" |
401 | + |
402 | +#: ../data/timer-applet.glade.h:20 |
403 | msgid "S_tart Timer" |
404 | msgstr "" |
405 | |
406 | -#: ../data/timer-applet.glade.h:15 |
407 | +#: ../data/timer-applet.glade.h:21 |
408 | +msgid "Show pulsing panel icon after timer has ended." |
409 | +msgstr "" |
410 | + |
411 | +#: ../data/timer-applet.glade.h:22 |
412 | msgid "Start Timer" |
413 | msgstr "সময় চালু করুন" |
414 | |
415 | -#: ../data/timer-applet.glade.h:16 |
416 | +#: ../data/timer-applet.glade.h:23 |
417 | +msgid "Start automatically" |
418 | +msgstr "" |
419 | + |
420 | +#: ../data/timer-applet.glade.h:24 |
421 | msgid "Timer Applet" |
422 | msgstr "" |
423 | |
424 | -#: ../data/timer-applet.glade.h:17 |
425 | +#: ../data/timer-applet.glade.h:25 |
426 | msgid "Timer Preferences" |
427 | msgstr "" |
428 | |
429 | -#: ../data/timer-applet.glade.h:18 |
430 | +#: ../data/timer-applet.glade.h:26 |
431 | msgid "Use c_ustom sound" |
432 | msgstr "" |
433 | |
434 | -#: ../data/timer-applet.glade.h:19 |
435 | +#: ../data/timer-applet.glade.h:27 |
436 | msgid "Use d_efault sound" |
437 | msgstr "" |
438 | |
439 | -#: ../data/timer-applet.glade.h:20 |
440 | +#: ../data/timer-applet.glade.h:28 |
441 | msgid "_Add..." |
442 | msgstr "যোগ করুন... (_A)" |
443 | |
444 | -#: ../data/timer-applet.glade.h:21 |
445 | +#: ../data/timer-applet.glade.h:29 |
446 | msgid "_Delete" |
447 | msgstr "মুছে ফেলো (_D)" |
448 | |
449 | -#: ../data/timer-applet.glade.h:22 |
450 | +#: ../data/timer-applet.glade.h:30 |
451 | msgid "_Edit..." |
452 | msgstr "" |
453 | |
454 | -#: ../data/timer-applet.glade.h:23 |
455 | +#: ../data/timer-applet.glade.h:31 |
456 | msgid "_Name:" |
457 | msgstr "" |
458 | |
459 | -#: ../data/timer-applet.glade.h:24 |
460 | +#: ../data/timer-applet.glade.h:32 |
461 | msgid "_Play notification sound" |
462 | msgstr "" |
463 | |
464 | -#: ../data/timer-applet.glade.h:25 |
465 | +#: ../data/timer-applet.glade.h:33 |
466 | +msgid "_Show popup notification" |
467 | +msgstr "" |
468 | + |
469 | +#: ../data/timer-applet.glade.h:34 |
470 | +msgid "_Show popup notification after timer has ended." |
471 | +msgstr "" |
472 | + |
473 | +#: ../data/timer-applet.glade.h:35 |
474 | msgid "_Show remaining time while timer is running" |
475 | msgstr "" |
476 | |
477 | @@ -187,63 +239,64 @@ |
478 | msgstr "" |
479 | |
480 | #: ../data/timer-applet.schemas.in.h:7 |
481 | +msgid "Show Popup notification" |
482 | +msgstr "" |
483 | + |
484 | +#: ../data/timer-applet.schemas.in.h:8 |
485 | +msgid "Show Popup notification in the notification area" |
486 | +msgstr "" |
487 | + |
488 | +#: ../data/timer-applet.schemas.in.h:9 |
489 | +msgid "Show Pulsing icon" |
490 | +msgstr "" |
491 | + |
492 | +#: ../data/timer-applet.schemas.in.h:10 |
493 | +msgid "Show pulsing tray icon when timer finished" |
494 | +msgstr "" |
495 | + |
496 | +#: ../data/timer-applet.schemas.in.h:11 |
497 | msgid "Show remaining time" |
498 | msgstr "" |
499 | |
500 | -#: ../data/timer-applet.schemas.in.h:8 |
501 | +#: ../data/timer-applet.schemas.in.h:12 |
502 | msgid "Show the remaining time while the timer is running or paused" |
503 | msgstr "" |
504 | |
505 | -#: ../data/timer-applet.schemas.in.h:9 |
506 | +#: ../data/timer-applet.schemas.in.h:13 |
507 | msgid "Use a custom notification sound" |
508 | msgstr "" |
509 | |
510 | -#: ../data/timer-applet.schemas.in.h:10 |
511 | +#: ../data/timer-applet.schemas.in.h:14 |
512 | msgid "" |
513 | "Use the custom notification sound specified in custom_notification_sound_path" |
514 | msgstr "" |
515 | |
516 | -#: ../src/timerapplet/controllers/GlobalController.py:60 |
517 | +#: ../src/timerapplet/controllers/GlobalController.py:62 |
518 | msgid "Edit Preset" |
519 | msgstr "" |
520 | |
521 | -#. HH:MM:SS |
522 | -#: ../src/timerapplet/controllers/TimerApplet.py:45 |
523 | -#: ../src/timerapplet/controllers/TimerApplet.py:360 |
524 | -#, python-format |
525 | -msgid "%02d:%02d:%02d" |
526 | -msgstr "" |
527 | - |
528 | -#. HH:MM |
529 | -#. MM:SS |
530 | -#: ../src/timerapplet/controllers/TimerApplet.py:49 |
531 | -#: ../src/timerapplet/controllers/TimerApplet.py:52 |
532 | -#, python-format |
533 | -msgid "%02d:%02d" |
534 | -msgstr "" |
535 | - |
536 | -#: ../src/timerapplet/controllers/TimerApplet.py:111 |
537 | +#: ../src/timerapplet/controllers/TimerApplet.py:99 |
538 | msgid "Continue timer countdown?" |
539 | msgstr "" |
540 | |
541 | -#: ../src/timerapplet/controllers/TimerApplet.py:112 |
542 | +#: ../src/timerapplet/controllers/TimerApplet.py:100 |
543 | msgid "The timer is currently paused. Would you like to continue countdown?" |
544 | msgstr "" |
545 | |
546 | -#: ../src/timerapplet/controllers/TimerApplet.py:192 |
547 | +#: ../src/timerapplet/controllers/TimerApplet.py:194 |
548 | msgid "Click to start a new timer countdown." |
549 | msgstr "" |
550 | |
551 | -#: ../src/timerapplet/controllers/TimerApplet.py:197 |
552 | +#: ../src/timerapplet/controllers/TimerApplet.py:199 |
553 | msgid "Paused. Click to continue timer countdown." |
554 | msgstr "" |
555 | |
556 | -#: ../src/timerapplet/controllers/TimerApplet.py:200 |
557 | +#: ../src/timerapplet/controllers/TimerApplet.py:202 |
558 | msgid "Finished" |
559 | msgstr "কাজটি সম্পূর্ণ হয়েছে" |
560 | |
561 | #. "<timer name>" finished at <time> |
562 | -#: ../src/timerapplet/controllers/TimerApplet.py:205 |
563 | +#: ../src/timerapplet/controllers/TimerApplet.py:207 |
564 | #, python-format |
565 | msgid "" |
566 | "\"%s\" finished at %s.\n" |
567 | @@ -251,7 +304,7 @@ |
568 | msgstr "" |
569 | |
570 | #. Timer finished at <time> |
571 | -#: ../src/timerapplet/controllers/TimerApplet.py:208 |
572 | +#: ../src/timerapplet/controllers/TimerApplet.py:210 |
573 | #, python-format |
574 | msgid "" |
575 | "Timer finished at %s.\n" |
576 | @@ -259,41 +312,48 @@ |
577 | msgstr "" |
578 | |
579 | #. HH:MM:SS (<timer name>) |
580 | -#: ../src/timerapplet/controllers/TimerApplet.py:357 |
581 | +#: ../src/timerapplet/controllers/TimerApplet.py:386 |
582 | #, python-format |
583 | msgid "%02d:%02d:%02d (%s)" |
584 | msgstr "" |
585 | |
586 | +#. HH:MM:SS |
587 | +#: ../src/timerapplet/controllers/TimerApplet.py:389 |
588 | +#: ../src/timerapplet/utils.py:52 |
589 | +#, python-format |
590 | +msgid "%02d:%02d:%02d" |
591 | +msgstr "" |
592 | + |
593 | #. "<timer name>" Finished |
594 | -#: ../src/timerapplet/controllers/TimerApplet.py:379 |
595 | +#: ../src/timerapplet/controllers/TimerApplet.py:411 |
596 | #, python-format |
597 | msgid "\"%s\" Finished" |
598 | msgstr "" |
599 | |
600 | #. "<timer name>" finished at <time> |
601 | -#: ../src/timerapplet/controllers/TimerApplet.py:382 |
602 | +#: ../src/timerapplet/controllers/TimerApplet.py:414 |
603 | #, python-format |
604 | msgid "\"%s\" finished at %s" |
605 | msgstr "" |
606 | |
607 | -#: ../src/timerapplet/controllers/TimerApplet.py:384 |
608 | +#: ../src/timerapplet/controllers/TimerApplet.py:416 |
609 | msgid "Timer Finished" |
610 | msgstr "" |
611 | |
612 | #. Timer finished at <time> |
613 | -#: ../src/timerapplet/controllers/TimerApplet.py:387 |
614 | +#: ../src/timerapplet/controllers/TimerApplet.py:419 |
615 | #, python-format |
616 | msgid "Timer finished at %s" |
617 | msgstr "" |
618 | |
619 | -#: ../src/timerapplet/controllers/TimerApplet.py:394 |
620 | +#: ../src/timerapplet/controllers/TimerApplet.py:426 |
621 | #, python-format |
622 | msgid "Timer finished about <b>%d second</b> ago" |
623 | msgid_plural "Timer finished about <b>%d seconds</b> ago" |
624 | msgstr[0] "" |
625 | msgstr[1] "" |
626 | |
627 | -#: ../src/timerapplet/controllers/TimerApplet.py:399 |
628 | +#: ../src/timerapplet/controllers/TimerApplet.py:431 |
629 | #, python-format |
630 | msgid "Timer finished about <b>%d minute</b> ago" |
631 | msgid_plural "Timer finished about <b>%d minutes</b> ago" |
632 | @@ -316,6 +376,10 @@ |
633 | msgid "_Continue Timer" |
634 | msgstr "" |
635 | |
636 | +#: ../src/timerapplet/ui/StartTimerDialog.py:186 |
637 | +msgid "<b>Command not found.</b>" |
638 | +msgstr "" |
639 | + |
640 | #: ../src/timerapplet/ui/DurationChooser.py:31 |
641 | msgid "_Hours:" |
642 | msgstr "ঘন্টা:(_ঘ)" |
643 | @@ -328,8 +392,15 @@ |
644 | msgid "_Seconds:" |
645 | msgstr "সেকেন্ড:(_ড)" |
646 | |
647 | +#. HH:MM |
648 | +#. MM:SS |
649 | +#: ../src/timerapplet/utils.py:56 ../src/timerapplet/utils.py:59 |
650 | +#, python-format |
651 | +msgid "%02d:%02d" |
652 | +msgstr "" |
653 | + |
654 | #. <preset name> (HH:MM:SS) |
655 | -#: ../src/timerapplet/utils.py:42 |
656 | +#: ../src/timerapplet/utils.py:69 |
657 | #, python-format |
658 | msgid "%s (%02d:%02d:%02d)" |
659 | msgstr "" |
660 | |
661 | === modified file 'timer-applet/po/es.po' |
662 | --- timer-applet/po/es.po 2010-08-04 03:30:23 +0000 |
663 | +++ timer-applet/po/es.po 2010-09-15 19:27:52 +0000 |
664 | @@ -7,8 +7,13 @@ |
665 | msgstr "" |
666 | "Project-Id-Version: timer-applet 0.5\n" |
667 | "Report-Msgid-Bugs-To: \n" |
668 | +<<<<<<< TREE |
669 | "POT-Creation-Date: 2010-08-01 20:20-0400\n" |
670 | "PO-Revision-Date: 2010-08-03 01:36+0000\n" |
671 | +======= |
672 | +"POT-Creation-Date: 2010-09-15 15:16-0400\n" |
673 | +"PO-Revision-Date: 2010-08-02 00:13+0000\n" |
674 | +>>>>>>> MERGE-SOURCE |
675 | "Last-Translator: Kenny Meyer <knny.myer@gmail.com>\n" |
676 | "Language-Team: Spanish <es@li.org>\n" |
677 | "MIME-Version: 1.0\n" |
678 | @@ -39,30 +44,34 @@ |
679 | msgstr "Admi_nistrar preestablecidos" |
680 | |
681 | #: ../data/TimerApplet.xml.h:2 |
682 | +msgid "Next" |
683 | +msgstr "" |
684 | + |
685 | +#: ../data/TimerApplet.xml.h:3 |
686 | msgid "Pa_use" |
687 | msgstr "Pa_usa" |
688 | |
689 | -#: ../data/TimerApplet.xml.h:3 |
690 | +#: ../data/TimerApplet.xml.h:4 |
691 | msgid "Pre_sets" |
692 | msgstr "Preestable_cidos" |
693 | |
694 | -#: ../data/TimerApplet.xml.h:4 |
695 | +#: ../data/TimerApplet.xml.h:5 |
696 | msgid "R_estart" |
697 | msgstr "R_einiciar" |
698 | |
699 | -#: ../data/TimerApplet.xml.h:5 |
700 | +#: ../data/TimerApplet.xml.h:6 |
701 | msgid "_About" |
702 | msgstr "_Acerca de" |
703 | |
704 | -#: ../data/TimerApplet.xml.h:6 |
705 | +#: ../data/TimerApplet.xml.h:7 |
706 | msgid "_Continue" |
707 | msgstr "_Continuar" |
708 | |
709 | -#: ../data/TimerApplet.xml.h:7 |
710 | +#: ../data/TimerApplet.xml.h:8 |
711 | msgid "_Preferences" |
712 | msgstr "_Preferencias" |
713 | |
714 | -#: ../data/TimerApplet.xml.h:8 |
715 | +#: ../data/TimerApplet.xml.h:9 |
716 | msgid "_Stop" |
717 | msgstr "_Detener" |
718 | |
719 | @@ -71,115 +80,141 @@ |
720 | msgstr "<b>Comando personalizado</b>" |
721 | |
722 | #: ../data/timer-applet.glade.h:2 |
723 | +msgid "<b>Define next timer</b>" |
724 | +msgstr "" |
725 | + |
726 | +#: ../data/timer-applet.glade.h:3 |
727 | +#, fuzzy |
728 | +msgid "<b>Interval timer</b>" |
729 | +msgstr "<b>_Nombre</b>" |
730 | + |
731 | +#: ../data/timer-applet.glade.h:4 |
732 | +#, fuzzy |
733 | +msgid "<b>Run custom command</b>" |
734 | +msgstr "<b>Comando personalizado</b>" |
735 | + |
736 | +#: ../data/timer-applet.glade.h:5 |
737 | msgid "<b>_Duration</b>" |
738 | msgstr "<b>_Duración</b>" |
739 | |
740 | -#: ../data/timer-applet.glade.h:3 |
741 | +#: ../data/timer-applet.glade.h:6 |
742 | msgid "<b>_Name</b>" |
743 | msgstr "<b>_Nombre</b>" |
744 | |
745 | -#: ../data/timer-applet.glade.h:4 |
746 | +#: ../data/timer-applet.glade.h:7 |
747 | msgid "<b>_Presets</b>" |
748 | msgstr "<b>_Preestablecidos</b>" |
749 | |
750 | -#: ../data/timer-applet.glade.h:5 |
751 | +#: ../data/timer-applet.glade.h:8 |
752 | msgid "A timer applet for the perfect egg and beyond!" |
753 | msgstr "Una miniaplicación cronómetro para el huevo perfecto y más!" |
754 | |
755 | -#: ../data/timer-applet.glade.h:6 |
756 | +#: ../data/timer-applet.glade.h:9 |
757 | #: ../src/timerapplet/controllers/GlobalController.py:47 |
758 | msgid "Add Preset" |
759 | msgstr "Agregar Preestablecido" |
760 | |
761 | -#: ../data/timer-applet.glade.h:7 |
762 | +#: ../data/timer-applet.glade.h:10 |
763 | +msgid "Advanced" |
764 | +msgstr "" |
765 | + |
766 | +#: ../data/timer-applet.glade.h:11 |
767 | msgid "Choose A Sound File" |
768 | msgstr "Elegir un archivo de sonido" |
769 | |
770 | -#: ../data/timer-applet.glade.h:8 |
771 | +#: ../data/timer-applet.glade.h:12 |
772 | +msgid "Execute:" |
773 | +msgstr "" |
774 | + |
775 | +#: ../data/timer-applet.glade.h:13 |
776 | +msgid "Initiate automatically" |
777 | +msgstr "" |
778 | + |
779 | +#: ../data/timer-applet.glade.h:14 |
780 | msgid "Mana_ge Presets" |
781 | msgstr "Adminis_trar preestablecidos" |
782 | |
783 | -#: ../data/timer-applet.glade.h:9 |
784 | +#: ../data/timer-applet.glade.h:15 |
785 | msgid "Manage Presets" |
786 | msgstr "Administrar Preestablecidos" |
787 | |
788 | -#: ../data/timer-applet.glade.h:10 |
789 | +#: ../data/timer-applet.glade.h:16 |
790 | msgid "Run custom command after timer has ended." |
791 | msgstr "Ejecutar un comando personalizado al terminarse el tiempo." |
792 | |
793 | -#: ../data/timer-applet.glade.h:11 |
794 | -msgid "Run executable" |
795 | -msgstr "Ejecutar" |
796 | - |
797 | -#: ../data/timer-applet.glade.h:12 |
798 | +#: ../data/timer-applet.glade.h:17 |
799 | msgid "Run executable after timer finished." |
800 | msgstr "Ejecutar al terminarse el tiempo." |
801 | |
802 | -#: ../data/timer-applet.glade.h:13 |
803 | +#: ../data/timer-applet.glade.h:18 |
804 | msgid "S_ave as Preset" |
805 | msgstr "G_uardar como preestablecido" |
806 | |
807 | -#: ../data/timer-applet.glade.h:14 |
808 | +#: ../data/timer-applet.glade.h:19 |
809 | msgid "S_how pulsing panel icon" |
810 | msgstr "_Mostrar pulso del icono del panel" |
811 | |
812 | -#: ../data/timer-applet.glade.h:15 |
813 | +#: ../data/timer-applet.glade.h:20 |
814 | msgid "S_tart Timer" |
815 | msgstr "Iniciar cronómetro" |
816 | |
817 | -#: ../data/timer-applet.glade.h:16 |
818 | +#: ../data/timer-applet.glade.h:21 |
819 | msgid "Show pulsing panel icon after timer has ended." |
820 | msgstr "_Mostrar pulso del icono del panel al terminarse el cronómetro." |
821 | |
822 | -#: ../data/timer-applet.glade.h:17 |
823 | +#: ../data/timer-applet.glade.h:22 |
824 | msgid "Start Timer" |
825 | msgstr "Iniciar cronómetro" |
826 | |
827 | -#: ../data/timer-applet.glade.h:18 |
828 | +#: ../data/timer-applet.glade.h:23 |
829 | +msgid "Start automatically" |
830 | +msgstr "" |
831 | + |
832 | +#: ../data/timer-applet.glade.h:24 |
833 | msgid "Timer Applet" |
834 | msgstr "Miniaplicación cronómetro" |
835 | |
836 | -#: ../data/timer-applet.glade.h:19 |
837 | +#: ../data/timer-applet.glade.h:25 |
838 | msgid "Timer Preferences" |
839 | msgstr "Preferencias del cronómetro" |
840 | |
841 | -#: ../data/timer-applet.glade.h:20 |
842 | +#: ../data/timer-applet.glade.h:26 |
843 | msgid "Use c_ustom sound" |
844 | msgstr "_Usar sonido personalizado" |
845 | |
846 | -#: ../data/timer-applet.glade.h:21 |
847 | +#: ../data/timer-applet.glade.h:27 |
848 | msgid "Use d_efault sound" |
849 | msgstr "Usar sonido pr_edeterminado" |
850 | |
851 | -#: ../data/timer-applet.glade.h:22 |
852 | +#: ../data/timer-applet.glade.h:28 |
853 | msgid "_Add..." |
854 | msgstr "_Añadir…" |
855 | |
856 | -#: ../data/timer-applet.glade.h:23 |
857 | +#: ../data/timer-applet.glade.h:29 |
858 | msgid "_Delete" |
859 | msgstr "_Borrar" |
860 | |
861 | -#: ../data/timer-applet.glade.h:24 |
862 | +#: ../data/timer-applet.glade.h:30 |
863 | msgid "_Edit..." |
864 | msgstr "_Editar..." |
865 | |
866 | -#: ../data/timer-applet.glade.h:25 |
867 | +#: ../data/timer-applet.glade.h:31 |
868 | msgid "_Name:" |
869 | msgstr "_Nombre:" |
870 | |
871 | -#: ../data/timer-applet.glade.h:26 |
872 | +#: ../data/timer-applet.glade.h:32 |
873 | msgid "_Play notification sound" |
874 | msgstr "Re_producir sonido de notificación" |
875 | |
876 | -#: ../data/timer-applet.glade.h:27 |
877 | +#: ../data/timer-applet.glade.h:33 |
878 | msgid "_Show popup notification" |
879 | msgstr "Mo_strar notificación emergente" |
880 | |
881 | -#: ../data/timer-applet.glade.h:28 |
882 | +#: ../data/timer-applet.glade.h:34 |
883 | msgid "_Show popup notification after timer has ended." |
884 | msgstr "Mo_strar notificación emergente al terminarse el tiempo." |
885 | |
886 | -#: ../data/timer-applet.glade.h:29 |
887 | +#: ../data/timer-applet.glade.h:35 |
888 | msgid "_Show remaining time while timer is running" |
889 | msgstr "_Muestra el tiempo restante mientras cuenta" |
890 | |
891 | @@ -248,47 +283,32 @@ |
892 | "Usar el sonido de notificación personalizado especificado en " |
893 | "custom_notification_sound_path" |
894 | |
895 | -#: ../src/timerapplet/controllers/GlobalController.py:61 |
896 | +#: ../src/timerapplet/controllers/GlobalController.py:62 |
897 | msgid "Edit Preset" |
898 | msgstr "Editar Preestablecido" |
899 | |
900 | -#. HH:MM:SS |
901 | -#: ../src/timerapplet/controllers/TimerApplet.py:49 |
902 | -#: ../src/timerapplet/controllers/TimerApplet.py:395 |
903 | -#, python-format |
904 | -msgid "%02d:%02d:%02d" |
905 | -msgstr "%02d:%02d:%02d" |
906 | - |
907 | -#. HH:MM |
908 | -#. MM:SS |
909 | -#: ../src/timerapplet/controllers/TimerApplet.py:53 |
910 | -#: ../src/timerapplet/controllers/TimerApplet.py:56 |
911 | -#, python-format |
912 | -msgid "%02d:%02d" |
913 | -msgstr "%02d:%02d" |
914 | - |
915 | -#: ../src/timerapplet/controllers/TimerApplet.py:119 |
916 | +#: ../src/timerapplet/controllers/TimerApplet.py:99 |
917 | msgid "Continue timer countdown?" |
918 | msgstr "¿Continuar temporizador?" |
919 | |
920 | -#: ../src/timerapplet/controllers/TimerApplet.py:120 |
921 | +#: ../src/timerapplet/controllers/TimerApplet.py:100 |
922 | msgid "The timer is currently paused. Would you like to continue countdown?" |
923 | msgstr "El temporizador está pausado. ¿Desea continuar la cuenta?" |
924 | |
925 | -#: ../src/timerapplet/controllers/TimerApplet.py:209 |
926 | +#: ../src/timerapplet/controllers/TimerApplet.py:194 |
927 | msgid "Click to start a new timer countdown." |
928 | msgstr "Click para iniciar un nuevo temporizador" |
929 | |
930 | -#: ../src/timerapplet/controllers/TimerApplet.py:214 |
931 | +#: ../src/timerapplet/controllers/TimerApplet.py:199 |
932 | msgid "Paused. Click to continue timer countdown." |
933 | msgstr "Pausado. Pulse para continuar el temporizador." |
934 | |
935 | -#: ../src/timerapplet/controllers/TimerApplet.py:217 |
936 | +#: ../src/timerapplet/controllers/TimerApplet.py:202 |
937 | msgid "Finished" |
938 | msgstr "Finalizado" |
939 | |
940 | #. "<timer name>" finished at <time> |
941 | -#: ../src/timerapplet/controllers/TimerApplet.py:222 |
942 | +#: ../src/timerapplet/controllers/TimerApplet.py:207 |
943 | #, python-format |
944 | msgid "" |
945 | "\"%s\" finished at %s.\n" |
946 | @@ -298,7 +318,7 @@ |
947 | "Click para detener el temporizador." |
948 | |
949 | #. Timer finished at <time> |
950 | -#: ../src/timerapplet/controllers/TimerApplet.py:225 |
951 | +#: ../src/timerapplet/controllers/TimerApplet.py:210 |
952 | #, python-format |
953 | msgid "" |
954 | "Timer finished at %s.\n" |
955 | @@ -308,41 +328,48 @@ |
956 | "Click para detener el temporizador." |
957 | |
958 | #. HH:MM:SS (<timer name>) |
959 | -#: ../src/timerapplet/controllers/TimerApplet.py:392 |
960 | +#: ../src/timerapplet/controllers/TimerApplet.py:386 |
961 | #, python-format |
962 | msgid "%02d:%02d:%02d (%s)" |
963 | msgstr "%02d:%02d:%02d (%s)" |
964 | |
965 | +#. HH:MM:SS |
966 | +#: ../src/timerapplet/controllers/TimerApplet.py:389 |
967 | +#: ../src/timerapplet/utils.py:52 |
968 | +#, python-format |
969 | +msgid "%02d:%02d:%02d" |
970 | +msgstr "%02d:%02d:%02d" |
971 | + |
972 | #. "<timer name>" Finished |
973 | -#: ../src/timerapplet/controllers/TimerApplet.py:416 |
974 | +#: ../src/timerapplet/controllers/TimerApplet.py:411 |
975 | #, python-format |
976 | msgid "\"%s\" Finished" |
977 | msgstr "\"%s\" Finalizado" |
978 | |
979 | #. "<timer name>" finished at <time> |
980 | -#: ../src/timerapplet/controllers/TimerApplet.py:419 |
981 | +#: ../src/timerapplet/controllers/TimerApplet.py:414 |
982 | #, python-format |
983 | msgid "\"%s\" finished at %s" |
984 | msgstr "\"%s\" terminó a las %s" |
985 | |
986 | -#: ../src/timerapplet/controllers/TimerApplet.py:421 |
987 | +#: ../src/timerapplet/controllers/TimerApplet.py:416 |
988 | msgid "Timer Finished" |
989 | msgstr "El tiempo terminó" |
990 | |
991 | #. Timer finished at <time> |
992 | -#: ../src/timerapplet/controllers/TimerApplet.py:424 |
993 | +#: ../src/timerapplet/controllers/TimerApplet.py:419 |
994 | #, python-format |
995 | msgid "Timer finished at %s" |
996 | msgstr "El tiempo terminó a las %s" |
997 | |
998 | -#: ../src/timerapplet/controllers/TimerApplet.py:431 |
999 | +#: ../src/timerapplet/controllers/TimerApplet.py:426 |
1000 | #, python-format |
1001 | msgid "Timer finished about <b>%d second</b> ago" |
1002 | msgid_plural "Timer finished about <b>%d seconds</b> ago" |
1003 | msgstr[0] "El tiempo terminó hace %d segundo atrás" |
1004 | msgstr[1] "El tiempo terminó hace %d segundos atrás" |
1005 | |
1006 | -#: ../src/timerapplet/controllers/TimerApplet.py:436 |
1007 | +#: ../src/timerapplet/controllers/TimerApplet.py:431 |
1008 | #, python-format |
1009 | msgid "Timer finished about <b>%d minute</b> ago" |
1010 | msgid_plural "Timer finished about <b>%d minutes</b> ago" |
1011 | @@ -365,7 +392,7 @@ |
1012 | msgid "_Continue Timer" |
1013 | msgstr "_Continuar temporizador" |
1014 | |
1015 | -#: ../src/timerapplet/ui/StartTimerDialog.py:174 |
1016 | +#: ../src/timerapplet/ui/StartTimerDialog.py:186 |
1017 | msgid "<b>Command not found.</b>" |
1018 | msgstr "<b>Comando no encontrado.</b>" |
1019 | |
1020 | @@ -381,12 +408,22 @@ |
1021 | msgid "_Seconds:" |
1022 | msgstr "_Segundos:" |
1023 | |
1024 | +#. HH:MM |
1025 | +#. MM:SS |
1026 | +#: ../src/timerapplet/utils.py:56 ../src/timerapplet/utils.py:59 |
1027 | +#, python-format |
1028 | +msgid "%02d:%02d" |
1029 | +msgstr "%02d:%02d" |
1030 | + |
1031 | #. <preset name> (HH:MM:SS) |
1032 | -#: ../src/timerapplet/utils.py:43 |
1033 | +#: ../src/timerapplet/utils.py:69 |
1034 | #, python-format |
1035 | msgid "%s (%02d:%02d:%02d)" |
1036 | msgstr "%s (%02d:%02d:%02d)" |
1037 | |
1038 | +#~ msgid "Run executable" |
1039 | +#~ msgstr "Ejecutar" |
1040 | + |
1041 | #~ msgid "Get a notification after a specified interval of time elapses" |
1042 | #~ msgstr "Notificar después de haber transcurrido un intervalo específico." |
1043 | |
1044 | @@ -486,7 +523,8 @@ |
1045 | #~ msgstr "¿Continuar el temporizador?" |
1046 | |
1047 | #~ msgid "" |
1048 | -#~ "The timer is currently paused. Would you like to continue countdown from %s?" |
1049 | +#~ "The timer is currently paused. Would you like to continue countdown from %" |
1050 | +#~ "s?" |
1051 | #~ msgstr "" |
1052 | #~ "El temporizador está pausado. ¿Quiere continuar la cuenta atrás desde %s?" |
1053 | |
1054 | |
1055 | === modified file 'timer-applet/po/messages.pot' |
1056 | --- timer-applet/po/messages.pot 2010-08-02 00:21:28 +0000 |
1057 | +++ timer-applet/po/messages.pot 2010-09-15 19:27:52 +0000 |
1058 | @@ -8,7 +8,7 @@ |
1059 | msgstr "" |
1060 | "Project-Id-Version: PACKAGE VERSION\n" |
1061 | "Report-Msgid-Bugs-To: \n" |
1062 | -"POT-Creation-Date: 2010-08-01 20:20-0400\n" |
1063 | +"POT-Creation-Date: 2010-09-15 15:16-0400\n" |
1064 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
1065 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
1066 | "Language-Team: LANGUAGE <LL@li.org>\n" |
1067 | @@ -38,30 +38,34 @@ |
1068 | msgstr "" |
1069 | |
1070 | #: ../data/TimerApplet.xml.h:2 |
1071 | +msgid "Next" |
1072 | +msgstr "" |
1073 | + |
1074 | +#: ../data/TimerApplet.xml.h:3 |
1075 | msgid "Pa_use" |
1076 | msgstr "" |
1077 | |
1078 | -#: ../data/TimerApplet.xml.h:3 |
1079 | +#: ../data/TimerApplet.xml.h:4 |
1080 | msgid "Pre_sets" |
1081 | msgstr "" |
1082 | |
1083 | -#: ../data/TimerApplet.xml.h:4 |
1084 | +#: ../data/TimerApplet.xml.h:5 |
1085 | msgid "R_estart" |
1086 | msgstr "" |
1087 | |
1088 | -#: ../data/TimerApplet.xml.h:5 |
1089 | +#: ../data/TimerApplet.xml.h:6 |
1090 | msgid "_About" |
1091 | msgstr "" |
1092 | |
1093 | -#: ../data/TimerApplet.xml.h:6 |
1094 | +#: ../data/TimerApplet.xml.h:7 |
1095 | msgid "_Continue" |
1096 | msgstr "" |
1097 | |
1098 | -#: ../data/TimerApplet.xml.h:7 |
1099 | +#: ../data/TimerApplet.xml.h:8 |
1100 | msgid "_Preferences" |
1101 | msgstr "" |
1102 | |
1103 | -#: ../data/TimerApplet.xml.h:8 |
1104 | +#: ../data/TimerApplet.xml.h:9 |
1105 | msgid "_Stop" |
1106 | msgstr "" |
1107 | |
1108 | @@ -70,115 +74,139 @@ |
1109 | msgstr "" |
1110 | |
1111 | #: ../data/timer-applet.glade.h:2 |
1112 | +msgid "<b>Define next timer</b>" |
1113 | +msgstr "" |
1114 | + |
1115 | +#: ../data/timer-applet.glade.h:3 |
1116 | +msgid "<b>Interval timer</b>" |
1117 | +msgstr "" |
1118 | + |
1119 | +#: ../data/timer-applet.glade.h:4 |
1120 | +msgid "<b>Run custom command</b>" |
1121 | +msgstr "" |
1122 | + |
1123 | +#: ../data/timer-applet.glade.h:5 |
1124 | msgid "<b>_Duration</b>" |
1125 | msgstr "" |
1126 | |
1127 | -#: ../data/timer-applet.glade.h:3 |
1128 | +#: ../data/timer-applet.glade.h:6 |
1129 | msgid "<b>_Name</b>" |
1130 | msgstr "" |
1131 | |
1132 | -#: ../data/timer-applet.glade.h:4 |
1133 | +#: ../data/timer-applet.glade.h:7 |
1134 | msgid "<b>_Presets</b>" |
1135 | msgstr "" |
1136 | |
1137 | -#: ../data/timer-applet.glade.h:5 |
1138 | +#: ../data/timer-applet.glade.h:8 |
1139 | msgid "A timer applet for the perfect egg and beyond!" |
1140 | msgstr "" |
1141 | |
1142 | -#: ../data/timer-applet.glade.h:6 |
1143 | +#: ../data/timer-applet.glade.h:9 |
1144 | #: ../src/timerapplet/controllers/GlobalController.py:47 |
1145 | msgid "Add Preset" |
1146 | msgstr "" |
1147 | |
1148 | -#: ../data/timer-applet.glade.h:7 |
1149 | +#: ../data/timer-applet.glade.h:10 |
1150 | +msgid "Advanced" |
1151 | +msgstr "" |
1152 | + |
1153 | +#: ../data/timer-applet.glade.h:11 |
1154 | msgid "Choose A Sound File" |
1155 | msgstr "" |
1156 | |
1157 | -#: ../data/timer-applet.glade.h:8 |
1158 | +#: ../data/timer-applet.glade.h:12 |
1159 | +msgid "Execute:" |
1160 | +msgstr "" |
1161 | + |
1162 | +#: ../data/timer-applet.glade.h:13 |
1163 | +msgid "Initiate automatically" |
1164 | +msgstr "" |
1165 | + |
1166 | +#: ../data/timer-applet.glade.h:14 |
1167 | msgid "Mana_ge Presets" |
1168 | msgstr "" |
1169 | |
1170 | -#: ../data/timer-applet.glade.h:9 |
1171 | +#: ../data/timer-applet.glade.h:15 |
1172 | msgid "Manage Presets" |
1173 | msgstr "" |
1174 | |
1175 | -#: ../data/timer-applet.glade.h:10 |
1176 | +#: ../data/timer-applet.glade.h:16 |
1177 | msgid "Run custom command after timer has ended." |
1178 | msgstr "" |
1179 | |
1180 | -#: ../data/timer-applet.glade.h:11 |
1181 | -msgid "Run executable" |
1182 | -msgstr "" |
1183 | - |
1184 | -#: ../data/timer-applet.glade.h:12 |
1185 | +#: ../data/timer-applet.glade.h:17 |
1186 | msgid "Run executable after timer finished." |
1187 | msgstr "" |
1188 | |
1189 | -#: ../data/timer-applet.glade.h:13 |
1190 | +#: ../data/timer-applet.glade.h:18 |
1191 | msgid "S_ave as Preset" |
1192 | msgstr "" |
1193 | |
1194 | -#: ../data/timer-applet.glade.h:14 |
1195 | +#: ../data/timer-applet.glade.h:19 |
1196 | msgid "S_how pulsing panel icon" |
1197 | msgstr "" |
1198 | |
1199 | -#: ../data/timer-applet.glade.h:15 |
1200 | +#: ../data/timer-applet.glade.h:20 |
1201 | msgid "S_tart Timer" |
1202 | msgstr "" |
1203 | |
1204 | -#: ../data/timer-applet.glade.h:16 |
1205 | +#: ../data/timer-applet.glade.h:21 |
1206 | msgid "Show pulsing panel icon after timer has ended." |
1207 | msgstr "" |
1208 | |
1209 | -#: ../data/timer-applet.glade.h:17 |
1210 | +#: ../data/timer-applet.glade.h:22 |
1211 | msgid "Start Timer" |
1212 | msgstr "" |
1213 | |
1214 | -#: ../data/timer-applet.glade.h:18 |
1215 | +#: ../data/timer-applet.glade.h:23 |
1216 | +msgid "Start automatically" |
1217 | +msgstr "" |
1218 | + |
1219 | +#: ../data/timer-applet.glade.h:24 |
1220 | msgid "Timer Applet" |
1221 | msgstr "" |
1222 | |
1223 | -#: ../data/timer-applet.glade.h:19 |
1224 | +#: ../data/timer-applet.glade.h:25 |
1225 | msgid "Timer Preferences" |
1226 | msgstr "" |
1227 | |
1228 | -#: ../data/timer-applet.glade.h:20 |
1229 | +#: ../data/timer-applet.glade.h:26 |
1230 | msgid "Use c_ustom sound" |
1231 | msgstr "" |
1232 | |
1233 | -#: ../data/timer-applet.glade.h:21 |
1234 | +#: ../data/timer-applet.glade.h:27 |
1235 | msgid "Use d_efault sound" |
1236 | msgstr "" |
1237 | |
1238 | -#: ../data/timer-applet.glade.h:22 |
1239 | +#: ../data/timer-applet.glade.h:28 |
1240 | msgid "_Add..." |
1241 | msgstr "" |
1242 | |
1243 | -#: ../data/timer-applet.glade.h:23 |
1244 | +#: ../data/timer-applet.glade.h:29 |
1245 | msgid "_Delete" |
1246 | msgstr "" |
1247 | |
1248 | -#: ../data/timer-applet.glade.h:24 |
1249 | +#: ../data/timer-applet.glade.h:30 |
1250 | msgid "_Edit..." |
1251 | msgstr "" |
1252 | |
1253 | -#: ../data/timer-applet.glade.h:25 |
1254 | +#: ../data/timer-applet.glade.h:31 |
1255 | msgid "_Name:" |
1256 | msgstr "" |
1257 | |
1258 | -#: ../data/timer-applet.glade.h:26 |
1259 | +#: ../data/timer-applet.glade.h:32 |
1260 | msgid "_Play notification sound" |
1261 | msgstr "" |
1262 | |
1263 | -#: ../data/timer-applet.glade.h:27 |
1264 | +#: ../data/timer-applet.glade.h:33 |
1265 | msgid "_Show popup notification" |
1266 | msgstr "" |
1267 | |
1268 | -#: ../data/timer-applet.glade.h:28 |
1269 | +#: ../data/timer-applet.glade.h:34 |
1270 | msgid "_Show popup notification after timer has ended." |
1271 | msgstr "" |
1272 | |
1273 | -#: ../data/timer-applet.glade.h:29 |
1274 | +#: ../data/timer-applet.glade.h:35 |
1275 | msgid "_Show remaining time while timer is running" |
1276 | msgstr "" |
1277 | |
1278 | @@ -242,47 +270,32 @@ |
1279 | "Use the custom notification sound specified in custom_notification_sound_path" |
1280 | msgstr "" |
1281 | |
1282 | -#: ../src/timerapplet/controllers/GlobalController.py:61 |
1283 | +#: ../src/timerapplet/controllers/GlobalController.py:62 |
1284 | msgid "Edit Preset" |
1285 | msgstr "" |
1286 | |
1287 | -#. HH:MM:SS |
1288 | -#: ../src/timerapplet/controllers/TimerApplet.py:49 |
1289 | -#: ../src/timerapplet/controllers/TimerApplet.py:395 |
1290 | -#, python-format |
1291 | -msgid "%02d:%02d:%02d" |
1292 | -msgstr "" |
1293 | - |
1294 | -#. HH:MM |
1295 | -#. MM:SS |
1296 | -#: ../src/timerapplet/controllers/TimerApplet.py:53 |
1297 | -#: ../src/timerapplet/controllers/TimerApplet.py:56 |
1298 | -#, python-format |
1299 | -msgid "%02d:%02d" |
1300 | -msgstr "" |
1301 | - |
1302 | -#: ../src/timerapplet/controllers/TimerApplet.py:119 |
1303 | +#: ../src/timerapplet/controllers/TimerApplet.py:99 |
1304 | msgid "Continue timer countdown?" |
1305 | msgstr "" |
1306 | |
1307 | -#: ../src/timerapplet/controllers/TimerApplet.py:120 |
1308 | +#: ../src/timerapplet/controllers/TimerApplet.py:100 |
1309 | msgid "The timer is currently paused. Would you like to continue countdown?" |
1310 | msgstr "" |
1311 | |
1312 | -#: ../src/timerapplet/controllers/TimerApplet.py:209 |
1313 | +#: ../src/timerapplet/controllers/TimerApplet.py:194 |
1314 | msgid "Click to start a new timer countdown." |
1315 | msgstr "" |
1316 | |
1317 | -#: ../src/timerapplet/controllers/TimerApplet.py:214 |
1318 | +#: ../src/timerapplet/controllers/TimerApplet.py:199 |
1319 | msgid "Paused. Click to continue timer countdown." |
1320 | msgstr "" |
1321 | |
1322 | -#: ../src/timerapplet/controllers/TimerApplet.py:217 |
1323 | +#: ../src/timerapplet/controllers/TimerApplet.py:202 |
1324 | msgid "Finished" |
1325 | msgstr "" |
1326 | |
1327 | #. "<timer name>" finished at <time> |
1328 | -#: ../src/timerapplet/controllers/TimerApplet.py:222 |
1329 | +#: ../src/timerapplet/controllers/TimerApplet.py:207 |
1330 | #, python-format |
1331 | msgid "" |
1332 | "\"%s\" finished at %s.\n" |
1333 | @@ -290,7 +303,7 @@ |
1334 | msgstr "" |
1335 | |
1336 | #. Timer finished at <time> |
1337 | -#: ../src/timerapplet/controllers/TimerApplet.py:225 |
1338 | +#: ../src/timerapplet/controllers/TimerApplet.py:210 |
1339 | #, python-format |
1340 | msgid "" |
1341 | "Timer finished at %s.\n" |
1342 | @@ -298,41 +311,48 @@ |
1343 | msgstr "" |
1344 | |
1345 | #. HH:MM:SS (<timer name>) |
1346 | -#: ../src/timerapplet/controllers/TimerApplet.py:392 |
1347 | +#: ../src/timerapplet/controllers/TimerApplet.py:386 |
1348 | #, python-format |
1349 | msgid "%02d:%02d:%02d (%s)" |
1350 | msgstr "" |
1351 | |
1352 | +#. HH:MM:SS |
1353 | +#: ../src/timerapplet/controllers/TimerApplet.py:389 |
1354 | +#: ../src/timerapplet/utils.py:52 |
1355 | +#, python-format |
1356 | +msgid "%02d:%02d:%02d" |
1357 | +msgstr "" |
1358 | + |
1359 | #. "<timer name>" Finished |
1360 | -#: ../src/timerapplet/controllers/TimerApplet.py:416 |
1361 | +#: ../src/timerapplet/controllers/TimerApplet.py:411 |
1362 | #, python-format |
1363 | msgid "\"%s\" Finished" |
1364 | msgstr "" |
1365 | |
1366 | #. "<timer name>" finished at <time> |
1367 | -#: ../src/timerapplet/controllers/TimerApplet.py:419 |
1368 | +#: ../src/timerapplet/controllers/TimerApplet.py:414 |
1369 | #, python-format |
1370 | msgid "\"%s\" finished at %s" |
1371 | msgstr "" |
1372 | |
1373 | -#: ../src/timerapplet/controllers/TimerApplet.py:421 |
1374 | +#: ../src/timerapplet/controllers/TimerApplet.py:416 |
1375 | msgid "Timer Finished" |
1376 | msgstr "" |
1377 | |
1378 | #. Timer finished at <time> |
1379 | -#: ../src/timerapplet/controllers/TimerApplet.py:424 |
1380 | +#: ../src/timerapplet/controllers/TimerApplet.py:419 |
1381 | #, python-format |
1382 | msgid "Timer finished at %s" |
1383 | msgstr "" |
1384 | |
1385 | -#: ../src/timerapplet/controllers/TimerApplet.py:431 |
1386 | +#: ../src/timerapplet/controllers/TimerApplet.py:426 |
1387 | #, python-format |
1388 | msgid "Timer finished about <b>%d second</b> ago" |
1389 | msgid_plural "Timer finished about <b>%d seconds</b> ago" |
1390 | msgstr[0] "" |
1391 | msgstr[1] "" |
1392 | |
1393 | -#: ../src/timerapplet/controllers/TimerApplet.py:436 |
1394 | +#: ../src/timerapplet/controllers/TimerApplet.py:431 |
1395 | #, python-format |
1396 | msgid "Timer finished about <b>%d minute</b> ago" |
1397 | msgid_plural "Timer finished about <b>%d minutes</b> ago" |
1398 | @@ -355,7 +375,7 @@ |
1399 | msgid "_Continue Timer" |
1400 | msgstr "" |
1401 | |
1402 | -#: ../src/timerapplet/ui/StartTimerDialog.py:174 |
1403 | +#: ../src/timerapplet/ui/StartTimerDialog.py:186 |
1404 | msgid "<b>Command not found.</b>" |
1405 | msgstr "" |
1406 | |
1407 | @@ -371,8 +391,15 @@ |
1408 | msgid "_Seconds:" |
1409 | msgstr "" |
1410 | |
1411 | +#. HH:MM |
1412 | +#. MM:SS |
1413 | +#: ../src/timerapplet/utils.py:56 ../src/timerapplet/utils.py:59 |
1414 | +#, python-format |
1415 | +msgid "%02d:%02d" |
1416 | +msgstr "" |
1417 | + |
1418 | #. <preset name> (HH:MM:SS) |
1419 | -#: ../src/timerapplet/utils.py:43 |
1420 | +#: ../src/timerapplet/utils.py:69 |
1421 | #, python-format |
1422 | msgid "%s (%02d:%02d:%02d)" |
1423 | msgstr "" |
1424 | |
1425 | === modified file 'timer-applet/src/timerapplet/controllers/GlobalController.py' |
1426 | --- timer-applet/src/timerapplet/controllers/GlobalController.py 2010-07-14 10:53:59 +0000 |
1427 | +++ timer-applet/src/timerapplet/controllers/GlobalController.py 2010-09-15 19:27:52 +0000 |
1428 | @@ -49,13 +49,14 @@ |
1429 | |
1430 | result = add_dialog.get_preset() |
1431 | if result is not None: |
1432 | - (name, hours, minutes, seconds, command) = result |
1433 | + (name, hours, minutes, seconds, command, next_timer, auto_start) = result |
1434 | self._presets_store.add_preset(name, hours, minutes, seconds, |
1435 | - command) |
1436 | + command, next_timer, auto_start) |
1437 | |
1438 | def _on_mgr_clicked_edit(self, sender, row_path, data=None): |
1439 | row_iter = self._presets_store.get_model().get_iter(row_path) |
1440 | - (name, hours, minutes, seconds, command) = self._presets_store.get_preset(row_iter) |
1441 | + (name, hours, minutes, seconds, command, next_timer, auto_start) = \ |
1442 | + self._presets_store.get_preset(row_iter) |
1443 | |
1444 | edit_dialog = ui.AddEditPresetDialog(config.GLADE_PATH, |
1445 | _('Edit Preset'), |
1446 | @@ -66,14 +67,25 @@ |
1447 | hours, |
1448 | minutes, |
1449 | seconds, |
1450 | - command) |
1451 | + command, |
1452 | + next_timer, |
1453 | + auto_start |
1454 | + ) |
1455 | |
1456 | result = edit_dialog.get_preset() |
1457 | if result is not None: |
1458 | - (name, hours, minutes, seconds, command) = result |
1459 | + (name, hours, minutes, seconds, command, next_timer, auto_start) = result |
1460 | self._presets_store.modify_preset(row_iter, name, hours, minutes, |
1461 | - seconds, command) |
1462 | + seconds, command, next_timer, |
1463 | + auto_start) |
1464 | |
1465 | def _on_mgr_clicked_remove(self, sender, row_path, data=None): |
1466 | row_iter = self._presets_store.get_model().get_iter(row_path) |
1467 | self._presets_store.remove_preset(row_iter) |
1468 | + |
1469 | + # TODO |
1470 | + def _on_mgr_next_timer_is_being_edited(self, sender, row_path, data=None): |
1471 | + """Show a dropdown widget to help completing the next timer.""" |
1472 | + raise NotImplementedError("Not implemented, yet") |
1473 | + |
1474 | + |
1475 | |
1476 | === modified file 'timer-applet/src/timerapplet/controllers/TimerApplet.py' |
1477 | --- timer-applet/src/timerapplet/controllers/TimerApplet.py 2010-07-23 18:38:21 +0000 |
1478 | +++ timer-applet/src/timerapplet/controllers/TimerApplet.py 2010-09-15 19:27:52 +0000 |
1479 | @@ -18,7 +18,6 @@ |
1480 | from gettext import gettext as _ |
1481 | from gettext import ngettext |
1482 | from datetime import datetime, timedelta |
1483 | -import bonobo.ui |
1484 | import gnomeapplet |
1485 | import gst |
1486 | import gtk |
1487 | @@ -31,33 +30,10 @@ |
1488 | from timerapplet import core |
1489 | from timerapplet import ui |
1490 | from timerapplet import utils |
1491 | -from timerapplet.logger import logging |
1492 | - |
1493 | -def construct_time_str(remaining_seconds, show_all=True): |
1494 | - """Return a user-friendly representation of remaining time based on the given number of seconds. |
1495 | - |
1496 | - show_all specifies whether the returned string should show all time components. |
1497 | - If show_all is True (default), the returned string is in HH:MM:SS format. |
1498 | - If show_all is False, the returned string is in either HH:MM or MM:SS format, |
1499 | - depending on how much time is remaining. This avoids showing the user more |
1500 | - information than necessary. |
1501 | - |
1502 | - """ |
1503 | - hours, minutes, seconds = utils.seconds_to_hms(remaining_seconds) |
1504 | - if show_all: |
1505 | - # HH:MM:SS |
1506 | - return _('%02d:%02d:%02d') % (hours, minutes, seconds) |
1507 | - else: |
1508 | - if hours > 0 or minutes > 14: |
1509 | - # HH:MM |
1510 | - return _('%02d:%02d') % (hours, minutes) |
1511 | - else: |
1512 | - # MM:SS |
1513 | - return _('%02d:%02d') % (minutes, seconds) |
1514 | - |
1515 | -def get_display_text_from_datetime(date_time): |
1516 | - return date_time.strftime('%X') |
1517 | - |
1518 | + |
1519 | +import pudb |
1520 | +import pdb |
1521 | + |
1522 | def on_widget_button_press_event(sender, event, data=None): |
1523 | if event.button != 1: |
1524 | sender.emit_stop_by_name('button-press-event') |
1525 | @@ -109,6 +85,10 @@ |
1526 | |
1527 | self._status_button = ui.StatusButton() |
1528 | self._notifier = ui.Notifier('TimerApplet', gtk.STOCK_DIALOG_INFO, self._status_button) |
1529 | + self._start_next_timer_dialog = ui.StartNextTimerDialog( |
1530 | + config.GLADE_PATH, |
1531 | + "Start next timer", |
1532 | + "Would you like to start the next timer?") |
1533 | self._start_timer_dialog = ui.StartTimerDialog(config.GLADE_PATH, |
1534 | lambda name: utils.is_valid_preset_name(name, |
1535 | self._presets_store), |
1536 | @@ -125,21 +105,26 @@ |
1537 | self._about_dialog.set_version(config.VERSION) |
1538 | |
1539 | self._applet.set_applet_flags(gnomeapplet.EXPAND_MINOR) |
1540 | - self._applet.setup_menu_from_file(None, |
1541 | - config.POPUP_MENU_FILE_PATH, |
1542 | - None, |
1543 | - [('PauseTimer', lambda component, verb: self._timer.stop()), |
1544 | - ('ContinueTimer', lambda component, verb: self._timer.start()), |
1545 | - ('StopTimer', lambda component, verb: self._timer.reset()), |
1546 | - ('RestartTimer', lambda component, verb: self._restart_timer()), |
1547 | - ('ManagePresets', lambda component, verb: self._manage_presets_dialog.show()), |
1548 | - ('Preferences', lambda component, verb: self._preferences_dialog.show()), |
1549 | - ('About', lambda component, verb: self._about_dialog.show())]) |
1550 | + self._applet.setup_menu_from_file( |
1551 | + None, |
1552 | + config.POPUP_MENU_FILE_PATH, |
1553 | + None, |
1554 | + [('PauseTimer', lambda component, verb: self._timer.stop()), |
1555 | + ('ContinueTimer', lambda component, verb: self._timer.start()), |
1556 | + ('StopTimer', lambda component, verb: self._timer.reset()), |
1557 | + ('RestartTimer', lambda component, verb: self._restart_timer()), |
1558 | + ('StartNextTimer', lambda component, verb: self._start_next_timer()), |
1559 | + ('ManagePresets', lambda component, verb: self._manage_presets_dialog.show()), |
1560 | + ('Preferences', lambda component, |
1561 | + verb: self._preferences_dialog.show()), |
1562 | + ('About', lambda component, verb: self._about_dialog.show())] |
1563 | + ) |
1564 | self._applet.add(self._status_button) |
1565 | |
1566 | # Remove padding around button contents. |
1567 | force_no_focus_padding(self._status_button) |
1568 | |
1569 | + # TODO: |
1570 | # Fix bug in which button would not propogate middle-clicks |
1571 | # and right-clicks to the applet. |
1572 | self._status_button.connect('button-press-event', on_widget_button_press_event) |
1573 | @@ -216,7 +201,7 @@ |
1574 | print 'Finished' |
1575 | self._status_button.set_label(_('Finished')) |
1576 | name_str = self._timer.get_name() |
1577 | - time_str = get_display_text_from_datetime(self._timer.get_end_time()) |
1578 | + time_str = utils.get_display_text_from_datetime(self._timer.get_end_time()) |
1579 | if len(name_str) > 0: |
1580 | # "<timer name>" finished at <time> |
1581 | self._status_button.set_tooltip(_('"%s" finished at %s.\nClick to stop timer.') % (name_str, time_str)) |
1582 | @@ -228,7 +213,7 @@ |
1583 | current_state == core.Timer.STATE_FINISHED) |
1584 | self._status_button.set_use_icon(current_state == core.Timer.STATE_IDLE) |
1585 | self._status_button.set_show_remaining_time(current_state != core.Timer.STATE_IDLE and |
1586 | - self._gconf.get_bool(TimerApplet._SHOW_REMAINING_TIME_KEY)) |
1587 | + self._gconf.get_bool(TimerApplet._SHOW_REMAINING_TIME_KEY)) |
1588 | |
1589 | if current_state == core.Timer.STATE_PAUSED: |
1590 | self._status_button.set_pie_fill_color(0.4, 0.4, 0.4) |
1591 | @@ -251,6 +236,7 @@ |
1592 | popup = self._applet.get_popup_component() |
1593 | |
1594 | timer_state = self._timer.get_state() |
1595 | + has_next_timer = self._timer.get_next_timer() |
1596 | show_pause = (timer_state == core.Timer.STATE_RUNNING) |
1597 | show_continue = (timer_state == core.Timer.STATE_PAUSED) |
1598 | show_stop = (timer_state == core.Timer.STATE_RUNNING or |
1599 | @@ -259,11 +245,18 @@ |
1600 | show_restart = (timer_state == core.Timer.STATE_RUNNING or |
1601 | timer_state == core.Timer.STATE_PAUSED or |
1602 | timer_state == core.Timer.STATE_FINISHED) |
1603 | + show_next_timer = ((timer_state == core.Timer.STATE_RUNNING or |
1604 | + timer_state == core.Timer.STATE_PAUSED or |
1605 | + timer_state == core.Timer.STATE_FINISHED) and |
1606 | + # Only show this popup menu item if it has a |
1607 | + # next_timer defined. Clever, huh? ;) |
1608 | + has_next_timer) |
1609 | |
1610 | show_presets_menu = (len(self._presets_store.get_model()) > 0) |
1611 | show_separator = ( |
1612 | show_presets_menu or |
1613 | show_pause or |
1614 | + show_next_timer or |
1615 | show_continue or |
1616 | show_stop or |
1617 | show_restart) |
1618 | @@ -273,6 +266,7 @@ |
1619 | popup.set_prop('/commands/ContinueTimer', 'hidden', to_hidden_str(show_continue)) |
1620 | popup.set_prop('/commands/StopTimer', 'hidden', to_hidden_str(show_stop)) |
1621 | popup.set_prop('/commands/RestartTimer', 'hidden', to_hidden_str(show_restart)) |
1622 | + popup.set_prop('/commands/StartNextTimer', 'hidden', to_hidden_str(show_next_timer)) |
1623 | popup.set_prop(TimerApplet._PRESETS_PATH, 'hidden', to_hidden_str(show_presets_menu)) |
1624 | popup.set_prop('/popups/popup/Separator1', 'hidden', to_hidden_str(show_separator)) |
1625 | |
1626 | @@ -337,9 +331,9 @@ |
1627 | # Try hiding the Start Timer dialog, just in case it's open. |
1628 | self._start_timer_dialog.hide() |
1629 | row_iter = self._presets_store.get_model().get_iter(row_path) |
1630 | - (name, hours, minutes, seconds, command) = self._presets_store.get_preset(row_iter) |
1631 | - logging.debug("In _on_presets_submenu_item, command: " + command) |
1632 | - self._start_timer_with_settings(name, hours, minutes, seconds, command) |
1633 | + (name, hours, minutes, seconds, command, next_timer, auto_start) = self._presets_store.get_preset(row_iter) |
1634 | + self._start_timer_with_settings(name, hours, minutes, seconds, command, |
1635 | + next_timer, auto_start) |
1636 | |
1637 | ## GConf callbacks ## |
1638 | |
1639 | @@ -380,7 +374,7 @@ |
1640 | hours, minutes, seconds = utils.seconds_to_hms(timer.get_remaining_time()) |
1641 | print 'Remaining time: %d, %d, %d' % (hours, minutes, seconds) |
1642 | name = self._timer.get_name() |
1643 | - self._status_button.set_label(construct_time_str(self._timer.get_remaining_time(), |
1644 | + self._status_button.set_label(utils.construct_time_str(self._timer.get_remaining_time(), |
1645 | show_all=False)) |
1646 | |
1647 | fraction_remaining = float(self._timer.get_remaining_time()) / self._timer.get_duration() |
1648 | @@ -395,6 +389,8 @@ |
1649 | self._status_button.set_tooltip(_('%02d:%02d:%02d') % (hours, minutes, seconds)) |
1650 | |
1651 | def _on_timer_state_changed(self, timer, data=None): |
1652 | + # TODO: |
1653 | + # Refactor me! |
1654 | print 'State changed' |
1655 | new_state = timer.get_state() |
1656 | print ' new state: %d' % new_state |
1657 | @@ -406,9 +402,8 @@ |
1658 | if new_state == core.Timer.STATE_FINISHED: |
1659 | name = self._timer.get_name() |
1660 | command = self._timer.get_command() |
1661 | - logging.debug("Command: " + command) |
1662 | end_time = self._timer.get_end_time() |
1663 | - time_text = get_display_text_from_datetime(end_time) |
1664 | + time_text = utils.get_display_text_from_datetime(end_time) |
1665 | summary = None |
1666 | message = None |
1667 | if len(name) > 0: |
1668 | @@ -438,23 +433,67 @@ |
1669 | minutes) % minutes |
1670 | return message |
1671 | |
1672 | - # Call popup notification |
1673 | - self._call_notify(summary, message, reminder_message_func) |
1674 | - self._start_pulsing_button() |
1675 | - self._play_notification_sound() |
1676 | - # Run custom command. |
1677 | - self._run_custom_command(command) |
1678 | - |
1679 | - if self._gconf.get_bool('play_beep'): |
1680 | - print 'Playing beep...' |
1681 | - gdk.beep() |
1682 | - print 'Done playing beep.' |
1683 | + # TODO: |
1684 | + # FIXME: |
1685 | + # Reason for using a Python thread: |
1686 | + # To do all the procedures after timer has ended. If I don't do |
1687 | + # this then after the timer ended and it had an auto-start and next |
1688 | + # timer defined, it would directly switch without any notification. |
1689 | + # Trying time.sleep() doesn't work as expected; it correctly starts |
1690 | + # the next timer, but it doesn't show the notification and the |
1691 | + # rest. |
1692 | + class MyThread(threading.Thread): |
1693 | + def __init__(self, timer_instance): |
1694 | + threading.Thread.__init__(self) |
1695 | + self.timer = timer_instance |
1696 | + |
1697 | + def run(self): |
1698 | + print "Starting thread..." |
1699 | + print "Calling popup notification.", |
1700 | + self.timer._call_notify(summary, message, reminder_message_func) |
1701 | + print "Starting pulsing button.", |
1702 | + self.timer._start_pulsing_button() |
1703 | + print "Playing notification sound.", |
1704 | + self.timer._play_notification_sound() |
1705 | + print "Running custom command.", |
1706 | + self.timer._run_custom_command(command) |
1707 | + |
1708 | + if self.timer._gconf.get_bool('play_beep'): |
1709 | + print 'Playing beep...' |
1710 | + gdk.beep() |
1711 | + print 'Done playing beep.' |
1712 | + |
1713 | + print "Ending Thread..." |
1714 | + thread = MyThread(self) |
1715 | + thread.start() |
1716 | + thread.join() |
1717 | + |
1718 | + next_timer = self._timer.get_next_timer() |
1719 | + auto_start = self._timer.get_auto_start() |
1720 | + if auto_start and next_timer: |
1721 | + # Start next timer |
1722 | + self._stop_sound() |
1723 | + self._call_notify(show=False) |
1724 | + self._stop_pulsing_button() |
1725 | + self._start_next_timer() |
1726 | + elif not(auto_start) and next_timer: |
1727 | + self._status_button.props.sensitive = False |
1728 | + dialog_result = self._start_next_timer_dialog.get_response() |
1729 | + self._status_button.props.sensitive = True |
1730 | + if dialog_result: |
1731 | + # Start next timer |
1732 | + self._stop_sound() |
1733 | + self._call_notify(show=False) |
1734 | + self._stop_pulsing_button() |
1735 | + self._start_next_timer() |
1736 | else: |
1737 | self._stop_sound() |
1738 | self._call_notify(show=False) |
1739 | self._stop_pulsing_button() |
1740 | |
1741 | + print "Updating status button..." |
1742 | self._update_status_button() |
1743 | + print "Updating popup menu..." |
1744 | self._update_popup_menu() |
1745 | |
1746 | ## StatusButton callbacks ## |
1747 | @@ -484,37 +523,61 @@ |
1748 | ## StartTimerDialog callbacks ## |
1749 | |
1750 | def _on_start_dialog_clicked_start(self, sender, data=None): |
1751 | - (name, hours, minutes, seconds, command) = self._start_timer_dialog.get_name_and_duration() |
1752 | - self._start_timer_with_settings(name, hours, minutes, seconds, command) |
1753 | + (name, hours, minutes, seconds, command, next_timer, auto_start) = \ |
1754 | + self._start_timer_dialog.get_control_data() |
1755 | + self._start_timer_with_settings(name, hours, minutes, seconds, command, |
1756 | + next_timer, auto_start) |
1757 | |
1758 | def _on_start_dialog_clicked_manage_presets(self, sender, data=None): |
1759 | self._manage_presets_dialog.show() |
1760 | |
1761 | def _on_start_dialog_clicked_save(self, sender, name, |
1762 | - hours, minutes, seconds, command, data=None): |
1763 | - self._presets_store.add_preset(name, hours, minutes, seconds, command) |
1764 | - |
1765 | + hours, minutes, seconds, command, |
1766 | + next_timer, auto_start, data=None): |
1767 | + self._presets_store.add_preset(name, hours, minutes, seconds, command, |
1768 | + next_timer, auto_start) |
1769 | + |
1770 | def _on_start_dialog_clicked_preset(self, sender, row_path, data=None): |
1771 | row_iter = self._presets_store.get_model().get_iter(row_path) |
1772 | - (name, hours, minutes, seconds, command) = self._presets_store.get_preset(row_iter) |
1773 | + (name, hours, minutes, seconds, command, next_timer, auto_start) = \ |
1774 | + self._presets_store.get_preset(row_iter) |
1775 | self._start_timer_dialog.set_name_and_duration(name, hours, minutes, |
1776 | - seconds, command) |
1777 | + seconds, command, |
1778 | + next_timer, auto_start) |
1779 | |
1780 | ## Private methods ## |
1781 | |
1782 | def _start_timer_with_settings(self, name, hours, minutes, seconds, |
1783 | - command): |
1784 | + command, next_timer, auto_start): |
1785 | + print "Resetting timer" |
1786 | if self._timer.get_state() != core.Timer.STATE_IDLE: |
1787 | self._timer.reset() |
1788 | self._timer.set_duration(utils.hms_to_seconds(hours, minutes, seconds)) |
1789 | self._timer.set_name(name) |
1790 | self._timer.set_command(command) |
1791 | + self._timer.set_next_timer(next_timer) |
1792 | + self._timer.set_auto_start(auto_start) |
1793 | self._timer.start() |
1794 | |
1795 | def _restart_timer(self): |
1796 | self._timer.reset() |
1797 | self._timer.start() |
1798 | - |
1799 | + |
1800 | + def _start_next_timer(self): |
1801 | + """Start next timer, if defined.""" |
1802 | + next_timer = self._timer.get_next_timer() |
1803 | + for row in self._presets_store.get_model(): |
1804 | + #print dir(row) |
1805 | + if str(row[0]) == next_timer: |
1806 | + (name, hours, minutes, seconds, command, next_timer, auto_start) = \ |
1807 | + self._presets_store.get_preset(row.iter) |
1808 | + break |
1809 | + print "Starting timer with settings: ", |
1810 | + print (name, hours, minutes, seconds, command, next_timer, auto_start) |
1811 | + self._start_timer_with_settings(name, hours, minutes, seconds, command, |
1812 | + next_timer, auto_start) |
1813 | + |
1814 | + |
1815 | def _play_notification_sound(self): |
1816 | if not self._gconf.get_bool(TimerApplet._PLAY_SOUND_KEY): |
1817 | return |
1818 | @@ -539,8 +602,11 @@ |
1819 | |
1820 | def _run_custom_command(self, command): |
1821 | if command: |
1822 | - logging.debug("Running custom command: " + command) |
1823 | - subprocess.call(shlex.split(command)) |
1824 | + print "Running custom command: " + command |
1825 | + try: |
1826 | + subprocess.call(shlex.split(command)) |
1827 | + except OSError: |
1828 | + print "... failed. Command not found." |
1829 | |
1830 | def _stop_sound(self): |
1831 | self._gst_playbin.set_state(gst.STATE_NULL) |
1832 | @@ -548,7 +614,7 @@ |
1833 | def _start_pulsing_button(self): |
1834 | if self._gconf.get_bool(TimerApplet._SHOW_PULSING_ICON_KEY): |
1835 | self._status_button.start_pulsing() |
1836 | - _ |
1837 | + |
1838 | def _stop_pulsing_button(self): |
1839 | self._status_button.stop_pulsing() |
1840 | |
1841 | |
1842 | === modified file 'timer-applet/src/timerapplet/core/PresetsStore.py' |
1843 | --- timer-applet/src/timerapplet/core/PresetsStore.py 2010-07-15 02:27:57 +0000 |
1844 | +++ timer-applet/src/timerapplet/core/PresetsStore.py 2010-09-15 19:27:52 +0000 |
1845 | @@ -1,5 +1,5 @@ |
1846 | +# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net> |
1847 | # Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com> |
1848 | -# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net> |
1849 | # |
1850 | # This program is free software; you can redistribute it and/or modify |
1851 | # it under the terms of the GNU General Public License as published by |
1852 | @@ -26,6 +26,10 @@ |
1853 | import gtk |
1854 | import timerapplet.utils as utils |
1855 | |
1856 | +from timerapplet.utils import (serialize_bool, |
1857 | + deserialize_bool, |
1858 | + seconds_to_hms, |
1859 | + hms_to_seconds) |
1860 | from timerapplet.defs import VERSION |
1861 | |
1862 | class PersistentStore(gtk.ListStore): |
1863 | @@ -37,7 +41,13 @@ |
1864 | self.connect('row-changed', lambda model, row_path, row_iter: save_func(self)) |
1865 | |
1866 | class PresetsStore(gobject.GObject): |
1867 | - (_NAME_COL, _HOURS_COL, _MINUTES_COL, _SECONDS_COL, _COM_COL) = xrange(5) |
1868 | + (_NAME_COL, |
1869 | + _HOURS_COL, |
1870 | + _MINUTES_COL, |
1871 | + _SECONDS_COL, |
1872 | + _COM_COL, |
1873 | + _NEXT_COL, |
1874 | + _AUTO_START_COL) = xrange(7) |
1875 | |
1876 | def __init__(self, filename): |
1877 | object.__init__(self) |
1878 | @@ -47,7 +57,9 @@ |
1879 | gobject.TYPE_INT, |
1880 | gobject.TYPE_INT, |
1881 | gobject.TYPE_INT, |
1882 | - gobject.TYPE_STRING |
1883 | + gobject.TYPE_STRING, |
1884 | + gobject.TYPE_STRING, |
1885 | + gobject.TYPE_BOOLEAN, |
1886 | ) |
1887 | |
1888 | def get_model(self): |
1889 | @@ -64,18 +76,27 @@ |
1890 | PresetsStore._HOURS_COL, |
1891 | PresetsStore._MINUTES_COL, |
1892 | PresetsStore._SECONDS_COL, |
1893 | - PresetsStore._COM_COL) |
1894 | + PresetsStore._COM_COL, |
1895 | + PresetsStore._NEXT_COL, |
1896 | + PresetsStore._AUTO_START_COL, |
1897 | + ) |
1898 | |
1899 | - def add_preset(self, name, hours, minutes, seconds, command): |
1900 | - self._model.append((name, hours, minutes, seconds, command)) |
1901 | + def add_preset(self, name, hours, minutes, seconds, command, next_timer, |
1902 | + auto_start): |
1903 | + self._model.append((name, hours, minutes, seconds, command, next_timer, |
1904 | + auto_start)) |
1905 | |
1906 | - def modify_preset(self, row_iter, name, hours, minutes, seconds, command): |
1907 | + def modify_preset(self, row_iter, name, hours, minutes, seconds, command, |
1908 | + next_timer, auto_start): |
1909 | self._model.set(row_iter, |
1910 | PresetsStore._NAME_COL, name, |
1911 | PresetsStore._HOURS_COL, hours, |
1912 | PresetsStore._MINUTES_COL, minutes, |
1913 | PresetsStore._SECONDS_COL, seconds, |
1914 | - PresetsStore._COM_COL, command) |
1915 | + PresetsStore._COM_COL, command, |
1916 | + PresetsStore._NEXT_COL, next_timer, |
1917 | + PresetsStore._AUTO_START_COL, auto_start |
1918 | + ) |
1919 | |
1920 | def remove_preset(self, row_iter): |
1921 | self._model.remove(row_iter) |
1922 | @@ -97,9 +118,12 @@ |
1923 | |
1924 | for node in root: |
1925 | name = node.get('name') |
1926 | - (hours, minutes, seconds) = utils.seconds_to_hms(int(node.get('duration'))) |
1927 | + (hours, minutes, seconds) = seconds_to_hms(int(node.get('duration'))) |
1928 | command = node.get('command') |
1929 | - model.append((name, hours, minutes, seconds, command)) |
1930 | + next_timer = node.get('next_timer') |
1931 | + auto_start = node.get('auto_start') |
1932 | + model.append((name, hours, minutes, seconds, command, next_timer, |
1933 | + deserialize_bool(auto_start))) |
1934 | _load_presets = staticmethod(_load_presets) |
1935 | |
1936 | def _save_presets(model, file_path): |
1937 | @@ -107,18 +131,22 @@ |
1938 | root.set('version', VERSION) |
1939 | |
1940 | def add_xml_node(model, path, row_iter): |
1941 | - (name, hours, minutes, seconds, command) = \ |
1942 | + (name, hours, minutes, seconds, command, next_timer, auto_start) = \ |
1943 | model.get(row_iter, |
1944 | PresetsStore._NAME_COL, |
1945 | PresetsStore._HOURS_COL, |
1946 | PresetsStore._MINUTES_COL, |
1947 | PresetsStore._SECONDS_COL, |
1948 | - PresetsStore._COM_COL |
1949 | + PresetsStore._COM_COL, |
1950 | + PresetsStore._NEXT_COL, |
1951 | + PresetsStore._AUTO_START_COL |
1952 | ) |
1953 | node = et.SubElement(root, 'preset') |
1954 | node.set('name', name) |
1955 | - node.set('duration', str(utils.hms_to_seconds(hours, minutes, seconds))) |
1956 | + node.set('duration', str(hms_to_seconds(hours, minutes, seconds))) |
1957 | node.set('command', command or '') |
1958 | + node.set('next_timer', next_timer or '') |
1959 | + node.set('auto_start', serialize_bool(auto_start)) |
1960 | |
1961 | model.foreach(add_xml_node) |
1962 | tree = et.ElementTree(root) |
1963 | |
1964 | === modified file 'timer-applet/src/timerapplet/core/Timer.py' |
1965 | --- timer-applet/src/timerapplet/core/Timer.py 2010-07-15 02:27:57 +0000 |
1966 | +++ timer-applet/src/timerapplet/core/Timer.py 2010-09-15 19:27:52 +0000 |
1967 | @@ -1,5 +1,5 @@ |
1968 | +# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net> |
1969 | # Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com> |
1970 | -# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net> |
1971 | # |
1972 | # This program is free software; you can redistribute it and/or modify |
1973 | # it under the terms of the GNU General Public License as published by |
1974 | @@ -35,6 +35,8 @@ |
1975 | self._end_time = 0 |
1976 | self._name = '' |
1977 | self._command = '' |
1978 | + self._next_timer = '' |
1979 | + self._auto_start = False |
1980 | |
1981 | def set_duration(self, seconds): |
1982 | """Set the duration of the timer in seconds.""" |
1983 | @@ -55,10 +57,31 @@ |
1984 | return self._name |
1985 | |
1986 | def set_command(self, command): |
1987 | + """Set the command to run of the timer.""" |
1988 | + assert self._state == Timer.STATE_IDLE |
1989 | self._command = command |
1990 | |
1991 | def get_command(self): |
1992 | + """Return the name of the command of the timer.""" |
1993 | return self._command |
1994 | + |
1995 | + def set_next_timer(self, timer): |
1996 | + """Set the next timeer of the timer.""" |
1997 | + assert self._state == Timer.STATE_IDLE |
1998 | + self._next_timer = timer |
1999 | + |
2000 | + def get_next_timer(self): |
2001 | + """Get the next timer of the timer.""" |
2002 | + return self._next_timer |
2003 | + |
2004 | + def set_auto_start(self, auto_start): |
2005 | + """Set the auto-start value of the timer.""" |
2006 | + assert self._state == Timer.STATE_IDLE |
2007 | + self._auto_start = auto_start |
2008 | + |
2009 | + def get_auto_start(self): |
2010 | + """Get the auto-start value.""" |
2011 | + return self._auto_start |
2012 | |
2013 | def start(self): |
2014 | """Start or resume the timer. |
2015 | @@ -68,7 +91,7 @@ |
2016 | """ |
2017 | assert self._state == Timer.STATE_IDLE or self._state == Timer.STATE_PAUSED |
2018 | self._timer_transition_to_state(Timer.STATE_RUNNING) |
2019 | - |
2020 | + |
2021 | def stop(self): |
2022 | """Pause the timer. |
2023 | |
2024 | |
2025 | === modified file 'timer-applet/src/timerapplet/ui/AddEditPresetDialog.py' |
2026 | --- timer-applet/src/timerapplet/ui/AddEditPresetDialog.py 2010-07-14 10:53:59 +0000 |
2027 | +++ timer-applet/src/timerapplet/ui/AddEditPresetDialog.py 2010-09-15 19:27:52 +0000 |
2028 | @@ -20,7 +20,8 @@ |
2029 | |
2030 | class AddEditPresetDialog(object): |
2031 | def __init__(self, glade_file_name, title, name_validator_func, |
2032 | - name='', hours=0, minutes=0, seconds=0, command=''): |
2033 | + name='', hours=0, minutes=0, seconds=0, command='', |
2034 | + next_timer='', auto_start=False): |
2035 | self._valid_name_func = name_validator_func |
2036 | |
2037 | glade_widgets = glade.XML(glade_file_name, 'add_edit_preset_dialog') |
2038 | @@ -31,6 +32,8 @@ |
2039 | duration_chooser_container = glade_widgets.get_widget('duration_chooser_container') |
2040 | self._duration_chooser = DurationChooser(gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)) |
2041 | self._command_entry = glade_widgets.get_widget('command_entry') |
2042 | + self._next_timer_entry = glade_widgets.get_widget('next_timer_entry') |
2043 | + self._auto_start_check = glade_widgets.get_widget('auto_start_check') |
2044 | |
2045 | duration_chooser_container.pack_start(self._duration_chooser) |
2046 | |
2047 | @@ -39,6 +42,8 @@ |
2048 | self._name_entry.set_text(name) |
2049 | self._command_entry.set_text(command) |
2050 | self._duration_chooser.set_duration(hours, minutes, seconds) |
2051 | + self._next_timer_entry.set_text(next_timer) |
2052 | + self._auto_start_check.set_active(auto_start) |
2053 | |
2054 | self._name_entry.connect('changed', lambda entry: self._check_for_valid_save_preset_input()) |
2055 | self._duration_chooser.connect('duration-changed', |
2056 | @@ -53,6 +58,8 @@ |
2057 | self._ok_button.props.sensitive = (self._non_zero_duration() and |
2058 | self._valid_name_func(self._name_entry.get_text())) |
2059 | |
2060 | + ## Callback for saving ## |
2061 | + |
2062 | def get_preset(self): |
2063 | self._check_for_valid_save_preset_input() |
2064 | result = self._dialog.run() |
2065 | @@ -60,6 +67,9 @@ |
2066 | if result == gtk.RESPONSE_OK: |
2067 | (hours, minutes, seconds) = self._duration_chooser.get_duration() |
2068 | cmd = self._command_entry.get_text() |
2069 | - return (self._name_entry.get_text(), hours, minutes, seconds, cmd) |
2070 | + next_timer = self._next_timer_entry.get_text() |
2071 | + auto_start = self._auto_start_check.get_active() |
2072 | + return (self._name_entry.get_text(), hours, minutes, seconds, cmd, |
2073 | + next_timer, auto_start) |
2074 | else: |
2075 | return None |
2076 | |
2077 | === modified file 'timer-applet/src/timerapplet/ui/Makefile.am' |
2078 | --- timer-applet/src/timerapplet/ui/Makefile.am 2007-04-15 05:04:58 +0000 |
2079 | +++ timer-applet/src/timerapplet/ui/Makefile.am 2010-09-15 19:27:52 +0000 |
2080 | @@ -11,4 +11,5 @@ |
2081 | PulseButton.py \ |
2082 | ScrollableButtonList.py \ |
2083 | StartTimerDialog.py \ |
2084 | + StartNextTimerDialog.py \ |
2085 | StatusButton.py |
2086 | |
2087 | === added file 'timer-applet/src/timerapplet/ui/StartNextTimerDialog.py' |
2088 | --- timer-applet/src/timerapplet/ui/StartNextTimerDialog.py 1970-01-01 00:00:00 +0000 |
2089 | +++ timer-applet/src/timerapplet/ui/StartNextTimerDialog.py 2010-09-15 19:27:52 +0000 |
2090 | @@ -0,0 +1,66 @@ |
2091 | +# -*- mode: python; coding: utf-8; -*- |
2092 | +# Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com> |
2093 | +# This program is free software; you can redistribute it and/or modify |
2094 | +# it under the terms of the GNU General Public License as published by |
2095 | +# the Free Software Foundation; either version 2 of the License, or |
2096 | +# (at your option) any later version. |
2097 | +# |
2098 | +# This program is distributed in the hope that it will be useful, |
2099 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2100 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2101 | +# GNU General Public License for more details. |
2102 | +# |
2103 | +# You should have received a copy of the GNU General Public License |
2104 | +# along with this program; if not, write to the Free Software |
2105 | +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
2106 | + |
2107 | +""" |
2108 | +The Start Next Timer dialog |
2109 | + |
2110 | +When a timer ended and the auto_start option was disabled this dialog shows up. |
2111 | +""" |
2112 | + |
2113 | +from gettext import gettext as _ |
2114 | +import gtk |
2115 | + |
2116 | +class StartNextTimerDialog(object): |
2117 | + def __init__(self, glade_file_name, header_text, body_text): |
2118 | + # TODO: Include next_timer in body_text |
2119 | + self._dialog = gtk.Dialog( |
2120 | + _("Start Next Timer"), |
2121 | + None, |
2122 | + gtk.DIALOG_DESTROY_WITH_PARENT, |
2123 | + (_("_Don't start next timer"), gtk.RESPONSE_CLOSE, |
2124 | + _("_Start next timer"), gtk.RESPONSE_YES)) |
2125 | + self._dialog.props.border_width = 6 |
2126 | + self._dialog.props.has_separator = False |
2127 | + self._dialog.props.resizable = False |
2128 | + self._dialog.vbox.props.spacing = 12 |
2129 | + self._dialog.set_default_response(gtk.RESPONSE_YES) |
2130 | + |
2131 | + hbox = gtk.HBox(False, 0) |
2132 | + hbox.props.spacing = 12 |
2133 | + hbox.props.border_width = 6 |
2134 | + |
2135 | + image = gtk.image_new_from_stock(gtk.STOCK_DIALOG_QUESTION, gtk.ICON_SIZE_DIALOG) |
2136 | + image.props.yalign = 0.0 |
2137 | + |
2138 | + label = gtk.Label('<span weight="bold" size="larger">%s</span>\n\n%s' % (header_text, body_text)) |
2139 | + label.props.use_markup = True |
2140 | + label.props.wrap = True |
2141 | + label.props.yalign = 0.0 |
2142 | + |
2143 | + hbox.pack_start(image, False, False, 0) |
2144 | + hbox.pack_start(label, False, False, 0) |
2145 | + self._dialog.vbox.pack_start(hbox, False, False, 0) |
2146 | + |
2147 | + hbox.show_all() |
2148 | + |
2149 | + def get_response(self): |
2150 | + dialog_result = self._dialog.run() |
2151 | + self._dialog.hide() |
2152 | + if dialog_result == gtk.RESPONSE_YES: |
2153 | + return True |
2154 | + else: |
2155 | + return False |
2156 | + |
2157 | |
2158 | === modified file 'timer-applet/src/timerapplet/ui/StartTimerDialog.py' |
2159 | --- timer-applet/src/timerapplet/ui/StartTimerDialog.py 2010-07-18 01:45:29 +0000 |
2160 | +++ timer-applet/src/timerapplet/ui/StartTimerDialog.py 2010-09-15 19:27:52 +0000 |
2161 | @@ -1,5 +1,5 @@ |
2162 | +# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net> |
2163 | # Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com> |
2164 | -# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net> |
2165 | # |
2166 | # This program is free software; you can redistribute it and/or modify |
2167 | # it under the terms of the GNU General Public License as published by |
2168 | @@ -24,7 +24,6 @@ |
2169 | from shlex import split as shell_tokenize |
2170 | from subprocess import check_call, CalledProcessError |
2171 | |
2172 | -from timerapplet.logger import logging as log |
2173 | from DurationChooser import DurationChooser |
2174 | from ScrollableButtonList import ScrollableButtonList |
2175 | |
2176 | @@ -42,7 +41,9 @@ |
2177 | gobject.TYPE_INT, |
2178 | gobject.TYPE_INT, |
2179 | gobject.TYPE_INT, |
2180 | - gobject.TYPE_STRING)), |
2181 | + gobject.TYPE_STRING, |
2182 | + gobject.TYPE_STRING, |
2183 | + gobject.TYPE_BOOLEAN)), |
2184 | 'clicked-preset': |
2185 | (gobject.SIGNAL_RUN_LAST, |
2186 | gobject.TYPE_NONE, |
2187 | @@ -68,9 +69,16 @@ |
2188 | duration_chooser_container = glade_widgets.get_widget('duration_chooser_container') |
2189 | presets_chooser_container = glade_widgets.get_widget('presets_chooser_container') |
2190 | self._presets_section = glade_widgets.get_widget('presets_section') |
2191 | - # The TextEntry control for running a custom command |
2192 | + #: The TextEntry control for running a custom command |
2193 | self._command_entry = glade_widgets.get_widget('command_entry') |
2194 | + #: The "Invalid Command" label |
2195 | self._invalid_cmd_label = glade_widgets.get_widget('invalid_command_label') |
2196 | + #: The next timer combo box |
2197 | + self._next_timer_combo = glade_widgets.get_widget('next_timer_combo_entry') |
2198 | + self._next_timer_combo.set_model(self._presets_store) |
2199 | + self._next_timer_combo.set_text_column(0) # The column to be shown |
2200 | + #: The auto-start check button. |
2201 | + self._auto_start_check = glade_widgets.get_widget('auto_start_check') |
2202 | |
2203 | labels_size_group.add_widget(name_label) |
2204 | self._dialog.set_default_response(gtk.RESPONSE_OK) |
2205 | @@ -84,6 +92,8 @@ |
2206 | self._save_button.connect('clicked', self._on_save_button_clicked) |
2207 | # Check that executable is valid while inserting text |
2208 | self._command_entry.connect('changed', self._check_is_valid_command) |
2209 | + self._next_timer_combo.child.connect("changed", |
2210 | + self._on_next_timer_combo_entry_child_changed) |
2211 | glade_widgets.get_widget('manage_presets_button').connect('clicked', |
2212 | self._on_manage_presets_button_clicked) |
2213 | self._presets_store.connect('row-deleted', |
2214 | @@ -107,23 +117,25 @@ |
2215 | def hide(self): |
2216 | self._dialog.hide() |
2217 | |
2218 | - def get_name_and_duration(self): |
2219 | + def get_control_data(self): |
2220 | """Return name and duration in a tuple. |
2221 | |
2222 | - The returned tuple is in this format: (name, hours, minutes, seconds) |
2223 | + The returned tuple is in this format: |
2224 | + |
2225 | + (name, hours, minutes, seconds, next_timer, auto_start) |
2226 | |
2227 | """ |
2228 | return (self._name_entry.get_text().strip(),) + \ |
2229 | - self._duration_chooser.get_duration() + \ |
2230 | - (self._command_entry.get_text().strip(),) |
2231 | + self._duration_chooser.get_duration() + \ |
2232 | + (self._command_entry.get_text().strip(), |
2233 | + self._next_timer_combo.child.get_text().strip(), |
2234 | + self._auto_start_check.get_active()) |
2235 | |
2236 | def set_name_and_duration(self, name, hours, minutes, seconds, *args): |
2237 | self._name_entry.set_text(name) |
2238 | - if args[0]: |
2239 | - self._command_entry.set_text(args[0]) |
2240 | - else: |
2241 | - # Clear the Command Entry control after switching preset elements |
2242 | - self._command_entry.set_text('') |
2243 | + self._command_entry.set_text(args[0]) |
2244 | + self._next_timer_combo.child.set_text(args[1]) |
2245 | + self._auto_start_check.set_active(args[2]) |
2246 | self._duration_chooser.set_duration(hours, minutes, seconds) |
2247 | |
2248 | def _update_presets_list(self): |
2249 | @@ -182,6 +194,7 @@ |
2250 | def _check_for_valid_save_preset_input(self): |
2251 | self._save_button.props.sensitive = (self._non_zero_duration() and |
2252 | self._valid_name_func(self._name_entry.get_text())) |
2253 | + # TODO: Add validator for next_timer_combo |
2254 | |
2255 | def _check_for_valid_start_timer_input(self): |
2256 | self._ok_button.props.sensitive = self._non_zero_duration() |
2257 | @@ -212,4 +225,26 @@ |
2258 | (hours, minutes, seconds) = self._duration_chooser.get_duration() |
2259 | name = self._name_entry.get_text() |
2260 | command = self._command_entry.get_text() |
2261 | - self.emit('clicked-save', name, hours, minutes, seconds, command) |
2262 | + next_timer = self._next_timer_combo.child.get_text() |
2263 | + auto_start = self._auto_start_check.get_active() |
2264 | + self.emit('clicked-save', name, hours, minutes, seconds, command, |
2265 | + next_timer, auto_start) |
2266 | + |
2267 | + def _on_next_timer_combo_entry_child_changed(self, widget, data=None): |
2268 | + """Validate selection of the Next Timer ComboBoxEntry.""" |
2269 | + modelfilter = self._presets_store.filter_new() |
2270 | + # Loop through all rows in ListStore |
2271 | + # TODO: Using a generator may be more memory efficient in this case. |
2272 | + for row in modelfilter: |
2273 | + # Check that name of preset is the exact match of the the text in |
2274 | + # the ComboBoxEntry |
2275 | + if widget.get_text() == row[0]: |
2276 | + # Yes, it matches! Make the auto-start checkbox sensitive |
2277 | + # (activate it). |
2278 | + self._auto_start_check.set_sensitive(True) |
2279 | + break |
2280 | + else: |
2281 | + # If value of ComboBoxEntry is None then de-activate the |
2282 | + # auto-start checkbox. |
2283 | + self._auto_start_check.set_sensitive(False) |
2284 | + |
2285 | |
2286 | === modified file 'timer-applet/src/timerapplet/ui/__init__.py' |
2287 | --- timer-applet/src/timerapplet/ui/__init__.py 2008-12-01 09:52:01 +0000 |
2288 | +++ timer-applet/src/timerapplet/ui/__init__.py 2010-09-15 19:27:52 +0000 |
2289 | @@ -24,4 +24,5 @@ |
2290 | from PulseButton import PulseButton |
2291 | from ScrollableButtonList import ScrollableButtonList |
2292 | from StartTimerDialog import StartTimerDialog |
2293 | +from StartNextTimerDialog import StartNextTimerDialog |
2294 | from StatusButton import StatusButton |
2295 | |
2296 | === modified file 'timer-applet/src/timerapplet/utils.py' |
2297 | --- timer-applet/src/timerapplet/utils.py 2010-07-15 02:27:57 +0000 |
2298 | +++ timer-applet/src/timerapplet/utils.py 2010-09-15 19:27:52 +0000 |
2299 | @@ -1,5 +1,5 @@ |
2300 | +# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net> |
2301 | # Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com> |
2302 | -# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net> |
2303 | # |
2304 | # This program is free software; you can redistribute it and/or modify |
2305 | # it under the terms of the GNU General Public License as published by |
2306 | @@ -36,8 +36,44 @@ |
2307 | def hms_to_seconds(hours, minutes, seconds): |
2308 | return hours * 3600 + minutes * 60 + seconds |
2309 | |
2310 | +def construct_time_str(remaining_seconds, show_all=True): |
2311 | + """Return a user-friendly representation of remaining time based on the given number of seconds. |
2312 | + |
2313 | + show_all specifies whether the returned string should show all time components. |
2314 | + If show_all is True (default), the returned string is in HH:MM:SS format. |
2315 | + If show_all is False, the returned string is in either HH:MM or MM:SS format, |
2316 | + depending on how much time is remaining. This avoids showing the user more |
2317 | + information than necessary. |
2318 | + |
2319 | + """ |
2320 | + hours, minutes, seconds = seconds_to_hms(remaining_seconds) |
2321 | + if show_all: |
2322 | + # HH:MM:SS |
2323 | + return _('%02d:%02d:%02d') % (hours, minutes, seconds) |
2324 | + else: |
2325 | + if hours > 0 or minutes > 14: |
2326 | + # HH:MM |
2327 | + return _('%02d:%02d') % (hours, minutes) |
2328 | + else: |
2329 | + # MM:SS |
2330 | + return _('%02d:%02d') % (minutes, seconds) |
2331 | + |
2332 | +def get_display_text_from_datetime(date_time): |
2333 | + return date_time.strftime('%X') |
2334 | + |
2335 | def get_preset_display_text(presets_store, row_iter): |
2336 | - (name, hours, minutes, seconds, command) = presets_store.get_preset(row_iter) |
2337 | + (name, hours, minutes, seconds, command, next_timer, auto_start) = \ |
2338 | + presets_store.get_preset(row_iter) |
2339 | |
2340 | # <preset name> (HH:MM:SS) |
2341 | return _('%s (%02d:%02d:%02d)') % (name, hours, minutes, seconds) |
2342 | + |
2343 | +def serialize_bool(boolean): |
2344 | + if boolean: |
2345 | + return "1" |
2346 | + return "0" |
2347 | + |
2348 | +def deserialize_bool(string): |
2349 | + if string == "1": |
2350 | + return True |
2351 | + return False |
Merged to development branch