Merge lp:~knny-myer/timer-applet/interval-timer into lp: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
Reviewer Review Type Date Requested Status
Kenny Meyer Approve
Review via email: mp+35571@code.launchpad.net

Description of the change

Added feature for defining a next timer in the presets menu.

To post a comment you must log in.
Revision history for this message
Kenny Meyer (knny-myer) wrote :

Merged to development branch

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'timer-applet/THANKS'
--- timer-applet/THANKS 2010-07-23 23:21:41 +0000
+++ timer-applet/THANKS 2010-09-15 19:27:52 +0000
@@ -1,5 +1,6 @@
1Timer Applet THANKS:1Timer Applet THANKS:
22
3Dave Atkins
3Ben Harrison4Ben Harrison
4Philipp Kern5Philipp Kern
5Paco Molinero6Paco Molinero
67
=== modified file 'timer-applet/data/TimerApplet.xml'
--- timer-applet/data/TimerApplet.xml 2007-04-15 05:04:58 +0000
+++ timer-applet/data/TimerApplet.xml 2010-09-15 19:27:52 +0000
@@ -6,6 +6,7 @@
6 <menuitem verb="ContinueTimer" name="Continue Item" _label="_Continue"/>6 <menuitem verb="ContinueTimer" name="Continue Item" _label="_Continue"/>
7 <menuitem verb="StopTimer" name="Stop Item" _label="_Stop"/>7 <menuitem verb="StopTimer" name="Stop Item" _label="_Stop"/>
8 <menuitem verb="RestartTimer" name="Restart Item" _label="R_estart"/>8 <menuitem verb="RestartTimer" name="Restart Item" _label="R_estart"/>
9 <menuitem verb="StartNextTimer" name="Start next item" _label="Next"/>
9 <submenu name="Presets" _label="Pre_sets">10 <submenu name="Presets" _label="Pre_sets">
10 </submenu>11 </submenu>
11 <separator name="Separator1"/>12 <separator name="Separator1"/>
1213
=== modified file 'timer-applet/data/timer-applet.glade'
--- timer-applet/data/timer-applet.glade 2010-08-02 00:21:28 +0000
+++ timer-applet/data/timer-applet.glade 2010-09-15 19:27:52 +0000
@@ -74,33 +74,131 @@
74 <widget class="GtkVBox" id="vbox1">74 <widget class="GtkVBox" id="vbox1">
75 <property name="visible">True</property>75 <property name="visible">True</property>
76 <child>76 <child>
77 <widget class="GtkHBox" id="hbox1">77 <widget class="GtkFrame" id="frame1">
78 <property name="visible">True</property>78 <property name="visible">True</property>
79 <child>79 <property name="label_xalign">0</property>
80 <widget class="GtkEntry" id="command_entry">80 <property name="shadow_type">none</property>
81 <property name="visible">True</property>81 <child>
82 <property name="can_focus">True</property>82 <widget class="GtkAlignment" id="alignment1">
83 <signal name="changed" handler="command_entry_changed_cb"/>83 <property name="visible">True</property>
84 <property name="left_padding">12</property>
85 <child>
86 <widget class="GtkVBox" id="vbox2">
87 <property name="visible">True</property>
88 <child>
89 <widget class="GtkTable" id="table1">
90 <property name="visible">True</property>
91 <property name="n_rows">2</property>
92 <child>
93 <widget class="GtkComboBoxEntry" id="next_timer_combo_entry">
94 <property name="visible">True</property>
95 </widget>
96 <packing>
97 <property name="y_padding">3</property>
98 </packing>
99 </child>
100 <child>
101 <widget class="GtkCheckButton" id="auto_start_check">
102 <property name="label" translatable="yes">Start automatically</property>
103 <property name="visible">True</property>
104 <property name="sensitive">False</property>
105 <property name="can_focus">True</property>
106 <property name="receives_default">False</property>
107 <property name="draw_indicator">True</property>
108 </widget>
109 <packing>
110 <property name="top_attach">1</property>
111 <property name="bottom_attach">2</property>
112 <property name="y_padding">3</property>
113 </packing>
114 </child>
115 </widget>
116 <packing>
117 <property name="position">0</property>
118 </packing>
119 </child>
120 </widget>
121 </child>
122 </widget>
123 </child>
124 <child>
125 <widget class="GtkLabel" id="label2">
126 <property name="visible">True</property>
127 <property name="label" translatable="yes">&lt;b&gt;Define next timer&lt;/b&gt;</property>
128 <property name="use_markup">True</property>
84 </widget>129 </widget>
85 <packing>130 <packing>
86 <property name="padding">5</property>131 <property name="type">label_item</property>
87 <property name="position">0</property>
88 </packing>132 </packing>
89 </child>133 </child>
90 </widget>134 </widget>
91 <packing>135 <packing>
92 <property name="padding">2</property>
93 <property name="position">0</property>136 <property name="position">0</property>
94 </packing>137 </packing>
95 </child>138 </child>
96 <child>139 <child>
140 <widget class="GtkFrame" id="frame2">
141 <property name="visible">True</property>
142 <property name="label_xalign">0</property>
143 <property name="shadow_type">none</property>
144 <child>
145 <widget class="GtkAlignment" id="alignment2">
146 <property name="visible">True</property>
147 <property name="left_padding">12</property>
148 <child>
149 <widget class="GtkHBox" id="hbox2">
150 <property name="visible">True</property>
151 <property name="border_width">3</property>
152 <child>
153 <widget class="GtkLabel" id="command_label">
154 <property name="width_request">50</property>
155 <property name="visible">True</property>
156 <property name="has_tooltip">True</property>
157 <property name="ypad">5</property>
158 <property name="label" translatable="yes">Execute:</property>
159 </widget>
160 <packing>
161 <property name="position">0</property>
162 </packing>
163 </child>
164 <child>
165 <widget class="GtkEntry" id="command_entry">
166 <property name="visible">True</property>
167 <property name="can_focus">True</property>
168 <signal name="changed" handler="command_entry_changed_cb"/>
169 </widget>
170 <packing>
171 <property name="padding">5</property>
172 <property name="position">1</property>
173 </packing>
174 </child>
175 </widget>
176 </child>
177 </widget>
178 </child>
179 <child>
180 <widget class="GtkLabel" id="label3">
181 <property name="visible">True</property>
182 <property name="label" translatable="yes">&lt;b&gt;Run custom command&lt;/b&gt;</property>
183 <property name="use_markup">True</property>
184 </widget>
185 <packing>
186 <property name="type">label_item</property>
187 </packing>
188 </child>
189 </widget>
190 <packing>
191 <property name="position">1</property>
192 </packing>
193 </child>
194 <child>
97 <widget class="GtkLabel" id="invalid_command_label">195 <widget class="GtkLabel" id="invalid_command_label">
98 <property name="visible">True</property>196 <property name="visible">True</property>
99 <property name="app_paintable">True</property>197 <property name="app_paintable">True</property>
100 <property name="use_markup">True</property>198 <property name="use_markup">True</property>
101 </widget>199 </widget>
102 <packing>200 <packing>
103 <property name="position">1</property>201 <property name="position">2</property>
104 </packing>202 </packing>
105 </child>203 </child>
106 </widget>204 </widget>
@@ -109,7 +207,7 @@
109 <widget class="GtkLabel" id="label_command">207 <widget class="GtkLabel" id="label_command">
110 <property name="visible">True</property>208 <property name="visible">True</property>
111 <property name="tooltip" translatable="yes">Run executable after timer finished.</property>209 <property name="tooltip" translatable="yes">Run executable after timer finished.</property>
112 <property name="label" translatable="yes">Run executable</property>210 <property name="label" translatable="yes">Advanced</property>
113 </widget>211 </widget>
114 <packing>212 <packing>
115 <property name="type">label_item</property>213 <property name="type">label_item</property>
@@ -632,6 +730,7 @@
632 <widget class="GtkAlignment" id="alignment2">730 <widget class="GtkAlignment" id="alignment2">
633 <property name="visible">True</property>731 <property name="visible">True</property>
634 <property name="left_padding">12</property>732 <property name="left_padding">12</property>
733 <property name="right_padding">12</property>
635 <child>734 <child>
636 <widget class="GtkEntry" id="name_entry">735 <widget class="GtkEntry" id="name_entry">
637 <property name="visible">True</property>736 <property name="visible">True</property>
@@ -704,6 +803,7 @@
704 <widget class="GtkAlignment" id="alignment1">803 <widget class="GtkAlignment" id="alignment1">
705 <property name="visible">True</property>804 <property name="visible">True</property>
706 <property name="left_padding">12</property>805 <property name="left_padding">12</property>
806 <property name="right_padding">12</property>
707 <child>807 <child>
708 <widget class="GtkEntry" id="command_entry">808 <widget class="GtkEntry" id="command_entry">
709 <property name="visible">True</property>809 <property name="visible">True</property>
@@ -728,6 +828,59 @@
728 <property name="position">2</property>828 <property name="position">2</property>
729 </packing>829 </packing>
730 </child>830 </child>
831 <child>
832 <widget class="GtkFrame" id="frame4">
833 <property name="visible">True</property>
834 <property name="label_xalign">0</property>
835 <property name="shadow_type">none</property>
836 <child>
837 <widget class="GtkAlignment" id="alignment4">
838 <property name="visible">True</property>
839 <property name="left_padding">12</property>
840 <property name="right_padding">12</property>
841 <child>
842 <widget class="GtkVBox" id="vbox1">
843 <property name="visible">True</property>
844 <child>
845 <widget class="GtkEntry" id="next_timer_entry">
846 <property name="visible">True</property>
847 <property name="can_focus">True</property>
848 </widget>
849 <packing>
850 <property name="position">0</property>
851 </packing>
852 </child>
853 <child>
854 <widget class="GtkCheckButton" id="auto_start_check">
855 <property name="label" translatable="yes">Initiate automatically</property>
856 <property name="visible">True</property>
857 <property name="can_focus">True</property>
858 <property name="receives_default">False</property>
859 <property name="draw_indicator">True</property>
860 </widget>
861 <packing>
862 <property name="position">1</property>
863 </packing>
864 </child>
865 </widget>
866 </child>
867 </widget>
868 </child>
869 <child>
870 <widget class="GtkLabel" id="label2">
871 <property name="visible">True</property>
872 <property name="label" translatable="yes">&lt;b&gt;Interval timer&lt;/b&gt;</property>
873 <property name="use_markup">True</property>
874 </widget>
875 <packing>
876 <property name="type">label_item</property>
877 </packing>
878 </child>
879 </widget>
880 <packing>
881 <property name="position">3</property>
882 </packing>
883 </child>
731 </widget>884 </widget>
732 <packing>885 <packing>
733 <property name="position">1</property>886 <property name="position">1</property>
734887
=== modified file 'timer-applet/po/bn.po'
--- timer-applet/po/bn.po 2010-07-11 03:37:51 +0000
+++ timer-applet/po/bn.po 2010-09-15 19:27:52 +0000
@@ -7,7 +7,7 @@
7msgstr ""7msgstr ""
8"Project-Id-Version: timer-applet\n"8"Project-Id-Version: timer-applet\n"
9"Report-Msgid-Bugs-To: \n"9"Report-Msgid-Bugs-To: \n"
10"POT-Creation-Date: 2010-07-10 05:19+0000\n"10"POT-Creation-Date: 2010-09-15 15:16-0400\n"
11"PO-Revision-Date: 2010-07-10 05:12+0000\n"11"PO-Revision-Date: 2010-07-10 05:12+0000\n"
12"Last-Translator: Khandakar Mujahidul Islam <suzan229@gmail.com>\n"12"Last-Translator: Khandakar Mujahidul Islam <suzan229@gmail.com>\n"
13"Language-Team: Bengali <bn@li.org>\n"13"Language-Team: Bengali <bn@li.org>\n"
@@ -39,123 +39,175 @@
39msgstr ""39msgstr ""
4040
41#: ../data/TimerApplet.xml.h:241#: ../data/TimerApplet.xml.h:2
42msgid "Next"
43msgstr ""
44
45#: ../data/TimerApplet.xml.h:3
42msgid "Pa_use"46msgid "Pa_use"
43msgstr "স্থগিত (_ত)"47msgstr "স্থগিত (_ত)"
4448
45#: ../data/TimerApplet.xml.h:349#: ../data/TimerApplet.xml.h:4
46msgid "Pre_sets"50msgid "Pre_sets"
47msgstr ""51msgstr ""
4852
49#: ../data/TimerApplet.xml.h:453#: ../data/TimerApplet.xml.h:5
50msgid "R_estart"54msgid "R_estart"
51msgstr "পুনরায় চালু (_ল)"55msgstr "পুনরায় চালু (_ল)"
5256
53#: ../data/TimerApplet.xml.h:557#: ../data/TimerApplet.xml.h:6
54msgid "_About"58msgid "_About"
55msgstr "পরিচিতি (_প)"59msgstr "পরিচিতি (_প)"
5660
57#: ../data/TimerApplet.xml.h:661#: ../data/TimerApplet.xml.h:7
58msgid "_Continue"62msgid "_Continue"
59msgstr "এগিয়ে যান"63msgstr "এগিয়ে যান"
6064
61#: ../data/TimerApplet.xml.h:765#: ../data/TimerApplet.xml.h:8
62msgid "_Preferences"66msgid "_Preferences"
63msgstr "পছন্দ (_ছ)"67msgstr "পছন্দ (_ছ)"
6468
65#: ../data/TimerApplet.xml.h:869#: ../data/TimerApplet.xml.h:9
66msgid "_Stop"70msgid "_Stop"
67msgstr "থামাও(_ও)"71msgstr "থামাও(_ও)"
6872
69#: ../data/timer-applet.glade.h:173#: ../data/timer-applet.glade.h:1
74msgid "<b>Custom command</b>"
75msgstr ""
76
77#: ../data/timer-applet.glade.h:2
78msgid "<b>Define next timer</b>"
79msgstr ""
80
81#: ../data/timer-applet.glade.h:3
82msgid "<b>Interval timer</b>"
83msgstr ""
84
85#: ../data/timer-applet.glade.h:4
86msgid "<b>Run custom command</b>"
87msgstr ""
88
89#: ../data/timer-applet.glade.h:5
70msgid "<b>_Duration</b>"90msgid "<b>_Duration</b>"
71msgstr ""91msgstr ""
7292
73#: ../data/timer-applet.glade.h:293#: ../data/timer-applet.glade.h:6
74msgid "<b>_Name</b>"94msgid "<b>_Name</b>"
75msgstr ""95msgstr ""
7696
77#: ../data/timer-applet.glade.h:397#: ../data/timer-applet.glade.h:7
78msgid "<b>_Presets</b>"98msgid "<b>_Presets</b>"
79msgstr ""99msgstr ""
80100
81#: ../data/timer-applet.glade.h:4101#: ../data/timer-applet.glade.h:8
82msgid "A timer applet for the perfect egg and beyond!"102msgid "A timer applet for the perfect egg and beyond!"
83msgstr ""103msgstr ""
84104
85#: ../data/timer-applet.glade.h:5105#: ../data/timer-applet.glade.h:9
86#: ../src/timerapplet/controllers/GlobalController.py:47106#: ../src/timerapplet/controllers/GlobalController.py:47
87msgid "Add Preset"107msgid "Add Preset"
88msgstr ""108msgstr ""
89109
90#: ../data/timer-applet.glade.h:6110#: ../data/timer-applet.glade.h:10
111msgid "Advanced"
112msgstr ""
113
114#: ../data/timer-applet.glade.h:11
91msgid "Choose A Sound File"115msgid "Choose A Sound File"
92msgstr ""116msgstr ""
93117
94#: ../data/timer-applet.glade.h:7118#: ../data/timer-applet.glade.h:12
119msgid "Execute:"
120msgstr ""
121
122#: ../data/timer-applet.glade.h:13
123msgid "Initiate automatically"
124msgstr ""
125
126#: ../data/timer-applet.glade.h:14
95msgid "Mana_ge Presets"127msgid "Mana_ge Presets"
96msgstr ""128msgstr ""
97129
98#: ../data/timer-applet.glade.h:8130#: ../data/timer-applet.glade.h:15
99msgid "Manage Presets"131msgid "Manage Presets"
100msgstr ""132msgstr ""
101133
102#. TRANSLATORS: Replace this string with your names, one name per line.134#: ../data/timer-applet.glade.h:16
103#: ../data/timer-applet.glade.h:10135msgid "Run custom command after timer has ended."
104msgid ""136msgstr ""
105"Miguel Anxo Bouzada\n"137
106"Bundo\n"138#: ../data/timer-applet.glade.h:17
107"C&#xE9;dric VALMARY (Tot en &#xF2;c) 16 points"139msgid "Run executable after timer finished."
108msgstr ""140msgstr ""
109141
110#: ../data/timer-applet.glade.h:13142#: ../data/timer-applet.glade.h:18
111msgid "S_ave as Preset"143msgid "S_ave as Preset"
112msgstr ""144msgstr ""
113145
114#: ../data/timer-applet.glade.h:14146#: ../data/timer-applet.glade.h:19
147msgid "S_how pulsing panel icon"
148msgstr ""
149
150#: ../data/timer-applet.glade.h:20
115msgid "S_tart Timer"151msgid "S_tart Timer"
116msgstr ""152msgstr ""
117153
118#: ../data/timer-applet.glade.h:15154#: ../data/timer-applet.glade.h:21
155msgid "Show pulsing panel icon after timer has ended."
156msgstr ""
157
158#: ../data/timer-applet.glade.h:22
119msgid "Start Timer"159msgid "Start Timer"
120msgstr "সময় চালু করুন"160msgstr "সময় চালু করুন"
121161
122#: ../data/timer-applet.glade.h:16162#: ../data/timer-applet.glade.h:23
163msgid "Start automatically"
164msgstr ""
165
166#: ../data/timer-applet.glade.h:24
123msgid "Timer Applet"167msgid "Timer Applet"
124msgstr ""168msgstr ""
125169
126#: ../data/timer-applet.glade.h:17170#: ../data/timer-applet.glade.h:25
127msgid "Timer Preferences"171msgid "Timer Preferences"
128msgstr ""172msgstr ""
129173
130#: ../data/timer-applet.glade.h:18174#: ../data/timer-applet.glade.h:26
131msgid "Use c_ustom sound"175msgid "Use c_ustom sound"
132msgstr ""176msgstr ""
133177
134#: ../data/timer-applet.glade.h:19178#: ../data/timer-applet.glade.h:27
135msgid "Use d_efault sound"179msgid "Use d_efault sound"
136msgstr ""180msgstr ""
137181
138#: ../data/timer-applet.glade.h:20182#: ../data/timer-applet.glade.h:28
139msgid "_Add..."183msgid "_Add..."
140msgstr "যোগ করুন... (_A)"184msgstr "যোগ করুন... (_A)"
141185
142#: ../data/timer-applet.glade.h:21186#: ../data/timer-applet.glade.h:29
143msgid "_Delete"187msgid "_Delete"
144msgstr "মুছে ফেলো (_D)"188msgstr "মুছে ফেলো (_D)"
145189
146#: ../data/timer-applet.glade.h:22190#: ../data/timer-applet.glade.h:30
147msgid "_Edit..."191msgid "_Edit..."
148msgstr ""192msgstr ""
149193
150#: ../data/timer-applet.glade.h:23194#: ../data/timer-applet.glade.h:31
151msgid "_Name:"195msgid "_Name:"
152msgstr ""196msgstr ""
153197
154#: ../data/timer-applet.glade.h:24198#: ../data/timer-applet.glade.h:32
155msgid "_Play notification sound"199msgid "_Play notification sound"
156msgstr ""200msgstr ""
157201
158#: ../data/timer-applet.glade.h:25202#: ../data/timer-applet.glade.h:33
203msgid "_Show popup notification"
204msgstr ""
205
206#: ../data/timer-applet.glade.h:34
207msgid "_Show popup notification after timer has ended."
208msgstr ""
209
210#: ../data/timer-applet.glade.h:35
159msgid "_Show remaining time while timer is running"211msgid "_Show remaining time while timer is running"
160msgstr ""212msgstr ""
161213
@@ -187,63 +239,64 @@
187msgstr ""239msgstr ""
188240
189#: ../data/timer-applet.schemas.in.h:7241#: ../data/timer-applet.schemas.in.h:7
242msgid "Show Popup notification"
243msgstr ""
244
245#: ../data/timer-applet.schemas.in.h:8
246msgid "Show Popup notification in the notification area"
247msgstr ""
248
249#: ../data/timer-applet.schemas.in.h:9
250msgid "Show Pulsing icon"
251msgstr ""
252
253#: ../data/timer-applet.schemas.in.h:10
254msgid "Show pulsing tray icon when timer finished"
255msgstr ""
256
257#: ../data/timer-applet.schemas.in.h:11
190msgid "Show remaining time"258msgid "Show remaining time"
191msgstr ""259msgstr ""
192260
193#: ../data/timer-applet.schemas.in.h:8261#: ../data/timer-applet.schemas.in.h:12
194msgid "Show the remaining time while the timer is running or paused"262msgid "Show the remaining time while the timer is running or paused"
195msgstr ""263msgstr ""
196264
197#: ../data/timer-applet.schemas.in.h:9265#: ../data/timer-applet.schemas.in.h:13
198msgid "Use a custom notification sound"266msgid "Use a custom notification sound"
199msgstr ""267msgstr ""
200268
201#: ../data/timer-applet.schemas.in.h:10269#: ../data/timer-applet.schemas.in.h:14
202msgid ""270msgid ""
203"Use the custom notification sound specified in custom_notification_sound_path"271"Use the custom notification sound specified in custom_notification_sound_path"
204msgstr ""272msgstr ""
205273
206#: ../src/timerapplet/controllers/GlobalController.py:60274#: ../src/timerapplet/controllers/GlobalController.py:62
207msgid "Edit Preset"275msgid "Edit Preset"
208msgstr ""276msgstr ""
209277
210#. HH:MM:SS278#: ../src/timerapplet/controllers/TimerApplet.py:99
211#: ../src/timerapplet/controllers/TimerApplet.py:45
212#: ../src/timerapplet/controllers/TimerApplet.py:360
213#, python-format
214msgid "%02d:%02d:%02d"
215msgstr ""
216
217#. HH:MM
218#. MM:SS
219#: ../src/timerapplet/controllers/TimerApplet.py:49
220#: ../src/timerapplet/controllers/TimerApplet.py:52
221#, python-format
222msgid "%02d:%02d"
223msgstr ""
224
225#: ../src/timerapplet/controllers/TimerApplet.py:111
226msgid "Continue timer countdown?"279msgid "Continue timer countdown?"
227msgstr ""280msgstr ""
228281
229#: ../src/timerapplet/controllers/TimerApplet.py:112282#: ../src/timerapplet/controllers/TimerApplet.py:100
230msgid "The timer is currently paused. Would you like to continue countdown?"283msgid "The timer is currently paused. Would you like to continue countdown?"
231msgstr ""284msgstr ""
232285
233#: ../src/timerapplet/controllers/TimerApplet.py:192286#: ../src/timerapplet/controllers/TimerApplet.py:194
234msgid "Click to start a new timer countdown."287msgid "Click to start a new timer countdown."
235msgstr ""288msgstr ""
236289
237#: ../src/timerapplet/controllers/TimerApplet.py:197290#: ../src/timerapplet/controllers/TimerApplet.py:199
238msgid "Paused. Click to continue timer countdown."291msgid "Paused. Click to continue timer countdown."
239msgstr ""292msgstr ""
240293
241#: ../src/timerapplet/controllers/TimerApplet.py:200294#: ../src/timerapplet/controllers/TimerApplet.py:202
242msgid "Finished"295msgid "Finished"
243msgstr "কাজটি সম্পূর্ণ হয়েছে"296msgstr "কাজটি সম্পূর্ণ হয়েছে"
244297
245#. "<timer name>" finished at <time>298#. "<timer name>" finished at <time>
246#: ../src/timerapplet/controllers/TimerApplet.py:205299#: ../src/timerapplet/controllers/TimerApplet.py:207
247#, python-format300#, python-format
248msgid ""301msgid ""
249"\"%s\" finished at %s.\n"302"\"%s\" finished at %s.\n"
@@ -251,7 +304,7 @@
251msgstr ""304msgstr ""
252305
253#. Timer finished at <time>306#. Timer finished at <time>
254#: ../src/timerapplet/controllers/TimerApplet.py:208307#: ../src/timerapplet/controllers/TimerApplet.py:210
255#, python-format308#, python-format
256msgid ""309msgid ""
257"Timer finished at %s.\n"310"Timer finished at %s.\n"
@@ -259,41 +312,48 @@
259msgstr ""312msgstr ""
260313
261#. HH:MM:SS (<timer name>)314#. HH:MM:SS (<timer name>)
262#: ../src/timerapplet/controllers/TimerApplet.py:357315#: ../src/timerapplet/controllers/TimerApplet.py:386
263#, python-format316#, python-format
264msgid "%02d:%02d:%02d (%s)"317msgid "%02d:%02d:%02d (%s)"
265msgstr ""318msgstr ""
266319
320#. HH:MM:SS
321#: ../src/timerapplet/controllers/TimerApplet.py:389
322#: ../src/timerapplet/utils.py:52
323#, python-format
324msgid "%02d:%02d:%02d"
325msgstr ""
326
267#. "<timer name>" Finished327#. "<timer name>" Finished
268#: ../src/timerapplet/controllers/TimerApplet.py:379328#: ../src/timerapplet/controllers/TimerApplet.py:411
269#, python-format329#, python-format
270msgid "\"%s\" Finished"330msgid "\"%s\" Finished"
271msgstr ""331msgstr ""
272332
273#. "<timer name>" finished at <time>333#. "<timer name>" finished at <time>
274#: ../src/timerapplet/controllers/TimerApplet.py:382334#: ../src/timerapplet/controllers/TimerApplet.py:414
275#, python-format335#, python-format
276msgid "\"%s\" finished at %s"336msgid "\"%s\" finished at %s"
277msgstr ""337msgstr ""
278338
279#: ../src/timerapplet/controllers/TimerApplet.py:384339#: ../src/timerapplet/controllers/TimerApplet.py:416
280msgid "Timer Finished"340msgid "Timer Finished"
281msgstr ""341msgstr ""
282342
283#. Timer finished at <time>343#. Timer finished at <time>
284#: ../src/timerapplet/controllers/TimerApplet.py:387344#: ../src/timerapplet/controllers/TimerApplet.py:419
285#, python-format345#, python-format
286msgid "Timer finished at %s"346msgid "Timer finished at %s"
287msgstr ""347msgstr ""
288348
289#: ../src/timerapplet/controllers/TimerApplet.py:394349#: ../src/timerapplet/controllers/TimerApplet.py:426
290#, python-format350#, python-format
291msgid "Timer finished about <b>%d second</b> ago"351msgid "Timer finished about <b>%d second</b> ago"
292msgid_plural "Timer finished about <b>%d seconds</b> ago"352msgid_plural "Timer finished about <b>%d seconds</b> ago"
293msgstr[0] ""353msgstr[0] ""
294msgstr[1] ""354msgstr[1] ""
295355
296#: ../src/timerapplet/controllers/TimerApplet.py:399356#: ../src/timerapplet/controllers/TimerApplet.py:431
297#, python-format357#, python-format
298msgid "Timer finished about <b>%d minute</b> ago"358msgid "Timer finished about <b>%d minute</b> ago"
299msgid_plural "Timer finished about <b>%d minutes</b> ago"359msgid_plural "Timer finished about <b>%d minutes</b> ago"
@@ -316,6 +376,10 @@
316msgid "_Continue Timer"376msgid "_Continue Timer"
317msgstr ""377msgstr ""
318378
379#: ../src/timerapplet/ui/StartTimerDialog.py:186
380msgid "<b>Command not found.</b>"
381msgstr ""
382
319#: ../src/timerapplet/ui/DurationChooser.py:31383#: ../src/timerapplet/ui/DurationChooser.py:31
320msgid "_Hours:"384msgid "_Hours:"
321msgstr "ঘন্টা:(_ঘ)"385msgstr "ঘন্টা:(_ঘ)"
@@ -328,8 +392,15 @@
328msgid "_Seconds:"392msgid "_Seconds:"
329msgstr "সেকেন্ড:(_ড)"393msgstr "সেকেন্ড:(_ড)"
330394
395#. HH:MM
396#. MM:SS
397#: ../src/timerapplet/utils.py:56 ../src/timerapplet/utils.py:59
398#, python-format
399msgid "%02d:%02d"
400msgstr ""
401
331#. <preset name> (HH:MM:SS)402#. <preset name> (HH:MM:SS)
332#: ../src/timerapplet/utils.py:42403#: ../src/timerapplet/utils.py:69
333#, python-format404#, python-format
334msgid "%s (%02d:%02d:%02d)"405msgid "%s (%02d:%02d:%02d)"
335msgstr ""406msgstr ""
336407
=== modified file 'timer-applet/po/es.po'
--- timer-applet/po/es.po 2010-08-04 03:30:23 +0000
+++ timer-applet/po/es.po 2010-09-15 19:27:52 +0000
@@ -7,8 +7,13 @@
7msgstr ""7msgstr ""
8"Project-Id-Version: timer-applet 0.5\n"8"Project-Id-Version: timer-applet 0.5\n"
9"Report-Msgid-Bugs-To: \n"9"Report-Msgid-Bugs-To: \n"
10<<<<<<< TREE
10"POT-Creation-Date: 2010-08-01 20:20-0400\n"11"POT-Creation-Date: 2010-08-01 20:20-0400\n"
11"PO-Revision-Date: 2010-08-03 01:36+0000\n"12"PO-Revision-Date: 2010-08-03 01:36+0000\n"
13=======
14"POT-Creation-Date: 2010-09-15 15:16-0400\n"
15"PO-Revision-Date: 2010-08-02 00:13+0000\n"
16>>>>>>> MERGE-SOURCE
12"Last-Translator: Kenny Meyer <knny.myer@gmail.com>\n"17"Last-Translator: Kenny Meyer <knny.myer@gmail.com>\n"
13"Language-Team: Spanish <es@li.org>\n"18"Language-Team: Spanish <es@li.org>\n"
14"MIME-Version: 1.0\n"19"MIME-Version: 1.0\n"
@@ -39,30 +44,34 @@
39msgstr "Admi_nistrar preestablecidos"44msgstr "Admi_nistrar preestablecidos"
4045
41#: ../data/TimerApplet.xml.h:246#: ../data/TimerApplet.xml.h:2
47msgid "Next"
48msgstr ""
49
50#: ../data/TimerApplet.xml.h:3
42msgid "Pa_use"51msgid "Pa_use"
43msgstr "Pa_usa"52msgstr "Pa_usa"
4453
45#: ../data/TimerApplet.xml.h:354#: ../data/TimerApplet.xml.h:4
46msgid "Pre_sets"55msgid "Pre_sets"
47msgstr "Preestable_cidos"56msgstr "Preestable_cidos"
4857
49#: ../data/TimerApplet.xml.h:458#: ../data/TimerApplet.xml.h:5
50msgid "R_estart"59msgid "R_estart"
51msgstr "R_einiciar"60msgstr "R_einiciar"
5261
53#: ../data/TimerApplet.xml.h:562#: ../data/TimerApplet.xml.h:6
54msgid "_About"63msgid "_About"
55msgstr "_Acerca de"64msgstr "_Acerca de"
5665
57#: ../data/TimerApplet.xml.h:666#: ../data/TimerApplet.xml.h:7
58msgid "_Continue"67msgid "_Continue"
59msgstr "_Continuar"68msgstr "_Continuar"
6069
61#: ../data/TimerApplet.xml.h:770#: ../data/TimerApplet.xml.h:8
62msgid "_Preferences"71msgid "_Preferences"
63msgstr "_Preferencias"72msgstr "_Preferencias"
6473
65#: ../data/TimerApplet.xml.h:874#: ../data/TimerApplet.xml.h:9
66msgid "_Stop"75msgid "_Stop"
67msgstr "_Detener"76msgstr "_Detener"
6877
@@ -71,115 +80,141 @@
71msgstr "<b>Comando personalizado</b>"80msgstr "<b>Comando personalizado</b>"
7281
73#: ../data/timer-applet.glade.h:282#: ../data/timer-applet.glade.h:2
83msgid "<b>Define next timer</b>"
84msgstr ""
85
86#: ../data/timer-applet.glade.h:3
87#, fuzzy
88msgid "<b>Interval timer</b>"
89msgstr "<b>_Nombre</b>"
90
91#: ../data/timer-applet.glade.h:4
92#, fuzzy
93msgid "<b>Run custom command</b>"
94msgstr "<b>Comando personalizado</b>"
95
96#: ../data/timer-applet.glade.h:5
74msgid "<b>_Duration</b>"97msgid "<b>_Duration</b>"
75msgstr "<b>_Duración</b>"98msgstr "<b>_Duración</b>"
7699
77#: ../data/timer-applet.glade.h:3100#: ../data/timer-applet.glade.h:6
78msgid "<b>_Name</b>"101msgid "<b>_Name</b>"
79msgstr "<b>_Nombre</b>"102msgstr "<b>_Nombre</b>"
80103
81#: ../data/timer-applet.glade.h:4104#: ../data/timer-applet.glade.h:7
82msgid "<b>_Presets</b>"105msgid "<b>_Presets</b>"
83msgstr "<b>_Preestablecidos</b>"106msgstr "<b>_Preestablecidos</b>"
84107
85#: ../data/timer-applet.glade.h:5108#: ../data/timer-applet.glade.h:8
86msgid "A timer applet for the perfect egg and beyond!"109msgid "A timer applet for the perfect egg and beyond!"
87msgstr "Una miniaplicación cronómetro para el huevo perfecto y más!"110msgstr "Una miniaplicación cronómetro para el huevo perfecto y más!"
88111
89#: ../data/timer-applet.glade.h:6112#: ../data/timer-applet.glade.h:9
90#: ../src/timerapplet/controllers/GlobalController.py:47113#: ../src/timerapplet/controllers/GlobalController.py:47
91msgid "Add Preset"114msgid "Add Preset"
92msgstr "Agregar Preestablecido"115msgstr "Agregar Preestablecido"
93116
94#: ../data/timer-applet.glade.h:7117#: ../data/timer-applet.glade.h:10
118msgid "Advanced"
119msgstr ""
120
121#: ../data/timer-applet.glade.h:11
95msgid "Choose A Sound File"122msgid "Choose A Sound File"
96msgstr "Elegir un archivo de sonido"123msgstr "Elegir un archivo de sonido"
97124
98#: ../data/timer-applet.glade.h:8125#: ../data/timer-applet.glade.h:12
126msgid "Execute:"
127msgstr ""
128
129#: ../data/timer-applet.glade.h:13
130msgid "Initiate automatically"
131msgstr ""
132
133#: ../data/timer-applet.glade.h:14
99msgid "Mana_ge Presets"134msgid "Mana_ge Presets"
100msgstr "Adminis_trar preestablecidos"135msgstr "Adminis_trar preestablecidos"
101136
102#: ../data/timer-applet.glade.h:9137#: ../data/timer-applet.glade.h:15
103msgid "Manage Presets"138msgid "Manage Presets"
104msgstr "Administrar Preestablecidos"139msgstr "Administrar Preestablecidos"
105140
106#: ../data/timer-applet.glade.h:10141#: ../data/timer-applet.glade.h:16
107msgid "Run custom command after timer has ended."142msgid "Run custom command after timer has ended."
108msgstr "Ejecutar un comando personalizado al terminarse el tiempo."143msgstr "Ejecutar un comando personalizado al terminarse el tiempo."
109144
110#: ../data/timer-applet.glade.h:11145#: ../data/timer-applet.glade.h:17
111msgid "Run executable"
112msgstr "Ejecutar"
113
114#: ../data/timer-applet.glade.h:12
115msgid "Run executable after timer finished."146msgid "Run executable after timer finished."
116msgstr "Ejecutar al terminarse el tiempo."147msgstr "Ejecutar al terminarse el tiempo."
117148
118#: ../data/timer-applet.glade.h:13149#: ../data/timer-applet.glade.h:18
119msgid "S_ave as Preset"150msgid "S_ave as Preset"
120msgstr "G_uardar como preestablecido"151msgstr "G_uardar como preestablecido"
121152
122#: ../data/timer-applet.glade.h:14153#: ../data/timer-applet.glade.h:19
123msgid "S_how pulsing panel icon"154msgid "S_how pulsing panel icon"
124msgstr "_Mostrar pulso del icono del panel"155msgstr "_Mostrar pulso del icono del panel"
125156
126#: ../data/timer-applet.glade.h:15157#: ../data/timer-applet.glade.h:20
127msgid "S_tart Timer"158msgid "S_tart Timer"
128msgstr "Iniciar cronómetro"159msgstr "Iniciar cronómetro"
129160
130#: ../data/timer-applet.glade.h:16161#: ../data/timer-applet.glade.h:21
131msgid "Show pulsing panel icon after timer has ended."162msgid "Show pulsing panel icon after timer has ended."
132msgstr "_Mostrar pulso del icono del panel al terminarse el cronómetro."163msgstr "_Mostrar pulso del icono del panel al terminarse el cronómetro."
133164
134#: ../data/timer-applet.glade.h:17165#: ../data/timer-applet.glade.h:22
135msgid "Start Timer"166msgid "Start Timer"
136msgstr "Iniciar cronómetro"167msgstr "Iniciar cronómetro"
137168
138#: ../data/timer-applet.glade.h:18169#: ../data/timer-applet.glade.h:23
170msgid "Start automatically"
171msgstr ""
172
173#: ../data/timer-applet.glade.h:24
139msgid "Timer Applet"174msgid "Timer Applet"
140msgstr "Miniaplicación cronómetro"175msgstr "Miniaplicación cronómetro"
141176
142#: ../data/timer-applet.glade.h:19177#: ../data/timer-applet.glade.h:25
143msgid "Timer Preferences"178msgid "Timer Preferences"
144msgstr "Preferencias del cronómetro"179msgstr "Preferencias del cronómetro"
145180
146#: ../data/timer-applet.glade.h:20181#: ../data/timer-applet.glade.h:26
147msgid "Use c_ustom sound"182msgid "Use c_ustom sound"
148msgstr "_Usar sonido personalizado"183msgstr "_Usar sonido personalizado"
149184
150#: ../data/timer-applet.glade.h:21185#: ../data/timer-applet.glade.h:27
151msgid "Use d_efault sound"186msgid "Use d_efault sound"
152msgstr "Usar sonido pr_edeterminado"187msgstr "Usar sonido pr_edeterminado"
153188
154#: ../data/timer-applet.glade.h:22189#: ../data/timer-applet.glade.h:28
155msgid "_Add..."190msgid "_Add..."
156msgstr "_Añadir…"191msgstr "_Añadir…"
157192
158#: ../data/timer-applet.glade.h:23193#: ../data/timer-applet.glade.h:29
159msgid "_Delete"194msgid "_Delete"
160msgstr "_Borrar"195msgstr "_Borrar"
161196
162#: ../data/timer-applet.glade.h:24197#: ../data/timer-applet.glade.h:30
163msgid "_Edit..."198msgid "_Edit..."
164msgstr "_Editar..."199msgstr "_Editar..."
165200
166#: ../data/timer-applet.glade.h:25201#: ../data/timer-applet.glade.h:31
167msgid "_Name:"202msgid "_Name:"
168msgstr "_Nombre:"203msgstr "_Nombre:"
169204
170#: ../data/timer-applet.glade.h:26205#: ../data/timer-applet.glade.h:32
171msgid "_Play notification sound"206msgid "_Play notification sound"
172msgstr "Re_producir sonido de notificación"207msgstr "Re_producir sonido de notificación"
173208
174#: ../data/timer-applet.glade.h:27209#: ../data/timer-applet.glade.h:33
175msgid "_Show popup notification"210msgid "_Show popup notification"
176msgstr "Mo_strar notificación emergente"211msgstr "Mo_strar notificación emergente"
177212
178#: ../data/timer-applet.glade.h:28213#: ../data/timer-applet.glade.h:34
179msgid "_Show popup notification after timer has ended."214msgid "_Show popup notification after timer has ended."
180msgstr "Mo_strar notificación emergente al terminarse el tiempo."215msgstr "Mo_strar notificación emergente al terminarse el tiempo."
181216
182#: ../data/timer-applet.glade.h:29217#: ../data/timer-applet.glade.h:35
183msgid "_Show remaining time while timer is running"218msgid "_Show remaining time while timer is running"
184msgstr "_Muestra el tiempo restante mientras cuenta"219msgstr "_Muestra el tiempo restante mientras cuenta"
185220
@@ -248,47 +283,32 @@
248"Usar el sonido de notificación personalizado especificado en "283"Usar el sonido de notificación personalizado especificado en "
249"custom_notification_sound_path"284"custom_notification_sound_path"
250285
251#: ../src/timerapplet/controllers/GlobalController.py:61286#: ../src/timerapplet/controllers/GlobalController.py:62
252msgid "Edit Preset"287msgid "Edit Preset"
253msgstr "Editar Preestablecido"288msgstr "Editar Preestablecido"
254289
255#. HH:MM:SS290#: ../src/timerapplet/controllers/TimerApplet.py:99
256#: ../src/timerapplet/controllers/TimerApplet.py:49
257#: ../src/timerapplet/controllers/TimerApplet.py:395
258#, python-format
259msgid "%02d:%02d:%02d"
260msgstr "%02d:%02d:%02d"
261
262#. HH:MM
263#. MM:SS
264#: ../src/timerapplet/controllers/TimerApplet.py:53
265#: ../src/timerapplet/controllers/TimerApplet.py:56
266#, python-format
267msgid "%02d:%02d"
268msgstr "%02d:%02d"
269
270#: ../src/timerapplet/controllers/TimerApplet.py:119
271msgid "Continue timer countdown?"291msgid "Continue timer countdown?"
272msgstr "¿Continuar temporizador?"292msgstr "¿Continuar temporizador?"
273293
274#: ../src/timerapplet/controllers/TimerApplet.py:120294#: ../src/timerapplet/controllers/TimerApplet.py:100
275msgid "The timer is currently paused. Would you like to continue countdown?"295msgid "The timer is currently paused. Would you like to continue countdown?"
276msgstr "El temporizador está pausado. ¿Desea continuar la cuenta?"296msgstr "El temporizador está pausado. ¿Desea continuar la cuenta?"
277297
278#: ../src/timerapplet/controllers/TimerApplet.py:209298#: ../src/timerapplet/controllers/TimerApplet.py:194
279msgid "Click to start a new timer countdown."299msgid "Click to start a new timer countdown."
280msgstr "Click para iniciar un nuevo temporizador"300msgstr "Click para iniciar un nuevo temporizador"
281301
282#: ../src/timerapplet/controllers/TimerApplet.py:214302#: ../src/timerapplet/controllers/TimerApplet.py:199
283msgid "Paused. Click to continue timer countdown."303msgid "Paused. Click to continue timer countdown."
284msgstr "Pausado. Pulse para continuar el temporizador."304msgstr "Pausado. Pulse para continuar el temporizador."
285305
286#: ../src/timerapplet/controllers/TimerApplet.py:217306#: ../src/timerapplet/controllers/TimerApplet.py:202
287msgid "Finished"307msgid "Finished"
288msgstr "Finalizado"308msgstr "Finalizado"
289309
290#. "<timer name>" finished at <time>310#. "<timer name>" finished at <time>
291#: ../src/timerapplet/controllers/TimerApplet.py:222311#: ../src/timerapplet/controllers/TimerApplet.py:207
292#, python-format312#, python-format
293msgid ""313msgid ""
294"\"%s\" finished at %s.\n"314"\"%s\" finished at %s.\n"
@@ -298,7 +318,7 @@
298"Click para detener el temporizador."318"Click para detener el temporizador."
299319
300#. Timer finished at <time>320#. Timer finished at <time>
301#: ../src/timerapplet/controllers/TimerApplet.py:225321#: ../src/timerapplet/controllers/TimerApplet.py:210
302#, python-format322#, python-format
303msgid ""323msgid ""
304"Timer finished at %s.\n"324"Timer finished at %s.\n"
@@ -308,41 +328,48 @@
308"Click para detener el temporizador."328"Click para detener el temporizador."
309329
310#. HH:MM:SS (<timer name>)330#. HH:MM:SS (<timer name>)
311#: ../src/timerapplet/controllers/TimerApplet.py:392331#: ../src/timerapplet/controllers/TimerApplet.py:386
312#, python-format332#, python-format
313msgid "%02d:%02d:%02d (%s)"333msgid "%02d:%02d:%02d (%s)"
314msgstr "%02d:%02d:%02d (%s)"334msgstr "%02d:%02d:%02d (%s)"
315335
336#. HH:MM:SS
337#: ../src/timerapplet/controllers/TimerApplet.py:389
338#: ../src/timerapplet/utils.py:52
339#, python-format
340msgid "%02d:%02d:%02d"
341msgstr "%02d:%02d:%02d"
342
316#. "<timer name>" Finished343#. "<timer name>" Finished
317#: ../src/timerapplet/controllers/TimerApplet.py:416344#: ../src/timerapplet/controllers/TimerApplet.py:411
318#, python-format345#, python-format
319msgid "\"%s\" Finished"346msgid "\"%s\" Finished"
320msgstr "\"%s\" Finalizado"347msgstr "\"%s\" Finalizado"
321348
322#. "<timer name>" finished at <time>349#. "<timer name>" finished at <time>
323#: ../src/timerapplet/controllers/TimerApplet.py:419350#: ../src/timerapplet/controllers/TimerApplet.py:414
324#, python-format351#, python-format
325msgid "\"%s\" finished at %s"352msgid "\"%s\" finished at %s"
326msgstr "\"%s\" terminó a las %s"353msgstr "\"%s\" terminó a las %s"
327354
328#: ../src/timerapplet/controllers/TimerApplet.py:421355#: ../src/timerapplet/controllers/TimerApplet.py:416
329msgid "Timer Finished"356msgid "Timer Finished"
330msgstr "El tiempo terminó"357msgstr "El tiempo terminó"
331358
332#. Timer finished at <time>359#. Timer finished at <time>
333#: ../src/timerapplet/controllers/TimerApplet.py:424360#: ../src/timerapplet/controllers/TimerApplet.py:419
334#, python-format361#, python-format
335msgid "Timer finished at %s"362msgid "Timer finished at %s"
336msgstr "El tiempo terminó a las %s"363msgstr "El tiempo terminó a las %s"
337364
338#: ../src/timerapplet/controllers/TimerApplet.py:431365#: ../src/timerapplet/controllers/TimerApplet.py:426
339#, python-format366#, python-format
340msgid "Timer finished about <b>%d second</b> ago"367msgid "Timer finished about <b>%d second</b> ago"
341msgid_plural "Timer finished about <b>%d seconds</b> ago"368msgid_plural "Timer finished about <b>%d seconds</b> ago"
342msgstr[0] "El tiempo terminó hace %d segundo atrás"369msgstr[0] "El tiempo terminó hace %d segundo atrás"
343msgstr[1] "El tiempo terminó hace %d segundos atrás"370msgstr[1] "El tiempo terminó hace %d segundos atrás"
344371
345#: ../src/timerapplet/controllers/TimerApplet.py:436372#: ../src/timerapplet/controllers/TimerApplet.py:431
346#, python-format373#, python-format
347msgid "Timer finished about <b>%d minute</b> ago"374msgid "Timer finished about <b>%d minute</b> ago"
348msgid_plural "Timer finished about <b>%d minutes</b> ago"375msgid_plural "Timer finished about <b>%d minutes</b> ago"
@@ -365,7 +392,7 @@
365msgid "_Continue Timer"392msgid "_Continue Timer"
366msgstr "_Continuar temporizador"393msgstr "_Continuar temporizador"
367394
368#: ../src/timerapplet/ui/StartTimerDialog.py:174395#: ../src/timerapplet/ui/StartTimerDialog.py:186
369msgid "<b>Command not found.</b>"396msgid "<b>Command not found.</b>"
370msgstr "<b>Comando no encontrado.</b>"397msgstr "<b>Comando no encontrado.</b>"
371398
@@ -381,12 +408,22 @@
381msgid "_Seconds:"408msgid "_Seconds:"
382msgstr "_Segundos:"409msgstr "_Segundos:"
383410
411#. HH:MM
412#. MM:SS
413#: ../src/timerapplet/utils.py:56 ../src/timerapplet/utils.py:59
414#, python-format
415msgid "%02d:%02d"
416msgstr "%02d:%02d"
417
384#. <preset name> (HH:MM:SS)418#. <preset name> (HH:MM:SS)
385#: ../src/timerapplet/utils.py:43419#: ../src/timerapplet/utils.py:69
386#, python-format420#, python-format
387msgid "%s (%02d:%02d:%02d)"421msgid "%s (%02d:%02d:%02d)"
388msgstr "%s (%02d:%02d:%02d)"422msgstr "%s (%02d:%02d:%02d)"
389423
424#~ msgid "Run executable"
425#~ msgstr "Ejecutar"
426
390#~ msgid "Get a notification after a specified interval of time elapses"427#~ msgid "Get a notification after a specified interval of time elapses"
391#~ msgstr "Notificar después de haber transcurrido un intervalo específico."428#~ msgstr "Notificar después de haber transcurrido un intervalo específico."
392429
@@ -486,7 +523,8 @@
486#~ msgstr "¿Continuar el temporizador?"523#~ msgstr "¿Continuar el temporizador?"
487524
488#~ msgid ""525#~ msgid ""
489#~ "The timer is currently paused. Would you like to continue countdown from %s?"526#~ "The timer is currently paused. Would you like to continue countdown from %"
527#~ "s?"
490#~ msgstr ""528#~ msgstr ""
491#~ "El temporizador está pausado. ¿Quiere continuar la cuenta atrás desde %s?"529#~ "El temporizador está pausado. ¿Quiere continuar la cuenta atrás desde %s?"
492530
493531
=== modified file 'timer-applet/po/messages.pot'
--- timer-applet/po/messages.pot 2010-08-02 00:21:28 +0000
+++ timer-applet/po/messages.pot 2010-09-15 19:27:52 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2010-08-01 20:20-0400\n"11"POT-Creation-Date: 2010-09-15 15:16-0400\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -38,30 +38,34 @@
38msgstr ""38msgstr ""
3939
40#: ../data/TimerApplet.xml.h:240#: ../data/TimerApplet.xml.h:2
41msgid "Next"
42msgstr ""
43
44#: ../data/TimerApplet.xml.h:3
41msgid "Pa_use"45msgid "Pa_use"
42msgstr ""46msgstr ""
4347
44#: ../data/TimerApplet.xml.h:348#: ../data/TimerApplet.xml.h:4
45msgid "Pre_sets"49msgid "Pre_sets"
46msgstr ""50msgstr ""
4751
48#: ../data/TimerApplet.xml.h:452#: ../data/TimerApplet.xml.h:5
49msgid "R_estart"53msgid "R_estart"
50msgstr ""54msgstr ""
5155
52#: ../data/TimerApplet.xml.h:556#: ../data/TimerApplet.xml.h:6
53msgid "_About"57msgid "_About"
54msgstr ""58msgstr ""
5559
56#: ../data/TimerApplet.xml.h:660#: ../data/TimerApplet.xml.h:7
57msgid "_Continue"61msgid "_Continue"
58msgstr ""62msgstr ""
5963
60#: ../data/TimerApplet.xml.h:764#: ../data/TimerApplet.xml.h:8
61msgid "_Preferences"65msgid "_Preferences"
62msgstr ""66msgstr ""
6367
64#: ../data/TimerApplet.xml.h:868#: ../data/TimerApplet.xml.h:9
65msgid "_Stop"69msgid "_Stop"
66msgstr ""70msgstr ""
6771
@@ -70,115 +74,139 @@
70msgstr ""74msgstr ""
7175
72#: ../data/timer-applet.glade.h:276#: ../data/timer-applet.glade.h:2
77msgid "<b>Define next timer</b>"
78msgstr ""
79
80#: ../data/timer-applet.glade.h:3
81msgid "<b>Interval timer</b>"
82msgstr ""
83
84#: ../data/timer-applet.glade.h:4
85msgid "<b>Run custom command</b>"
86msgstr ""
87
88#: ../data/timer-applet.glade.h:5
73msgid "<b>_Duration</b>"89msgid "<b>_Duration</b>"
74msgstr ""90msgstr ""
7591
76#: ../data/timer-applet.glade.h:392#: ../data/timer-applet.glade.h:6
77msgid "<b>_Name</b>"93msgid "<b>_Name</b>"
78msgstr ""94msgstr ""
7995
80#: ../data/timer-applet.glade.h:496#: ../data/timer-applet.glade.h:7
81msgid "<b>_Presets</b>"97msgid "<b>_Presets</b>"
82msgstr ""98msgstr ""
8399
84#: ../data/timer-applet.glade.h:5100#: ../data/timer-applet.glade.h:8
85msgid "A timer applet for the perfect egg and beyond!"101msgid "A timer applet for the perfect egg and beyond!"
86msgstr ""102msgstr ""
87103
88#: ../data/timer-applet.glade.h:6104#: ../data/timer-applet.glade.h:9
89#: ../src/timerapplet/controllers/GlobalController.py:47105#: ../src/timerapplet/controllers/GlobalController.py:47
90msgid "Add Preset"106msgid "Add Preset"
91msgstr ""107msgstr ""
92108
93#: ../data/timer-applet.glade.h:7109#: ../data/timer-applet.glade.h:10
110msgid "Advanced"
111msgstr ""
112
113#: ../data/timer-applet.glade.h:11
94msgid "Choose A Sound File"114msgid "Choose A Sound File"
95msgstr ""115msgstr ""
96116
97#: ../data/timer-applet.glade.h:8117#: ../data/timer-applet.glade.h:12
118msgid "Execute:"
119msgstr ""
120
121#: ../data/timer-applet.glade.h:13
122msgid "Initiate automatically"
123msgstr ""
124
125#: ../data/timer-applet.glade.h:14
98msgid "Mana_ge Presets"126msgid "Mana_ge Presets"
99msgstr ""127msgstr ""
100128
101#: ../data/timer-applet.glade.h:9129#: ../data/timer-applet.glade.h:15
102msgid "Manage Presets"130msgid "Manage Presets"
103msgstr ""131msgstr ""
104132
105#: ../data/timer-applet.glade.h:10133#: ../data/timer-applet.glade.h:16
106msgid "Run custom command after timer has ended."134msgid "Run custom command after timer has ended."
107msgstr ""135msgstr ""
108136
109#: ../data/timer-applet.glade.h:11137#: ../data/timer-applet.glade.h:17
110msgid "Run executable"
111msgstr ""
112
113#: ../data/timer-applet.glade.h:12
114msgid "Run executable after timer finished."138msgid "Run executable after timer finished."
115msgstr ""139msgstr ""
116140
117#: ../data/timer-applet.glade.h:13141#: ../data/timer-applet.glade.h:18
118msgid "S_ave as Preset"142msgid "S_ave as Preset"
119msgstr ""143msgstr ""
120144
121#: ../data/timer-applet.glade.h:14145#: ../data/timer-applet.glade.h:19
122msgid "S_how pulsing panel icon"146msgid "S_how pulsing panel icon"
123msgstr ""147msgstr ""
124148
125#: ../data/timer-applet.glade.h:15149#: ../data/timer-applet.glade.h:20
126msgid "S_tart Timer"150msgid "S_tart Timer"
127msgstr ""151msgstr ""
128152
129#: ../data/timer-applet.glade.h:16153#: ../data/timer-applet.glade.h:21
130msgid "Show pulsing panel icon after timer has ended."154msgid "Show pulsing panel icon after timer has ended."
131msgstr ""155msgstr ""
132156
133#: ../data/timer-applet.glade.h:17157#: ../data/timer-applet.glade.h:22
134msgid "Start Timer"158msgid "Start Timer"
135msgstr ""159msgstr ""
136160
137#: ../data/timer-applet.glade.h:18161#: ../data/timer-applet.glade.h:23
162msgid "Start automatically"
163msgstr ""
164
165#: ../data/timer-applet.glade.h:24
138msgid "Timer Applet"166msgid "Timer Applet"
139msgstr ""167msgstr ""
140168
141#: ../data/timer-applet.glade.h:19169#: ../data/timer-applet.glade.h:25
142msgid "Timer Preferences"170msgid "Timer Preferences"
143msgstr ""171msgstr ""
144172
145#: ../data/timer-applet.glade.h:20173#: ../data/timer-applet.glade.h:26
146msgid "Use c_ustom sound"174msgid "Use c_ustom sound"
147msgstr ""175msgstr ""
148176
149#: ../data/timer-applet.glade.h:21177#: ../data/timer-applet.glade.h:27
150msgid "Use d_efault sound"178msgid "Use d_efault sound"
151msgstr ""179msgstr ""
152180
153#: ../data/timer-applet.glade.h:22181#: ../data/timer-applet.glade.h:28
154msgid "_Add..."182msgid "_Add..."
155msgstr ""183msgstr ""
156184
157#: ../data/timer-applet.glade.h:23185#: ../data/timer-applet.glade.h:29
158msgid "_Delete"186msgid "_Delete"
159msgstr ""187msgstr ""
160188
161#: ../data/timer-applet.glade.h:24189#: ../data/timer-applet.glade.h:30
162msgid "_Edit..."190msgid "_Edit..."
163msgstr ""191msgstr ""
164192
165#: ../data/timer-applet.glade.h:25193#: ../data/timer-applet.glade.h:31
166msgid "_Name:"194msgid "_Name:"
167msgstr ""195msgstr ""
168196
169#: ../data/timer-applet.glade.h:26197#: ../data/timer-applet.glade.h:32
170msgid "_Play notification sound"198msgid "_Play notification sound"
171msgstr ""199msgstr ""
172200
173#: ../data/timer-applet.glade.h:27201#: ../data/timer-applet.glade.h:33
174msgid "_Show popup notification"202msgid "_Show popup notification"
175msgstr ""203msgstr ""
176204
177#: ../data/timer-applet.glade.h:28205#: ../data/timer-applet.glade.h:34
178msgid "_Show popup notification after timer has ended."206msgid "_Show popup notification after timer has ended."
179msgstr ""207msgstr ""
180208
181#: ../data/timer-applet.glade.h:29209#: ../data/timer-applet.glade.h:35
182msgid "_Show remaining time while timer is running"210msgid "_Show remaining time while timer is running"
183msgstr ""211msgstr ""
184212
@@ -242,47 +270,32 @@
242"Use the custom notification sound specified in custom_notification_sound_path"270"Use the custom notification sound specified in custom_notification_sound_path"
243msgstr ""271msgstr ""
244272
245#: ../src/timerapplet/controllers/GlobalController.py:61273#: ../src/timerapplet/controllers/GlobalController.py:62
246msgid "Edit Preset"274msgid "Edit Preset"
247msgstr ""275msgstr ""
248276
249#. HH:MM:SS277#: ../src/timerapplet/controllers/TimerApplet.py:99
250#: ../src/timerapplet/controllers/TimerApplet.py:49
251#: ../src/timerapplet/controllers/TimerApplet.py:395
252#, python-format
253msgid "%02d:%02d:%02d"
254msgstr ""
255
256#. HH:MM
257#. MM:SS
258#: ../src/timerapplet/controllers/TimerApplet.py:53
259#: ../src/timerapplet/controllers/TimerApplet.py:56
260#, python-format
261msgid "%02d:%02d"
262msgstr ""
263
264#: ../src/timerapplet/controllers/TimerApplet.py:119
265msgid "Continue timer countdown?"278msgid "Continue timer countdown?"
266msgstr ""279msgstr ""
267280
268#: ../src/timerapplet/controllers/TimerApplet.py:120281#: ../src/timerapplet/controllers/TimerApplet.py:100
269msgid "The timer is currently paused. Would you like to continue countdown?"282msgid "The timer is currently paused. Would you like to continue countdown?"
270msgstr ""283msgstr ""
271284
272#: ../src/timerapplet/controllers/TimerApplet.py:209285#: ../src/timerapplet/controllers/TimerApplet.py:194
273msgid "Click to start a new timer countdown."286msgid "Click to start a new timer countdown."
274msgstr ""287msgstr ""
275288
276#: ../src/timerapplet/controllers/TimerApplet.py:214289#: ../src/timerapplet/controllers/TimerApplet.py:199
277msgid "Paused. Click to continue timer countdown."290msgid "Paused. Click to continue timer countdown."
278msgstr ""291msgstr ""
279292
280#: ../src/timerapplet/controllers/TimerApplet.py:217293#: ../src/timerapplet/controllers/TimerApplet.py:202
281msgid "Finished"294msgid "Finished"
282msgstr ""295msgstr ""
283296
284#. "<timer name>" finished at <time>297#. "<timer name>" finished at <time>
285#: ../src/timerapplet/controllers/TimerApplet.py:222298#: ../src/timerapplet/controllers/TimerApplet.py:207
286#, python-format299#, python-format
287msgid ""300msgid ""
288"\"%s\" finished at %s.\n"301"\"%s\" finished at %s.\n"
@@ -290,7 +303,7 @@
290msgstr ""303msgstr ""
291304
292#. Timer finished at <time>305#. Timer finished at <time>
293#: ../src/timerapplet/controllers/TimerApplet.py:225306#: ../src/timerapplet/controllers/TimerApplet.py:210
294#, python-format307#, python-format
295msgid ""308msgid ""
296"Timer finished at %s.\n"309"Timer finished at %s.\n"
@@ -298,41 +311,48 @@
298msgstr ""311msgstr ""
299312
300#. HH:MM:SS (<timer name>)313#. HH:MM:SS (<timer name>)
301#: ../src/timerapplet/controllers/TimerApplet.py:392314#: ../src/timerapplet/controllers/TimerApplet.py:386
302#, python-format315#, python-format
303msgid "%02d:%02d:%02d (%s)"316msgid "%02d:%02d:%02d (%s)"
304msgstr ""317msgstr ""
305318
319#. HH:MM:SS
320#: ../src/timerapplet/controllers/TimerApplet.py:389
321#: ../src/timerapplet/utils.py:52
322#, python-format
323msgid "%02d:%02d:%02d"
324msgstr ""
325
306#. "<timer name>" Finished326#. "<timer name>" Finished
307#: ../src/timerapplet/controllers/TimerApplet.py:416327#: ../src/timerapplet/controllers/TimerApplet.py:411
308#, python-format328#, python-format
309msgid "\"%s\" Finished"329msgid "\"%s\" Finished"
310msgstr ""330msgstr ""
311331
312#. "<timer name>" finished at <time>332#. "<timer name>" finished at <time>
313#: ../src/timerapplet/controllers/TimerApplet.py:419333#: ../src/timerapplet/controllers/TimerApplet.py:414
314#, python-format334#, python-format
315msgid "\"%s\" finished at %s"335msgid "\"%s\" finished at %s"
316msgstr ""336msgstr ""
317337
318#: ../src/timerapplet/controllers/TimerApplet.py:421338#: ../src/timerapplet/controllers/TimerApplet.py:416
319msgid "Timer Finished"339msgid "Timer Finished"
320msgstr ""340msgstr ""
321341
322#. Timer finished at <time>342#. Timer finished at <time>
323#: ../src/timerapplet/controllers/TimerApplet.py:424343#: ../src/timerapplet/controllers/TimerApplet.py:419
324#, python-format344#, python-format
325msgid "Timer finished at %s"345msgid "Timer finished at %s"
326msgstr ""346msgstr ""
327347
328#: ../src/timerapplet/controllers/TimerApplet.py:431348#: ../src/timerapplet/controllers/TimerApplet.py:426
329#, python-format349#, python-format
330msgid "Timer finished about <b>%d second</b> ago"350msgid "Timer finished about <b>%d second</b> ago"
331msgid_plural "Timer finished about <b>%d seconds</b> ago"351msgid_plural "Timer finished about <b>%d seconds</b> ago"
332msgstr[0] ""352msgstr[0] ""
333msgstr[1] ""353msgstr[1] ""
334354
335#: ../src/timerapplet/controllers/TimerApplet.py:436355#: ../src/timerapplet/controllers/TimerApplet.py:431
336#, python-format356#, python-format
337msgid "Timer finished about <b>%d minute</b> ago"357msgid "Timer finished about <b>%d minute</b> ago"
338msgid_plural "Timer finished about <b>%d minutes</b> ago"358msgid_plural "Timer finished about <b>%d minutes</b> ago"
@@ -355,7 +375,7 @@
355msgid "_Continue Timer"375msgid "_Continue Timer"
356msgstr ""376msgstr ""
357377
358#: ../src/timerapplet/ui/StartTimerDialog.py:174378#: ../src/timerapplet/ui/StartTimerDialog.py:186
359msgid "<b>Command not found.</b>"379msgid "<b>Command not found.</b>"
360msgstr ""380msgstr ""
361381
@@ -371,8 +391,15 @@
371msgid "_Seconds:"391msgid "_Seconds:"
372msgstr ""392msgstr ""
373393
394#. HH:MM
395#. MM:SS
396#: ../src/timerapplet/utils.py:56 ../src/timerapplet/utils.py:59
397#, python-format
398msgid "%02d:%02d"
399msgstr ""
400
374#. <preset name> (HH:MM:SS)401#. <preset name> (HH:MM:SS)
375#: ../src/timerapplet/utils.py:43402#: ../src/timerapplet/utils.py:69
376#, python-format403#, python-format
377msgid "%s (%02d:%02d:%02d)"404msgid "%s (%02d:%02d:%02d)"
378msgstr ""405msgstr ""
379406
=== modified file 'timer-applet/src/timerapplet/controllers/GlobalController.py'
--- timer-applet/src/timerapplet/controllers/GlobalController.py 2010-07-14 10:53:59 +0000
+++ timer-applet/src/timerapplet/controllers/GlobalController.py 2010-09-15 19:27:52 +0000
@@ -49,13 +49,14 @@
49 49
50 result = add_dialog.get_preset()50 result = add_dialog.get_preset()
51 if result is not None:51 if result is not None:
52 (name, hours, minutes, seconds, command) = result52 (name, hours, minutes, seconds, command, next_timer, auto_start) = result
53 self._presets_store.add_preset(name, hours, minutes, seconds,53 self._presets_store.add_preset(name, hours, minutes, seconds,
54 command)54 command, next_timer, auto_start)
55 55
56 def _on_mgr_clicked_edit(self, sender, row_path, data=None):56 def _on_mgr_clicked_edit(self, sender, row_path, data=None):
57 row_iter = self._presets_store.get_model().get_iter(row_path)57 row_iter = self._presets_store.get_model().get_iter(row_path)
58 (name, hours, minutes, seconds, command) = self._presets_store.get_preset(row_iter)58 (name, hours, minutes, seconds, command, next_timer, auto_start) = \
59 self._presets_store.get_preset(row_iter)
5960
60 edit_dialog = ui.AddEditPresetDialog(config.GLADE_PATH,61 edit_dialog = ui.AddEditPresetDialog(config.GLADE_PATH,
61 _('Edit Preset'),62 _('Edit Preset'),
@@ -66,14 +67,25 @@
66 hours,67 hours,
67 minutes,68 minutes,
68 seconds,69 seconds,
69 command)70 command,
71 next_timer,
72 auto_start
73 )
70 74
71 result = edit_dialog.get_preset()75 result = edit_dialog.get_preset()
72 if result is not None:76 if result is not None:
73 (name, hours, minutes, seconds, command) = result77 (name, hours, minutes, seconds, command, next_timer, auto_start) = result
74 self._presets_store.modify_preset(row_iter, name, hours, minutes,78 self._presets_store.modify_preset(row_iter, name, hours, minutes,
75 seconds, command)79 seconds, command, next_timer,
80 auto_start)
7681
77 def _on_mgr_clicked_remove(self, sender, row_path, data=None):82 def _on_mgr_clicked_remove(self, sender, row_path, data=None):
78 row_iter = self._presets_store.get_model().get_iter(row_path)83 row_iter = self._presets_store.get_model().get_iter(row_path)
79 self._presets_store.remove_preset(row_iter)84 self._presets_store.remove_preset(row_iter)
85
86 # TODO
87 def _on_mgr_next_timer_is_being_edited(self, sender, row_path, data=None):
88 """Show a dropdown widget to help completing the next timer."""
89 raise NotImplementedError("Not implemented, yet")
90
91
8092
=== modified file 'timer-applet/src/timerapplet/controllers/TimerApplet.py'
--- timer-applet/src/timerapplet/controllers/TimerApplet.py 2010-07-23 18:38:21 +0000
+++ timer-applet/src/timerapplet/controllers/TimerApplet.py 2010-09-15 19:27:52 +0000
@@ -18,7 +18,6 @@
18from gettext import gettext as _18from gettext import gettext as _
19from gettext import ngettext19from gettext import ngettext
20from datetime import datetime, timedelta20from datetime import datetime, timedelta
21import bonobo.ui
22import gnomeapplet21import gnomeapplet
23import gst22import gst
24import gtk23import gtk
@@ -31,33 +30,10 @@
31from timerapplet import core30from timerapplet import core
32from timerapplet import ui31from timerapplet import ui
33from timerapplet import utils32from timerapplet import utils
34from timerapplet.logger import logging33
3534import pudb
36def construct_time_str(remaining_seconds, show_all=True):35import pdb
37 """Return a user-friendly representation of remaining time based on the given number of seconds.36
38
39 show_all specifies whether the returned string should show all time components.
40 If show_all is True (default), the returned string is in HH:MM:SS format.
41 If show_all is False, the returned string is in either HH:MM or MM:SS format,
42 depending on how much time is remaining. This avoids showing the user more
43 information than necessary.
44
45 """
46 hours, minutes, seconds = utils.seconds_to_hms(remaining_seconds)
47 if show_all:
48 # HH:MM:SS
49 return _('%02d:%02d:%02d') % (hours, minutes, seconds)
50 else:
51 if hours > 0 or minutes > 14:
52 # HH:MM
53 return _('%02d:%02d') % (hours, minutes)
54 else:
55 # MM:SS
56 return _('%02d:%02d') % (minutes, seconds)
57
58def get_display_text_from_datetime(date_time):
59 return date_time.strftime('%X')
60
61def on_widget_button_press_event(sender, event, data=None):37def on_widget_button_press_event(sender, event, data=None):
62 if event.button != 1:38 if event.button != 1:
63 sender.emit_stop_by_name('button-press-event') 39 sender.emit_stop_by_name('button-press-event')
@@ -109,6 +85,10 @@
109 85
110 self._status_button = ui.StatusButton()86 self._status_button = ui.StatusButton()
111 self._notifier = ui.Notifier('TimerApplet', gtk.STOCK_DIALOG_INFO, self._status_button)87 self._notifier = ui.Notifier('TimerApplet', gtk.STOCK_DIALOG_INFO, self._status_button)
88 self._start_next_timer_dialog = ui.StartNextTimerDialog(
89 config.GLADE_PATH,
90 "Start next timer",
91 "Would you like to start the next timer?")
112 self._start_timer_dialog = ui.StartTimerDialog(config.GLADE_PATH,92 self._start_timer_dialog = ui.StartTimerDialog(config.GLADE_PATH,
113 lambda name: utils.is_valid_preset_name(name,93 lambda name: utils.is_valid_preset_name(name,
114 self._presets_store),94 self._presets_store),
@@ -125,21 +105,26 @@
125 self._about_dialog.set_version(config.VERSION)105 self._about_dialog.set_version(config.VERSION)
126 106
127 self._applet.set_applet_flags(gnomeapplet.EXPAND_MINOR)107 self._applet.set_applet_flags(gnomeapplet.EXPAND_MINOR)
128 self._applet.setup_menu_from_file(None,108 self._applet.setup_menu_from_file(
129 config.POPUP_MENU_FILE_PATH,109 None,
130 None,110 config.POPUP_MENU_FILE_PATH,
131 [('PauseTimer', lambda component, verb: self._timer.stop()),111 None,
132 ('ContinueTimer', lambda component, verb: self._timer.start()),112 [('PauseTimer', lambda component, verb: self._timer.stop()),
133 ('StopTimer', lambda component, verb: self._timer.reset()),113 ('ContinueTimer', lambda component, verb: self._timer.start()),
134 ('RestartTimer', lambda component, verb: self._restart_timer()),114 ('StopTimer', lambda component, verb: self._timer.reset()),
135 ('ManagePresets', lambda component, verb: self._manage_presets_dialog.show()),115 ('RestartTimer', lambda component, verb: self._restart_timer()),
136 ('Preferences', lambda component, verb: self._preferences_dialog.show()),116 ('StartNextTimer', lambda component, verb: self._start_next_timer()),
137 ('About', lambda component, verb: self._about_dialog.show())])117 ('ManagePresets', lambda component, verb: self._manage_presets_dialog.show()),
118 ('Preferences', lambda component,
119 verb: self._preferences_dialog.show()),
120 ('About', lambda component, verb: self._about_dialog.show())]
121 )
138 self._applet.add(self._status_button)122 self._applet.add(self._status_button)
139 123
140 # Remove padding around button contents.124 # Remove padding around button contents.
141 force_no_focus_padding(self._status_button)125 force_no_focus_padding(self._status_button)
142 126
127 # TODO:
143 # Fix bug in which button would not propogate middle-clicks128 # Fix bug in which button would not propogate middle-clicks
144 # and right-clicks to the applet.129 # and right-clicks to the applet.
145 self._status_button.connect('button-press-event', on_widget_button_press_event)130 self._status_button.connect('button-press-event', on_widget_button_press_event)
@@ -216,7 +201,7 @@
216 print 'Finished'201 print 'Finished'
217 self._status_button.set_label(_('Finished'))202 self._status_button.set_label(_('Finished'))
218 name_str = self._timer.get_name()203 name_str = self._timer.get_name()
219 time_str = get_display_text_from_datetime(self._timer.get_end_time())204 time_str = utils.get_display_text_from_datetime(self._timer.get_end_time())
220 if len(name_str) > 0:205 if len(name_str) > 0:
221 # "<timer name>" finished at <time>206 # "<timer name>" finished at <time>
222 self._status_button.set_tooltip(_('"%s" finished at %s.\nClick to stop timer.') % (name_str, time_str))207 self._status_button.set_tooltip(_('"%s" finished at %s.\nClick to stop timer.') % (name_str, time_str))
@@ -228,7 +213,7 @@
228 current_state == core.Timer.STATE_FINISHED)213 current_state == core.Timer.STATE_FINISHED)
229 self._status_button.set_use_icon(current_state == core.Timer.STATE_IDLE)214 self._status_button.set_use_icon(current_state == core.Timer.STATE_IDLE)
230 self._status_button.set_show_remaining_time(current_state != core.Timer.STATE_IDLE and215 self._status_button.set_show_remaining_time(current_state != core.Timer.STATE_IDLE and
231 self._gconf.get_bool(TimerApplet._SHOW_REMAINING_TIME_KEY))216 self._gconf.get_bool(TimerApplet._SHOW_REMAINING_TIME_KEY))
232 217
233 if current_state == core.Timer.STATE_PAUSED:218 if current_state == core.Timer.STATE_PAUSED:
234 self._status_button.set_pie_fill_color(0.4, 0.4, 0.4)219 self._status_button.set_pie_fill_color(0.4, 0.4, 0.4)
@@ -251,6 +236,7 @@
251 popup = self._applet.get_popup_component()236 popup = self._applet.get_popup_component()
252 237
253 timer_state = self._timer.get_state()238 timer_state = self._timer.get_state()
239 has_next_timer = self._timer.get_next_timer()
254 show_pause = (timer_state == core.Timer.STATE_RUNNING)240 show_pause = (timer_state == core.Timer.STATE_RUNNING)
255 show_continue = (timer_state == core.Timer.STATE_PAUSED)241 show_continue = (timer_state == core.Timer.STATE_PAUSED)
256 show_stop = (timer_state == core.Timer.STATE_RUNNING or242 show_stop = (timer_state == core.Timer.STATE_RUNNING or
@@ -259,11 +245,18 @@
259 show_restart = (timer_state == core.Timer.STATE_RUNNING or245 show_restart = (timer_state == core.Timer.STATE_RUNNING or
260 timer_state == core.Timer.STATE_PAUSED or246 timer_state == core.Timer.STATE_PAUSED or
261 timer_state == core.Timer.STATE_FINISHED)247 timer_state == core.Timer.STATE_FINISHED)
248 show_next_timer = ((timer_state == core.Timer.STATE_RUNNING or
249 timer_state == core.Timer.STATE_PAUSED or
250 timer_state == core.Timer.STATE_FINISHED) and
251 # Only show this popup menu item if it has a
252 # next_timer defined. Clever, huh? ;)
253 has_next_timer)
262 254
263 show_presets_menu = (len(self._presets_store.get_model()) > 0)255 show_presets_menu = (len(self._presets_store.get_model()) > 0)
264 show_separator = (256 show_separator = (
265 show_presets_menu or257 show_presets_menu or
266 show_pause or258 show_pause or
259 show_next_timer or
267 show_continue or260 show_continue or
268 show_stop or261 show_stop or
269 show_restart)262 show_restart)
@@ -273,6 +266,7 @@
273 popup.set_prop('/commands/ContinueTimer', 'hidden', to_hidden_str(show_continue))266 popup.set_prop('/commands/ContinueTimer', 'hidden', to_hidden_str(show_continue))
274 popup.set_prop('/commands/StopTimer', 'hidden', to_hidden_str(show_stop))267 popup.set_prop('/commands/StopTimer', 'hidden', to_hidden_str(show_stop))
275 popup.set_prop('/commands/RestartTimer', 'hidden', to_hidden_str(show_restart))268 popup.set_prop('/commands/RestartTimer', 'hidden', to_hidden_str(show_restart))
269 popup.set_prop('/commands/StartNextTimer', 'hidden', to_hidden_str(show_next_timer))
276 popup.set_prop(TimerApplet._PRESETS_PATH, 'hidden', to_hidden_str(show_presets_menu))270 popup.set_prop(TimerApplet._PRESETS_PATH, 'hidden', to_hidden_str(show_presets_menu))
277 popup.set_prop('/popups/popup/Separator1', 'hidden', to_hidden_str(show_separator))271 popup.set_prop('/popups/popup/Separator1', 'hidden', to_hidden_str(show_separator))
278 272
@@ -337,9 +331,9 @@
337 # Try hiding the Start Timer dialog, just in case it's open.331 # Try hiding the Start Timer dialog, just in case it's open.
338 self._start_timer_dialog.hide()332 self._start_timer_dialog.hide()
339 row_iter = self._presets_store.get_model().get_iter(row_path)333 row_iter = self._presets_store.get_model().get_iter(row_path)
340 (name, hours, minutes, seconds, command) = self._presets_store.get_preset(row_iter)334 (name, hours, minutes, seconds, command, next_timer, auto_start) = self._presets_store.get_preset(row_iter)
341 logging.debug("In _on_presets_submenu_item, command: " + command)335 self._start_timer_with_settings(name, hours, minutes, seconds, command,
342 self._start_timer_with_settings(name, hours, minutes, seconds, command)336 next_timer, auto_start)
343 337
344 ## GConf callbacks ##338 ## GConf callbacks ##
345 339
@@ -380,7 +374,7 @@
380 hours, minutes, seconds = utils.seconds_to_hms(timer.get_remaining_time())374 hours, minutes, seconds = utils.seconds_to_hms(timer.get_remaining_time())
381 print 'Remaining time: %d, %d, %d' % (hours, minutes, seconds)375 print 'Remaining time: %d, %d, %d' % (hours, minutes, seconds)
382 name = self._timer.get_name()376 name = self._timer.get_name()
383 self._status_button.set_label(construct_time_str(self._timer.get_remaining_time(),377 self._status_button.set_label(utils.construct_time_str(self._timer.get_remaining_time(),
384 show_all=False))378 show_all=False))
385379
386 fraction_remaining = float(self._timer.get_remaining_time()) / self._timer.get_duration()380 fraction_remaining = float(self._timer.get_remaining_time()) / self._timer.get_duration()
@@ -395,6 +389,8 @@
395 self._status_button.set_tooltip(_('%02d:%02d:%02d') % (hours, minutes, seconds))389 self._status_button.set_tooltip(_('%02d:%02d:%02d') % (hours, minutes, seconds))
396 390
397 def _on_timer_state_changed(self, timer, data=None):391 def _on_timer_state_changed(self, timer, data=None):
392 # TODO:
393 # Refactor me!
398 print 'State changed'394 print 'State changed'
399 new_state = timer.get_state()395 new_state = timer.get_state()
400 print ' new state: %d' % new_state396 print ' new state: %d' % new_state
@@ -406,9 +402,8 @@
406 if new_state == core.Timer.STATE_FINISHED:402 if new_state == core.Timer.STATE_FINISHED:
407 name = self._timer.get_name()403 name = self._timer.get_name()
408 command = self._timer.get_command()404 command = self._timer.get_command()
409 logging.debug("Command: " + command)
410 end_time = self._timer.get_end_time()405 end_time = self._timer.get_end_time()
411 time_text = get_display_text_from_datetime(end_time)406 time_text = utils.get_display_text_from_datetime(end_time)
412 summary = None407 summary = None
413 message = None408 message = None
414 if len(name) > 0:409 if len(name) > 0:
@@ -438,23 +433,67 @@
438 minutes) % minutes433 minutes) % minutes
439 return message434 return message
440 435
441 # Call popup notification436 # TODO:
442 self._call_notify(summary, message, reminder_message_func)437 # FIXME:
443 self._start_pulsing_button()438 # Reason for using a Python thread:
444 self._play_notification_sound()439 # To do all the procedures after timer has ended. If I don't do
445 # Run custom command.440 # this then after the timer ended and it had an auto-start and next
446 self._run_custom_command(command)441 # timer defined, it would directly switch without any notification.
447 442 # Trying time.sleep() doesn't work as expected; it correctly starts
448 if self._gconf.get_bool('play_beep'):443 # the next timer, but it doesn't show the notification and the
449 print 'Playing beep...'444 # rest.
450 gdk.beep()445 class MyThread(threading.Thread):
451 print 'Done playing beep.'446 def __init__(self, timer_instance):
447 threading.Thread.__init__(self)
448 self.timer = timer_instance
449
450 def run(self):
451 print "Starting thread..."
452 print "Calling popup notification.",
453 self.timer._call_notify(summary, message, reminder_message_func)
454 print "Starting pulsing button.",
455 self.timer._start_pulsing_button()
456 print "Playing notification sound.",
457 self.timer._play_notification_sound()
458 print "Running custom command.",
459 self.timer._run_custom_command(command)
460
461 if self.timer._gconf.get_bool('play_beep'):
462 print 'Playing beep...'
463 gdk.beep()
464 print 'Done playing beep.'
465
466 print "Ending Thread..."
467 thread = MyThread(self)
468 thread.start()
469 thread.join()
470
471 next_timer = self._timer.get_next_timer()
472 auto_start = self._timer.get_auto_start()
473 if auto_start and next_timer:
474 # Start next timer
475 self._stop_sound()
476 self._call_notify(show=False)
477 self._stop_pulsing_button()
478 self._start_next_timer()
479 elif not(auto_start) and next_timer:
480 self._status_button.props.sensitive = False
481 dialog_result = self._start_next_timer_dialog.get_response()
482 self._status_button.props.sensitive = True
483 if dialog_result:
484 # Start next timer
485 self._stop_sound()
486 self._call_notify(show=False)
487 self._stop_pulsing_button()
488 self._start_next_timer()
452 else:489 else:
453 self._stop_sound()490 self._stop_sound()
454 self._call_notify(show=False)491 self._call_notify(show=False)
455 self._stop_pulsing_button()492 self._stop_pulsing_button()
456 493
494 print "Updating status button..."
457 self._update_status_button()495 self._update_status_button()
496 print "Updating popup menu..."
458 self._update_popup_menu()497 self._update_popup_menu()
459 498
460 ## StatusButton callbacks ##499 ## StatusButton callbacks ##
@@ -484,37 +523,61 @@
484 ## StartTimerDialog callbacks ##523 ## StartTimerDialog callbacks ##
485 524
486 def _on_start_dialog_clicked_start(self, sender, data=None):525 def _on_start_dialog_clicked_start(self, sender, data=None):
487 (name, hours, minutes, seconds, command) = self._start_timer_dialog.get_name_and_duration()526 (name, hours, minutes, seconds, command, next_timer, auto_start) = \
488 self._start_timer_with_settings(name, hours, minutes, seconds, command)527 self._start_timer_dialog.get_control_data()
528 self._start_timer_with_settings(name, hours, minutes, seconds, command,
529 next_timer, auto_start)
489 530
490 def _on_start_dialog_clicked_manage_presets(self, sender, data=None):531 def _on_start_dialog_clicked_manage_presets(self, sender, data=None):
491 self._manage_presets_dialog.show()532 self._manage_presets_dialog.show()
492 533
493 def _on_start_dialog_clicked_save(self, sender, name,534 def _on_start_dialog_clicked_save(self, sender, name,
494 hours, minutes, seconds, command, data=None):535 hours, minutes, seconds, command,
495 self._presets_store.add_preset(name, hours, minutes, seconds, command)536 next_timer, auto_start, data=None):
496 537 self._presets_store.add_preset(name, hours, minutes, seconds, command,
538 next_timer, auto_start)
539
497 def _on_start_dialog_clicked_preset(self, sender, row_path, data=None):540 def _on_start_dialog_clicked_preset(self, sender, row_path, data=None):
498 row_iter = self._presets_store.get_model().get_iter(row_path)541 row_iter = self._presets_store.get_model().get_iter(row_path)
499 (name, hours, minutes, seconds, command) = self._presets_store.get_preset(row_iter)542 (name, hours, minutes, seconds, command, next_timer, auto_start) = \
543 self._presets_store.get_preset(row_iter)
500 self._start_timer_dialog.set_name_and_duration(name, hours, minutes,544 self._start_timer_dialog.set_name_and_duration(name, hours, minutes,
501 seconds, command)545 seconds, command,
546 next_timer, auto_start)
502 547
503 ## Private methods ##548 ## Private methods ##
504 549
505 def _start_timer_with_settings(self, name, hours, minutes, seconds,550 def _start_timer_with_settings(self, name, hours, minutes, seconds,
506 command):551 command, next_timer, auto_start):
552 print "Resetting timer"
507 if self._timer.get_state() != core.Timer.STATE_IDLE:553 if self._timer.get_state() != core.Timer.STATE_IDLE:
508 self._timer.reset()554 self._timer.reset()
509 self._timer.set_duration(utils.hms_to_seconds(hours, minutes, seconds))555 self._timer.set_duration(utils.hms_to_seconds(hours, minutes, seconds))
510 self._timer.set_name(name)556 self._timer.set_name(name)
511 self._timer.set_command(command)557 self._timer.set_command(command)
558 self._timer.set_next_timer(next_timer)
559 self._timer.set_auto_start(auto_start)
512 self._timer.start()560 self._timer.start()
513 561
514 def _restart_timer(self):562 def _restart_timer(self):
515 self._timer.reset()563 self._timer.reset()
516 self._timer.start()564 self._timer.start()
517 565
566 def _start_next_timer(self):
567 """Start next timer, if defined."""
568 next_timer = self._timer.get_next_timer()
569 for row in self._presets_store.get_model():
570 #print dir(row)
571 if str(row[0]) == next_timer:
572 (name, hours, minutes, seconds, command, next_timer, auto_start) = \
573 self._presets_store.get_preset(row.iter)
574 break
575 print "Starting timer with settings: ",
576 print (name, hours, minutes, seconds, command, next_timer, auto_start)
577 self._start_timer_with_settings(name, hours, minutes, seconds, command,
578 next_timer, auto_start)
579
580
518 def _play_notification_sound(self):581 def _play_notification_sound(self):
519 if not self._gconf.get_bool(TimerApplet._PLAY_SOUND_KEY):582 if not self._gconf.get_bool(TimerApplet._PLAY_SOUND_KEY):
520 return583 return
@@ -539,8 +602,11 @@
539602
540 def _run_custom_command(self, command):603 def _run_custom_command(self, command):
541 if command:604 if command:
542 logging.debug("Running custom command: " + command)605 print "Running custom command: " + command
543 subprocess.call(shlex.split(command))606 try:
607 subprocess.call(shlex.split(command))
608 except OSError:
609 print "... failed. Command not found."
544610
545 def _stop_sound(self):611 def _stop_sound(self):
546 self._gst_playbin.set_state(gst.STATE_NULL)612 self._gst_playbin.set_state(gst.STATE_NULL)
@@ -548,7 +614,7 @@
548 def _start_pulsing_button(self):614 def _start_pulsing_button(self):
549 if self._gconf.get_bool(TimerApplet._SHOW_PULSING_ICON_KEY):615 if self._gconf.get_bool(TimerApplet._SHOW_PULSING_ICON_KEY):
550 self._status_button.start_pulsing()616 self._status_button.start_pulsing()
551 _617
552 def _stop_pulsing_button(self):618 def _stop_pulsing_button(self):
553 self._status_button.stop_pulsing()619 self._status_button.stop_pulsing()
554 620
555621
=== modified file 'timer-applet/src/timerapplet/core/PresetsStore.py'
--- timer-applet/src/timerapplet/core/PresetsStore.py 2010-07-15 02:27:57 +0000
+++ timer-applet/src/timerapplet/core/PresetsStore.py 2010-09-15 19:27:52 +0000
@@ -1,5 +1,5 @@
1# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net>
1# Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com>2# Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com>
2# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net>
3#3#
4# This program is free software; you can redistribute it and/or modify4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by5# it under the terms of the GNU General Public License as published by
@@ -26,6 +26,10 @@
26import gtk26import gtk
27import timerapplet.utils as utils27import timerapplet.utils as utils
2828
29from timerapplet.utils import (serialize_bool,
30 deserialize_bool,
31 seconds_to_hms,
32 hms_to_seconds)
29from timerapplet.defs import VERSION33from timerapplet.defs import VERSION
3034
31class PersistentStore(gtk.ListStore):35class PersistentStore(gtk.ListStore):
@@ -37,7 +41,13 @@
37 self.connect('row-changed', lambda model, row_path, row_iter: save_func(self))41 self.connect('row-changed', lambda model, row_path, row_iter: save_func(self))
3842
39class PresetsStore(gobject.GObject):43class PresetsStore(gobject.GObject):
40 (_NAME_COL, _HOURS_COL, _MINUTES_COL, _SECONDS_COL, _COM_COL) = xrange(5)44 (_NAME_COL,
45 _HOURS_COL,
46 _MINUTES_COL,
47 _SECONDS_COL,
48 _COM_COL,
49 _NEXT_COL,
50 _AUTO_START_COL) = xrange(7)
41 51
42 def __init__(self, filename):52 def __init__(self, filename):
43 object.__init__(self)53 object.__init__(self)
@@ -47,7 +57,9 @@
47 gobject.TYPE_INT,57 gobject.TYPE_INT,
48 gobject.TYPE_INT,58 gobject.TYPE_INT,
49 gobject.TYPE_INT,59 gobject.TYPE_INT,
50 gobject.TYPE_STRING60 gobject.TYPE_STRING,
61 gobject.TYPE_STRING,
62 gobject.TYPE_BOOLEAN,
51 )63 )
52 64
53 def get_model(self):65 def get_model(self):
@@ -64,18 +76,27 @@
64 PresetsStore._HOURS_COL,76 PresetsStore._HOURS_COL,
65 PresetsStore._MINUTES_COL,77 PresetsStore._MINUTES_COL,
66 PresetsStore._SECONDS_COL,78 PresetsStore._SECONDS_COL,
67 PresetsStore._COM_COL)79 PresetsStore._COM_COL,
80 PresetsStore._NEXT_COL,
81 PresetsStore._AUTO_START_COL,
82 )
68 83
69 def add_preset(self, name, hours, minutes, seconds, command):84 def add_preset(self, name, hours, minutes, seconds, command, next_timer,
70 self._model.append((name, hours, minutes, seconds, command))85 auto_start):
86 self._model.append((name, hours, minutes, seconds, command, next_timer,
87 auto_start))
71 88
72 def modify_preset(self, row_iter, name, hours, minutes, seconds, command):89 def modify_preset(self, row_iter, name, hours, minutes, seconds, command,
90 next_timer, auto_start):
73 self._model.set(row_iter,91 self._model.set(row_iter,
74 PresetsStore._NAME_COL, name,92 PresetsStore._NAME_COL, name,
75 PresetsStore._HOURS_COL, hours,93 PresetsStore._HOURS_COL, hours,
76 PresetsStore._MINUTES_COL, minutes,94 PresetsStore._MINUTES_COL, minutes,
77 PresetsStore._SECONDS_COL, seconds,95 PresetsStore._SECONDS_COL, seconds,
78 PresetsStore._COM_COL, command)96 PresetsStore._COM_COL, command,
97 PresetsStore._NEXT_COL, next_timer,
98 PresetsStore._AUTO_START_COL, auto_start
99 )
79 100
80 def remove_preset(self, row_iter):101 def remove_preset(self, row_iter):
81 self._model.remove(row_iter)102 self._model.remove(row_iter)
@@ -97,9 +118,12 @@
97 118
98 for node in root:119 for node in root:
99 name = node.get('name')120 name = node.get('name')
100 (hours, minutes, seconds) = utils.seconds_to_hms(int(node.get('duration')))121 (hours, minutes, seconds) = seconds_to_hms(int(node.get('duration')))
101 command = node.get('command')122 command = node.get('command')
102 model.append((name, hours, minutes, seconds, command))123 next_timer = node.get('next_timer')
124 auto_start = node.get('auto_start')
125 model.append((name, hours, minutes, seconds, command, next_timer,
126 deserialize_bool(auto_start)))
103 _load_presets = staticmethod(_load_presets)127 _load_presets = staticmethod(_load_presets)
104128
105 def _save_presets(model, file_path):129 def _save_presets(model, file_path):
@@ -107,18 +131,22 @@
107 root.set('version', VERSION)131 root.set('version', VERSION)
108 132
109 def add_xml_node(model, path, row_iter):133 def add_xml_node(model, path, row_iter):
110 (name, hours, minutes, seconds, command) = \134 (name, hours, minutes, seconds, command, next_timer, auto_start) = \
111 model.get(row_iter, 135 model.get(row_iter,
112 PresetsStore._NAME_COL,136 PresetsStore._NAME_COL,
113 PresetsStore._HOURS_COL,137 PresetsStore._HOURS_COL,
114 PresetsStore._MINUTES_COL,138 PresetsStore._MINUTES_COL,
115 PresetsStore._SECONDS_COL, 139 PresetsStore._SECONDS_COL,
116 PresetsStore._COM_COL140 PresetsStore._COM_COL,
141 PresetsStore._NEXT_COL,
142 PresetsStore._AUTO_START_COL
117 )143 )
118 node = et.SubElement(root, 'preset')144 node = et.SubElement(root, 'preset')
119 node.set('name', name)145 node.set('name', name)
120 node.set('duration', str(utils.hms_to_seconds(hours, minutes, seconds)))146 node.set('duration', str(hms_to_seconds(hours, minutes, seconds)))
121 node.set('command', command or '')147 node.set('command', command or '')
148 node.set('next_timer', next_timer or '')
149 node.set('auto_start', serialize_bool(auto_start))
122 150
123 model.foreach(add_xml_node)151 model.foreach(add_xml_node)
124 tree = et.ElementTree(root)152 tree = et.ElementTree(root)
125153
=== modified file 'timer-applet/src/timerapplet/core/Timer.py'
--- timer-applet/src/timerapplet/core/Timer.py 2010-07-15 02:27:57 +0000
+++ timer-applet/src/timerapplet/core/Timer.py 2010-09-15 19:27:52 +0000
@@ -1,5 +1,5 @@
1# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net>
1# Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com>2# Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com>
2# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net>
3#3#
4# This program is free software; you can redistribute it and/or modify4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by5# it under the terms of the GNU General Public License as published by
@@ -35,6 +35,8 @@
35 self._end_time = 035 self._end_time = 0
36 self._name = ''36 self._name = ''
37 self._command = ''37 self._command = ''
38 self._next_timer = ''
39 self._auto_start = False
38 40
39 def set_duration(self, seconds):41 def set_duration(self, seconds):
40 """Set the duration of the timer in seconds."""42 """Set the duration of the timer in seconds."""
@@ -55,10 +57,31 @@
55 return self._name57 return self._name
5658
57 def set_command(self, command):59 def set_command(self, command):
60 """Set the command to run of the timer."""
61 assert self._state == Timer.STATE_IDLE
58 self._command = command62 self._command = command
59 63
60 def get_command(self):64 def get_command(self):
65 """Return the name of the command of the timer."""
61 return self._command66 return self._command
67
68 def set_next_timer(self, timer):
69 """Set the next timeer of the timer."""
70 assert self._state == Timer.STATE_IDLE
71 self._next_timer = timer
72
73 def get_next_timer(self):
74 """Get the next timer of the timer."""
75 return self._next_timer
76
77 def set_auto_start(self, auto_start):
78 """Set the auto-start value of the timer."""
79 assert self._state == Timer.STATE_IDLE
80 self._auto_start = auto_start
81
82 def get_auto_start(self):
83 """Get the auto-start value."""
84 return self._auto_start
6285
63 def start(self):86 def start(self):
64 """Start or resume the timer.87 """Start or resume the timer.
@@ -68,7 +91,7 @@
68 """91 """
69 assert self._state == Timer.STATE_IDLE or self._state == Timer.STATE_PAUSED92 assert self._state == Timer.STATE_IDLE or self._state == Timer.STATE_PAUSED
70 self._timer_transition_to_state(Timer.STATE_RUNNING)93 self._timer_transition_to_state(Timer.STATE_RUNNING)
71 94
72 def stop(self):95 def stop(self):
73 """Pause the timer.96 """Pause the timer.
74 97
7598
=== modified file 'timer-applet/src/timerapplet/ui/AddEditPresetDialog.py'
--- timer-applet/src/timerapplet/ui/AddEditPresetDialog.py 2010-07-14 10:53:59 +0000
+++ timer-applet/src/timerapplet/ui/AddEditPresetDialog.py 2010-09-15 19:27:52 +0000
@@ -20,7 +20,8 @@
2020
21class AddEditPresetDialog(object):21class AddEditPresetDialog(object):
22 def __init__(self, glade_file_name, title, name_validator_func,22 def __init__(self, glade_file_name, title, name_validator_func,
23 name='', hours=0, minutes=0, seconds=0, command=''):23 name='', hours=0, minutes=0, seconds=0, command='',
24 next_timer='', auto_start=False):
24 self._valid_name_func = name_validator_func25 self._valid_name_func = name_validator_func
25 26
26 glade_widgets = glade.XML(glade_file_name, 'add_edit_preset_dialog')27 glade_widgets = glade.XML(glade_file_name, 'add_edit_preset_dialog')
@@ -31,6 +32,8 @@
31 duration_chooser_container = glade_widgets.get_widget('duration_chooser_container')32 duration_chooser_container = glade_widgets.get_widget('duration_chooser_container')
32 self._duration_chooser = DurationChooser(gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL))33 self._duration_chooser = DurationChooser(gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL))
33 self._command_entry = glade_widgets.get_widget('command_entry')34 self._command_entry = glade_widgets.get_widget('command_entry')
35 self._next_timer_entry = glade_widgets.get_widget('next_timer_entry')
36 self._auto_start_check = glade_widgets.get_widget('auto_start_check')
34 37
35 duration_chooser_container.pack_start(self._duration_chooser)38 duration_chooser_container.pack_start(self._duration_chooser)
36 39
@@ -39,6 +42,8 @@
39 self._name_entry.set_text(name)42 self._name_entry.set_text(name)
40 self._command_entry.set_text(command)43 self._command_entry.set_text(command)
41 self._duration_chooser.set_duration(hours, minutes, seconds)44 self._duration_chooser.set_duration(hours, minutes, seconds)
45 self._next_timer_entry.set_text(next_timer)
46 self._auto_start_check.set_active(auto_start)
42 47
43 self._name_entry.connect('changed', lambda entry: self._check_for_valid_save_preset_input())48 self._name_entry.connect('changed', lambda entry: self._check_for_valid_save_preset_input())
44 self._duration_chooser.connect('duration-changed',49 self._duration_chooser.connect('duration-changed',
@@ -53,6 +58,8 @@
53 self._ok_button.props.sensitive = (self._non_zero_duration() and 58 self._ok_button.props.sensitive = (self._non_zero_duration() and
54 self._valid_name_func(self._name_entry.get_text()))59 self._valid_name_func(self._name_entry.get_text()))
5560
61 ## Callback for saving ##
62
56 def get_preset(self):63 def get_preset(self):
57 self._check_for_valid_save_preset_input()64 self._check_for_valid_save_preset_input()
58 result = self._dialog.run()65 result = self._dialog.run()
@@ -60,6 +67,9 @@
60 if result == gtk.RESPONSE_OK:67 if result == gtk.RESPONSE_OK:
61 (hours, minutes, seconds) = self._duration_chooser.get_duration()68 (hours, minutes, seconds) = self._duration_chooser.get_duration()
62 cmd = self._command_entry.get_text()69 cmd = self._command_entry.get_text()
63 return (self._name_entry.get_text(), hours, minutes, seconds, cmd)70 next_timer = self._next_timer_entry.get_text()
71 auto_start = self._auto_start_check.get_active()
72 return (self._name_entry.get_text(), hours, minutes, seconds, cmd,
73 next_timer, auto_start)
64 else:74 else:
65 return None75 return None
6676
=== modified file 'timer-applet/src/timerapplet/ui/Makefile.am'
--- timer-applet/src/timerapplet/ui/Makefile.am 2007-04-15 05:04:58 +0000
+++ timer-applet/src/timerapplet/ui/Makefile.am 2010-09-15 19:27:52 +0000
@@ -11,4 +11,5 @@
11 PulseButton.py \11 PulseButton.py \
12 ScrollableButtonList.py \12 ScrollableButtonList.py \
13 StartTimerDialog.py \13 StartTimerDialog.py \
14 StartNextTimerDialog.py \
14 StatusButton.py15 StatusButton.py
1516
=== added file 'timer-applet/src/timerapplet/ui/StartNextTimerDialog.py'
--- timer-applet/src/timerapplet/ui/StartNextTimerDialog.py 1970-01-01 00:00:00 +0000
+++ timer-applet/src/timerapplet/ui/StartNextTimerDialog.py 2010-09-15 19:27:52 +0000
@@ -0,0 +1,66 @@
1# -*- mode: python; coding: utf-8; -*-
2# Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com>
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 2 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
17"""
18The Start Next Timer dialog
19
20When a timer ended and the auto_start option was disabled this dialog shows up.
21"""
22
23from gettext import gettext as _
24import gtk
25
26class StartNextTimerDialog(object):
27 def __init__(self, glade_file_name, header_text, body_text):
28 # TODO: Include next_timer in body_text
29 self._dialog = gtk.Dialog(
30 _("Start Next Timer"),
31 None,
32 gtk.DIALOG_DESTROY_WITH_PARENT,
33 (_("_Don't start next timer"), gtk.RESPONSE_CLOSE,
34 _("_Start next timer"), gtk.RESPONSE_YES))
35 self._dialog.props.border_width = 6
36 self._dialog.props.has_separator = False
37 self._dialog.props.resizable = False
38 self._dialog.vbox.props.spacing = 12
39 self._dialog.set_default_response(gtk.RESPONSE_YES)
40
41 hbox = gtk.HBox(False, 0)
42 hbox.props.spacing = 12
43 hbox.props.border_width = 6
44
45 image = gtk.image_new_from_stock(gtk.STOCK_DIALOG_QUESTION, gtk.ICON_SIZE_DIALOG)
46 image.props.yalign = 0.0
47
48 label = gtk.Label('<span weight="bold" size="larger">%s</span>\n\n%s' % (header_text, body_text))
49 label.props.use_markup = True
50 label.props.wrap = True
51 label.props.yalign = 0.0
52
53 hbox.pack_start(image, False, False, 0)
54 hbox.pack_start(label, False, False, 0)
55 self._dialog.vbox.pack_start(hbox, False, False, 0)
56
57 hbox.show_all()
58
59 def get_response(self):
60 dialog_result = self._dialog.run()
61 self._dialog.hide()
62 if dialog_result == gtk.RESPONSE_YES:
63 return True
64 else:
65 return False
66
067
=== modified file 'timer-applet/src/timerapplet/ui/StartTimerDialog.py'
--- timer-applet/src/timerapplet/ui/StartTimerDialog.py 2010-07-18 01:45:29 +0000
+++ timer-applet/src/timerapplet/ui/StartTimerDialog.py 2010-09-15 19:27:52 +0000
@@ -1,5 +1,5 @@
1# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net>
1# Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com>2# Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com>
2# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net>
3#3#
4# This program is free software; you can redistribute it and/or modify4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by5# it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@
24from shlex import split as shell_tokenize24from shlex import split as shell_tokenize
25from subprocess import check_call, CalledProcessError25from subprocess import check_call, CalledProcessError
2626
27from timerapplet.logger import logging as log
28from DurationChooser import DurationChooser27from DurationChooser import DurationChooser
29from ScrollableButtonList import ScrollableButtonList28from ScrollableButtonList import ScrollableButtonList
3029
@@ -42,7 +41,9 @@
42 gobject.TYPE_INT,41 gobject.TYPE_INT,
43 gobject.TYPE_INT,42 gobject.TYPE_INT,
44 gobject.TYPE_INT,43 gobject.TYPE_INT,
45 gobject.TYPE_STRING)),44 gobject.TYPE_STRING,
45 gobject.TYPE_STRING,
46 gobject.TYPE_BOOLEAN)),
46 'clicked-preset':47 'clicked-preset':
47 (gobject.SIGNAL_RUN_LAST,48 (gobject.SIGNAL_RUN_LAST,
48 gobject.TYPE_NONE,49 gobject.TYPE_NONE,
@@ -68,9 +69,16 @@
68 duration_chooser_container = glade_widgets.get_widget('duration_chooser_container')69 duration_chooser_container = glade_widgets.get_widget('duration_chooser_container')
69 presets_chooser_container = glade_widgets.get_widget('presets_chooser_container')70 presets_chooser_container = glade_widgets.get_widget('presets_chooser_container')
70 self._presets_section = glade_widgets.get_widget('presets_section')71 self._presets_section = glade_widgets.get_widget('presets_section')
71 # The TextEntry control for running a custom command72 #: The TextEntry control for running a custom command
72 self._command_entry = glade_widgets.get_widget('command_entry')73 self._command_entry = glade_widgets.get_widget('command_entry')
74 #: The "Invalid Command" label
73 self._invalid_cmd_label = glade_widgets.get_widget('invalid_command_label')75 self._invalid_cmd_label = glade_widgets.get_widget('invalid_command_label')
76 #: The next timer combo box
77 self._next_timer_combo = glade_widgets.get_widget('next_timer_combo_entry')
78 self._next_timer_combo.set_model(self._presets_store)
79 self._next_timer_combo.set_text_column(0) # The column to be shown
80 #: The auto-start check button.
81 self._auto_start_check = glade_widgets.get_widget('auto_start_check')
74 82
75 labels_size_group.add_widget(name_label)83 labels_size_group.add_widget(name_label)
76 self._dialog.set_default_response(gtk.RESPONSE_OK)84 self._dialog.set_default_response(gtk.RESPONSE_OK)
@@ -84,6 +92,8 @@
84 self._save_button.connect('clicked', self._on_save_button_clicked)92 self._save_button.connect('clicked', self._on_save_button_clicked)
85 # Check that executable is valid while inserting text93 # Check that executable is valid while inserting text
86 self._command_entry.connect('changed', self._check_is_valid_command)94 self._command_entry.connect('changed', self._check_is_valid_command)
95 self._next_timer_combo.child.connect("changed",
96 self._on_next_timer_combo_entry_child_changed)
87 glade_widgets.get_widget('manage_presets_button').connect('clicked',97 glade_widgets.get_widget('manage_presets_button').connect('clicked',
88 self._on_manage_presets_button_clicked)98 self._on_manage_presets_button_clicked)
89 self._presets_store.connect('row-deleted',99 self._presets_store.connect('row-deleted',
@@ -107,23 +117,25 @@
107 def hide(self):117 def hide(self):
108 self._dialog.hide()118 self._dialog.hide()
109 119
110 def get_name_and_duration(self):120 def get_control_data(self):
111 """Return name and duration in a tuple.121 """Return name and duration in a tuple.
112 122
113 The returned tuple is in this format: (name, hours, minutes, seconds)123 The returned tuple is in this format:
124
125 (name, hours, minutes, seconds, next_timer, auto_start)
114 126
115 """127 """
116 return (self._name_entry.get_text().strip(),) + \128 return (self._name_entry.get_text().strip(),) + \
117 self._duration_chooser.get_duration() + \129 self._duration_chooser.get_duration() + \
118 (self._command_entry.get_text().strip(),)130 (self._command_entry.get_text().strip(),
131 self._next_timer_combo.child.get_text().strip(),
132 self._auto_start_check.get_active())
119 133
120 def set_name_and_duration(self, name, hours, minutes, seconds, *args):134 def set_name_and_duration(self, name, hours, minutes, seconds, *args):
121 self._name_entry.set_text(name)135 self._name_entry.set_text(name)
122 if args[0]:136 self._command_entry.set_text(args[0])
123 self._command_entry.set_text(args[0])137 self._next_timer_combo.child.set_text(args[1])
124 else:138 self._auto_start_check.set_active(args[2])
125 # Clear the Command Entry control after switching preset elements
126 self._command_entry.set_text('')
127 self._duration_chooser.set_duration(hours, minutes, seconds)139 self._duration_chooser.set_duration(hours, minutes, seconds)
128140
129 def _update_presets_list(self):141 def _update_presets_list(self):
@@ -182,6 +194,7 @@
182 def _check_for_valid_save_preset_input(self):194 def _check_for_valid_save_preset_input(self):
183 self._save_button.props.sensitive = (self._non_zero_duration() and195 self._save_button.props.sensitive = (self._non_zero_duration() and
184 self._valid_name_func(self._name_entry.get_text()))196 self._valid_name_func(self._name_entry.get_text()))
197 # TODO: Add validator for next_timer_combo
185 198
186 def _check_for_valid_start_timer_input(self):199 def _check_for_valid_start_timer_input(self):
187 self._ok_button.props.sensitive = self._non_zero_duration()200 self._ok_button.props.sensitive = self._non_zero_duration()
@@ -212,4 +225,26 @@
212 (hours, minutes, seconds) = self._duration_chooser.get_duration()225 (hours, minutes, seconds) = self._duration_chooser.get_duration()
213 name = self._name_entry.get_text()226 name = self._name_entry.get_text()
214 command = self._command_entry.get_text()227 command = self._command_entry.get_text()
215 self.emit('clicked-save', name, hours, minutes, seconds, command)228 next_timer = self._next_timer_combo.child.get_text()
229 auto_start = self._auto_start_check.get_active()
230 self.emit('clicked-save', name, hours, minutes, seconds, command,
231 next_timer, auto_start)
232
233 def _on_next_timer_combo_entry_child_changed(self, widget, data=None):
234 """Validate selection of the Next Timer ComboBoxEntry."""
235 modelfilter = self._presets_store.filter_new()
236 # Loop through all rows in ListStore
237 # TODO: Using a generator may be more memory efficient in this case.
238 for row in modelfilter:
239 # Check that name of preset is the exact match of the the text in
240 # the ComboBoxEntry
241 if widget.get_text() == row[0]:
242 # Yes, it matches! Make the auto-start checkbox sensitive
243 # (activate it).
244 self._auto_start_check.set_sensitive(True)
245 break
246 else:
247 # If value of ComboBoxEntry is None then de-activate the
248 # auto-start checkbox.
249 self._auto_start_check.set_sensitive(False)
250
216251
=== modified file 'timer-applet/src/timerapplet/ui/__init__.py'
--- timer-applet/src/timerapplet/ui/__init__.py 2008-12-01 09:52:01 +0000
+++ timer-applet/src/timerapplet/ui/__init__.py 2010-09-15 19:27:52 +0000
@@ -24,4 +24,5 @@
24from PulseButton import PulseButton24from PulseButton import PulseButton
25from ScrollableButtonList import ScrollableButtonList25from ScrollableButtonList import ScrollableButtonList
26from StartTimerDialog import StartTimerDialog26from StartTimerDialog import StartTimerDialog
27from StartNextTimerDialog import StartNextTimerDialog
27from StatusButton import StatusButton28from StatusButton import StatusButton
2829
=== modified file 'timer-applet/src/timerapplet/utils.py'
--- timer-applet/src/timerapplet/utils.py 2010-07-15 02:27:57 +0000
+++ timer-applet/src/timerapplet/utils.py 2010-09-15 19:27:52 +0000
@@ -1,5 +1,5 @@
1# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net>
1# Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com>2# Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com>
2# Copyright (C) 2008 Jimmy Do <jimmydo@users.sourceforge.net>
3#3#
4# This program is free software; you can redistribute it and/or modify4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by5# it under the terms of the GNU General Public License as published by
@@ -36,8 +36,44 @@
36def hms_to_seconds(hours, minutes, seconds):36def hms_to_seconds(hours, minutes, seconds):
37 return hours * 3600 + minutes * 60 + seconds37 return hours * 3600 + minutes * 60 + seconds
38 38
39def construct_time_str(remaining_seconds, show_all=True):
40 """Return a user-friendly representation of remaining time based on the given number of seconds.
41
42 show_all specifies whether the returned string should show all time components.
43 If show_all is True (default), the returned string is in HH:MM:SS format.
44 If show_all is False, the returned string is in either HH:MM or MM:SS format,
45 depending on how much time is remaining. This avoids showing the user more
46 information than necessary.
47
48 """
49 hours, minutes, seconds = seconds_to_hms(remaining_seconds)
50 if show_all:
51 # HH:MM:SS
52 return _('%02d:%02d:%02d') % (hours, minutes, seconds)
53 else:
54 if hours > 0 or minutes > 14:
55 # HH:MM
56 return _('%02d:%02d') % (hours, minutes)
57 else:
58 # MM:SS
59 return _('%02d:%02d') % (minutes, seconds)
60
61def get_display_text_from_datetime(date_time):
62 return date_time.strftime('%X')
63
39def get_preset_display_text(presets_store, row_iter):64def get_preset_display_text(presets_store, row_iter):
40 (name, hours, minutes, seconds, command) = presets_store.get_preset(row_iter)65 (name, hours, minutes, seconds, command, next_timer, auto_start) = \
66 presets_store.get_preset(row_iter)
41 67
42 # <preset name> (HH:MM:SS)68 # <preset name> (HH:MM:SS)
43 return _('%s (%02d:%02d:%02d)') % (name, hours, minutes, seconds)69 return _('%s (%02d:%02d:%02d)') % (name, hours, minutes, seconds)
70
71def serialize_bool(boolean):
72 if boolean:
73 return "1"
74 return "0"
75
76def deserialize_bool(string):
77 if string == "1":
78 return True
79 return False

Subscribers

People subscribed via source and target branches

to all changes: