Merge lp:~noskcaj/ubuntu/utopic/xfce4-timer-plugin/1.6.0 into lp:ubuntu/utopic/xfce4-timer-plugin
- Utopic (14.10)
- 1.6.0
- Merge into utopic
Proposed by
Jackson Doak
Status: | Merged |
---|---|
Merge reported by: | Martin Pitt |
Merged at revision: | not available |
Proposed branch: | lp:~noskcaj/ubuntu/utopic/xfce4-timer-plugin/1.6.0 |
Merge into: | lp:ubuntu/utopic/xfce4-timer-plugin |
Diff against target: |
16441 lines (+3920/-6995) 67 files modified
.pc/.quilt_patches (+0/-1) .pc/.quilt_series (+0/-1) .pc/.version (+0/-1) .pc/01_improve-timer-stop.patch/src/xfcetimer.c (+0/-1811) .pc/02_fix-format-string.patch/src/xfcetimer.c (+0/-1813) .pc/applied-patches (+0/-2) ChangeLog (+4/-0) Makefile.in (+5/-6) acconfig.h (+0/-14) acinclude.m4 (+0/-1) aclocal.m4 (+1/-2) config.h.in (+0/-14) configure (+11/-11) configure.in (+5/-3) debian/changelog (+6/-0) debian/control (+2/-1) debian/patches/01_improve-timer-stop.patch (+7/-3) debian/patches/02_fix-format-string.patch (+12/-7) icons/48x48/Makefile.in (+2/-3) icons/Makefile.in (+2/-3) mkinstalldirs (+0/-162) po/ChangeLog (+0/-224) po/ar.po (+83/-100) po/ast.po (+79/-85) po/bg.po (+211/-0) po/ca.po (+69/-88) po/cs.po (+73/-90) po/da.po (+80/-95) po/de.po (+79/-95) po/el.po (+45/-40) po/en_AU.po (+210/-0) po/en_GB.po (+75/-94) po/es.po (+79/-89) po/eu.po (+45/-40) po/fr.po (+80/-92) po/gl.po (+45/-40) po/hr.po (+81/-83) po/hu.po (+76/-91) po/id.po (+78/-91) po/it.po (+79/-94) po/ja.po (+90/-108) po/ko.po (+75/-93) po/lv.po (+45/-40) po/ms.po (+212/-0) po/nb.po (+210/-0) po/nl.po (+75/-87) po/oc.po (+212/-0) po/pl.po (+87/-103) po/pt.po (+75/-91) po/pt_BR.po (+77/-92) po/ru.po (+99/-108) po/sk.po (+45/-40) po/sq.po (+45/-40) po/sr.po (+73/-89) po/sv.po (+78/-87) po/th.po (+209/-0) po/tr.po (+79/-91) po/ug.po (+69/-88) po/uk.po (+76/-88) po/ur.po (+45/-40) po/ur_PK.po (+45/-40) po/zh_CN.po (+75/-97) po/zh_TW.po (+70/-91) src/Makefile.am (+10/-12) src/Makefile.in (+11/-15) src/xfce4-timer.desktop.in.in (+3/-1) src/xfcetimer.c (+106/-64) |
To merge this branch: | bzr merge lp:~noskcaj/ubuntu/utopic/xfce4-timer-plugin/1.6.0 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Pitt | Approve | ||
Sean Davis | Pending | ||
Review via email: mp+226921@code.launchpad.net |
Commit message
Description of the change
New upstream release
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === removed directory '.pc' |
2 | === removed file '.pc/.quilt_patches' |
3 | --- .pc/.quilt_patches 2013-05-22 21:42:15 +0000 |
4 | +++ .pc/.quilt_patches 1970-01-01 00:00:00 +0000 |
5 | @@ -1,1 +0,0 @@ |
6 | -debian/patches |
7 | |
8 | === removed file '.pc/.quilt_series' |
9 | --- .pc/.quilt_series 2013-05-22 21:42:15 +0000 |
10 | +++ .pc/.quilt_series 1970-01-01 00:00:00 +0000 |
11 | @@ -1,1 +0,0 @@ |
12 | -series |
13 | |
14 | === removed file '.pc/.version' |
15 | --- .pc/.version 2010-04-10 21:12:05 +0000 |
16 | +++ .pc/.version 1970-01-01 00:00:00 +0000 |
17 | @@ -1,1 +0,0 @@ |
18 | -2 |
19 | |
20 | === removed directory '.pc/01_improve-timer-stop.patch' |
21 | === removed directory '.pc/01_improve-timer-stop.patch/src' |
22 | === removed file '.pc/01_improve-timer-stop.patch/src/xfcetimer.c' |
23 | --- .pc/01_improve-timer-stop.patch/src/xfcetimer.c 2013-05-22 21:42:15 +0000 |
24 | +++ .pc/01_improve-timer-stop.patch/src/xfcetimer.c 1970-01-01 00:00:00 +0000 |
25 | @@ -1,1811 +0,0 @@ |
26 | -/* |
27 | - * |
28 | - * Copyright (C) 2005 Kemal Ilgar Eroglu <kieroglu@math.washington.edu> |
29 | - * |
30 | - * This program is free software; you can redistribute it and/or modify |
31 | - * it under the terms of the GNU General Public License as published by |
32 | - * the Free Software Foundation; either version 2 of the License, or |
33 | - * (at your option) any later version. |
34 | - * |
35 | - * This program is distributed in the hope that it will be useful, |
36 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
37 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
38 | - * GNU Library General Public License for more details. |
39 | - * |
40 | - * You should have received a copy of the GNU General Public License |
41 | - * along with this program; if not, write to the Free Software |
42 | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
43 | - */ |
44 | - |
45 | - |
46 | -#define UPDATE_INTERVAL 2000 /* Countdown update period in |
47 | - milliseconds */ |
48 | -#define PBAR_THICKNESS 10 |
49 | - |
50 | -#define BORDER 8 |
51 | -#define WIDGET_SPACING 2 |
52 | - |
53 | -#ifdef HAVE_CONFIG_H |
54 | -#include <config.h> |
55 | -#endif |
56 | - |
57 | -#include <stdio.h> |
58 | -#include <stdlib.h> |
59 | -#include <time.h> |
60 | -#include <string.h> |
61 | - |
62 | -#include <gtk/gtk.h> |
63 | - |
64 | -#include <libxfce4util/libxfce4util.h> |
65 | -#ifdef HAVE_XFCE48 |
66 | -#include <libxfce4ui/libxfce4ui.h> |
67 | -#include <libxfce4panel/libxfce4panel.h> |
68 | -#else |
69 | -#include <libxfcegui4/xfce_iconbutton.h> |
70 | -#include <libxfce4panel/xfce-panel-plugin.h> |
71 | -#include <libxfcegui4/dialogs.h> |
72 | -#endif |
73 | - |
74 | -#include "xfcetimer.h" |
75 | - |
76 | -static void create_plugin_control (XfcePanelPlugin *plugin); |
77 | - |
78 | -static void start_stop_selected (GtkWidget* menuitem, gpointer |
79 | - data); |
80 | -XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(create_plugin_control); |
81 | - |
82 | -void make_menu(plugin_data *pd); |
83 | - |
84 | -/** |
85 | - * This is the timeout function that |
86 | - * repeats the alarm. |
87 | -**/ |
88 | -static gboolean repeat_alarm (gpointer data){ |
89 | - |
90 | - plugin_data *pd=(plugin_data *)data; |
91 | - |
92 | - /* Don't repeat anymore */ |
93 | - if(pd->rem_repetitions == 0){ |
94 | - |
95 | - if(pd->timeout_command) |
96 | - g_free(pd->timeout_command); |
97 | - pd->timeout_command=NULL; |
98 | - pd->alarm_repeating=FALSE; |
99 | - //make_menu(pd); |
100 | - |
101 | - return FALSE; |
102 | - |
103 | - |
104 | - } |
105 | - |
106 | - g_spawn_command_line_async (pd->timeout_command,NULL); |
107 | - pd->rem_repetitions = pd->rem_repetitions -1 ; |
108 | - return TRUE; |
109 | -} |
110 | - |
111 | -/** |
112 | - * Fills in the pd->liststore to create the treeview |
113 | - * in the options window. The second arguments indicates |
114 | - * the alarm whose row will be highlighted in the |
115 | - * treeview. If it is NULL, no action is taken. |
116 | -**/ |
117 | - |
118 | -static void fill_liststore (plugin_data *pd, GList *selected) { |
119 | - |
120 | - GtkTreeIter iter; |
121 | - GList *list; |
122 | - alarm_t *alrm; |
123 | - |
124 | - if(pd->liststore) |
125 | - gtk_list_store_clear (pd->liststore); |
126 | - |
127 | - list = pd->alarm_list; |
128 | - |
129 | - |
130 | - while (list) { |
131 | - |
132 | - alrm = (alarm_t *) list->data; |
133 | - |
134 | - gtk_list_store_append (pd->liststore, &iter); |
135 | - |
136 | - gtk_list_store_set (pd->liststore, &iter, 0, list, 1, alrm->name, 2, alrm->info, 3, alrm->command,-1); |
137 | - |
138 | - /* We select the given row */ |
139 | - if (selected && list == selected) |
140 | - gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->tree)),&iter); |
141 | - |
142 | - list = g_list_next (list); |
143 | - |
144 | - } |
145 | -} |
146 | - |
147 | -/** |
148 | - * This is the update function that updates the |
149 | - * tooltip, pbar and keeps track of elapsed time |
150 | -**/ |
151 | -static gboolean update_function (gpointer data){ |
152 | - |
153 | - plugin_data *pd=(plugin_data *)data; |
154 | - gint elapsed_sec,remaining; |
155 | - gchar *tiptext = NULL, *temp, *dialog_title, *dialog_message; |
156 | - GtkWidget *dialog; |
157 | - |
158 | - elapsed_sec=(gint)g_timer_elapsed(pd->timer,NULL); |
159 | - |
160 | - /* If countdown is not over, update tooltip */ |
161 | - if(elapsed_sec < pd->timeout_period_in_sec){ |
162 | - |
163 | - remaining=pd->timeout_period_in_sec-elapsed_sec; |
164 | - |
165 | - if(remaining>=3600) |
166 | - tiptext = g_strdup_printf(_("%dh %dm %ds left"),remaining/3600, (remaining%3600)/60, |
167 | - remaining%60); |
168 | - else if (remaining>=60) |
169 | - tiptext = g_strdup_printf(_("%dm %ds left"),remaining/60, remaining%60); |
170 | - else |
171 | - tiptext = g_strdup_printf(_("%ds left"),remaining); |
172 | - |
173 | - if(pd->is_paused) { |
174 | - temp = g_strconcat(tiptext,_(" (Paused)"),NULL); |
175 | - g_free (tiptext); |
176 | - tiptext = temp; |
177 | - } |
178 | - gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(pd->pbar), |
179 | - 1.0-((gdouble)elapsed_sec)/pd->timeout_period_in_sec); |
180 | - |
181 | - gtk_tooltips_set_tip(pd->tip,GTK_WIDGET(pd->base),tiptext,NULL); |
182 | - |
183 | - g_free(tiptext); |
184 | - |
185 | - return TRUE; |
186 | - |
187 | - } |
188 | - |
189 | - /* Countdown is over, stop timer and free resources */ |
190 | - |
191 | - if( (strlen(pd->timeout_command)==0) || !pd->nowin_if_alarm ) { |
192 | - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pd->pbar),1); |
193 | - |
194 | - /* Display the name of the alarm when the countdown ends */ |
195 | - dialog_message = g_strdup_printf(_("Beeep! :) \nTime is up for the alarm %s."), pd->active_timer_name); |
196 | - |
197 | - dialog = gtk_message_dialog_new (NULL, |
198 | - GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, |
199 | - GTK_MESSAGE_WARNING, |
200 | - GTK_BUTTONS_CLOSE, |
201 | - dialog_message); |
202 | - |
203 | - g_signal_connect_swapped (dialog, "response", |
204 | - G_CALLBACK (gtk_widget_destroy), |
205 | - dialog); |
206 | - |
207 | - dialog_title = g_strdup_printf("Xfce4 Timer Plugin: %s", pd->active_timer_name); |
208 | - gtk_window_set_title ((GtkWindow *) dialog, dialog_title); |
209 | - |
210 | - g_free(dialog_title); |
211 | - g_free(dialog_message); |
212 | - |
213 | - gtk_widget_show(dialog); |
214 | - } |
215 | - |
216 | - if(strlen(pd->timeout_command)>0) { |
217 | - |
218 | - g_spawn_command_line_async (pd->timeout_command,NULL); |
219 | - |
220 | - if(pd->repeat_alarm){ |
221 | - pd->alarm_repeating=TRUE; |
222 | - pd->rem_repetitions=pd->repetitions; |
223 | - if(pd->repeat_timeout!=0) |
224 | - g_source_remove(pd->repeat_timeout); |
225 | - pd->repeat_timeout = g_timeout_add(pd->repeat_interval*1000,repeat_alarm,pd); |
226 | - } |
227 | - else |
228 | - { |
229 | - if(pd->timeout_command) |
230 | - g_free(pd->timeout_command); |
231 | - pd->timeout_command=NULL; |
232 | - } |
233 | - } |
234 | - |
235 | - if(pd->timer) |
236 | - g_timer_destroy(pd->timer); |
237 | - pd->timer=NULL; |
238 | - |
239 | - /* Disable tooltips, reset pbar */ |
240 | - gtk_tooltips_set_tip(pd->tip,GTK_WIDGET(pd->base),"",NULL); |
241 | - gtk_tooltips_disable(pd->tip); |
242 | - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pd->pbar),0); |
243 | - |
244 | - pd->timeout=0; |
245 | - |
246 | - pd->timer_on=FALSE; |
247 | - |
248 | - //make_menu(pd); |
249 | - |
250 | - /* This function won't be called again */ |
251 | - return FALSE; |
252 | - |
253 | -} |
254 | - |
255 | -/** |
256 | - * This is the callback function called when a timer |
257 | - * is selected in the popup menu |
258 | -**/ |
259 | - |
260 | -//static void timer_selected (GtkWidget* menuitem, GdkEventButton *event, gpointer data){ |
261 | -static void timer_selected (GtkWidget* menuitem, gpointer data){ |
262 | - GList *list = (GList *) data; |
263 | - alarm_t *alrm; |
264 | - plugin_data *pd; |
265 | - GtkRadioMenuItem *rmi; |
266 | - |
267 | - rmi = (GtkRadioMenuItem *) menuitem; |
268 | - |
269 | - // We do this to get rid of the (irrelevant) "activate" signals |
270 | - // emitted by the first radio check button in the pop-up |
271 | - // menu when the menu is created and also by the (deactivated) |
272 | - // previous selection when a new selection is made. Another workaround |
273 | - // is to listen to the button_press_event but it does not capture |
274 | - // the Enter key press on the menuitem. |
275 | - if(!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(rmi))) |
276 | - return; |
277 | - |
278 | - alrm = (alarm_t *) list->data; |
279 | - pd = (plugin_data *) alrm->pd; |
280 | - |
281 | - pd->selected = list; |
282 | - |
283 | - /* start the timer if the option to do so on selecting is set */ |
284 | - if(pd->selecting_starts && !pd->timer_on) |
285 | - start_stop_selected(menuitem,pd); |
286 | - |
287 | -} |
288 | - |
289 | -/** |
290 | - * This is the callback function called when the |
291 | - * start/stop item is selected in the popup menu |
292 | -**/ |
293 | - |
294 | -static void start_stop_selected (GtkWidget* menuitem, gpointer |
295 | - data){ |
296 | - |
297 | - plugin_data *pd=(plugin_data *)data; |
298 | - GSList *group=NULL; |
299 | - gchar temp[8]; |
300 | - gint row_count,cur_h,cur_m,cur_s,time; |
301 | - gint timeout_period; |
302 | - gboolean is_cd; |
303 | - GTimeVal timeval; |
304 | - struct tm *current; |
305 | - alarm_t *alrm; |
306 | - |
307 | - /* If counting down, we stop the timer and free the resources */ |
308 | - if(pd->timer_on){ |
309 | - |
310 | - if(pd->timer) |
311 | - g_timer_destroy(pd->timer); |
312 | - if(pd->timeout) |
313 | - g_source_remove(pd->timeout); |
314 | - if(pd->timeout_command) |
315 | - g_free(pd->timeout_command); |
316 | - if(pd->active_timer_name) |
317 | - g_free(pd->active_timer_name); |
318 | - |
319 | - pd->timer = NULL; |
320 | - pd->timeout_command = NULL; |
321 | - pd->active_timer_name = NULL; |
322 | - pd->timeout = 0; |
323 | - pd->timer_on = FALSE; |
324 | - pd->is_paused = FALSE; |
325 | - |
326 | - /* Disable tooltips, reset pbar */ |
327 | - gtk_tooltips_set_tip(pd->tip,GTK_WIDGET(pd->base),"",NULL); |
328 | - gtk_tooltips_disable(pd->tip); |
329 | - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pd->pbar),0); |
330 | - |
331 | - return; |
332 | - |
333 | - } |
334 | - |
335 | - /* If we're here then the timer is off, so we start it */ |
336 | - |
337 | - /* Empty timer list-> Nothing to do. pd->selected=0, though. */ |
338 | - if(pd->selected == NULL) |
339 | - return; |
340 | - |
341 | - alrm = (alarm_t *) pd->selected->data; |
342 | - |
343 | - /* Record the timer name */ |
344 | - if (pd->active_timer_name) |
345 | - g_free(pd->active_timer_name); |
346 | - |
347 | - pd->active_timer_name = g_strdup(alrm->name); /* It's freed next time |
348 | - or at exit */ |
349 | - if(pd->timeout_command) |
350 | - g_free(pd->timeout_command); |
351 | - |
352 | - /* If an alarm command is set, it overrides the default (if any) */ |
353 | - if (strlen(alrm->command)>0) |
354 | - pd->timeout_command = g_strdup(alrm->command); /* It's freed next |
355 | - time or at exit */ |
356 | - else if (pd->use_global_command) |
357 | - pd->timeout_command = g_strdup (pd->global_command); |
358 | - else |
359 | - pd->timeout_command = g_strdup(""); |
360 | - |
361 | - /* If it's a 24h type alarm, we find the difference with current time |
362 | - Here 'time' is in minutes */ |
363 | - if(!alrm->iscountdown) { |
364 | - |
365 | - g_get_current_time(&timeval); |
366 | - current = localtime((time_t *)&timeval.tv_sec); |
367 | - strftime(temp,7,"%H",current); |
368 | - cur_h = atoi(temp); |
369 | - strftime(temp,7,"%M",current); |
370 | - cur_m = atoi(temp); |
371 | - strftime(temp,7,"%S",current); |
372 | - cur_s = atoi(temp); |
373 | - |
374 | - timeout_period = (alrm->time)*60 - ((60*cur_h + cur_m)*60 + cur_s); |
375 | - |
376 | - if(timeout_period <0) |
377 | - timeout_period+= 24*60*60; |
378 | - |
379 | - pd->is_countdown = FALSE; |
380 | - |
381 | - } |
382 | - /* Else 'pd->selected->time' already gives the countdown period in seconds */ |
383 | - else { |
384 | - |
385 | - pd->is_countdown = TRUE; |
386 | - timeout_period = alrm->time; |
387 | - |
388 | - } |
389 | - pd->timeout_period_in_sec=timeout_period; |
390 | - |
391 | - /* start the timer */ |
392 | - pd->timer=g_timer_new(); |
393 | - pd->timer_on=TRUE; |
394 | - |
395 | - gtk_tooltips_set_tip(pd->tip, GTK_WIDGET(pd->base), alrm->info, NULL); |
396 | - gtk_tooltips_enable(pd->tip); |
397 | - |
398 | - g_timer_start(pd->timer); |
399 | - pd->timeout = g_timeout_add(UPDATE_INTERVAL, update_function,pd); |
400 | - |
401 | -} |
402 | - |
403 | -static void pause_resume_selected (GtkWidget* menuitem, gpointer |
404 | - data){ |
405 | - |
406 | - plugin_data *pd=(plugin_data *)data; |
407 | - |
408 | - |
409 | - /* If paused, we resume */ |
410 | - if(pd->is_paused){ |
411 | - |
412 | - g_timer_continue(pd->timer); |
413 | - pd->is_paused=FALSE; |
414 | - |
415 | - /* If we're here then the timer is runnig, so we pause */ |
416 | - } else { |
417 | - |
418 | - pd->is_paused=TRUE; |
419 | - g_timer_stop(pd->timer); |
420 | - |
421 | - } |
422 | - |
423 | - //make_menu(pd); |
424 | - |
425 | -} |
426 | - |
427 | -/** |
428 | - * Callback when "Stop the alarm" is selected in the popup menu |
429 | -**/ |
430 | - |
431 | -static void stop_repeating_alarm (GtkWidget* menuitem, gpointer |
432 | - data){ |
433 | - plugin_data *pd=(plugin_data *)data; |
434 | - |
435 | - g_source_remove(pd->repeat_timeout); |
436 | - |
437 | - pd->alarm_repeating=FALSE; |
438 | - |
439 | - if(pd->timeout_command){ |
440 | - g_free(pd->timeout_command); |
441 | - pd->timeout_command=NULL; |
442 | - } |
443 | - |
444 | - //make_menu(pd); |
445 | - |
446 | -} |
447 | - |
448 | -/** |
449 | - * Callback when clicking on pbar. Pops the menu up/down |
450 | -**/ |
451 | -static void pbar_clicked (GtkWidget *pbar, GdkEventButton *event, gpointer data){ |
452 | - |
453 | - plugin_data *pd=(plugin_data *)data; |
454 | - |
455 | - make_menu(pd); |
456 | - |
457 | - if(!pd->menu) |
458 | - return; |
459 | - |
460 | - if(event->button==1) |
461 | - gtk_menu_popup (GTK_MENU(pd->menu),NULL,NULL,NULL,NULL,event->button,event->time); |
462 | - else |
463 | - gtk_menu_popdown(GTK_MENU(pd->menu)); |
464 | - |
465 | -} |
466 | - |
467 | -/** |
468 | - * This function generates the popup menu |
469 | -**/ |
470 | -void make_menu(plugin_data *pd){ |
471 | - |
472 | - GSList *group = NULL; |
473 | - GList *list = NULL; |
474 | - alarm_t *alrm; |
475 | - GtkWidget *menuitem, *to_be_activated; |
476 | - gchar *itemtext; |
477 | - |
478 | - |
479 | - /* Destroy the existing one */ |
480 | - if(pd->menu) |
481 | - gtk_widget_destroy(pd->menu); |
482 | - |
483 | - pd->menu=gtk_menu_new(); |
484 | - |
485 | - /* If the alarm is paused, the only option is to resume or stop */ |
486 | - if (pd->is_paused) { |
487 | - menuitem=gtk_menu_item_new_with_label(_("Resume timer")); |
488 | - |
489 | - gtk_menu_shell_append (GTK_MENU_SHELL(pd->menu),menuitem); |
490 | - g_signal_connect (G_OBJECT(menuitem),"activate", |
491 | - G_CALLBACK(pause_resume_selected),pd); |
492 | - gtk_widget_show(menuitem); |
493 | - |
494 | - menuitem=gtk_menu_item_new_with_label(_("Stop timer")); |
495 | - |
496 | - gtk_menu_shell_append (GTK_MENU_SHELL(pd->menu),menuitem); |
497 | - g_signal_connect (G_OBJECT(menuitem),"activate", |
498 | - G_CALLBACK(start_stop_selected),pd); |
499 | - gtk_widget_show(menuitem); |
500 | - gtk_widget_show(pd->menu); |
501 | - return; |
502 | - } |
503 | - |
504 | - list = pd->alarm_list; |
505 | - |
506 | - while (list){ |
507 | - |
508 | - /* Run through the list, read name and timer period info */ |
509 | - |
510 | - alrm = (alarm_t *) list->data; |
511 | - |
512 | - itemtext = g_strdup_printf("%s (%s)",alrm->name,alrm->info); |
513 | - menuitem=gtk_radio_menu_item_new_with_label(group,itemtext); |
514 | - gtk_menu_shell_append(GTK_MENU_SHELL(pd->menu),menuitem); |
515 | - /* The selected timer is always active */ |
516 | - if(list == pd->selected) |
517 | - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),TRUE); |
518 | - /* others are disabled when timer or alarm is already running */ |
519 | - else if(pd->timer_on || pd->alarm_repeating) |
520 | - gtk_widget_set_sensitive(GTK_WIDGET(menuitem),FALSE); |
521 | - |
522 | - group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem)); |
523 | - g_signal_connect (G_OBJECT(menuitem),"activate", |
524 | - G_CALLBACK(timer_selected),list); |
525 | - |
526 | - g_free(itemtext); |
527 | - |
528 | - list = list->next; |
529 | - |
530 | - } |
531 | - |
532 | - /* Horizontal line (empty item) */ |
533 | - menuitem=gtk_menu_item_new(); |
534 | - gtk_menu_shell_append(GTK_MENU_SHELL(pd->menu),menuitem); |
535 | - |
536 | - /* Pause menu item */ |
537 | - if(pd->timer_on && !pd->is_paused && pd->is_countdown) { |
538 | - menuitem=gtk_menu_item_new_with_label(_("Pause timer")); |
539 | - |
540 | - gtk_menu_shell_append (GTK_MENU_SHELL(pd->menu),menuitem); |
541 | - g_signal_connect (G_OBJECT(menuitem),"activate", |
542 | - G_CALLBACK(pause_resume_selected),pd); |
543 | - |
544 | - |
545 | - } |
546 | - |
547 | - /* Start/stop menu item */ |
548 | - if(!pd->alarm_repeating){ |
549 | - if(pd->timer_on) |
550 | - menuitem=gtk_menu_item_new_with_label(_("Stop timer")); |
551 | - else |
552 | - menuitem=gtk_menu_item_new_with_label(_("Start timer")); |
553 | - |
554 | - gtk_menu_shell_append (GTK_MENU_SHELL(pd->menu),menuitem); |
555 | - g_signal_connect (G_OBJECT(menuitem),"activate", |
556 | - G_CALLBACK(start_stop_selected),pd); |
557 | - } |
558 | - |
559 | - /* Stop repeating alarm if so */ |
560 | - if(pd->alarm_repeating) { |
561 | - menuitem=gtk_menu_item_new_with_label(_("Stop the alarm")); |
562 | - |
563 | - gtk_menu_shell_append (GTK_MENU_SHELL(pd->menu),menuitem); |
564 | - g_signal_connect (G_OBJECT(menuitem),"activate", |
565 | - G_CALLBACK(stop_repeating_alarm),pd); |
566 | - } |
567 | - |
568 | - gtk_widget_show_all(pd->menu); |
569 | -} |
570 | - |
571 | - |
572 | -/** |
573 | - * Callback to the OK button in the Add window |
574 | -**/ |
575 | -static void ok_add(GtkButton *button, gpointer data){ |
576 | - |
577 | - alarm_data *adata = (alarm_data *)data; |
578 | - alarm_t *newalarm; |
579 | - GtkTreeIter iter; |
580 | - gint t1,t2,t3,t; |
581 | - gchar *timeinfo = NULL; |
582 | - |
583 | - /* Add item to the alarm list and liststore */ |
584 | - |
585 | - newalarm = g_new0(alarm_t,1); |
586 | - newalarm->name = g_strdup(gtk_entry_get_text(GTK_ENTRY(adata->name))); |
587 | - newalarm->command = g_strdup(gtk_entry_get_text(GTK_ENTRY(adata->command))); |
588 | - newalarm->iscountdown = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(adata-> |
589 | - rb1)); |
590 | - newalarm->pd = (gpointer) adata->pd; |
591 | - |
592 | - adata->pd->alarm_list = g_list_append (adata->pd->alarm_list, newalarm); |
593 | - |
594 | - gtk_list_store_append(adata->pd->liststore,&iter); |
595 | - |
596 | - gtk_list_store_set(GTK_LIST_STORE(adata->pd->liststore),&iter, |
597 | - 0,g_list_last(adata->pd->alarm_list), |
598 | - 1,newalarm->name, |
599 | - 3,newalarm->command, |
600 | - -1); |
601 | - /* Item count goes up by one */ |
602 | - adata->pd->count=adata->pd->count+1; |
603 | - |
604 | - /* If the h-m-s format (countdown) was chosen, convert time to seconds, |
605 | - save the choice into the list */ |
606 | - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(adata->rb1))){ |
607 | - |
608 | - t1=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->timeh)); |
609 | - t2=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->timem)); |
610 | - t3=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->times)); |
611 | - t=t1*3600+t2*60+t3; |
612 | - |
613 | - |
614 | - |
615 | - if(t1>0) |
616 | - timeinfo = g_strdup_printf(_("%dh %dm %ds"),t1,t2,t3); |
617 | - else if(t2>0) |
618 | - timeinfo = g_strdup_printf(_("%dm %ds"),t2,t3); |
619 | - else |
620 | - timeinfo = g_strdup_printf(_("%ds"),t3); |
621 | - |
622 | - |
623 | - } |
624 | - else{ /* The 24h format (alarm at specified time). Save time in minutes */ |
625 | - |
626 | - t1=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->time_h)); |
627 | - t2=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->time_m)); |
628 | - t=t1*60+t2; |
629 | - timeinfo = g_strdup_printf(_("At %02d:%02d"),t1,t2); |
630 | - |
631 | - } |
632 | - |
633 | - newalarm->time = t; |
634 | - newalarm->info = timeinfo; |
635 | - gtk_list_store_set(GTK_LIST_STORE(adata->pd->liststore),&iter,2,timeinfo,-1); |
636 | - |
637 | - |
638 | - /* Free resources */ |
639 | - gtk_widget_destroy(GTK_WIDGET(adata->window)); |
640 | - |
641 | - g_free(adata); |
642 | -} |
643 | - |
644 | - |
645 | - |
646 | -/** |
647 | - * Callback for OK button on Edit window. See ok_add for comments. |
648 | -**/ |
649 | -static void ok_edit(GtkButton *button, gpointer data){ |
650 | - |
651 | - alarm_data *adata = (alarm_data *)data; |
652 | - GtkTreeIter iter; |
653 | - gint t1,t2,t3,t; |
654 | - gchar *timeinfo = NULL; |
655 | - GList *list; |
656 | - alarm_t *alrm; |
657 | - GtkTreeSelection *select; |
658 | - GtkTreeModel *model; |
659 | - |
660 | - select = gtk_tree_view_get_selection (GTK_TREE_VIEW (adata->pd->tree)); |
661 | - |
662 | - if (gtk_tree_selection_get_selected (select, &model, &iter)) |
663 | - { |
664 | - |
665 | - gtk_tree_model_get(GTK_TREE_MODEL(adata->pd->liststore), &iter, 0, &list,-1); |
666 | - alrm = (alarm_t *) list->data; |
667 | - |
668 | - alrm->name = g_strdup(gtk_entry_get_text(GTK_ENTRY(adata->name))); |
669 | - alrm->command = g_strdup(gtk_entry_get_text(GTK_ENTRY(adata->command))); |
670 | - alrm->iscountdown = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(adata-> |
671 | - rb1)); |
672 | - /* This should be unnecessary, but do it anyway */ |
673 | - alrm->pd = (gpointer) adata->pd; |
674 | - |
675 | - gtk_list_store_set(GTK_LIST_STORE(adata->pd->liststore),&iter, |
676 | - 1,alrm->name, |
677 | - 3,alrm->command ,-1); |
678 | - |
679 | - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(adata->rb1))){ |
680 | - |
681 | - t1=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->timeh)); |
682 | - t2=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->timem)); |
683 | - t3=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->times)); |
684 | - t=t1*3600+t2*60+t3; |
685 | - |
686 | - if(t1>0) |
687 | - timeinfo = g_strdup_printf(_("%dh %dm %ds"),t1,t2,t3); |
688 | - else if(t2>0) |
689 | - timeinfo = g_strdup_printf(_("%dm %ds"),t2,t3); |
690 | - else |
691 | - timeinfo = g_strdup_printf(_("%ds"),t3); |
692 | - |
693 | - |
694 | - } |
695 | - else{ |
696 | - |
697 | - t1=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->time_h)); |
698 | - t2=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->time_m)); |
699 | - t=t1*60+t2; |
700 | - timeinfo = g_strdup_printf(_("At %02d:%02d"),t1,t2); |
701 | - } |
702 | - |
703 | - alrm->time = t; |
704 | - alrm->info = timeinfo; |
705 | - gtk_list_store_set(GTK_LIST_STORE(adata->pd->liststore),&iter,2,timeinfo,-1); |
706 | - |
707 | - } |
708 | - |
709 | - //make_menu(adata->pd); |
710 | - |
711 | - gtk_widget_destroy(GTK_WIDGET(adata->window)); |
712 | - |
713 | - g_free(adata); |
714 | -} |
715 | - |
716 | - |
717 | - |
718 | -/** |
719 | - * Callback for cancelling Add and Edit. Just closes the window :). |
720 | -**/ |
721 | -static void cancel_add_edit(GtkButton *button, gpointer data){ |
722 | - |
723 | - alarm_data *adata=(alarm_data *)data; |
724 | - |
725 | - gtk_widget_destroy(GTK_WIDGET(adata->window)); |
726 | - |
727 | - g_free(adata); |
728 | - |
729 | -} |
730 | - |
731 | -/** |
732 | - * Callback when first radio button in dialog has been selected. |
733 | - */ |
734 | -static void alarmdialog_countdown_toggled (GtkButton *button, gpointer data) |
735 | -{ |
736 | - alarm_data *adata = (alarm_data *) data; |
737 | - gboolean active; |
738 | - |
739 | - active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)); |
740 | - gtk_widget_set_sensitive(GTK_WIDGET(adata->timeh), active); |
741 | - gtk_widget_set_sensitive(GTK_WIDGET(adata->timem), active); |
742 | - gtk_widget_set_sensitive(GTK_WIDGET(adata->times), active); |
743 | -} |
744 | - |
745 | -/** |
746 | - * Callback when second radio button in dialog has been selected. |
747 | - */ |
748 | -static void alarmdialog_alarmtime_toggled (GtkButton *button, gpointer data) |
749 | -{ |
750 | - alarm_data *adata = (alarm_data *) data; |
751 | - gboolean active; |
752 | - |
753 | - active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)); |
754 | - gtk_widget_set_sensitive(GTK_WIDGET(adata->time_h), active); |
755 | - gtk_widget_set_sensitive(GTK_WIDGET(adata->time_m), active); |
756 | -} |
757 | - |
758 | -/** |
759 | - * Callback to the Add button in options window. |
760 | - * Creates the Add window. |
761 | -**/ |
762 | -static void add_edit_clicked (GtkButton *buttonn, gpointer data){ |
763 | - |
764 | - plugin_data *pd = (plugin_data *)data; |
765 | - |
766 | - GtkWindow *parent_window; |
767 | - GtkWindow *window; |
768 | - GtkLabel *label; |
769 | - GtkEntry *name,*command; |
770 | - GtkSpinButton *timeh,*timem,*times,*time_h,*time_m; |
771 | - GtkRadioButton *rb1,*rb2; |
772 | - GtkWidget *hbox,*vbox,*button; |
773 | - alarm_data *adata=g_new0(alarm_data,1); |
774 | - gchar *nc; gboolean is_cd; gint time; |
775 | - GtkTreeIter iter; |
776 | - GtkTreeSelection *select; |
777 | - GtkTreeModel *model; |
778 | - GList *list; |
779 | - alarm_t *alrm; |
780 | - |
781 | - window = (GtkWindow *)gtk_window_new(GTK_WINDOW_TOPLEVEL); |
782 | - |
783 | - adata->window=window; |
784 | - adata->pd=pd; |
785 | - |
786 | - gtk_window_set_modal(GTK_WINDOW(window),TRUE); |
787 | - parent_window = (GtkWindow *) gtk_widget_get_toplevel(GTK_WIDGET(buttonn)); |
788 | - if (gtk_widget_is_toplevel(GTK_WIDGET(parent_window))) |
789 | - gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(parent_window)); |
790 | - |
791 | - vbox=gtk_vbox_new(FALSE, BORDER); |
792 | - gtk_container_add(GTK_CONTAINER(window),vbox); |
793 | - gtk_container_set_border_width(GTK_CONTAINER(window), BORDER); |
794 | - |
795 | - /***********/ |
796 | - hbox=gtk_hbox_new(FALSE, BORDER); |
797 | - gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE, WIDGET_SPACING); |
798 | - |
799 | - label = (GtkLabel *)gtk_label_new (_("Name:")); |
800 | - name = (GtkEntry *) gtk_entry_new(); |
801 | - adata->name=name; |
802 | - |
803 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(label),FALSE,FALSE,0); |
804 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(name),TRUE,TRUE,0); |
805 | - |
806 | - /**********/ |
807 | - rb1=(GtkRadioButton *)gtk_radio_button_new_with_label(NULL,_("Enter the countdown time")); |
808 | - g_signal_connect(G_OBJECT(rb1), "toggled", G_CALLBACK(alarmdialog_countdown_toggled), adata); |
809 | - rb2=(GtkRadioButton *)gtk_radio_button_new_with_label(gtk_radio_button_get_group |
810 | - (rb1),_("Enter the time of alarm (24h format)")); |
811 | - g_signal_connect(G_OBJECT(rb2), "toggled", G_CALLBACK(alarmdialog_alarmtime_toggled), adata); |
812 | - adata->rb1=rb1; |
813 | - |
814 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(rb1),TRUE,TRUE,0); |
815 | - |
816 | - hbox=gtk_hbox_new(FALSE,0); |
817 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(hbox),TRUE,TRUE,0); |
818 | - |
819 | - timeh = (GtkSpinButton *)gtk_spin_button_new_with_range(0,23,1); |
820 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(timeh),FALSE,FALSE, WIDGET_SPACING); |
821 | - adata->timeh=timeh; |
822 | - label = (GtkLabel *)gtk_label_new (_("h ")); |
823 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(label),FALSE,FALSE, WIDGET_SPACING); |
824 | - timem = (GtkSpinButton *)gtk_spin_button_new_with_range(0,59,1); |
825 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(timem),FALSE,FALSE,WIDGET_SPACING); |
826 | - adata->timem=timem; |
827 | - label = (GtkLabel *)gtk_label_new (_("m ")); |
828 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(label),FALSE,FALSE,WIDGET_SPACING); |
829 | - times = (GtkSpinButton *)gtk_spin_button_new_with_range(0,59,1); |
830 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(times),FALSE,FALSE,WIDGET_SPACING); |
831 | - adata->times=times; |
832 | - label = (GtkLabel *)gtk_label_new (_("s ")); |
833 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(label),FALSE,FALSE,WIDGET_SPACING); |
834 | - |
835 | - label = (GtkLabel *)gtk_label_new (_("or")); |
836 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(label),TRUE,TRUE,BORDER); |
837 | - |
838 | - |
839 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(rb2),TRUE,TRUE,0); |
840 | - |
841 | - hbox=gtk_hbox_new(FALSE,WIDGET_SPACING); |
842 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(hbox),TRUE,TRUE,0); |
843 | - |
844 | - time_h = (GtkSpinButton *)gtk_spin_button_new_with_range(0,23,1); |
845 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(time_h),FALSE,FALSE,0); |
846 | - adata->time_h=time_h; |
847 | - label = (GtkLabel *)gtk_label_new (":"); |
848 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(label),FALSE,FALSE,WIDGET_SPACING); |
849 | - time_m = (GtkSpinButton *)gtk_spin_button_new_with_range(0,59,1); |
850 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(time_m),FALSE,FALSE,WIDGET_SPACING); |
851 | - adata->time_m=time_m; |
852 | - |
853 | - /****************/ |
854 | - |
855 | - label = (GtkLabel *)gtk_label_new (_("Command to run:")); |
856 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(label),FALSE,FALSE,WIDGET_SPACING); |
857 | - command = (GtkEntry *)gtk_entry_new(); |
858 | - adata->command=command; |
859 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(command),TRUE,TRUE,WIDGET_SPACING); |
860 | - |
861 | - /****************/ |
862 | - |
863 | - //hbox=gtk_hbox_new(TRUE,0); |
864 | - hbox = gtk_hbutton_box_new(); |
865 | - gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END); |
866 | - gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbox), BORDER); |
867 | - gtk_box_pack_start(GTK_BOX(vbox),hbox,TRUE,TRUE,WIDGET_SPACING); |
868 | - //gtk_container_set_border_width(GTK_CONTAINER(hbox), BORDER); |
869 | - |
870 | - button=gtk_button_new_from_stock(GTK_STOCK_CANCEL); |
871 | - gtk_box_pack_start(GTK_BOX(hbox),button,TRUE,TRUE,0); |
872 | - g_signal_connect(G_OBJECT(button),"clicked",G_CALLBACK(cancel_add_edit),adata); |
873 | - |
874 | - button=gtk_button_new_from_stock(GTK_STOCK_OK); |
875 | - gtk_box_pack_start(GTK_BOX(hbox),button,TRUE,TRUE,0); |
876 | - if(GTK_WIDGET(buttonn)==pd->buttonadd) |
877 | - g_signal_connect(G_OBJECT(button),"clicked",G_CALLBACK(ok_add),adata); |
878 | - else |
879 | - g_signal_connect(G_OBJECT(button),"clicked",G_CALLBACK(ok_edit),adata); |
880 | - |
881 | - |
882 | - |
883 | - /* If this is the add window, we're done */ |
884 | - if(GTK_WIDGET(buttonn)==pd->buttonadd) { |
885 | - gtk_window_set_title(window,_("Add new alarm")); |
886 | - gtk_widget_show_all(GTK_WIDGET(window)); |
887 | - alarmdialog_alarmtime_toggled(GTK_BUTTON(rb2), adata); |
888 | - return; |
889 | - } |
890 | - |
891 | - /* Else fill the values in the boxes with the current choices */ |
892 | - select = gtk_tree_view_get_selection (GTK_TREE_VIEW (pd->tree)); |
893 | - /*gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);*/ |
894 | - |
895 | - if (gtk_tree_selection_get_selected (select, &model, &iter)){ |
896 | - |
897 | - gtk_tree_model_get(model,&iter,0,&list,-1); |
898 | - alrm = (alarm_t *) list->data; |
899 | - |
900 | - gtk_entry_set_text(GTK_ENTRY(name),alrm->name); |
901 | - gtk_entry_set_text(GTK_ENTRY(command),alrm->command); |
902 | - |
903 | - time = alrm->time; |
904 | - |
905 | - if(alrm->iscountdown){ |
906 | - |
907 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(timeh),time/3600); |
908 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(timem),(time%3600)/60); |
909 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(times),time%60); |
910 | - alarmdialog_alarmtime_toggled(GTK_BUTTON(rb2), adata); |
911 | - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rb1),TRUE); |
912 | - } |
913 | - else{ |
914 | - |
915 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(time_h),time/60); |
916 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(time_m),time%60); |
917 | - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rb2),TRUE); // active by default |
918 | - } |
919 | - |
920 | - } |
921 | - |
922 | - gtk_window_set_title(window,_("Edit alarm")); |
923 | - gtk_widget_show_all(GTK_WIDGET(window)); |
924 | - |
925 | -} |
926 | - |
927 | - |
928 | -/** |
929 | - * Calllback for the remove button in the options |
930 | -**/ |
931 | -static void remove_clicked(GtkButton *button, gpointer data){ |
932 | - |
933 | - plugin_data *pd = (plugin_data *)data; |
934 | - |
935 | - GtkTreeIter iter; |
936 | - GtkTreeModel *model; |
937 | - GtkTreeSelection *select; |
938 | - GList *list; |
939 | - |
940 | - /* Get the selected row */ |
941 | - select = gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->tree)); |
942 | - |
943 | - if (!select) |
944 | - return; |
945 | - |
946 | - if (!gtk_tree_selection_get_selected (select, &model, &iter)) |
947 | - return; |
948 | - |
949 | - gtk_tree_model_get(model,&iter,0,&list,-1); |
950 | - |
951 | - if (pd->selected == list) { |
952 | - pd->alarm_list = g_list_delete_link (pd->alarm_list, list); |
953 | - pd->selected = pd->alarm_list; |
954 | - } else { |
955 | - pd->alarm_list = g_list_delete_link (pd->alarm_list, list); |
956 | - } |
957 | - |
958 | - fill_liststore (pd,NULL); |
959 | - |
960 | -} |
961 | - |
962 | -/** |
963 | - * Moves an alarm one row up in the list |
964 | -**/ |
965 | -static void up_clicked(GtkButton *button, gpointer data){ |
966 | - |
967 | - plugin_data *pd = (plugin_data *)data; |
968 | - |
969 | - GtkTreeIter iter; |
970 | - GtkTreeModel *model; |
971 | - GtkTreeSelection *select; |
972 | - GList *list, *list_prev; |
973 | - |
974 | - /* Get the selected row */ |
975 | - select = gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->tree)); |
976 | - |
977 | - if (!select) |
978 | - return; |
979 | - |
980 | - if (!gtk_tree_selection_get_selected (select, &model, &iter)) |
981 | - return; |
982 | - |
983 | - /* This is the item to be moved up */ |
984 | - gtk_tree_model_get(model,&iter,0,&list,-1); |
985 | - |
986 | - /* First item can't be moved up */ |
987 | - if(g_list_position(pd->alarm_list, list) <= 0) |
988 | - return; |
989 | - |
990 | - /* swap places */ |
991 | - list_prev = list->prev; |
992 | - if(list_prev->prev) |
993 | - list_prev->prev->next = list; |
994 | - if(list->next) |
995 | - list->next->prev = list_prev; |
996 | - list_prev->next = list->next; |
997 | - list->prev = list_prev->prev; |
998 | - list->next = list_prev; |
999 | - list_prev->prev = list; |
1000 | - |
1001 | - pd->alarm_list = g_list_first(list); |
1002 | - |
1003 | - fill_liststore (pd, list); |
1004 | -} |
1005 | - |
1006 | -/** |
1007 | - * Moves an alarm one row down in the list |
1008 | -**/ |
1009 | -static void down_clicked(GtkButton *button, gpointer data){ |
1010 | - |
1011 | - plugin_data *pd = (plugin_data *)data; |
1012 | - |
1013 | - GtkTreeIter iter; |
1014 | - GtkTreeSelection *select; |
1015 | - GtkTreeModel *model; |
1016 | - GList *list,*list_next; |
1017 | - |
1018 | - /* Get the selected row */ |
1019 | - select = gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->tree)); |
1020 | - |
1021 | - if (!select) |
1022 | - return; |
1023 | - |
1024 | - if (!gtk_tree_selection_get_selected (select, &model, &iter)) |
1025 | - return; |
1026 | - |
1027 | - /* This is the item to be moved down */ |
1028 | - gtk_tree_model_get(model,&iter,0,&list,-1); |
1029 | - |
1030 | - /* Last item can't go down) */ |
1031 | - if (list == g_list_last(pd->alarm_list)) |
1032 | - return; |
1033 | - |
1034 | - /* swap places */ |
1035 | - list_next = list->next; |
1036 | - if(list_next->next) |
1037 | - list_next->next->prev = list; |
1038 | - if(list->prev) |
1039 | - list->prev->next = list_next; |
1040 | - list_next->prev = list ->prev; |
1041 | - list->next = list_next->next; |
1042 | - list_next->next = list; |
1043 | - list->prev = list_next; |
1044 | - |
1045 | - pd->alarm_list = g_list_first(list_next); |
1046 | - |
1047 | - fill_liststore (pd, list); |
1048 | -} |
1049 | - |
1050 | - |
1051 | -/** |
1052 | - * Adds the progressbar, taking into account the orientation. |
1053 | - * pd->pbar is not destroyed, just reparented (saves fraction setting code etc.). |
1054 | -**/ |
1055 | -static void add_pbar(XfcePanelPlugin *plugin, plugin_data *pd){ |
1056 | - |
1057 | - gdouble frac; |
1058 | - |
1059 | - gtk_widget_hide(GTK_WIDGET(plugin)); |
1060 | - |
1061 | - /* Always true except at initialization */ |
1062 | -// if(pd->box){ |
1063 | - //g_object_ref(G_OBJECT(pd->pbar)); |
1064 | -// gtk_container_remove(GTK_CONTAINER(pd->box),pd->pbar); |
1065 | -// gtk_widget_destroy(pd->box); |
1066 | -// } |
1067 | - |
1068 | - if (pd -> box) { |
1069 | - frac = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (pd->pbar)); |
1070 | - gtk_widget_destroy(pd->box); |
1071 | - pd->pbar = gtk_progress_bar_new (); |
1072 | - gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR(pd->pbar), |
1073 | - GTK_PROGRESS_CONTINUOUS); |
1074 | - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pd->pbar),frac); |
1075 | - } |
1076 | - |
1077 | - /* vertical bar */ |
1078 | - if(xfce_panel_plugin_get_orientation(plugin)==GTK_ORIENTATION_HORIZONTAL){ |
1079 | - pd->box=gtk_hbox_new(TRUE,0); |
1080 | - gtk_container_set_border_width (GTK_CONTAINER(pd->box), BORDER/2); |
1081 | -#ifdef HAVE_XFCE48 |
1082 | - gtk_container_add(GTK_CONTAINER(plugin),pd->box); |
1083 | -#else |
1084 | - gtk_container_add(GTK_CONTAINER(pd->eventbox),pd->box); |
1085 | -#endif |
1086 | - gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR(pd-> |
1087 | - pbar),GTK_PROGRESS_BOTTOM_TO_TOP); |
1088 | - gtk_widget_set_size_request(GTK_WIDGET(pd->pbar),PBAR_THICKNESS,0); |
1089 | - gtk_box_pack_start(GTK_BOX(pd->box),gtk_vseparator_new(),FALSE,FALSE,0); |
1090 | - gtk_box_pack_start(GTK_BOX(pd->box),pd->pbar,FALSE,FALSE,0); |
1091 | - gtk_box_pack_start(GTK_BOX(pd->box),gtk_vseparator_new(),FALSE,FALSE,0); |
1092 | - |
1093 | - } |
1094 | - else{ /* horizontal bar */ |
1095 | - pd->box=gtk_vbox_new(TRUE,0); |
1096 | - gtk_container_set_border_width (GTK_CONTAINER(pd->box), BORDER/2); |
1097 | -#ifdef HAVE_XFCE48 |
1098 | - gtk_container_add(GTK_CONTAINER(plugin),pd->box); |
1099 | -#else |
1100 | - gtk_container_add(GTK_CONTAINER(pd->eventbox),pd->box); |
1101 | -#endif |
1102 | - gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR(pd-> |
1103 | - pbar),GTK_PROGRESS_LEFT_TO_RIGHT); |
1104 | - gtk_widget_set_size_request(GTK_WIDGET(pd->pbar),0,PBAR_THICKNESS); |
1105 | - gtk_box_pack_start(GTK_BOX(pd->box),gtk_hseparator_new(),FALSE,FALSE,0); |
1106 | - gtk_box_pack_start(GTK_BOX(pd->box),pd->pbar,FALSE,FALSE,0); |
1107 | - gtk_box_pack_start(GTK_BOX(pd->box),gtk_hseparator_new(),FALSE,FALSE,0); |
1108 | - |
1109 | - } |
1110 | - |
1111 | - gtk_widget_show_all(GTK_WIDGET(plugin)); |
1112 | - |
1113 | -} |
1114 | - |
1115 | -/** |
1116 | - * Callback for orientation change of panel. Just calls add_pbar. |
1117 | -**/ |
1118 | -static void orient_change(XfcePanelPlugin *plugin, GtkOrientation orient, plugin_data *pd){ |
1119 | - |
1120 | - add_pbar(plugin,pd); |
1121 | -} |
1122 | - |
1123 | -/** |
1124 | - * Loads the settings and alarm list from a keyfile, saves the |
1125 | - * alarm list in the linked list pd->alarm_list |
1126 | -**/ |
1127 | -static void load_settings(plugin_data *pd) |
1128 | -{ |
1129 | - |
1130 | - gchar groupname[8]; |
1131 | - const gchar *timerstring; |
1132 | - gint groupnum,time; |
1133 | - gboolean is_cd; |
1134 | - alarm_t *alrm; |
1135 | - |
1136 | - XfceRc *rc; |
1137 | - |
1138 | - //if ((file=xfce_panel_plugin_lookup_rc_file (pd->base)) != NULL) { |
1139 | - |
1140 | - |
1141 | - if (g_file_test(pd->configfile,G_FILE_TEST_EXISTS)) { |
1142 | - |
1143 | - rc = xfce_rc_simple_open (pd->configfile, TRUE); |
1144 | - |
1145 | - |
1146 | - if (rc != NULL) |
1147 | - { |
1148 | - |
1149 | - |
1150 | - groupnum=0; |
1151 | - g_sprintf(groupname,"G0"); |
1152 | - |
1153 | - |
1154 | - while(xfce_rc_has_group(rc,groupname)){ |
1155 | - |
1156 | - xfce_rc_set_group(rc,groupname); |
1157 | - |
1158 | - alrm = g_new0 (alarm_t,1); |
1159 | - pd->alarm_list = g_list_append(pd->alarm_list, alrm); |
1160 | - |
1161 | - timerstring=(gchar *)xfce_rc_read_entry(rc,"timername","No name"); |
1162 | - alrm->name = g_strdup(timerstring); |
1163 | - |
1164 | - timerstring=(gchar *)xfce_rc_read_entry(rc,"timercommand",""); |
1165 | - alrm->command = g_strdup(timerstring); |
1166 | - |
1167 | - timerstring=(gchar *)xfce_rc_read_entry(rc,"timerinfo",""); |
1168 | - alrm->info = g_strdup(timerstring); |
1169 | - |
1170 | - is_cd=xfce_rc_read_bool_entry(rc,"is_countdown",TRUE); |
1171 | - alrm->iscountdown = is_cd; |
1172 | - |
1173 | - time=xfce_rc_read_int_entry(rc,"time",0); |
1174 | - alrm->time = time; |
1175 | - |
1176 | - /* Include a link to the whole data */ |
1177 | - alrm->pd = (gpointer) pd; |
1178 | - |
1179 | - groupnum++; |
1180 | - g_snprintf(groupname,5,"G%d",groupnum); |
1181 | - |
1182 | - } /* end of while loop */ |
1183 | - |
1184 | - pd->count=groupnum; |
1185 | - |
1186 | - |
1187 | - /* Read other options */ |
1188 | - if(xfce_rc_has_group(rc,"others")){ |
1189 | - xfce_rc_set_group(rc,"others"); |
1190 | - pd->nowin_if_alarm= xfce_rc_read_bool_entry |
1191 | - (rc,"nowin_if_alarm",FALSE); |
1192 | - pd->selecting_starts= xfce_rc_read_bool_entry |
1193 | - (rc,"selecting_starts",FALSE); |
1194 | - pd->use_global_command= xfce_rc_read_bool_entry |
1195 | - (rc,"use_global_command",FALSE); |
1196 | - |
1197 | - if(pd->global_command) g_free(pd->global_command); |
1198 | - pd->global_command = g_strdup((gchar *)xfce_rc_read_entry |
1199 | - (rc,"global_command","")); |
1200 | - |
1201 | - pd->repeat_alarm= xfce_rc_read_bool_entry |
1202 | - (rc,"repeat_alarm",FALSE); |
1203 | - pd->repetitions= xfce_rc_read_int_entry |
1204 | - (rc,"repetitions",1); |
1205 | - pd->repeat_interval= xfce_rc_read_int_entry |
1206 | - (rc,"repeat_interval",10); |
1207 | - |
1208 | - } |
1209 | - |
1210 | - add_pbar(pd->base,pd); |
1211 | - |
1212 | - xfce_rc_close(rc); |
1213 | - } |
1214 | - |
1215 | -// } |
1216 | - } |
1217 | - |
1218 | -} |
1219 | - |
1220 | - |
1221 | -/** |
1222 | - * Saves the list to a keyfile, backup a permanent copy |
1223 | -**/ |
1224 | -static void save_settings(XfcePanelPlugin *plugin, plugin_data *pd){ |
1225 | - |
1226 | - gchar groupname[8]; |
1227 | - gint row_count; |
1228 | - GList *list; |
1229 | - alarm_t *alrm; |
1230 | - FILE *conffile; |
1231 | - XfceRc *rc; |
1232 | - gchar *file, *contents=NULL; |
1233 | - |
1234 | - if (!(file = xfce_panel_plugin_save_location (plugin, TRUE))) |
1235 | - return; |
1236 | - |
1237 | - // We do this to start a fresh config file, otherwise if the old config file is longer, |
1238 | - // the tail will not get truncated. See |
1239 | - // http://bugzilla.xfce.org/show_bug.cgi?id=2647 |
1240 | - // for a related bug report. |
1241 | - conffile = fopen(file,"w"); |
1242 | - if (conffile) |
1243 | - fclose(conffile); |
1244 | - |
1245 | - rc = xfce_rc_simple_open (file, FALSE); |
1246 | - |
1247 | - if (!rc) |
1248 | - return; |
1249 | - |
1250 | - list = pd->alarm_list; |
1251 | - |
1252 | - row_count = 0; |
1253 | - |
1254 | - while (list){ |
1255 | - |
1256 | - g_snprintf(groupname,7,"G%d",row_count); |
1257 | - |
1258 | - xfce_rc_set_group(rc,groupname); |
1259 | - |
1260 | - alrm = (alarm_t *) list->data; |
1261 | - |
1262 | - xfce_rc_write_entry(rc,"timername",alrm->name); |
1263 | - |
1264 | - xfce_rc_write_int_entry(rc,"time",alrm->time); |
1265 | - |
1266 | - xfce_rc_write_entry(rc,"timercommand",alrm->command); |
1267 | - |
1268 | - xfce_rc_write_entry(rc,"timerinfo",alrm->info); |
1269 | - |
1270 | - xfce_rc_write_bool_entry(rc,"is_countdown",alrm->iscountdown); |
1271 | - |
1272 | - row_count ++; |
1273 | - list = list->next; |
1274 | - } |
1275 | - |
1276 | - |
1277 | - /* save the other options */ |
1278 | - xfce_rc_set_group(rc,"others"); |
1279 | - |
1280 | - xfce_rc_write_bool_entry(rc,"nowin_if_alarm",pd->nowin_if_alarm); |
1281 | - xfce_rc_write_bool_entry(rc,"selecting_starts",pd->selecting_starts); |
1282 | - xfce_rc_write_bool_entry(rc,"use_global_command",pd->use_global_command); |
1283 | - xfce_rc_write_entry(rc,"global_command",pd->global_command); |
1284 | - xfce_rc_write_bool_entry(rc,"repeat_alarm",pd->repeat_alarm); |
1285 | - xfce_rc_write_int_entry(rc,"repetitions",pd->repetitions); |
1286 | - xfce_rc_write_int_entry(rc,"repeat_interval",pd->repeat_interval); |
1287 | - |
1288 | - xfce_rc_close(rc); |
1289 | - |
1290 | - conffile = fopen (pd->configfile,"w"); |
1291 | - /* We backup a permanent copy, which we'll use to load settings */ |
1292 | - if (conffile && g_file_get_contents(file,&contents,NULL,NULL)){ |
1293 | - fputs(contents,conffile); |
1294 | - fclose(conffile); |
1295 | - } |
1296 | - |
1297 | - g_free(file); |
1298 | - if(contents) |
1299 | - g_free(contents); |
1300 | - |
1301 | -} |
1302 | - |
1303 | - |
1304 | -/** |
1305 | - * Activates the Edit and Remove buttons when an item in the list is selected |
1306 | -**/ |
1307 | - |
1308 | -static void tree_selected (GtkTreeSelection *select, gpointer data){ |
1309 | - |
1310 | - plugin_data *pd=(plugin_data *)data; |
1311 | - |
1312 | - gtk_widget_set_sensitive(pd->buttonedit,TRUE); |
1313 | - gtk_widget_set_sensitive(pd->buttonremove,TRUE); |
1314 | - gtk_widget_set_sensitive(pd->buttonup,TRUE); |
1315 | - gtk_widget_set_sensitive(pd->buttondown,TRUE); |
1316 | - |
1317 | -} |
1318 | - |
1319 | - |
1320 | -/******************/ |
1321 | -/* plugin_free */ |
1322 | -/******************/ |
1323 | - |
1324 | -static void |
1325 | -plugin_free (XfcePanelPlugin *plugin, plugin_data *pd) |
1326 | -{ |
1327 | - |
1328 | - /* remove timeouts */ |
1329 | - if (pd->timeout!=0) g_source_remove(pd->timeout); |
1330 | - if (pd->repeat_timeout!=0) g_source_remove(pd->repeat_timeout); |
1331 | - |
1332 | - /*save_settings(pd);*/ |
1333 | - |
1334 | - if(pd->timer) |
1335 | - g_timer_destroy(pd->timer); |
1336 | - |
1337 | - if(pd->active_timer_name) |
1338 | - g_free(pd->active_timer_name); |
1339 | - |
1340 | - if(pd->timeout_command) |
1341 | - g_free(pd->timeout_command); |
1342 | - |
1343 | - if(pd->global_command) |
1344 | - g_free(pd->global_command); |
1345 | - |
1346 | - if(pd->configfile) |
1347 | - g_free(pd->configfile); |
1348 | - |
1349 | - if(pd->liststore) { |
1350 | - gtk_list_store_clear (pd->liststore); |
1351 | - //g_free (pd->liststore); |
1352 | - } |
1353 | - |
1354 | - if(pd->alarm_list) |
1355 | - g_list_free (pd->alarm_list); |
1356 | - |
1357 | - /* destroy the tooltips */ |
1358 | - gtk_object_destroy(GTK_OBJECT(pd->tip)); |
1359 | - |
1360 | - /* destroy all widgets */ |
1361 | -#ifndef HAVE_XFCE48 |
1362 | - gtk_widget_destroy(GTK_WIDGET(pd->eventbox)); |
1363 | -#endif |
1364 | - |
1365 | - /* free the plugin data structure */ |
1366 | - g_free(pd); |
1367 | - |
1368 | - gtk_main_quit(); |
1369 | -} |
1370 | - |
1371 | -/***************************/ |
1372 | -/* options dialog response */ |
1373 | -/***************************/ |
1374 | -static void |
1375 | -options_dialog_response (GtkWidget *dlg, int reponse, plugin_data *pd) |
1376 | -{ |
1377 | - if(pd->global_command) |
1378 | - g_free(pd->global_command); |
1379 | - pd->global_command = g_strdup (gtk_entry_get_text((GtkEntry *)pd->glob_command_entry)); |
1380 | - gtk_widget_destroy (dlg); |
1381 | - xfce_panel_plugin_unblock_menu (pd->base); |
1382 | - save_settings(pd->base,pd); |
1383 | -} |
1384 | - |
1385 | -/** |
1386 | - * nowin_if_alarm toggle callback |
1387 | -**/ |
1388 | -static void toggle_nowin_if_alarm(GtkToggleButton *button, gpointer data){ |
1389 | - |
1390 | - plugin_data *pd=(plugin_data *)data; |
1391 | - |
1392 | - pd->nowin_if_alarm = gtk_toggle_button_get_active(button); |
1393 | - |
1394 | -} |
1395 | - |
1396 | -/** |
1397 | - * selecting_starts toggle callback |
1398 | -**/ |
1399 | -static void toggle_selecting_starts(GtkToggleButton *button, gpointer data){ |
1400 | - |
1401 | - plugin_data *pd=(plugin_data *)data; |
1402 | - |
1403 | - pd->selecting_starts = gtk_toggle_button_get_active(button); |
1404 | - |
1405 | -} |
1406 | -/** |
1407 | - * toggle_global_command toggle callback |
1408 | -**/ |
1409 | -static void toggle_global_command(GtkToggleButton *button, gpointer data){ |
1410 | - |
1411 | - plugin_data *pd=(plugin_data *)data; |
1412 | - |
1413 | - pd->use_global_command = gtk_toggle_button_get_active(button); |
1414 | - |
1415 | - gtk_widget_set_sensitive(pd->global_command_box,pd->use_global_command); |
1416 | - |
1417 | -} |
1418 | - |
1419 | -/** |
1420 | - * toggle_repeat_alarm toggle callback |
1421 | -**/ |
1422 | -static void toggle_repeat_alarm(GtkToggleButton *button, gpointer data){ |
1423 | - |
1424 | - plugin_data *pd=(plugin_data *)data; |
1425 | - |
1426 | - pd->repeat_alarm = gtk_toggle_button_get_active(button); |
1427 | - |
1428 | - gtk_widget_set_sensitive(pd->repeat_alarm_box,pd->repeat_alarm); |
1429 | - |
1430 | -} |
1431 | - |
1432 | -/** |
1433 | - * Spinbutton 1 (#of alarm repetitions |
1434 | - * value change callback |
1435 | -**/ |
1436 | -static void spin1_changed(GtkSpinButton *button, gpointer data){ |
1437 | - |
1438 | - plugin_data *pd=(plugin_data *)data; |
1439 | - |
1440 | - pd->repetitions = gtk_spin_button_get_value_as_int(button); |
1441 | - |
1442 | -} |
1443 | - |
1444 | -/** |
1445 | - * Spinbutton 1 (alarm repetition |
1446 | - * interval) value change callback |
1447 | -**/ |
1448 | -static void spin2_changed(GtkSpinButton *button, gpointer data){ |
1449 | - |
1450 | - plugin_data *pd=(plugin_data *)data; |
1451 | - |
1452 | - pd->repeat_interval = gtk_spin_button_get_value_as_int(button); |
1453 | - |
1454 | -} |
1455 | - |
1456 | -/** |
1457 | - * options dialog |
1458 | -**/ |
1459 | -static void plugin_create_options (XfcePanelPlugin *plugin,plugin_data *pd) { |
1460 | - |
1461 | - GtkWidget *vbox=gtk_vbox_new(FALSE,0); /*outermost box */ |
1462 | - GtkWidget *hbox=gtk_hbox_new(FALSE,0); /* holds the treeview and buttons */ |
1463 | - GtkWidget *buttonbox,*button,*sw,*tree,*spinbutton; |
1464 | - GtkTreeSelection *select; |
1465 | - GtkTreeViewColumn *column; |
1466 | - GtkWidget *dlg=NULL, *header=NULL; |
1467 | - GtkCellRenderer *renderer; |
1468 | - |
1469 | - |
1470 | - xfce_panel_plugin_block_menu (plugin); |
1471 | - |
1472 | - |
1473 | - |
1474 | -#ifdef HAVE_XFCE48 |
1475 | - header = xfce_titled_dialog_new_with_buttons (_("Xfce4 Timer Options"), |
1476 | - GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))), |
1477 | - GTK_DIALOG_DESTROY_WITH_PARENT | |
1478 | - GTK_DIALOG_NO_SEPARATOR, |
1479 | - GTK_STOCK_CLOSE, GTK_RESPONSE_OK, |
1480 | - NULL); |
1481 | - |
1482 | - dlg = header; |
1483 | -#else |
1484 | - header = xfce_create_header (NULL, _("Xfce4 Timer Options")); |
1485 | - |
1486 | - dlg = gtk_dialog_new_with_buttons (_("Xfce 4 Timer Plugin"), |
1487 | - GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))), |
1488 | - GTK_DIALOG_DESTROY_WITH_PARENT | |
1489 | - GTK_DIALOG_NO_SEPARATOR, |
1490 | - GTK_STOCK_CLOSE, GTK_RESPONSE_OK, |
1491 | - NULL); |
1492 | - |
1493 | - |
1494 | - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), header, |
1495 | - FALSE, TRUE, 0); |
1496 | -#endif |
1497 | - |
1498 | - g_signal_connect (dlg, "response", G_CALLBACK (options_dialog_response), |
1499 | - pd); |
1500 | - |
1501 | - gtk_container_set_border_width (GTK_CONTAINER(dlg), BORDER); |
1502 | - |
1503 | - gtk_widget_set_size_request (dlg, 650, -1); |
1504 | - gtk_window_set_position(GTK_WINDOW(header),GTK_WIN_POS_CENTER); |
1505 | - |
1506 | - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), vbox, |
1507 | - TRUE, TRUE, WIDGET_SPACING); |
1508 | - |
1509 | - |
1510 | - hbox = gtk_hbox_new(FALSE, BORDER); |
1511 | - gtk_box_pack_start(GTK_BOX(vbox),hbox,TRUE,TRUE,BORDER); |
1512 | - |
1513 | - sw = gtk_scrolled_window_new (NULL, NULL); |
1514 | - |
1515 | - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), |
1516 | - GTK_SHADOW_ETCHED_IN); |
1517 | - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), |
1518 | - GTK_POLICY_AUTOMATIC, |
1519 | - GTK_POLICY_AUTOMATIC); |
1520 | - |
1521 | - gtk_box_pack_start(GTK_BOX(hbox),sw,TRUE,TRUE,0); |
1522 | - |
1523 | - fill_liststore (pd,NULL); |
1524 | - |
1525 | - tree=gtk_tree_view_new_with_model(GTK_TREE_MODEL(pd->liststore)); |
1526 | - pd->tree=tree; |
1527 | - gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree), TRUE); |
1528 | - gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (tree)), |
1529 | - GTK_SELECTION_SINGLE); |
1530 | - |
1531 | - renderer = gtk_cell_renderer_text_new (); |
1532 | - column = gtk_tree_view_column_new_with_attributes (_("Timer name"), renderer, |
1533 | - "text", 1, NULL); |
1534 | - gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); |
1535 | - |
1536 | - |
1537 | - column = gtk_tree_view_column_new_with_attributes (_("Countdown period /\nAlarm time"), |
1538 | - renderer, "text", 2, NULL); |
1539 | - gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); |
1540 | - |
1541 | - column = gtk_tree_view_column_new_with_attributes (_("Alarm command"), renderer, |
1542 | - "text", 3, NULL); |
1543 | - gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); |
1544 | - |
1545 | - |
1546 | - if(tree) |
1547 | - gtk_container_add(GTK_CONTAINER(sw),tree); |
1548 | - |
1549 | - gtk_widget_set_size_request(GTK_WIDGET(sw),350,200); |
1550 | - |
1551 | - select = gtk_tree_view_get_selection (GTK_TREE_VIEW (pd->tree)); |
1552 | - gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE); |
1553 | - g_signal_connect (G_OBJECT (select), "changed", |
1554 | - G_CALLBACK(tree_selected), pd); |
1555 | - |
1556 | - |
1557 | - buttonbox=gtk_vbutton_box_new(); |
1558 | - gtk_button_box_set_layout(GTK_BUTTON_BOX(buttonbox),GTK_BUTTONBOX_START); |
1559 | - gtk_button_box_set_spacing(GTK_BUTTON_BOX(buttonbox),WIDGET_SPACING<<1); |
1560 | - gtk_box_pack_start(GTK_BOX(hbox),buttonbox,FALSE,FALSE,0); |
1561 | - |
1562 | - button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
1563 | - pd->buttonadd=button; |
1564 | - gtk_box_pack_start(GTK_BOX (buttonbox), button, FALSE, FALSE,WIDGET_SPACING<<1); |
1565 | - gtk_widget_set_sensitive(button,TRUE); |
1566 | - g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK(add_edit_clicked), pd); |
1567 | - |
1568 | - |
1569 | - button = gtk_button_new_from_stock (GTK_STOCK_EDIT); |
1570 | - pd->buttonedit=button; |
1571 | - gtk_box_pack_start(GTK_BOX (buttonbox), button, FALSE, FALSE,WIDGET_SPACING<<1); |
1572 | - gtk_widget_set_sensitive(button,FALSE); |
1573 | - g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK(add_edit_clicked), pd); |
1574 | - |
1575 | - button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
1576 | - pd->buttonremove=button; |
1577 | - gtk_box_pack_start(GTK_BOX (buttonbox), button, FALSE, FALSE,WIDGET_SPACING); |
1578 | - gtk_widget_set_sensitive(button,FALSE); |
1579 | - g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK(remove_clicked), pd); |
1580 | - |
1581 | - button = gtk_button_new_from_stock (GTK_STOCK_GO_UP); |
1582 | - pd->buttonup=button; |
1583 | - gtk_box_pack_start(GTK_BOX (buttonbox), button, FALSE, FALSE,WIDGET_SPACING); |
1584 | - gtk_widget_set_sensitive(button,FALSE); |
1585 | - g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK(up_clicked), pd); |
1586 | - |
1587 | - button = gtk_button_new_from_stock (GTK_STOCK_GO_DOWN); |
1588 | - pd->buttondown=button; |
1589 | - gtk_box_pack_start(GTK_BOX (buttonbox), button, FALSE, FALSE,WIDGET_SPACING); |
1590 | - gtk_widget_set_sensitive(button,FALSE); |
1591 | - g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK(down_clicked), pd); |
1592 | - |
1593 | - gtk_widget_set_size_request(hbox,-1,-1); |
1594 | - |
1595 | - gtk_box_pack_start(GTK_BOX(vbox),gtk_hseparator_new(),FALSE,FALSE,BORDER); |
1596 | - |
1597 | - button=gtk_check_button_new_with_label(_("Don't display a warning if an alarm command is set")); |
1598 | - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),pd->nowin_if_alarm); |
1599 | - g_signal_connect(G_OBJECT(button),"toggled",G_CALLBACK(toggle_nowin_if_alarm),pd); |
1600 | - gtk_box_pack_start(GTK_BOX(vbox),button,FALSE,FALSE,WIDGET_SPACING); |
1601 | - |
1602 | - button=gtk_check_button_new_with_label(_("Selecting a timer starts it")); |
1603 | - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),pd->selecting_starts); |
1604 | - g_signal_connect(G_OBJECT(button),"toggled",G_CALLBACK(toggle_selecting_starts),pd); |
1605 | - gtk_box_pack_start(GTK_BOX(vbox),button,FALSE,FALSE,WIDGET_SPACING); |
1606 | - |
1607 | - gtk_box_pack_start(GTK_BOX(vbox),gtk_hseparator_new(),FALSE,FALSE,BORDER); |
1608 | - |
1609 | - /* Default alarm command config */ |
1610 | - button=gtk_check_button_new_with_label(_("Use a default alarm command")); |
1611 | - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),pd->use_global_command); |
1612 | - g_signal_connect(G_OBJECT(button),"toggled",G_CALLBACK(toggle_global_command),pd); |
1613 | - gtk_box_pack_start(GTK_BOX(vbox),button,FALSE,FALSE,WIDGET_SPACING); |
1614 | - |
1615 | - hbox = gtk_hbox_new (FALSE,0); |
1616 | - pd->global_command_box=hbox; |
1617 | - gtk_box_pack_start(GTK_BOX(hbox),gtk_label_new(_("Default command: ")),FALSE,FALSE,0); |
1618 | - pd->glob_command_entry = (GtkWidget *) gtk_entry_new(); |
1619 | - gtk_widget_set_size_request(pd->glob_command_entry,400,-1); |
1620 | - gtk_entry_set_text(GTK_ENTRY(pd->glob_command_entry), pd->global_command); |
1621 | - gtk_box_pack_start(GTK_BOX(hbox),pd->glob_command_entry,FALSE,FALSE,10); |
1622 | - |
1623 | - gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,WIDGET_SPACING); |
1624 | - gtk_widget_set_sensitive(hbox,pd->use_global_command); |
1625 | - |
1626 | - gtk_box_pack_start(GTK_BOX(vbox),gtk_hseparator_new(),FALSE,FALSE,BORDER); |
1627 | - |
1628 | - /* Alarm repetitions config */ |
1629 | - button=gtk_check_button_new_with_label(_("Repeat the alarm command")); |
1630 | - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),pd->repeat_alarm); |
1631 | - g_signal_connect(G_OBJECT(button),"toggled",G_CALLBACK(toggle_repeat_alarm),pd); |
1632 | - gtk_box_pack_start(GTK_BOX(vbox),button,FALSE,FALSE,WIDGET_SPACING); |
1633 | - |
1634 | - hbox = gtk_hbox_new (FALSE,0); |
1635 | - pd->repeat_alarm_box=hbox; |
1636 | - gtk_box_pack_start(GTK_BOX(hbox),gtk_label_new(_("Number of repetitions")),FALSE,FALSE,0); |
1637 | - spinbutton=gtk_spin_button_new_with_range(1,50,1); |
1638 | - pd->spin_repeat=spinbutton; |
1639 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbutton), pd->repetitions); |
1640 | - g_signal_connect(G_OBJECT(spinbutton),"value-changed", G_CALLBACK(spin1_changed), pd); |
1641 | - gtk_box_pack_start(GTK_BOX(hbox),spinbutton,FALSE,FALSE,10); |
1642 | - gtk_box_pack_start(GTK_BOX(hbox),gtk_label_new(_(" Time interval (sec.)")),FALSE,FALSE,0); |
1643 | - spinbutton=gtk_spin_button_new_with_range(1,600,1); |
1644 | - pd->spin_interval=spinbutton; |
1645 | - gtk_box_pack_start(GTK_BOX(hbox),spinbutton,FALSE,FALSE,10); |
1646 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbutton), pd->repeat_interval); |
1647 | - g_signal_connect(G_OBJECT(spinbutton),"value-changed", G_CALLBACK(spin2_changed), pd); |
1648 | - |
1649 | - gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,WIDGET_SPACING); |
1650 | - gtk_widget_set_sensitive(hbox,pd->repeat_alarm); |
1651 | - |
1652 | - |
1653 | - |
1654 | - gtk_widget_show_all(GTK_WIDGET(dlg)); |
1655 | - |
1656 | -} |
1657 | - |
1658 | -/** |
1659 | - * Show the "About" window |
1660 | -**/ |
1661 | -static void show_about_window(XfcePanelPlugin *plugin, plugin_data *pd) |
1662 | -{ |
1663 | - GdkPixbuf *icon; |
1664 | - const gchar *author[] = { "Kemal Ilgar Eroğlu <ilgar_eroglu@yahoo.com>", NULL}; |
1665 | - const gchar *translators = |
1666 | -"Mohammad Alhargan <malham1@hotmail.com> \n\ |
1667 | -Marcos Antonio Alvarez Costales <marcoscostales@gmail.com> \n\ |
1668 | -Harald Servat <redcrash@gmail.com> \n\ |
1669 | -Michal Várady <miko.vaji@gmail.com>\n\ |
1670 | -Per Kongstad <p_kongstad@op.pl>\n\ |
1671 | -Simon Schneider <simon@schneiderimtal.de>\n\ |
1672 | -Efstathios Iosifidis <iosifidis@opensuse.org>\n\ |
1673 | -Jeff Bailes <thepizzaking@gmail.com>\n\ |
1674 | -Sergio <oigres200@gmail.com>\n\ |
1675 | -Piarres Beobide <pi@beobide.net>\n\ |
1676 | -Maximilian Schleiss <maximilian@xfce.org>\n\ |
1677 | -Leandro Regueiro <leandro.regueiro@gmail.com>\n\ |
1678 | -Ivica Kolić <ikoli@yahoo.com>\n\ |
1679 | -Gabor Kelemen <kelemeng at gnome dot hu>\n\ |
1680 | -Andhika Padmawan <andhika.padmawan@gmail.com>\n\ |
1681 | -Cristian Marchi <cri.penta@gmail.com>\n\ |
1682 | -Nobuhiro Iwamatsu <iwamatsu@nigauri.org>\n\ |
1683 | -Seong-ho Cho <darkcircle.0426@gmail.com>\n\ |
1684 | -Rihards Priedītis <rprieditis@inbox.lv>\n\ |
1685 | -Pjotr <pjotrvertaalt@gmail.com>\n\ |
1686 | -Piotr Sokół <piotr.sokol@10g.pl>\n\ |
1687 | -Sérgio Marques <smarquespt@gmail.com>\n\ |
1688 | -Rafael Ferreira <rafael.f.f1@gmail.com>\n\ |
1689 | -Dima Smirnov <arch@cnc-parts.info>\n\ |
1690 | -Tomáš Vadina <kyberdev@gmail.com>\n\ |
1691 | -Besnik Bleta <besnik@programeshqip.org>\n\ |
1692 | -Саша Петровић <salepetronije@gmail.com>\n\ |
1693 | -Daniel Nylander <po@danielnylander.se>\n\ |
1694 | -Kemal Ilgar Eroğlu <ilgar_eroglu@yahoo.com>\n\ |
1695 | -Gheyret T.Kenji <gheyret@gmail.com>\n\ |
1696 | -Dmitry Nikitin <luckas_fb@mail.ru>\n\ |
1697 | -Muhammad Ali Makki <makki.ma@gmail.com>\n\ |
1698 | -Hunt Xu <huntxu@live.cn>\n\ |
1699 | -Cheng-Chia Tseng <pswo10680@gmail.com>\n"; |
1700 | - |
1701 | - icon = xfce_panel_pixbuf_from_source("xfce4-timer", NULL, 48); |
1702 | - gtk_show_about_dialog(NULL, |
1703 | - "title", _("About xfce4-timer-plugin"), |
1704 | - "logo", icon, |
1705 | - "license", xfce_get_license_text (XFCE_LICENSE_TEXT_GPL), |
1706 | - "version", PACKAGE_VERSION, |
1707 | - "program-name", PACKAGE_NAME, |
1708 | - "comments", _("A plugin to define countdown timers or alarms at given times."), |
1709 | - "website", "http://goodies.xfce.org/projects/panel-plugins/xfce4-timer-plugin", |
1710 | - "copyright", _("Copyright (c) 2005-2013\n"), |
1711 | - "authors", author, |
1712 | - "translator-credits" , translators, |
1713 | - NULL); |
1714 | - |
1715 | - if(icon) |
1716 | - g_object_unref(G_OBJECT(icon)); |
1717 | -} |
1718 | - |
1719 | -/** |
1720 | - * create_sample_control |
1721 | - * |
1722 | - * Create a new instance of the plugin. |
1723 | - * |
1724 | - * @control : #Control parent container |
1725 | - * |
1726 | - * Returns %TRUE on success, %FALSE on failure. |
1727 | - **/ |
1728 | - |
1729 | -static void create_plugin_control (XfcePanelPlugin *plugin) |
1730 | -{ |
1731 | - |
1732 | - GtkWidget *base,*menu,*socket,*menuitem,*box,*pbar2; |
1733 | - GtkTooltips *tooltip; |
1734 | - char command[1024]; |
1735 | - gchar *filename,*pathname; |
1736 | - |
1737 | - xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8"); |
1738 | - |
1739 | - plugin_data *pd=g_new0(plugin_data,1); |
1740 | - |
1741 | - pd->base=plugin; |
1742 | - pd->count=0; |
1743 | - pd->pbar=gtk_progress_bar_new(); |
1744 | - pd->liststore=gtk_list_store_new(4, |
1745 | - G_TYPE_POINTER, /* Column 0: GList alarm list node */ |
1746 | - G_TYPE_STRING, /* Column 1: Name */ |
1747 | - G_TYPE_STRING, /* Column 2: Timer period/alarm time - info string */ |
1748 | - G_TYPE_STRING); /* Command to run */ |
1749 | - |
1750 | -#ifndef HAVE_XFCE48 |
1751 | - pd->eventbox = gtk_event_box_new(); |
1752 | -#endif |
1753 | - pd->box=NULL; |
1754 | - pd->timer_on=FALSE; |
1755 | - pd->timeout=0; |
1756 | - pd->buttonadd=NULL; |
1757 | - pd->buttonedit=NULL; |
1758 | - pd->buttonremove=NULL; |
1759 | - pd->menu=NULL; |
1760 | - pd->tip=gtk_tooltips_new(); |
1761 | - pd->timeout_command=NULL; |
1762 | - pd->timer=NULL; |
1763 | - pd->active_timer_name = g_strdup(""); |
1764 | - pd->nowin_if_alarm=FALSE; |
1765 | - pd->selecting_starts=FALSE; |
1766 | - pd->repeat_alarm=FALSE; |
1767 | - pd->is_paused=FALSE; |
1768 | - pd->is_countdown=TRUE; |
1769 | - pd->use_global_command = FALSE; |
1770 | - pd->glob_command_entry = NULL; |
1771 | - pd->global_command = g_strdup(""); /* For Gtk >= 3.4 one could just set = NULL */ |
1772 | - pd->global_command_box = NULL; |
1773 | - pd->repeat_alarm_box=NULL; |
1774 | - pd->repetitions=1; |
1775 | - pd->rem_repetitions=1; |
1776 | - pd->repeat_interval=10; |
1777 | - pd->alarm_repeating=FALSE; |
1778 | - pd->repeat_timeout=0; |
1779 | - pd->alarm_list = NULL; |
1780 | - pd->selected=NULL; |
1781 | - |
1782 | - gtk_tooltips_set_tip(pd->tip, GTK_WIDGET(plugin), "", NULL); |
1783 | - gtk_tooltips_disable(pd->tip); |
1784 | - |
1785 | - |
1786 | - g_object_ref(pd->liststore); |
1787 | - |
1788 | - filename = xfce_panel_plugin_save_location (pd->base,TRUE); |
1789 | - pathname = g_path_get_dirname (filename); |
1790 | - pd->configfile = g_strconcat (pathname,"/XfceTimer.rc",NULL); |
1791 | - g_free(filename); |
1792 | - g_free(pathname); |
1793 | - |
1794 | - load_settings(pd); |
1795 | - pd->selected = pd->alarm_list; |
1796 | - |
1797 | - gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR(pd->pbar), |
1798 | - GTK_PROGRESS_CONTINUOUS); |
1799 | - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pd->pbar),0); |
1800 | - |
1801 | - add_pbar(pd->base,pd); |
1802 | - |
1803 | - /* Trying to get a thin box, but no way */ |
1804 | - gtk_widget_set_size_request(GTK_WIDGET(plugin),10,10); |
1805 | - xfce_panel_plugin_set_expand(plugin,FALSE); |
1806 | - |
1807 | -#ifdef HAVE_XFCE48 |
1808 | - g_signal_connect (G_OBJECT(plugin), "button_press_event", |
1809 | - G_CALLBACK(pbar_clicked), pd); |
1810 | -#else |
1811 | - gtk_container_add(GTK_CONTAINER(plugin),pd->eventbox); |
1812 | - g_signal_connect (G_OBJECT(pd->eventbox), "button_press_event", |
1813 | - G_CALLBACK(pbar_clicked), pd); |
1814 | -#endif |
1815 | - |
1816 | - gtk_widget_show_all(GTK_WIDGET(plugin)); |
1817 | - |
1818 | - g_signal_connect (plugin, "free-data", |
1819 | - G_CALLBACK (plugin_free), pd); |
1820 | - |
1821 | - g_signal_connect (plugin, "save", |
1822 | - G_CALLBACK (save_settings), pd); |
1823 | - |
1824 | - g_signal_connect (plugin, "orientation-changed", |
1825 | - G_CALLBACK (orient_change), pd); |
1826 | - |
1827 | - xfce_panel_plugin_menu_show_configure (plugin); |
1828 | - g_signal_connect (plugin, "configure-plugin", |
1829 | - G_CALLBACK (plugin_create_options), pd); |
1830 | - |
1831 | - xfce_panel_plugin_menu_show_about(plugin); |
1832 | - g_signal_connect (plugin, "about", G_CALLBACK (show_about_window), pd); |
1833 | - |
1834 | -} |
1835 | - |
1836 | - |
1837 | |
1838 | === removed directory '.pc/02_fix-format-string.patch' |
1839 | === removed directory '.pc/02_fix-format-string.patch/src' |
1840 | === removed file '.pc/02_fix-format-string.patch/src/xfcetimer.c' |
1841 | --- .pc/02_fix-format-string.patch/src/xfcetimer.c 2013-05-22 21:42:15 +0000 |
1842 | +++ .pc/02_fix-format-string.patch/src/xfcetimer.c 1970-01-01 00:00:00 +0000 |
1843 | @@ -1,1813 +0,0 @@ |
1844 | -/* |
1845 | - * |
1846 | - * Copyright (C) 2005 Kemal Ilgar Eroglu <kieroglu@math.washington.edu> |
1847 | - * |
1848 | - * This program is free software; you can redistribute it and/or modify |
1849 | - * it under the terms of the GNU General Public License as published by |
1850 | - * the Free Software Foundation; either version 2 of the License, or |
1851 | - * (at your option) any later version. |
1852 | - * |
1853 | - * This program is distributed in the hope that it will be useful, |
1854 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1855 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1856 | - * GNU Library General Public License for more details. |
1857 | - * |
1858 | - * You should have received a copy of the GNU General Public License |
1859 | - * along with this program; if not, write to the Free Software |
1860 | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1861 | - */ |
1862 | - |
1863 | - |
1864 | -#define UPDATE_INTERVAL 2000 /* Countdown update period in |
1865 | - milliseconds */ |
1866 | -#define PBAR_THICKNESS 10 |
1867 | - |
1868 | -#define BORDER 8 |
1869 | -#define WIDGET_SPACING 2 |
1870 | - |
1871 | -#ifdef HAVE_CONFIG_H |
1872 | -#include <config.h> |
1873 | -#endif |
1874 | - |
1875 | -#include <stdio.h> |
1876 | -#include <stdlib.h> |
1877 | -#include <time.h> |
1878 | -#include <string.h> |
1879 | - |
1880 | -#include <gtk/gtk.h> |
1881 | - |
1882 | -#include <libxfce4util/libxfce4util.h> |
1883 | -#ifdef HAVE_XFCE48 |
1884 | -#include <libxfce4ui/libxfce4ui.h> |
1885 | -#include <libxfce4panel/libxfce4panel.h> |
1886 | -#else |
1887 | -#include <libxfcegui4/xfce_iconbutton.h> |
1888 | -#include <libxfce4panel/xfce-panel-plugin.h> |
1889 | -#include <libxfcegui4/dialogs.h> |
1890 | -#endif |
1891 | - |
1892 | -#include "xfcetimer.h" |
1893 | - |
1894 | -static void create_plugin_control (XfcePanelPlugin *plugin); |
1895 | - |
1896 | -static void start_stop_selected (GtkWidget* menuitem, gpointer |
1897 | - data); |
1898 | -XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(create_plugin_control); |
1899 | - |
1900 | -void make_menu(plugin_data *pd); |
1901 | - |
1902 | -/** |
1903 | - * This is the timeout function that |
1904 | - * repeats the alarm. |
1905 | -**/ |
1906 | -static gboolean repeat_alarm (gpointer data){ |
1907 | - |
1908 | - plugin_data *pd=(plugin_data *)data; |
1909 | - |
1910 | - /* Don't repeat anymore */ |
1911 | - if(pd->rem_repetitions == 0){ |
1912 | - |
1913 | - if(pd->timeout_command) |
1914 | - g_free(pd->timeout_command); |
1915 | - pd->timeout_command=NULL; |
1916 | - pd->alarm_repeating=FALSE; |
1917 | - //make_menu(pd); |
1918 | - |
1919 | - return FALSE; |
1920 | - |
1921 | - |
1922 | - } |
1923 | - |
1924 | - g_spawn_command_line_async (pd->timeout_command,NULL); |
1925 | - pd->rem_repetitions = pd->rem_repetitions -1 ; |
1926 | - return TRUE; |
1927 | -} |
1928 | - |
1929 | -/** |
1930 | - * Fills in the pd->liststore to create the treeview |
1931 | - * in the options window. The second arguments indicates |
1932 | - * the alarm whose row will be highlighted in the |
1933 | - * treeview. If it is NULL, no action is taken. |
1934 | -**/ |
1935 | - |
1936 | -static void fill_liststore (plugin_data *pd, GList *selected) { |
1937 | - |
1938 | - GtkTreeIter iter; |
1939 | - GList *list; |
1940 | - alarm_t *alrm; |
1941 | - |
1942 | - if(pd->liststore) |
1943 | - gtk_list_store_clear (pd->liststore); |
1944 | - |
1945 | - list = pd->alarm_list; |
1946 | - |
1947 | - |
1948 | - while (list) { |
1949 | - |
1950 | - alrm = (alarm_t *) list->data; |
1951 | - |
1952 | - gtk_list_store_append (pd->liststore, &iter); |
1953 | - |
1954 | - gtk_list_store_set (pd->liststore, &iter, 0, list, 1, alrm->name, 2, alrm->info, 3, alrm->command,-1); |
1955 | - |
1956 | - /* We select the given row */ |
1957 | - if (selected && list == selected) |
1958 | - gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->tree)),&iter); |
1959 | - |
1960 | - list = g_list_next (list); |
1961 | - |
1962 | - } |
1963 | -} |
1964 | - |
1965 | -/** |
1966 | - * This is the update function that updates the |
1967 | - * tooltip, pbar and keeps track of elapsed time |
1968 | -**/ |
1969 | -static gboolean update_function (gpointer data){ |
1970 | - |
1971 | - plugin_data *pd=(plugin_data *)data; |
1972 | - gint elapsed_sec,remaining; |
1973 | - gchar *tiptext = NULL, *temp, *dialog_title, *dialog_message; |
1974 | - GtkWidget *dialog; |
1975 | - |
1976 | - elapsed_sec=(gint)g_timer_elapsed(pd->timer,NULL); |
1977 | - |
1978 | - /* If countdown is not over, update tooltip */ |
1979 | - if(elapsed_sec < pd->timeout_period_in_sec){ |
1980 | - |
1981 | - remaining=pd->timeout_period_in_sec-elapsed_sec; |
1982 | - |
1983 | - if(remaining>=3600) |
1984 | - tiptext = g_strdup_printf(_("%dh %dm %ds left"),remaining/3600, (remaining%3600)/60, |
1985 | - remaining%60); |
1986 | - else if (remaining>=60) |
1987 | - tiptext = g_strdup_printf(_("%dm %ds left"),remaining/60, remaining%60); |
1988 | - else |
1989 | - tiptext = g_strdup_printf(_("%ds left"),remaining); |
1990 | - |
1991 | - if(pd->is_paused) { |
1992 | - temp = g_strconcat(tiptext,_(" (Paused)"),NULL); |
1993 | - g_free (tiptext); |
1994 | - tiptext = temp; |
1995 | - } |
1996 | - gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(pd->pbar), |
1997 | - 1.0-((gdouble)elapsed_sec)/pd->timeout_period_in_sec); |
1998 | - |
1999 | - gtk_tooltips_set_tip(pd->tip,GTK_WIDGET(pd->base),tiptext,NULL); |
2000 | - |
2001 | - g_free(tiptext); |
2002 | - |
2003 | - return TRUE; |
2004 | - |
2005 | - } |
2006 | - |
2007 | - /* Countdown is over, stop timer and free resources */ |
2008 | - g_snprintf(tiptext,31,_("%ds left"),0); |
2009 | - gtk_tooltips_set_tip(pd->tip,GTK_WIDGET(pd->base),tiptext,NULL); |
2010 | - |
2011 | - if( (strlen(pd->timeout_command)==0) || !pd->nowin_if_alarm ) { |
2012 | - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pd->pbar),1); |
2013 | - |
2014 | - /* Display the name of the alarm when the countdown ends */ |
2015 | - dialog_message = g_strdup_printf(_("Beeep! :) \nTime is up for the alarm %s."), pd->active_timer_name); |
2016 | - |
2017 | - dialog = gtk_message_dialog_new (NULL, |
2018 | - GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, |
2019 | - GTK_MESSAGE_WARNING, |
2020 | - GTK_BUTTONS_CLOSE, |
2021 | - dialog_message); |
2022 | - |
2023 | - g_signal_connect_swapped (dialog, "response", |
2024 | - G_CALLBACK (gtk_widget_destroy), |
2025 | - dialog); |
2026 | - |
2027 | - dialog_title = g_strdup_printf("Xfce4 Timer Plugin: %s", pd->active_timer_name); |
2028 | - gtk_window_set_title ((GtkWindow *) dialog, dialog_title); |
2029 | - |
2030 | - g_free(dialog_title); |
2031 | - g_free(dialog_message); |
2032 | - |
2033 | - gtk_widget_show(dialog); |
2034 | - } |
2035 | - |
2036 | - if(strlen(pd->timeout_command)>0) { |
2037 | - |
2038 | - g_spawn_command_line_async (pd->timeout_command,NULL); |
2039 | - |
2040 | - if(pd->repeat_alarm){ |
2041 | - pd->alarm_repeating=TRUE; |
2042 | - pd->rem_repetitions=pd->repetitions; |
2043 | - if(pd->repeat_timeout!=0) |
2044 | - g_source_remove(pd->repeat_timeout); |
2045 | - pd->repeat_timeout = g_timeout_add(pd->repeat_interval*1000,repeat_alarm,pd); |
2046 | - } |
2047 | - else |
2048 | - { |
2049 | - if(pd->timeout_command) |
2050 | - g_free(pd->timeout_command); |
2051 | - pd->timeout_command=NULL; |
2052 | - } |
2053 | - } |
2054 | - |
2055 | - if(pd->timer) |
2056 | - g_timer_destroy(pd->timer); |
2057 | - pd->timer=NULL; |
2058 | - |
2059 | - /* Disable tooltips, reset pbar */ |
2060 | - gtk_tooltips_set_tip(pd->tip,GTK_WIDGET(pd->base),"",NULL); |
2061 | - gtk_tooltips_disable(pd->tip); |
2062 | - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pd->pbar),0); |
2063 | - |
2064 | - pd->timeout=0; |
2065 | - |
2066 | - pd->timer_on=FALSE; |
2067 | - |
2068 | - //make_menu(pd); |
2069 | - |
2070 | - /* This function won't be called again */ |
2071 | - return FALSE; |
2072 | - |
2073 | -} |
2074 | - |
2075 | -/** |
2076 | - * This is the callback function called when a timer |
2077 | - * is selected in the popup menu |
2078 | -**/ |
2079 | - |
2080 | -//static void timer_selected (GtkWidget* menuitem, GdkEventButton *event, gpointer data){ |
2081 | -static void timer_selected (GtkWidget* menuitem, gpointer data){ |
2082 | - GList *list = (GList *) data; |
2083 | - alarm_t *alrm; |
2084 | - plugin_data *pd; |
2085 | - GtkRadioMenuItem *rmi; |
2086 | - |
2087 | - rmi = (GtkRadioMenuItem *) menuitem; |
2088 | - |
2089 | - // We do this to get rid of the (irrelevant) "activate" signals |
2090 | - // emitted by the first radio check button in the pop-up |
2091 | - // menu when the menu is created and also by the (deactivated) |
2092 | - // previous selection when a new selection is made. Another workaround |
2093 | - // is to listen to the button_press_event but it does not capture |
2094 | - // the Enter key press on the menuitem. |
2095 | - if(!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(rmi))) |
2096 | - return; |
2097 | - |
2098 | - alrm = (alarm_t *) list->data; |
2099 | - pd = (plugin_data *) alrm->pd; |
2100 | - |
2101 | - pd->selected = list; |
2102 | - |
2103 | - /* start the timer if the option to do so on selecting is set */ |
2104 | - if(pd->selecting_starts && !pd->timer_on) |
2105 | - start_stop_selected(menuitem,pd); |
2106 | - |
2107 | -} |
2108 | - |
2109 | -/** |
2110 | - * This is the callback function called when the |
2111 | - * start/stop item is selected in the popup menu |
2112 | -**/ |
2113 | - |
2114 | -static void start_stop_selected (GtkWidget* menuitem, gpointer |
2115 | - data){ |
2116 | - |
2117 | - plugin_data *pd=(plugin_data *)data; |
2118 | - GSList *group=NULL; |
2119 | - gchar temp[8]; |
2120 | - gint row_count,cur_h,cur_m,cur_s,time; |
2121 | - gint timeout_period; |
2122 | - gboolean is_cd; |
2123 | - GTimeVal timeval; |
2124 | - struct tm *current; |
2125 | - alarm_t *alrm; |
2126 | - |
2127 | - /* If counting down, we stop the timer and free the resources */ |
2128 | - if(pd->timer_on){ |
2129 | - |
2130 | - if(pd->timer) |
2131 | - g_timer_destroy(pd->timer); |
2132 | - if(pd->timeout) |
2133 | - g_source_remove(pd->timeout); |
2134 | - if(pd->timeout_command) |
2135 | - g_free(pd->timeout_command); |
2136 | - if(pd->active_timer_name) |
2137 | - g_free(pd->active_timer_name); |
2138 | - |
2139 | - pd->timer = NULL; |
2140 | - pd->timeout_command = NULL; |
2141 | - pd->active_timer_name = NULL; |
2142 | - pd->timeout = 0; |
2143 | - pd->timer_on = FALSE; |
2144 | - pd->is_paused = FALSE; |
2145 | - |
2146 | - /* Disable tooltips, reset pbar */ |
2147 | - gtk_tooltips_set_tip(pd->tip,GTK_WIDGET(pd->base),"",NULL); |
2148 | - gtk_tooltips_disable(pd->tip); |
2149 | - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pd->pbar),0); |
2150 | - |
2151 | - return; |
2152 | - |
2153 | - } |
2154 | - |
2155 | - /* If we're here then the timer is off, so we start it */ |
2156 | - |
2157 | - /* Empty timer list-> Nothing to do. pd->selected=0, though. */ |
2158 | - if(pd->selected == NULL) |
2159 | - return; |
2160 | - |
2161 | - alrm = (alarm_t *) pd->selected->data; |
2162 | - |
2163 | - /* Record the timer name */ |
2164 | - if (pd->active_timer_name) |
2165 | - g_free(pd->active_timer_name); |
2166 | - |
2167 | - pd->active_timer_name = g_strdup(alrm->name); /* It's freed next time |
2168 | - or at exit */ |
2169 | - if(pd->timeout_command) |
2170 | - g_free(pd->timeout_command); |
2171 | - |
2172 | - /* If an alarm command is set, it overrides the default (if any) */ |
2173 | - if (strlen(alrm->command)>0) |
2174 | - pd->timeout_command = g_strdup(alrm->command); /* It's freed next |
2175 | - time or at exit */ |
2176 | - else if (pd->use_global_command) |
2177 | - pd->timeout_command = g_strdup (pd->global_command); |
2178 | - else |
2179 | - pd->timeout_command = g_strdup(""); |
2180 | - |
2181 | - /* If it's a 24h type alarm, we find the difference with current time |
2182 | - Here 'time' is in minutes */ |
2183 | - if(!alrm->iscountdown) { |
2184 | - |
2185 | - g_get_current_time(&timeval); |
2186 | - current = localtime((time_t *)&timeval.tv_sec); |
2187 | - strftime(temp,7,"%H",current); |
2188 | - cur_h = atoi(temp); |
2189 | - strftime(temp,7,"%M",current); |
2190 | - cur_m = atoi(temp); |
2191 | - strftime(temp,7,"%S",current); |
2192 | - cur_s = atoi(temp); |
2193 | - |
2194 | - timeout_period = (alrm->time)*60 - ((60*cur_h + cur_m)*60 + cur_s); |
2195 | - |
2196 | - if(timeout_period <0) |
2197 | - timeout_period+= 24*60*60; |
2198 | - |
2199 | - pd->is_countdown = FALSE; |
2200 | - |
2201 | - } |
2202 | - /* Else 'pd->selected->time' already gives the countdown period in seconds */ |
2203 | - else { |
2204 | - |
2205 | - pd->is_countdown = TRUE; |
2206 | - timeout_period = alrm->time; |
2207 | - |
2208 | - } |
2209 | - pd->timeout_period_in_sec=timeout_period; |
2210 | - |
2211 | - /* start the timer */ |
2212 | - pd->timer=g_timer_new(); |
2213 | - pd->timer_on=TRUE; |
2214 | - |
2215 | - gtk_tooltips_set_tip(pd->tip, GTK_WIDGET(pd->base), alrm->info, NULL); |
2216 | - gtk_tooltips_enable(pd->tip); |
2217 | - |
2218 | - g_timer_start(pd->timer); |
2219 | - pd->timeout = g_timeout_add(UPDATE_INTERVAL, update_function,pd); |
2220 | - |
2221 | -} |
2222 | - |
2223 | -static void pause_resume_selected (GtkWidget* menuitem, gpointer |
2224 | - data){ |
2225 | - |
2226 | - plugin_data *pd=(plugin_data *)data; |
2227 | - |
2228 | - |
2229 | - /* If paused, we resume */ |
2230 | - if(pd->is_paused){ |
2231 | - |
2232 | - g_timer_continue(pd->timer); |
2233 | - pd->is_paused=FALSE; |
2234 | - |
2235 | - /* If we're here then the timer is runnig, so we pause */ |
2236 | - } else { |
2237 | - |
2238 | - pd->is_paused=TRUE; |
2239 | - g_timer_stop(pd->timer); |
2240 | - |
2241 | - } |
2242 | - |
2243 | - //make_menu(pd); |
2244 | - |
2245 | -} |
2246 | - |
2247 | -/** |
2248 | - * Callback when "Stop the alarm" is selected in the popup menu |
2249 | -**/ |
2250 | - |
2251 | -static void stop_repeating_alarm (GtkWidget* menuitem, gpointer |
2252 | - data){ |
2253 | - plugin_data *pd=(plugin_data *)data; |
2254 | - |
2255 | - g_source_remove(pd->repeat_timeout); |
2256 | - |
2257 | - pd->alarm_repeating=FALSE; |
2258 | - |
2259 | - if(pd->timeout_command){ |
2260 | - g_free(pd->timeout_command); |
2261 | - pd->timeout_command=NULL; |
2262 | - } |
2263 | - |
2264 | - //make_menu(pd); |
2265 | - |
2266 | -} |
2267 | - |
2268 | -/** |
2269 | - * Callback when clicking on pbar. Pops the menu up/down |
2270 | -**/ |
2271 | -static void pbar_clicked (GtkWidget *pbar, GdkEventButton *event, gpointer data){ |
2272 | - |
2273 | - plugin_data *pd=(plugin_data *)data; |
2274 | - |
2275 | - make_menu(pd); |
2276 | - |
2277 | - if(!pd->menu) |
2278 | - return; |
2279 | - |
2280 | - if(event->button==1) |
2281 | - gtk_menu_popup (GTK_MENU(pd->menu),NULL,NULL,NULL,NULL,event->button,event->time); |
2282 | - else |
2283 | - gtk_menu_popdown(GTK_MENU(pd->menu)); |
2284 | - |
2285 | -} |
2286 | - |
2287 | -/** |
2288 | - * This function generates the popup menu |
2289 | -**/ |
2290 | -void make_menu(plugin_data *pd){ |
2291 | - |
2292 | - GSList *group = NULL; |
2293 | - GList *list = NULL; |
2294 | - alarm_t *alrm; |
2295 | - GtkWidget *menuitem, *to_be_activated; |
2296 | - gchar *itemtext; |
2297 | - |
2298 | - |
2299 | - /* Destroy the existing one */ |
2300 | - if(pd->menu) |
2301 | - gtk_widget_destroy(pd->menu); |
2302 | - |
2303 | - pd->menu=gtk_menu_new(); |
2304 | - |
2305 | - /* If the alarm is paused, the only option is to resume or stop */ |
2306 | - if (pd->is_paused) { |
2307 | - menuitem=gtk_menu_item_new_with_label(_("Resume timer")); |
2308 | - |
2309 | - gtk_menu_shell_append (GTK_MENU_SHELL(pd->menu),menuitem); |
2310 | - g_signal_connect (G_OBJECT(menuitem),"activate", |
2311 | - G_CALLBACK(pause_resume_selected),pd); |
2312 | - gtk_widget_show(menuitem); |
2313 | - |
2314 | - menuitem=gtk_menu_item_new_with_label(_("Stop timer")); |
2315 | - |
2316 | - gtk_menu_shell_append (GTK_MENU_SHELL(pd->menu),menuitem); |
2317 | - g_signal_connect (G_OBJECT(menuitem),"activate", |
2318 | - G_CALLBACK(start_stop_selected),pd); |
2319 | - gtk_widget_show(menuitem); |
2320 | - gtk_widget_show(pd->menu); |
2321 | - return; |
2322 | - } |
2323 | - |
2324 | - list = pd->alarm_list; |
2325 | - |
2326 | - while (list){ |
2327 | - |
2328 | - /* Run through the list, read name and timer period info */ |
2329 | - |
2330 | - alrm = (alarm_t *) list->data; |
2331 | - |
2332 | - itemtext = g_strdup_printf("%s (%s)",alrm->name,alrm->info); |
2333 | - menuitem=gtk_radio_menu_item_new_with_label(group,itemtext); |
2334 | - gtk_menu_shell_append(GTK_MENU_SHELL(pd->menu),menuitem); |
2335 | - /* The selected timer is always active */ |
2336 | - if(list == pd->selected) |
2337 | - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),TRUE); |
2338 | - /* others are disabled when timer or alarm is already running */ |
2339 | - else if(pd->timer_on || pd->alarm_repeating) |
2340 | - gtk_widget_set_sensitive(GTK_WIDGET(menuitem),FALSE); |
2341 | - |
2342 | - group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem)); |
2343 | - g_signal_connect (G_OBJECT(menuitem),"activate", |
2344 | - G_CALLBACK(timer_selected),list); |
2345 | - |
2346 | - g_free(itemtext); |
2347 | - |
2348 | - list = list->next; |
2349 | - |
2350 | - } |
2351 | - |
2352 | - /* Horizontal line (empty item) */ |
2353 | - menuitem=gtk_menu_item_new(); |
2354 | - gtk_menu_shell_append(GTK_MENU_SHELL(pd->menu),menuitem); |
2355 | - |
2356 | - /* Pause menu item */ |
2357 | - if(pd->timer_on && !pd->is_paused && pd->is_countdown) { |
2358 | - menuitem=gtk_menu_item_new_with_label(_("Pause timer")); |
2359 | - |
2360 | - gtk_menu_shell_append (GTK_MENU_SHELL(pd->menu),menuitem); |
2361 | - g_signal_connect (G_OBJECT(menuitem),"activate", |
2362 | - G_CALLBACK(pause_resume_selected),pd); |
2363 | - |
2364 | - |
2365 | - } |
2366 | - |
2367 | - /* Start/stop menu item */ |
2368 | - if(!pd->alarm_repeating){ |
2369 | - if(pd->timer_on) |
2370 | - menuitem=gtk_menu_item_new_with_label(_("Stop timer")); |
2371 | - else |
2372 | - menuitem=gtk_menu_item_new_with_label(_("Start timer")); |
2373 | - |
2374 | - gtk_menu_shell_append (GTK_MENU_SHELL(pd->menu),menuitem); |
2375 | - g_signal_connect (G_OBJECT(menuitem),"activate", |
2376 | - G_CALLBACK(start_stop_selected),pd); |
2377 | - } |
2378 | - |
2379 | - /* Stop repeating alarm if so */ |
2380 | - if(pd->alarm_repeating) { |
2381 | - menuitem=gtk_menu_item_new_with_label(_("Stop the alarm")); |
2382 | - |
2383 | - gtk_menu_shell_append (GTK_MENU_SHELL(pd->menu),menuitem); |
2384 | - g_signal_connect (G_OBJECT(menuitem),"activate", |
2385 | - G_CALLBACK(stop_repeating_alarm),pd); |
2386 | - } |
2387 | - |
2388 | - gtk_widget_show_all(pd->menu); |
2389 | -} |
2390 | - |
2391 | - |
2392 | -/** |
2393 | - * Callback to the OK button in the Add window |
2394 | -**/ |
2395 | -static void ok_add(GtkButton *button, gpointer data){ |
2396 | - |
2397 | - alarm_data *adata = (alarm_data *)data; |
2398 | - alarm_t *newalarm; |
2399 | - GtkTreeIter iter; |
2400 | - gint t1,t2,t3,t; |
2401 | - gchar *timeinfo = NULL; |
2402 | - |
2403 | - /* Add item to the alarm list and liststore */ |
2404 | - |
2405 | - newalarm = g_new0(alarm_t,1); |
2406 | - newalarm->name = g_strdup(gtk_entry_get_text(GTK_ENTRY(adata->name))); |
2407 | - newalarm->command = g_strdup(gtk_entry_get_text(GTK_ENTRY(adata->command))); |
2408 | - newalarm->iscountdown = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(adata-> |
2409 | - rb1)); |
2410 | - newalarm->pd = (gpointer) adata->pd; |
2411 | - |
2412 | - adata->pd->alarm_list = g_list_append (adata->pd->alarm_list, newalarm); |
2413 | - |
2414 | - gtk_list_store_append(adata->pd->liststore,&iter); |
2415 | - |
2416 | - gtk_list_store_set(GTK_LIST_STORE(adata->pd->liststore),&iter, |
2417 | - 0,g_list_last(adata->pd->alarm_list), |
2418 | - 1,newalarm->name, |
2419 | - 3,newalarm->command, |
2420 | - -1); |
2421 | - /* Item count goes up by one */ |
2422 | - adata->pd->count=adata->pd->count+1; |
2423 | - |
2424 | - /* If the h-m-s format (countdown) was chosen, convert time to seconds, |
2425 | - save the choice into the list */ |
2426 | - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(adata->rb1))){ |
2427 | - |
2428 | - t1=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->timeh)); |
2429 | - t2=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->timem)); |
2430 | - t3=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->times)); |
2431 | - t=t1*3600+t2*60+t3; |
2432 | - |
2433 | - |
2434 | - |
2435 | - if(t1>0) |
2436 | - timeinfo = g_strdup_printf(_("%dh %dm %ds"),t1,t2,t3); |
2437 | - else if(t2>0) |
2438 | - timeinfo = g_strdup_printf(_("%dm %ds"),t2,t3); |
2439 | - else |
2440 | - timeinfo = g_strdup_printf(_("%ds"),t3); |
2441 | - |
2442 | - |
2443 | - } |
2444 | - else{ /* The 24h format (alarm at specified time). Save time in minutes */ |
2445 | - |
2446 | - t1=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->time_h)); |
2447 | - t2=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->time_m)); |
2448 | - t=t1*60+t2; |
2449 | - timeinfo = g_strdup_printf(_("At %02d:%02d"),t1,t2); |
2450 | - |
2451 | - } |
2452 | - |
2453 | - newalarm->time = t; |
2454 | - newalarm->info = timeinfo; |
2455 | - gtk_list_store_set(GTK_LIST_STORE(adata->pd->liststore),&iter,2,timeinfo,-1); |
2456 | - |
2457 | - |
2458 | - /* Free resources */ |
2459 | - gtk_widget_destroy(GTK_WIDGET(adata->window)); |
2460 | - |
2461 | - g_free(adata); |
2462 | -} |
2463 | - |
2464 | - |
2465 | - |
2466 | -/** |
2467 | - * Callback for OK button on Edit window. See ok_add for comments. |
2468 | -**/ |
2469 | -static void ok_edit(GtkButton *button, gpointer data){ |
2470 | - |
2471 | - alarm_data *adata = (alarm_data *)data; |
2472 | - GtkTreeIter iter; |
2473 | - gint t1,t2,t3,t; |
2474 | - gchar *timeinfo = NULL; |
2475 | - GList *list; |
2476 | - alarm_t *alrm; |
2477 | - GtkTreeSelection *select; |
2478 | - GtkTreeModel *model; |
2479 | - |
2480 | - select = gtk_tree_view_get_selection (GTK_TREE_VIEW (adata->pd->tree)); |
2481 | - |
2482 | - if (gtk_tree_selection_get_selected (select, &model, &iter)) |
2483 | - { |
2484 | - |
2485 | - gtk_tree_model_get(GTK_TREE_MODEL(adata->pd->liststore), &iter, 0, &list,-1); |
2486 | - alrm = (alarm_t *) list->data; |
2487 | - |
2488 | - alrm->name = g_strdup(gtk_entry_get_text(GTK_ENTRY(adata->name))); |
2489 | - alrm->command = g_strdup(gtk_entry_get_text(GTK_ENTRY(adata->command))); |
2490 | - alrm->iscountdown = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(adata-> |
2491 | - rb1)); |
2492 | - /* This should be unnecessary, but do it anyway */ |
2493 | - alrm->pd = (gpointer) adata->pd; |
2494 | - |
2495 | - gtk_list_store_set(GTK_LIST_STORE(adata->pd->liststore),&iter, |
2496 | - 1,alrm->name, |
2497 | - 3,alrm->command ,-1); |
2498 | - |
2499 | - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(adata->rb1))){ |
2500 | - |
2501 | - t1=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->timeh)); |
2502 | - t2=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->timem)); |
2503 | - t3=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->times)); |
2504 | - t=t1*3600+t2*60+t3; |
2505 | - |
2506 | - if(t1>0) |
2507 | - timeinfo = g_strdup_printf(_("%dh %dm %ds"),t1,t2,t3); |
2508 | - else if(t2>0) |
2509 | - timeinfo = g_strdup_printf(_("%dm %ds"),t2,t3); |
2510 | - else |
2511 | - timeinfo = g_strdup_printf(_("%ds"),t3); |
2512 | - |
2513 | - |
2514 | - } |
2515 | - else{ |
2516 | - |
2517 | - t1=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->time_h)); |
2518 | - t2=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(adata->time_m)); |
2519 | - t=t1*60+t2; |
2520 | - timeinfo = g_strdup_printf(_("At %02d:%02d"),t1,t2); |
2521 | - } |
2522 | - |
2523 | - alrm->time = t; |
2524 | - alrm->info = timeinfo; |
2525 | - gtk_list_store_set(GTK_LIST_STORE(adata->pd->liststore),&iter,2,timeinfo,-1); |
2526 | - |
2527 | - } |
2528 | - |
2529 | - //make_menu(adata->pd); |
2530 | - |
2531 | - gtk_widget_destroy(GTK_WIDGET(adata->window)); |
2532 | - |
2533 | - g_free(adata); |
2534 | -} |
2535 | - |
2536 | - |
2537 | - |
2538 | -/** |
2539 | - * Callback for cancelling Add and Edit. Just closes the window :). |
2540 | -**/ |
2541 | -static void cancel_add_edit(GtkButton *button, gpointer data){ |
2542 | - |
2543 | - alarm_data *adata=(alarm_data *)data; |
2544 | - |
2545 | - gtk_widget_destroy(GTK_WIDGET(adata->window)); |
2546 | - |
2547 | - g_free(adata); |
2548 | - |
2549 | -} |
2550 | - |
2551 | -/** |
2552 | - * Callback when first radio button in dialog has been selected. |
2553 | - */ |
2554 | -static void alarmdialog_countdown_toggled (GtkButton *button, gpointer data) |
2555 | -{ |
2556 | - alarm_data *adata = (alarm_data *) data; |
2557 | - gboolean active; |
2558 | - |
2559 | - active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)); |
2560 | - gtk_widget_set_sensitive(GTK_WIDGET(adata->timeh), active); |
2561 | - gtk_widget_set_sensitive(GTK_WIDGET(adata->timem), active); |
2562 | - gtk_widget_set_sensitive(GTK_WIDGET(adata->times), active); |
2563 | -} |
2564 | - |
2565 | -/** |
2566 | - * Callback when second radio button in dialog has been selected. |
2567 | - */ |
2568 | -static void alarmdialog_alarmtime_toggled (GtkButton *button, gpointer data) |
2569 | -{ |
2570 | - alarm_data *adata = (alarm_data *) data; |
2571 | - gboolean active; |
2572 | - |
2573 | - active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)); |
2574 | - gtk_widget_set_sensitive(GTK_WIDGET(adata->time_h), active); |
2575 | - gtk_widget_set_sensitive(GTK_WIDGET(adata->time_m), active); |
2576 | -} |
2577 | - |
2578 | -/** |
2579 | - * Callback to the Add button in options window. |
2580 | - * Creates the Add window. |
2581 | -**/ |
2582 | -static void add_edit_clicked (GtkButton *buttonn, gpointer data){ |
2583 | - |
2584 | - plugin_data *pd = (plugin_data *)data; |
2585 | - |
2586 | - GtkWindow *parent_window; |
2587 | - GtkWindow *window; |
2588 | - GtkLabel *label; |
2589 | - GtkEntry *name,*command; |
2590 | - GtkSpinButton *timeh,*timem,*times,*time_h,*time_m; |
2591 | - GtkRadioButton *rb1,*rb2; |
2592 | - GtkWidget *hbox,*vbox,*button; |
2593 | - alarm_data *adata=g_new0(alarm_data,1); |
2594 | - gchar *nc; gboolean is_cd; gint time; |
2595 | - GtkTreeIter iter; |
2596 | - GtkTreeSelection *select; |
2597 | - GtkTreeModel *model; |
2598 | - GList *list; |
2599 | - alarm_t *alrm; |
2600 | - |
2601 | - window = (GtkWindow *)gtk_window_new(GTK_WINDOW_TOPLEVEL); |
2602 | - |
2603 | - adata->window=window; |
2604 | - adata->pd=pd; |
2605 | - |
2606 | - gtk_window_set_modal(GTK_WINDOW(window),TRUE); |
2607 | - parent_window = (GtkWindow *) gtk_widget_get_toplevel(GTK_WIDGET(buttonn)); |
2608 | - if (gtk_widget_is_toplevel(GTK_WIDGET(parent_window))) |
2609 | - gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(parent_window)); |
2610 | - |
2611 | - vbox=gtk_vbox_new(FALSE, BORDER); |
2612 | - gtk_container_add(GTK_CONTAINER(window),vbox); |
2613 | - gtk_container_set_border_width(GTK_CONTAINER(window), BORDER); |
2614 | - |
2615 | - /***********/ |
2616 | - hbox=gtk_hbox_new(FALSE, BORDER); |
2617 | - gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE, WIDGET_SPACING); |
2618 | - |
2619 | - label = (GtkLabel *)gtk_label_new (_("Name:")); |
2620 | - name = (GtkEntry *) gtk_entry_new(); |
2621 | - adata->name=name; |
2622 | - |
2623 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(label),FALSE,FALSE,0); |
2624 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(name),TRUE,TRUE,0); |
2625 | - |
2626 | - /**********/ |
2627 | - rb1=(GtkRadioButton *)gtk_radio_button_new_with_label(NULL,_("Enter the countdown time")); |
2628 | - g_signal_connect(G_OBJECT(rb1), "toggled", G_CALLBACK(alarmdialog_countdown_toggled), adata); |
2629 | - rb2=(GtkRadioButton *)gtk_radio_button_new_with_label(gtk_radio_button_get_group |
2630 | - (rb1),_("Enter the time of alarm (24h format)")); |
2631 | - g_signal_connect(G_OBJECT(rb2), "toggled", G_CALLBACK(alarmdialog_alarmtime_toggled), adata); |
2632 | - adata->rb1=rb1; |
2633 | - |
2634 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(rb1),TRUE,TRUE,0); |
2635 | - |
2636 | - hbox=gtk_hbox_new(FALSE,0); |
2637 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(hbox),TRUE,TRUE,0); |
2638 | - |
2639 | - timeh = (GtkSpinButton *)gtk_spin_button_new_with_range(0,23,1); |
2640 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(timeh),FALSE,FALSE, WIDGET_SPACING); |
2641 | - adata->timeh=timeh; |
2642 | - label = (GtkLabel *)gtk_label_new (_("h ")); |
2643 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(label),FALSE,FALSE, WIDGET_SPACING); |
2644 | - timem = (GtkSpinButton *)gtk_spin_button_new_with_range(0,59,1); |
2645 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(timem),FALSE,FALSE,WIDGET_SPACING); |
2646 | - adata->timem=timem; |
2647 | - label = (GtkLabel *)gtk_label_new (_("m ")); |
2648 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(label),FALSE,FALSE,WIDGET_SPACING); |
2649 | - times = (GtkSpinButton *)gtk_spin_button_new_with_range(0,59,1); |
2650 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(times),FALSE,FALSE,WIDGET_SPACING); |
2651 | - adata->times=times; |
2652 | - label = (GtkLabel *)gtk_label_new (_("s ")); |
2653 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(label),FALSE,FALSE,WIDGET_SPACING); |
2654 | - |
2655 | - label = (GtkLabel *)gtk_label_new (_("or")); |
2656 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(label),TRUE,TRUE,BORDER); |
2657 | - |
2658 | - |
2659 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(rb2),TRUE,TRUE,0); |
2660 | - |
2661 | - hbox=gtk_hbox_new(FALSE,WIDGET_SPACING); |
2662 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(hbox),TRUE,TRUE,0); |
2663 | - |
2664 | - time_h = (GtkSpinButton *)gtk_spin_button_new_with_range(0,23,1); |
2665 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(time_h),FALSE,FALSE,0); |
2666 | - adata->time_h=time_h; |
2667 | - label = (GtkLabel *)gtk_label_new (":"); |
2668 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(label),FALSE,FALSE,WIDGET_SPACING); |
2669 | - time_m = (GtkSpinButton *)gtk_spin_button_new_with_range(0,59,1); |
2670 | - gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(time_m),FALSE,FALSE,WIDGET_SPACING); |
2671 | - adata->time_m=time_m; |
2672 | - |
2673 | - /****************/ |
2674 | - |
2675 | - label = (GtkLabel *)gtk_label_new (_("Command to run:")); |
2676 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(label),FALSE,FALSE,WIDGET_SPACING); |
2677 | - command = (GtkEntry *)gtk_entry_new(); |
2678 | - adata->command=command; |
2679 | - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(command),TRUE,TRUE,WIDGET_SPACING); |
2680 | - |
2681 | - /****************/ |
2682 | - |
2683 | - //hbox=gtk_hbox_new(TRUE,0); |
2684 | - hbox = gtk_hbutton_box_new(); |
2685 | - gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END); |
2686 | - gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbox), BORDER); |
2687 | - gtk_box_pack_start(GTK_BOX(vbox),hbox,TRUE,TRUE,WIDGET_SPACING); |
2688 | - //gtk_container_set_border_width(GTK_CONTAINER(hbox), BORDER); |
2689 | - |
2690 | - button=gtk_button_new_from_stock(GTK_STOCK_CANCEL); |
2691 | - gtk_box_pack_start(GTK_BOX(hbox),button,TRUE,TRUE,0); |
2692 | - g_signal_connect(G_OBJECT(button),"clicked",G_CALLBACK(cancel_add_edit),adata); |
2693 | - |
2694 | - button=gtk_button_new_from_stock(GTK_STOCK_OK); |
2695 | - gtk_box_pack_start(GTK_BOX(hbox),button,TRUE,TRUE,0); |
2696 | - if(GTK_WIDGET(buttonn)==pd->buttonadd) |
2697 | - g_signal_connect(G_OBJECT(button),"clicked",G_CALLBACK(ok_add),adata); |
2698 | - else |
2699 | - g_signal_connect(G_OBJECT(button),"clicked",G_CALLBACK(ok_edit),adata); |
2700 | - |
2701 | - |
2702 | - |
2703 | - /* If this is the add window, we're done */ |
2704 | - if(GTK_WIDGET(buttonn)==pd->buttonadd) { |
2705 | - gtk_window_set_title(window,_("Add new alarm")); |
2706 | - gtk_widget_show_all(GTK_WIDGET(window)); |
2707 | - alarmdialog_alarmtime_toggled(GTK_BUTTON(rb2), adata); |
2708 | - return; |
2709 | - } |
2710 | - |
2711 | - /* Else fill the values in the boxes with the current choices */ |
2712 | - select = gtk_tree_view_get_selection (GTK_TREE_VIEW (pd->tree)); |
2713 | - /*gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);*/ |
2714 | - |
2715 | - if (gtk_tree_selection_get_selected (select, &model, &iter)){ |
2716 | - |
2717 | - gtk_tree_model_get(model,&iter,0,&list,-1); |
2718 | - alrm = (alarm_t *) list->data; |
2719 | - |
2720 | - gtk_entry_set_text(GTK_ENTRY(name),alrm->name); |
2721 | - gtk_entry_set_text(GTK_ENTRY(command),alrm->command); |
2722 | - |
2723 | - time = alrm->time; |
2724 | - |
2725 | - if(alrm->iscountdown){ |
2726 | - |
2727 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(timeh),time/3600); |
2728 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(timem),(time%3600)/60); |
2729 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(times),time%60); |
2730 | - alarmdialog_alarmtime_toggled(GTK_BUTTON(rb2), adata); |
2731 | - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rb1),TRUE); |
2732 | - } |
2733 | - else{ |
2734 | - |
2735 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(time_h),time/60); |
2736 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(time_m),time%60); |
2737 | - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rb2),TRUE); // active by default |
2738 | - } |
2739 | - |
2740 | - } |
2741 | - |
2742 | - gtk_window_set_title(window,_("Edit alarm")); |
2743 | - gtk_widget_show_all(GTK_WIDGET(window)); |
2744 | - |
2745 | -} |
2746 | - |
2747 | - |
2748 | -/** |
2749 | - * Calllback for the remove button in the options |
2750 | -**/ |
2751 | -static void remove_clicked(GtkButton *button, gpointer data){ |
2752 | - |
2753 | - plugin_data *pd = (plugin_data *)data; |
2754 | - |
2755 | - GtkTreeIter iter; |
2756 | - GtkTreeModel *model; |
2757 | - GtkTreeSelection *select; |
2758 | - GList *list; |
2759 | - |
2760 | - /* Get the selected row */ |
2761 | - select = gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->tree)); |
2762 | - |
2763 | - if (!select) |
2764 | - return; |
2765 | - |
2766 | - if (!gtk_tree_selection_get_selected (select, &model, &iter)) |
2767 | - return; |
2768 | - |
2769 | - gtk_tree_model_get(model,&iter,0,&list,-1); |
2770 | - |
2771 | - if (pd->selected == list) { |
2772 | - pd->alarm_list = g_list_delete_link (pd->alarm_list, list); |
2773 | - pd->selected = pd->alarm_list; |
2774 | - } else { |
2775 | - pd->alarm_list = g_list_delete_link (pd->alarm_list, list); |
2776 | - } |
2777 | - |
2778 | - fill_liststore (pd,NULL); |
2779 | - |
2780 | -} |
2781 | - |
2782 | -/** |
2783 | - * Moves an alarm one row up in the list |
2784 | -**/ |
2785 | -static void up_clicked(GtkButton *button, gpointer data){ |
2786 | - |
2787 | - plugin_data *pd = (plugin_data *)data; |
2788 | - |
2789 | - GtkTreeIter iter; |
2790 | - GtkTreeModel *model; |
2791 | - GtkTreeSelection *select; |
2792 | - GList *list, *list_prev; |
2793 | - |
2794 | - /* Get the selected row */ |
2795 | - select = gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->tree)); |
2796 | - |
2797 | - if (!select) |
2798 | - return; |
2799 | - |
2800 | - if (!gtk_tree_selection_get_selected (select, &model, &iter)) |
2801 | - return; |
2802 | - |
2803 | - /* This is the item to be moved up */ |
2804 | - gtk_tree_model_get(model,&iter,0,&list,-1); |
2805 | - |
2806 | - /* First item can't be moved up */ |
2807 | - if(g_list_position(pd->alarm_list, list) <= 0) |
2808 | - return; |
2809 | - |
2810 | - /* swap places */ |
2811 | - list_prev = list->prev; |
2812 | - if(list_prev->prev) |
2813 | - list_prev->prev->next = list; |
2814 | - if(list->next) |
2815 | - list->next->prev = list_prev; |
2816 | - list_prev->next = list->next; |
2817 | - list->prev = list_prev->prev; |
2818 | - list->next = list_prev; |
2819 | - list_prev->prev = list; |
2820 | - |
2821 | - pd->alarm_list = g_list_first(list); |
2822 | - |
2823 | - fill_liststore (pd, list); |
2824 | -} |
2825 | - |
2826 | -/** |
2827 | - * Moves an alarm one row down in the list |
2828 | -**/ |
2829 | -static void down_clicked(GtkButton *button, gpointer data){ |
2830 | - |
2831 | - plugin_data *pd = (plugin_data *)data; |
2832 | - |
2833 | - GtkTreeIter iter; |
2834 | - GtkTreeSelection *select; |
2835 | - GtkTreeModel *model; |
2836 | - GList *list,*list_next; |
2837 | - |
2838 | - /* Get the selected row */ |
2839 | - select = gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->tree)); |
2840 | - |
2841 | - if (!select) |
2842 | - return; |
2843 | - |
2844 | - if (!gtk_tree_selection_get_selected (select, &model, &iter)) |
2845 | - return; |
2846 | - |
2847 | - /* This is the item to be moved down */ |
2848 | - gtk_tree_model_get(model,&iter,0,&list,-1); |
2849 | - |
2850 | - /* Last item can't go down) */ |
2851 | - if (list == g_list_last(pd->alarm_list)) |
2852 | - return; |
2853 | - |
2854 | - /* swap places */ |
2855 | - list_next = list->next; |
2856 | - if(list_next->next) |
2857 | - list_next->next->prev = list; |
2858 | - if(list->prev) |
2859 | - list->prev->next = list_next; |
2860 | - list_next->prev = list ->prev; |
2861 | - list->next = list_next->next; |
2862 | - list_next->next = list; |
2863 | - list->prev = list_next; |
2864 | - |
2865 | - pd->alarm_list = g_list_first(list_next); |
2866 | - |
2867 | - fill_liststore (pd, list); |
2868 | -} |
2869 | - |
2870 | - |
2871 | -/** |
2872 | - * Adds the progressbar, taking into account the orientation. |
2873 | - * pd->pbar is not destroyed, just reparented (saves fraction setting code etc.). |
2874 | -**/ |
2875 | -static void add_pbar(XfcePanelPlugin *plugin, plugin_data *pd){ |
2876 | - |
2877 | - gdouble frac; |
2878 | - |
2879 | - gtk_widget_hide(GTK_WIDGET(plugin)); |
2880 | - |
2881 | - /* Always true except at initialization */ |
2882 | -// if(pd->box){ |
2883 | - //g_object_ref(G_OBJECT(pd->pbar)); |
2884 | -// gtk_container_remove(GTK_CONTAINER(pd->box),pd->pbar); |
2885 | -// gtk_widget_destroy(pd->box); |
2886 | -// } |
2887 | - |
2888 | - if (pd -> box) { |
2889 | - frac = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (pd->pbar)); |
2890 | - gtk_widget_destroy(pd->box); |
2891 | - pd->pbar = gtk_progress_bar_new (); |
2892 | - gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR(pd->pbar), |
2893 | - GTK_PROGRESS_CONTINUOUS); |
2894 | - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pd->pbar),frac); |
2895 | - } |
2896 | - |
2897 | - /* vertical bar */ |
2898 | - if(xfce_panel_plugin_get_orientation(plugin)==GTK_ORIENTATION_HORIZONTAL){ |
2899 | - pd->box=gtk_hbox_new(TRUE,0); |
2900 | - gtk_container_set_border_width (GTK_CONTAINER(pd->box), BORDER/2); |
2901 | -#ifdef HAVE_XFCE48 |
2902 | - gtk_container_add(GTK_CONTAINER(plugin),pd->box); |
2903 | -#else |
2904 | - gtk_container_add(GTK_CONTAINER(pd->eventbox),pd->box); |
2905 | -#endif |
2906 | - gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR(pd-> |
2907 | - pbar),GTK_PROGRESS_BOTTOM_TO_TOP); |
2908 | - gtk_widget_set_size_request(GTK_WIDGET(pd->pbar),PBAR_THICKNESS,0); |
2909 | - gtk_box_pack_start(GTK_BOX(pd->box),gtk_vseparator_new(),FALSE,FALSE,0); |
2910 | - gtk_box_pack_start(GTK_BOX(pd->box),pd->pbar,FALSE,FALSE,0); |
2911 | - gtk_box_pack_start(GTK_BOX(pd->box),gtk_vseparator_new(),FALSE,FALSE,0); |
2912 | - |
2913 | - } |
2914 | - else{ /* horizontal bar */ |
2915 | - pd->box=gtk_vbox_new(TRUE,0); |
2916 | - gtk_container_set_border_width (GTK_CONTAINER(pd->box), BORDER/2); |
2917 | -#ifdef HAVE_XFCE48 |
2918 | - gtk_container_add(GTK_CONTAINER(plugin),pd->box); |
2919 | -#else |
2920 | - gtk_container_add(GTK_CONTAINER(pd->eventbox),pd->box); |
2921 | -#endif |
2922 | - gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR(pd-> |
2923 | - pbar),GTK_PROGRESS_LEFT_TO_RIGHT); |
2924 | - gtk_widget_set_size_request(GTK_WIDGET(pd->pbar),0,PBAR_THICKNESS); |
2925 | - gtk_box_pack_start(GTK_BOX(pd->box),gtk_hseparator_new(),FALSE,FALSE,0); |
2926 | - gtk_box_pack_start(GTK_BOX(pd->box),pd->pbar,FALSE,FALSE,0); |
2927 | - gtk_box_pack_start(GTK_BOX(pd->box),gtk_hseparator_new(),FALSE,FALSE,0); |
2928 | - |
2929 | - } |
2930 | - |
2931 | - gtk_widget_show_all(GTK_WIDGET(plugin)); |
2932 | - |
2933 | -} |
2934 | - |
2935 | -/** |
2936 | - * Callback for orientation change of panel. Just calls add_pbar. |
2937 | -**/ |
2938 | -static void orient_change(XfcePanelPlugin *plugin, GtkOrientation orient, plugin_data *pd){ |
2939 | - |
2940 | - add_pbar(plugin,pd); |
2941 | -} |
2942 | - |
2943 | -/** |
2944 | - * Loads the settings and alarm list from a keyfile, saves the |
2945 | - * alarm list in the linked list pd->alarm_list |
2946 | -**/ |
2947 | -static void load_settings(plugin_data *pd) |
2948 | -{ |
2949 | - |
2950 | - gchar groupname[8]; |
2951 | - const gchar *timerstring; |
2952 | - gint groupnum,time; |
2953 | - gboolean is_cd; |
2954 | - alarm_t *alrm; |
2955 | - |
2956 | - XfceRc *rc; |
2957 | - |
2958 | - //if ((file=xfce_panel_plugin_lookup_rc_file (pd->base)) != NULL) { |
2959 | - |
2960 | - |
2961 | - if (g_file_test(pd->configfile,G_FILE_TEST_EXISTS)) { |
2962 | - |
2963 | - rc = xfce_rc_simple_open (pd->configfile, TRUE); |
2964 | - |
2965 | - |
2966 | - if (rc != NULL) |
2967 | - { |
2968 | - |
2969 | - |
2970 | - groupnum=0; |
2971 | - g_sprintf(groupname,"G0"); |
2972 | - |
2973 | - |
2974 | - while(xfce_rc_has_group(rc,groupname)){ |
2975 | - |
2976 | - xfce_rc_set_group(rc,groupname); |
2977 | - |
2978 | - alrm = g_new0 (alarm_t,1); |
2979 | - pd->alarm_list = g_list_append(pd->alarm_list, alrm); |
2980 | - |
2981 | - timerstring=(gchar *)xfce_rc_read_entry(rc,"timername","No name"); |
2982 | - alrm->name = g_strdup(timerstring); |
2983 | - |
2984 | - timerstring=(gchar *)xfce_rc_read_entry(rc,"timercommand",""); |
2985 | - alrm->command = g_strdup(timerstring); |
2986 | - |
2987 | - timerstring=(gchar *)xfce_rc_read_entry(rc,"timerinfo",""); |
2988 | - alrm->info = g_strdup(timerstring); |
2989 | - |
2990 | - is_cd=xfce_rc_read_bool_entry(rc,"is_countdown",TRUE); |
2991 | - alrm->iscountdown = is_cd; |
2992 | - |
2993 | - time=xfce_rc_read_int_entry(rc,"time",0); |
2994 | - alrm->time = time; |
2995 | - |
2996 | - /* Include a link to the whole data */ |
2997 | - alrm->pd = (gpointer) pd; |
2998 | - |
2999 | - groupnum++; |
3000 | - g_snprintf(groupname,5,"G%d",groupnum); |
3001 | - |
3002 | - } /* end of while loop */ |
3003 | - |
3004 | - pd->count=groupnum; |
3005 | - |
3006 | - |
3007 | - /* Read other options */ |
3008 | - if(xfce_rc_has_group(rc,"others")){ |
3009 | - xfce_rc_set_group(rc,"others"); |
3010 | - pd->nowin_if_alarm= xfce_rc_read_bool_entry |
3011 | - (rc,"nowin_if_alarm",FALSE); |
3012 | - pd->selecting_starts= xfce_rc_read_bool_entry |
3013 | - (rc,"selecting_starts",FALSE); |
3014 | - pd->use_global_command= xfce_rc_read_bool_entry |
3015 | - (rc,"use_global_command",FALSE); |
3016 | - |
3017 | - if(pd->global_command) g_free(pd->global_command); |
3018 | - pd->global_command = g_strdup((gchar *)xfce_rc_read_entry |
3019 | - (rc,"global_command","")); |
3020 | - |
3021 | - pd->repeat_alarm= xfce_rc_read_bool_entry |
3022 | - (rc,"repeat_alarm",FALSE); |
3023 | - pd->repetitions= xfce_rc_read_int_entry |
3024 | - (rc,"repetitions",1); |
3025 | - pd->repeat_interval= xfce_rc_read_int_entry |
3026 | - (rc,"repeat_interval",10); |
3027 | - |
3028 | - } |
3029 | - |
3030 | - add_pbar(pd->base,pd); |
3031 | - |
3032 | - xfce_rc_close(rc); |
3033 | - } |
3034 | - |
3035 | -// } |
3036 | - } |
3037 | - |
3038 | -} |
3039 | - |
3040 | - |
3041 | -/** |
3042 | - * Saves the list to a keyfile, backup a permanent copy |
3043 | -**/ |
3044 | -static void save_settings(XfcePanelPlugin *plugin, plugin_data *pd){ |
3045 | - |
3046 | - gchar groupname[8]; |
3047 | - gint row_count; |
3048 | - GList *list; |
3049 | - alarm_t *alrm; |
3050 | - FILE *conffile; |
3051 | - XfceRc *rc; |
3052 | - gchar *file, *contents=NULL; |
3053 | - |
3054 | - if (!(file = xfce_panel_plugin_save_location (plugin, TRUE))) |
3055 | - return; |
3056 | - |
3057 | - // We do this to start a fresh config file, otherwise if the old config file is longer, |
3058 | - // the tail will not get truncated. See |
3059 | - // http://bugzilla.xfce.org/show_bug.cgi?id=2647 |
3060 | - // for a related bug report. |
3061 | - conffile = fopen(file,"w"); |
3062 | - if (conffile) |
3063 | - fclose(conffile); |
3064 | - |
3065 | - rc = xfce_rc_simple_open (file, FALSE); |
3066 | - |
3067 | - if (!rc) |
3068 | - return; |
3069 | - |
3070 | - list = pd->alarm_list; |
3071 | - |
3072 | - row_count = 0; |
3073 | - |
3074 | - while (list){ |
3075 | - |
3076 | - g_snprintf(groupname,7,"G%d",row_count); |
3077 | - |
3078 | - xfce_rc_set_group(rc,groupname); |
3079 | - |
3080 | - alrm = (alarm_t *) list->data; |
3081 | - |
3082 | - xfce_rc_write_entry(rc,"timername",alrm->name); |
3083 | - |
3084 | - xfce_rc_write_int_entry(rc,"time",alrm->time); |
3085 | - |
3086 | - xfce_rc_write_entry(rc,"timercommand",alrm->command); |
3087 | - |
3088 | - xfce_rc_write_entry(rc,"timerinfo",alrm->info); |
3089 | - |
3090 | - xfce_rc_write_bool_entry(rc,"is_countdown",alrm->iscountdown); |
3091 | - |
3092 | - row_count ++; |
3093 | - list = list->next; |
3094 | - } |
3095 | - |
3096 | - |
3097 | - /* save the other options */ |
3098 | - xfce_rc_set_group(rc,"others"); |
3099 | - |
3100 | - xfce_rc_write_bool_entry(rc,"nowin_if_alarm",pd->nowin_if_alarm); |
3101 | - xfce_rc_write_bool_entry(rc,"selecting_starts",pd->selecting_starts); |
3102 | - xfce_rc_write_bool_entry(rc,"use_global_command",pd->use_global_command); |
3103 | - xfce_rc_write_entry(rc,"global_command",pd->global_command); |
3104 | - xfce_rc_write_bool_entry(rc,"repeat_alarm",pd->repeat_alarm); |
3105 | - xfce_rc_write_int_entry(rc,"repetitions",pd->repetitions); |
3106 | - xfce_rc_write_int_entry(rc,"repeat_interval",pd->repeat_interval); |
3107 | - |
3108 | - xfce_rc_close(rc); |
3109 | - |
3110 | - conffile = fopen (pd->configfile,"w"); |
3111 | - /* We backup a permanent copy, which we'll use to load settings */ |
3112 | - if (conffile && g_file_get_contents(file,&contents,NULL,NULL)){ |
3113 | - fputs(contents,conffile); |
3114 | - fclose(conffile); |
3115 | - } |
3116 | - |
3117 | - g_free(file); |
3118 | - if(contents) |
3119 | - g_free(contents); |
3120 | - |
3121 | -} |
3122 | - |
3123 | - |
3124 | -/** |
3125 | - * Activates the Edit and Remove buttons when an item in the list is selected |
3126 | -**/ |
3127 | - |
3128 | -static void tree_selected (GtkTreeSelection *select, gpointer data){ |
3129 | - |
3130 | - plugin_data *pd=(plugin_data *)data; |
3131 | - |
3132 | - gtk_widget_set_sensitive(pd->buttonedit,TRUE); |
3133 | - gtk_widget_set_sensitive(pd->buttonremove,TRUE); |
3134 | - gtk_widget_set_sensitive(pd->buttonup,TRUE); |
3135 | - gtk_widget_set_sensitive(pd->buttondown,TRUE); |
3136 | - |
3137 | -} |
3138 | - |
3139 | - |
3140 | -/******************/ |
3141 | -/* plugin_free */ |
3142 | -/******************/ |
3143 | - |
3144 | -static void |
3145 | -plugin_free (XfcePanelPlugin *plugin, plugin_data *pd) |
3146 | -{ |
3147 | - |
3148 | - /* remove timeouts */ |
3149 | - if (pd->timeout!=0) g_source_remove(pd->timeout); |
3150 | - if (pd->repeat_timeout!=0) g_source_remove(pd->repeat_timeout); |
3151 | - |
3152 | - /*save_settings(pd);*/ |
3153 | - |
3154 | - if(pd->timer) |
3155 | - g_timer_destroy(pd->timer); |
3156 | - |
3157 | - if(pd->active_timer_name) |
3158 | - g_free(pd->active_timer_name); |
3159 | - |
3160 | - if(pd->timeout_command) |
3161 | - g_free(pd->timeout_command); |
3162 | - |
3163 | - if(pd->global_command) |
3164 | - g_free(pd->global_command); |
3165 | - |
3166 | - if(pd->configfile) |
3167 | - g_free(pd->configfile); |
3168 | - |
3169 | - if(pd->liststore) { |
3170 | - gtk_list_store_clear (pd->liststore); |
3171 | - //g_free (pd->liststore); |
3172 | - } |
3173 | - |
3174 | - if(pd->alarm_list) |
3175 | - g_list_free (pd->alarm_list); |
3176 | - |
3177 | - /* destroy the tooltips */ |
3178 | - gtk_object_destroy(GTK_OBJECT(pd->tip)); |
3179 | - |
3180 | - /* destroy all widgets */ |
3181 | -#ifndef HAVE_XFCE48 |
3182 | - gtk_widget_destroy(GTK_WIDGET(pd->eventbox)); |
3183 | -#endif |
3184 | - |
3185 | - /* free the plugin data structure */ |
3186 | - g_free(pd); |
3187 | - |
3188 | - gtk_main_quit(); |
3189 | -} |
3190 | - |
3191 | -/***************************/ |
3192 | -/* options dialog response */ |
3193 | -/***************************/ |
3194 | -static void |
3195 | -options_dialog_response (GtkWidget *dlg, int reponse, plugin_data *pd) |
3196 | -{ |
3197 | - if(pd->global_command) |
3198 | - g_free(pd->global_command); |
3199 | - pd->global_command = g_strdup (gtk_entry_get_text((GtkEntry *)pd->glob_command_entry)); |
3200 | - gtk_widget_destroy (dlg); |
3201 | - xfce_panel_plugin_unblock_menu (pd->base); |
3202 | - save_settings(pd->base,pd); |
3203 | -} |
3204 | - |
3205 | -/** |
3206 | - * nowin_if_alarm toggle callback |
3207 | -**/ |
3208 | -static void toggle_nowin_if_alarm(GtkToggleButton *button, gpointer data){ |
3209 | - |
3210 | - plugin_data *pd=(plugin_data *)data; |
3211 | - |
3212 | - pd->nowin_if_alarm = gtk_toggle_button_get_active(button); |
3213 | - |
3214 | -} |
3215 | - |
3216 | -/** |
3217 | - * selecting_starts toggle callback |
3218 | -**/ |
3219 | -static void toggle_selecting_starts(GtkToggleButton *button, gpointer data){ |
3220 | - |
3221 | - plugin_data *pd=(plugin_data *)data; |
3222 | - |
3223 | - pd->selecting_starts = gtk_toggle_button_get_active(button); |
3224 | - |
3225 | -} |
3226 | -/** |
3227 | - * toggle_global_command toggle callback |
3228 | -**/ |
3229 | -static void toggle_global_command(GtkToggleButton *button, gpointer data){ |
3230 | - |
3231 | - plugin_data *pd=(plugin_data *)data; |
3232 | - |
3233 | - pd->use_global_command = gtk_toggle_button_get_active(button); |
3234 | - |
3235 | - gtk_widget_set_sensitive(pd->global_command_box,pd->use_global_command); |
3236 | - |
3237 | -} |
3238 | - |
3239 | -/** |
3240 | - * toggle_repeat_alarm toggle callback |
3241 | -**/ |
3242 | -static void toggle_repeat_alarm(GtkToggleButton *button, gpointer data){ |
3243 | - |
3244 | - plugin_data *pd=(plugin_data *)data; |
3245 | - |
3246 | - pd->repeat_alarm = gtk_toggle_button_get_active(button); |
3247 | - |
3248 | - gtk_widget_set_sensitive(pd->repeat_alarm_box,pd->repeat_alarm); |
3249 | - |
3250 | -} |
3251 | - |
3252 | -/** |
3253 | - * Spinbutton 1 (#of alarm repetitions |
3254 | - * value change callback |
3255 | -**/ |
3256 | -static void spin1_changed(GtkSpinButton *button, gpointer data){ |
3257 | - |
3258 | - plugin_data *pd=(plugin_data *)data; |
3259 | - |
3260 | - pd->repetitions = gtk_spin_button_get_value_as_int(button); |
3261 | - |
3262 | -} |
3263 | - |
3264 | -/** |
3265 | - * Spinbutton 1 (alarm repetition |
3266 | - * interval) value change callback |
3267 | -**/ |
3268 | -static void spin2_changed(GtkSpinButton *button, gpointer data){ |
3269 | - |
3270 | - plugin_data *pd=(plugin_data *)data; |
3271 | - |
3272 | - pd->repeat_interval = gtk_spin_button_get_value_as_int(button); |
3273 | - |
3274 | -} |
3275 | - |
3276 | -/** |
3277 | - * options dialog |
3278 | -**/ |
3279 | -static void plugin_create_options (XfcePanelPlugin *plugin,plugin_data *pd) { |
3280 | - |
3281 | - GtkWidget *vbox=gtk_vbox_new(FALSE,0); /*outermost box */ |
3282 | - GtkWidget *hbox=gtk_hbox_new(FALSE,0); /* holds the treeview and buttons */ |
3283 | - GtkWidget *buttonbox,*button,*sw,*tree,*spinbutton; |
3284 | - GtkTreeSelection *select; |
3285 | - GtkTreeViewColumn *column; |
3286 | - GtkWidget *dlg=NULL, *header=NULL; |
3287 | - GtkCellRenderer *renderer; |
3288 | - |
3289 | - |
3290 | - xfce_panel_plugin_block_menu (plugin); |
3291 | - |
3292 | - |
3293 | - |
3294 | -#ifdef HAVE_XFCE48 |
3295 | - header = xfce_titled_dialog_new_with_buttons (_("Xfce4 Timer Options"), |
3296 | - GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))), |
3297 | - GTK_DIALOG_DESTROY_WITH_PARENT | |
3298 | - GTK_DIALOG_NO_SEPARATOR, |
3299 | - GTK_STOCK_CLOSE, GTK_RESPONSE_OK, |
3300 | - NULL); |
3301 | - |
3302 | - dlg = header; |
3303 | -#else |
3304 | - header = xfce_create_header (NULL, _("Xfce4 Timer Options")); |
3305 | - |
3306 | - dlg = gtk_dialog_new_with_buttons (_("Xfce 4 Timer Plugin"), |
3307 | - GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))), |
3308 | - GTK_DIALOG_DESTROY_WITH_PARENT | |
3309 | - GTK_DIALOG_NO_SEPARATOR, |
3310 | - GTK_STOCK_CLOSE, GTK_RESPONSE_OK, |
3311 | - NULL); |
3312 | - |
3313 | - |
3314 | - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), header, |
3315 | - FALSE, TRUE, 0); |
3316 | -#endif |
3317 | - |
3318 | - g_signal_connect (dlg, "response", G_CALLBACK (options_dialog_response), |
3319 | - pd); |
3320 | - |
3321 | - gtk_container_set_border_width (GTK_CONTAINER(dlg), BORDER); |
3322 | - |
3323 | - gtk_widget_set_size_request (dlg, 650, -1); |
3324 | - gtk_window_set_position(GTK_WINDOW(header),GTK_WIN_POS_CENTER); |
3325 | - |
3326 | - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), vbox, |
3327 | - TRUE, TRUE, WIDGET_SPACING); |
3328 | - |
3329 | - |
3330 | - hbox = gtk_hbox_new(FALSE, BORDER); |
3331 | - gtk_box_pack_start(GTK_BOX(vbox),hbox,TRUE,TRUE,BORDER); |
3332 | - |
3333 | - sw = gtk_scrolled_window_new (NULL, NULL); |
3334 | - |
3335 | - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), |
3336 | - GTK_SHADOW_ETCHED_IN); |
3337 | - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), |
3338 | - GTK_POLICY_AUTOMATIC, |
3339 | - GTK_POLICY_AUTOMATIC); |
3340 | - |
3341 | - gtk_box_pack_start(GTK_BOX(hbox),sw,TRUE,TRUE,0); |
3342 | - |
3343 | - fill_liststore (pd,NULL); |
3344 | - |
3345 | - tree=gtk_tree_view_new_with_model(GTK_TREE_MODEL(pd->liststore)); |
3346 | - pd->tree=tree; |
3347 | - gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree), TRUE); |
3348 | - gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (tree)), |
3349 | - GTK_SELECTION_SINGLE); |
3350 | - |
3351 | - renderer = gtk_cell_renderer_text_new (); |
3352 | - column = gtk_tree_view_column_new_with_attributes (_("Timer name"), renderer, |
3353 | - "text", 1, NULL); |
3354 | - gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); |
3355 | - |
3356 | - |
3357 | - column = gtk_tree_view_column_new_with_attributes (_("Countdown period /\nAlarm time"), |
3358 | - renderer, "text", 2, NULL); |
3359 | - gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); |
3360 | - |
3361 | - column = gtk_tree_view_column_new_with_attributes (_("Alarm command"), renderer, |
3362 | - "text", 3, NULL); |
3363 | - gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); |
3364 | - |
3365 | - |
3366 | - if(tree) |
3367 | - gtk_container_add(GTK_CONTAINER(sw),tree); |
3368 | - |
3369 | - gtk_widget_set_size_request(GTK_WIDGET(sw),350,200); |
3370 | - |
3371 | - select = gtk_tree_view_get_selection (GTK_TREE_VIEW (pd->tree)); |
3372 | - gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE); |
3373 | - g_signal_connect (G_OBJECT (select), "changed", |
3374 | - G_CALLBACK(tree_selected), pd); |
3375 | - |
3376 | - |
3377 | - buttonbox=gtk_vbutton_box_new(); |
3378 | - gtk_button_box_set_layout(GTK_BUTTON_BOX(buttonbox),GTK_BUTTONBOX_START); |
3379 | - gtk_button_box_set_spacing(GTK_BUTTON_BOX(buttonbox),WIDGET_SPACING<<1); |
3380 | - gtk_box_pack_start(GTK_BOX(hbox),buttonbox,FALSE,FALSE,0); |
3381 | - |
3382 | - button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
3383 | - pd->buttonadd=button; |
3384 | - gtk_box_pack_start(GTK_BOX (buttonbox), button, FALSE, FALSE,WIDGET_SPACING<<1); |
3385 | - gtk_widget_set_sensitive(button,TRUE); |
3386 | - g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK(add_edit_clicked), pd); |
3387 | - |
3388 | - |
3389 | - button = gtk_button_new_from_stock (GTK_STOCK_EDIT); |
3390 | - pd->buttonedit=button; |
3391 | - gtk_box_pack_start(GTK_BOX (buttonbox), button, FALSE, FALSE,WIDGET_SPACING<<1); |
3392 | - gtk_widget_set_sensitive(button,FALSE); |
3393 | - g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK(add_edit_clicked), pd); |
3394 | - |
3395 | - button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
3396 | - pd->buttonremove=button; |
3397 | - gtk_box_pack_start(GTK_BOX (buttonbox), button, FALSE, FALSE,WIDGET_SPACING); |
3398 | - gtk_widget_set_sensitive(button,FALSE); |
3399 | - g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK(remove_clicked), pd); |
3400 | - |
3401 | - button = gtk_button_new_from_stock (GTK_STOCK_GO_UP); |
3402 | - pd->buttonup=button; |
3403 | - gtk_box_pack_start(GTK_BOX (buttonbox), button, FALSE, FALSE,WIDGET_SPACING); |
3404 | - gtk_widget_set_sensitive(button,FALSE); |
3405 | - g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK(up_clicked), pd); |
3406 | - |
3407 | - button = gtk_button_new_from_stock (GTK_STOCK_GO_DOWN); |
3408 | - pd->buttondown=button; |
3409 | - gtk_box_pack_start(GTK_BOX (buttonbox), button, FALSE, FALSE,WIDGET_SPACING); |
3410 | - gtk_widget_set_sensitive(button,FALSE); |
3411 | - g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK(down_clicked), pd); |
3412 | - |
3413 | - gtk_widget_set_size_request(hbox,-1,-1); |
3414 | - |
3415 | - gtk_box_pack_start(GTK_BOX(vbox),gtk_hseparator_new(),FALSE,FALSE,BORDER); |
3416 | - |
3417 | - button=gtk_check_button_new_with_label(_("Don't display a warning if an alarm command is set")); |
3418 | - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),pd->nowin_if_alarm); |
3419 | - g_signal_connect(G_OBJECT(button),"toggled",G_CALLBACK(toggle_nowin_if_alarm),pd); |
3420 | - gtk_box_pack_start(GTK_BOX(vbox),button,FALSE,FALSE,WIDGET_SPACING); |
3421 | - |
3422 | - button=gtk_check_button_new_with_label(_("Selecting a timer starts it")); |
3423 | - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),pd->selecting_starts); |
3424 | - g_signal_connect(G_OBJECT(button),"toggled",G_CALLBACK(toggle_selecting_starts),pd); |
3425 | - gtk_box_pack_start(GTK_BOX(vbox),button,FALSE,FALSE,WIDGET_SPACING); |
3426 | - |
3427 | - gtk_box_pack_start(GTK_BOX(vbox),gtk_hseparator_new(),FALSE,FALSE,BORDER); |
3428 | - |
3429 | - /* Default alarm command config */ |
3430 | - button=gtk_check_button_new_with_label(_("Use a default alarm command")); |
3431 | - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),pd->use_global_command); |
3432 | - g_signal_connect(G_OBJECT(button),"toggled",G_CALLBACK(toggle_global_command),pd); |
3433 | - gtk_box_pack_start(GTK_BOX(vbox),button,FALSE,FALSE,WIDGET_SPACING); |
3434 | - |
3435 | - hbox = gtk_hbox_new (FALSE,0); |
3436 | - pd->global_command_box=hbox; |
3437 | - gtk_box_pack_start(GTK_BOX(hbox),gtk_label_new(_("Default command: ")),FALSE,FALSE,0); |
3438 | - pd->glob_command_entry = (GtkWidget *) gtk_entry_new(); |
3439 | - gtk_widget_set_size_request(pd->glob_command_entry,400,-1); |
3440 | - gtk_entry_set_text(GTK_ENTRY(pd->glob_command_entry), pd->global_command); |
3441 | - gtk_box_pack_start(GTK_BOX(hbox),pd->glob_command_entry,FALSE,FALSE,10); |
3442 | - |
3443 | - gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,WIDGET_SPACING); |
3444 | - gtk_widget_set_sensitive(hbox,pd->use_global_command); |
3445 | - |
3446 | - gtk_box_pack_start(GTK_BOX(vbox),gtk_hseparator_new(),FALSE,FALSE,BORDER); |
3447 | - |
3448 | - /* Alarm repetitions config */ |
3449 | - button=gtk_check_button_new_with_label(_("Repeat the alarm command")); |
3450 | - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),pd->repeat_alarm); |
3451 | - g_signal_connect(G_OBJECT(button),"toggled",G_CALLBACK(toggle_repeat_alarm),pd); |
3452 | - gtk_box_pack_start(GTK_BOX(vbox),button,FALSE,FALSE,WIDGET_SPACING); |
3453 | - |
3454 | - hbox = gtk_hbox_new (FALSE,0); |
3455 | - pd->repeat_alarm_box=hbox; |
3456 | - gtk_box_pack_start(GTK_BOX(hbox),gtk_label_new(_("Number of repetitions")),FALSE,FALSE,0); |
3457 | - spinbutton=gtk_spin_button_new_with_range(1,50,1); |
3458 | - pd->spin_repeat=spinbutton; |
3459 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbutton), pd->repetitions); |
3460 | - g_signal_connect(G_OBJECT(spinbutton),"value-changed", G_CALLBACK(spin1_changed), pd); |
3461 | - gtk_box_pack_start(GTK_BOX(hbox),spinbutton,FALSE,FALSE,10); |
3462 | - gtk_box_pack_start(GTK_BOX(hbox),gtk_label_new(_(" Time interval (sec.)")),FALSE,FALSE,0); |
3463 | - spinbutton=gtk_spin_button_new_with_range(1,600,1); |
3464 | - pd->spin_interval=spinbutton; |
3465 | - gtk_box_pack_start(GTK_BOX(hbox),spinbutton,FALSE,FALSE,10); |
3466 | - gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbutton), pd->repeat_interval); |
3467 | - g_signal_connect(G_OBJECT(spinbutton),"value-changed", G_CALLBACK(spin2_changed), pd); |
3468 | - |
3469 | - gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,WIDGET_SPACING); |
3470 | - gtk_widget_set_sensitive(hbox,pd->repeat_alarm); |
3471 | - |
3472 | - |
3473 | - |
3474 | - gtk_widget_show_all(GTK_WIDGET(dlg)); |
3475 | - |
3476 | -} |
3477 | - |
3478 | -/** |
3479 | - * Show the "About" window |
3480 | -**/ |
3481 | -static void show_about_window(XfcePanelPlugin *plugin, plugin_data *pd) |
3482 | -{ |
3483 | - GdkPixbuf *icon; |
3484 | - const gchar *author[] = { "Kemal Ilgar Eroğlu <ilgar_eroglu@yahoo.com>", NULL}; |
3485 | - const gchar *translators = |
3486 | -"Mohammad Alhargan <malham1@hotmail.com> \n\ |
3487 | -Marcos Antonio Alvarez Costales <marcoscostales@gmail.com> \n\ |
3488 | -Harald Servat <redcrash@gmail.com> \n\ |
3489 | -Michal Várady <miko.vaji@gmail.com>\n\ |
3490 | -Per Kongstad <p_kongstad@op.pl>\n\ |
3491 | -Simon Schneider <simon@schneiderimtal.de>\n\ |
3492 | -Efstathios Iosifidis <iosifidis@opensuse.org>\n\ |
3493 | -Jeff Bailes <thepizzaking@gmail.com>\n\ |
3494 | -Sergio <oigres200@gmail.com>\n\ |
3495 | -Piarres Beobide <pi@beobide.net>\n\ |
3496 | -Maximilian Schleiss <maximilian@xfce.org>\n\ |
3497 | -Leandro Regueiro <leandro.regueiro@gmail.com>\n\ |
3498 | -Ivica Kolić <ikoli@yahoo.com>\n\ |
3499 | -Gabor Kelemen <kelemeng at gnome dot hu>\n\ |
3500 | -Andhika Padmawan <andhika.padmawan@gmail.com>\n\ |
3501 | -Cristian Marchi <cri.penta@gmail.com>\n\ |
3502 | -Nobuhiro Iwamatsu <iwamatsu@nigauri.org>\n\ |
3503 | -Seong-ho Cho <darkcircle.0426@gmail.com>\n\ |
3504 | -Rihards Priedītis <rprieditis@inbox.lv>\n\ |
3505 | -Pjotr <pjotrvertaalt@gmail.com>\n\ |
3506 | -Piotr Sokół <piotr.sokol@10g.pl>\n\ |
3507 | -Sérgio Marques <smarquespt@gmail.com>\n\ |
3508 | -Rafael Ferreira <rafael.f.f1@gmail.com>\n\ |
3509 | -Dima Smirnov <arch@cnc-parts.info>\n\ |
3510 | -Tomáš Vadina <kyberdev@gmail.com>\n\ |
3511 | -Besnik Bleta <besnik@programeshqip.org>\n\ |
3512 | -Саша Петровић <salepetronije@gmail.com>\n\ |
3513 | -Daniel Nylander <po@danielnylander.se>\n\ |
3514 | -Kemal Ilgar Eroğlu <ilgar_eroglu@yahoo.com>\n\ |
3515 | -Gheyret T.Kenji <gheyret@gmail.com>\n\ |
3516 | -Dmitry Nikitin <luckas_fb@mail.ru>\n\ |
3517 | -Muhammad Ali Makki <makki.ma@gmail.com>\n\ |
3518 | -Hunt Xu <huntxu@live.cn>\n\ |
3519 | -Cheng-Chia Tseng <pswo10680@gmail.com>\n"; |
3520 | - |
3521 | - icon = xfce_panel_pixbuf_from_source("xfce4-timer", NULL, 48); |
3522 | - gtk_show_about_dialog(NULL, |
3523 | - "title", _("About xfce4-timer-plugin"), |
3524 | - "logo", icon, |
3525 | - "license", xfce_get_license_text (XFCE_LICENSE_TEXT_GPL), |
3526 | - "version", PACKAGE_VERSION, |
3527 | - "program-name", PACKAGE_NAME, |
3528 | - "comments", _("A plugin to define countdown timers or alarms at given times."), |
3529 | - "website", "http://goodies.xfce.org/projects/panel-plugins/xfce4-timer-plugin", |
3530 | - "copyright", _("Copyright (c) 2005-2013\n"), |
3531 | - "authors", author, |
3532 | - "translator-credits" , translators, |
3533 | - NULL); |
3534 | - |
3535 | - if(icon) |
3536 | - g_object_unref(G_OBJECT(icon)); |
3537 | -} |
3538 | - |
3539 | -/** |
3540 | - * create_sample_control |
3541 | - * |
3542 | - * Create a new instance of the plugin. |
3543 | - * |
3544 | - * @control : #Control parent container |
3545 | - * |
3546 | - * Returns %TRUE on success, %FALSE on failure. |
3547 | - **/ |
3548 | - |
3549 | -static void create_plugin_control (XfcePanelPlugin *plugin) |
3550 | -{ |
3551 | - |
3552 | - GtkWidget *base,*menu,*socket,*menuitem,*box,*pbar2; |
3553 | - GtkTooltips *tooltip; |
3554 | - char command[1024]; |
3555 | - gchar *filename,*pathname; |
3556 | - |
3557 | - xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8"); |
3558 | - |
3559 | - plugin_data *pd=g_new0(plugin_data,1); |
3560 | - |
3561 | - pd->base=plugin; |
3562 | - pd->count=0; |
3563 | - pd->pbar=gtk_progress_bar_new(); |
3564 | - pd->liststore=gtk_list_store_new(4, |
3565 | - G_TYPE_POINTER, /* Column 0: GList alarm list node */ |
3566 | - G_TYPE_STRING, /* Column 1: Name */ |
3567 | - G_TYPE_STRING, /* Column 2: Timer period/alarm time - info string */ |
3568 | - G_TYPE_STRING); /* Command to run */ |
3569 | - |
3570 | -#ifndef HAVE_XFCE48 |
3571 | - pd->eventbox = gtk_event_box_new(); |
3572 | -#endif |
3573 | - pd->box=NULL; |
3574 | - pd->timer_on=FALSE; |
3575 | - pd->timeout=0; |
3576 | - pd->buttonadd=NULL; |
3577 | - pd->buttonedit=NULL; |
3578 | - pd->buttonremove=NULL; |
3579 | - pd->menu=NULL; |
3580 | - pd->tip=gtk_tooltips_new(); |
3581 | - pd->timeout_command=NULL; |
3582 | - pd->timer=NULL; |
3583 | - pd->active_timer_name = g_strdup(""); |
3584 | - pd->nowin_if_alarm=FALSE; |
3585 | - pd->selecting_starts=FALSE; |
3586 | - pd->repeat_alarm=FALSE; |
3587 | - pd->is_paused=FALSE; |
3588 | - pd->is_countdown=TRUE; |
3589 | - pd->use_global_command = FALSE; |
3590 | - pd->glob_command_entry = NULL; |
3591 | - pd->global_command = g_strdup(""); /* For Gtk >= 3.4 one could just set = NULL */ |
3592 | - pd->global_command_box = NULL; |
3593 | - pd->repeat_alarm_box=NULL; |
3594 | - pd->repetitions=1; |
3595 | - pd->rem_repetitions=1; |
3596 | - pd->repeat_interval=10; |
3597 | - pd->alarm_repeating=FALSE; |
3598 | - pd->repeat_timeout=0; |
3599 | - pd->alarm_list = NULL; |
3600 | - pd->selected=NULL; |
3601 | - |
3602 | - gtk_tooltips_set_tip(pd->tip, GTK_WIDGET(plugin), "", NULL); |
3603 | - gtk_tooltips_disable(pd->tip); |
3604 | - |
3605 | - |
3606 | - g_object_ref(pd->liststore); |
3607 | - |
3608 | - filename = xfce_panel_plugin_save_location (pd->base,TRUE); |
3609 | - pathname = g_path_get_dirname (filename); |
3610 | - pd->configfile = g_strconcat (pathname,"/XfceTimer.rc",NULL); |
3611 | - g_free(filename); |
3612 | - g_free(pathname); |
3613 | - |
3614 | - load_settings(pd); |
3615 | - pd->selected = pd->alarm_list; |
3616 | - |
3617 | - gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR(pd->pbar), |
3618 | - GTK_PROGRESS_CONTINUOUS); |
3619 | - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pd->pbar),0); |
3620 | - |
3621 | - add_pbar(pd->base,pd); |
3622 | - |
3623 | - /* Trying to get a thin box, but no way */ |
3624 | - gtk_widget_set_size_request(GTK_WIDGET(plugin),10,10); |
3625 | - xfce_panel_plugin_set_expand(plugin,FALSE); |
3626 | - |
3627 | -#ifdef HAVE_XFCE48 |
3628 | - g_signal_connect (G_OBJECT(plugin), "button_press_event", |
3629 | - G_CALLBACK(pbar_clicked), pd); |
3630 | -#else |
3631 | - gtk_container_add(GTK_CONTAINER(plugin),pd->eventbox); |
3632 | - g_signal_connect (G_OBJECT(pd->eventbox), "button_press_event", |
3633 | - G_CALLBACK(pbar_clicked), pd); |
3634 | -#endif |
3635 | - |
3636 | - gtk_widget_show_all(GTK_WIDGET(plugin)); |
3637 | - |
3638 | - g_signal_connect (plugin, "free-data", |
3639 | - G_CALLBACK (plugin_free), pd); |
3640 | - |
3641 | - g_signal_connect (plugin, "save", |
3642 | - G_CALLBACK (save_settings), pd); |
3643 | - |
3644 | - g_signal_connect (plugin, "orientation-changed", |
3645 | - G_CALLBACK (orient_change), pd); |
3646 | - |
3647 | - xfce_panel_plugin_menu_show_configure (plugin); |
3648 | - g_signal_connect (plugin, "configure-plugin", |
3649 | - G_CALLBACK (plugin_create_options), pd); |
3650 | - |
3651 | - xfce_panel_plugin_menu_show_about(plugin); |
3652 | - g_signal_connect (plugin, "about", G_CALLBACK (show_about_window), pd); |
3653 | - |
3654 | -} |
3655 | - |
3656 | - |
3657 | |
3658 | === removed file '.pc/applied-patches' |
3659 | --- .pc/applied-patches 2013-05-22 21:42:15 +0000 |
3660 | +++ .pc/applied-patches 1970-01-01 00:00:00 +0000 |
3661 | @@ -1,2 +0,0 @@ |
3662 | -01_improve-timer-stop.patch |
3663 | -02_fix-format-string.patch |
3664 | |
3665 | === modified file 'ChangeLog' |
3666 | --- ChangeLog 2013-05-22 21:42:15 +0000 |
3667 | +++ ChangeLog 2014-07-15 20:47:56 +0000 |
3668 | @@ -1,3 +1,7 @@ |
3669 | +05/06/2014 Kemal Ilgar Eroglu <ilgar_eroglu@yahoo.com> |
3670 | + * Version 1.6.0 |
3671 | + * Added button in the alarm window to rerun the timer |
3672 | + * Minor fixes and code cleanup |
3673 | 10/05/2013 Kemal Ilgar Eroglu <ilgar_eroglu@yahoo.com> |
3674 | * Version 1.5.0 |
3675 | * Major code reorganization |
3676 | |
3677 | === modified file 'Makefile.in' |
3678 | --- Makefile.in 2013-05-22 21:42:15 +0000 |
3679 | +++ Makefile.in 2014-07-15 20:47:56 +0000 |
3680 | @@ -54,16 +54,15 @@ |
3681 | DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ |
3682 | $(srcdir)/Makefile.in $(srcdir)/config.h.in \ |
3683 | $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ |
3684 | - TODO acconfig.h compile config.guess config.sub depcomp \ |
3685 | - install-sh ltmain.sh missing mkinstalldirs |
3686 | + TODO compile config.guess config.sub depcomp install-sh \ |
3687 | + ltmain.sh missing |
3688 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
3689 | -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ |
3690 | - $(top_srcdir)/configure.in |
3691 | +am__aclocal_m4_deps = $(top_srcdir)/configure.in |
3692 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
3693 | $(ACLOCAL_M4) |
3694 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ |
3695 | configure.lineno config.status.lineno |
3696 | -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
3697 | +mkinstalldirs = $(install_sh) -d |
3698 | CONFIG_HEADER = config.h |
3699 | CONFIG_CLEAN_FILES = |
3700 | CONFIG_CLEAN_VPATH_FILES = |
3701 | @@ -370,7 +369,7 @@ |
3702 | stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status |
3703 | @rm -f stamp-h1 |
3704 | cd $(top_builddir) && $(SHELL) ./config.status config.h |
3705 | -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/acconfig.h |
3706 | +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) |
3707 | ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) |
3708 | rm -f stamp-h1 |
3709 | touch $@ |
3710 | |
3711 | === removed file 'acconfig.h' |
3712 | --- acconfig.h 2009-02-22 20:07:50 +0000 |
3713 | +++ acconfig.h 1970-01-01 00:00:00 +0000 |
3714 | @@ -1,14 +0,0 @@ |
3715 | -#undef ENABLE_NLS |
3716 | -#undef HAVE_CATGETS |
3717 | -#undef HAVE_GETTEXT |
3718 | -#undef HAVE_LC_MESSAGES |
3719 | -#undef HAVE_STPCPY |
3720 | -#undef HAVE_LIBSM |
3721 | -#undef PACKAGE_LOCALE_DIR |
3722 | -#undef PACKAGE_DOC_DIR |
3723 | -#undef PACKAGE_DATA_DIR |
3724 | -#undef PACKAGE_PIXMAPS_DIR |
3725 | -#undef PACKAGE_HELP_DIR |
3726 | -#undef PACKAGE_MENU_DIR |
3727 | -#undef PACKAGE_SOURCE_DIR |
3728 | -#undef GETTEXT_PACKAGE |
3729 | |
3730 | === removed file 'acinclude.m4' |
3731 | --- acinclude.m4 2009-02-22 20:07:50 +0000 |
3732 | +++ acinclude.m4 1970-01-01 00:00:00 +0000 |
3733 | @@ -1,1 +0,0 @@ |
3734 | -AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) |
3735 | |
3736 | === modified file 'aclocal.m4' |
3737 | --- aclocal.m4 2013-05-22 21:42:15 +0000 |
3738 | +++ aclocal.m4 2014-07-15 20:47:56 +0000 |
3739 | @@ -9260,7 +9260,7 @@ |
3740 | m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) |
3741 | |
3742 | # nls.m4 serial 5 (gettext-0.18) |
3743 | -dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, |
3744 | +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation, |
3745 | dnl Inc. |
3746 | dnl This file is free software; the Free Software Foundation |
3747 | dnl gives unlimited permission to copy and/or distribute it, |
3748 | @@ -10923,4 +10923,3 @@ |
3749 | ]) |
3750 | |
3751 | |
3752 | -m4_include([acinclude.m4]) |
3753 | |
3754 | === modified file 'config.h.in' |
3755 | --- config.h.in 2013-05-22 21:42:15 +0000 |
3756 | +++ config.h.in 2014-07-15 20:47:56 +0000 |
3757 | @@ -1,18 +1,4 @@ |
3758 | /* config.h.in. Generated from configure.in by autoheader. */ |
3759 | -#undef ENABLE_NLS |
3760 | -#undef HAVE_CATGETS |
3761 | -#undef HAVE_GETTEXT |
3762 | -#undef HAVE_LC_MESSAGES |
3763 | -#undef HAVE_STPCPY |
3764 | -#undef HAVE_LIBSM |
3765 | -#undef PACKAGE_LOCALE_DIR |
3766 | -#undef PACKAGE_DOC_DIR |
3767 | -#undef PACKAGE_DATA_DIR |
3768 | -#undef PACKAGE_PIXMAPS_DIR |
3769 | -#undef PACKAGE_HELP_DIR |
3770 | -#undef PACKAGE_MENU_DIR |
3771 | -#undef PACKAGE_SOURCE_DIR |
3772 | -#undef GETTEXT_PACKAGE |
3773 | |
3774 | /* always defined to indicate that i18n is enabled */ |
3775 | #undef ENABLE_NLS |
3776 | |
3777 | === modified file 'configure' |
3778 | --- configure 2013-05-22 21:42:15 +0000 |
3779 | +++ configure 2014-07-15 20:47:56 +0000 |
3780 | @@ -1,6 +1,6 @@ |
3781 | #! /bin/sh |
3782 | # Guess values for system-dependent variables and create Makefiles. |
3783 | -# Generated by GNU Autoconf 2.69 for xfce4-timer-plugin 1.5.0. |
3784 | +# Generated by GNU Autoconf 2.69 for xfce4-timer-plugin 1.6.0. |
3785 | # |
3786 | # Report bugs to <ilgar_eroglu@yahoo.com>. |
3787 | # |
3788 | @@ -590,8 +590,8 @@ |
3789 | # Identity of this package. |
3790 | PACKAGE_NAME='xfce4-timer-plugin' |
3791 | PACKAGE_TARNAME='xfce4-timer-plugin' |
3792 | -PACKAGE_VERSION='1.5.0' |
3793 | -PACKAGE_STRING='xfce4-timer-plugin 1.5.0' |
3794 | +PACKAGE_VERSION='1.6.0' |
3795 | +PACKAGE_STRING='xfce4-timer-plugin 1.6.0' |
3796 | PACKAGE_BUGREPORT='ilgar_eroglu@yahoo.com' |
3797 | PACKAGE_URL='' |
3798 | |
3799 | @@ -1399,7 +1399,7 @@ |
3800 | # Omit some internal or obsolete options to make the list less imposing. |
3801 | # This message is too long to be a string in the A/UX 3.1 sh. |
3802 | cat <<_ACEOF |
3803 | -\`configure' configures xfce4-timer-plugin 1.5.0 to adapt to many kinds of systems. |
3804 | +\`configure' configures xfce4-timer-plugin 1.6.0 to adapt to many kinds of systems. |
3805 | |
3806 | Usage: $0 [OPTION]... [VAR=VALUE]... |
3807 | |
3808 | @@ -1470,7 +1470,7 @@ |
3809 | |
3810 | if test -n "$ac_init_help"; then |
3811 | case $ac_init_help in |
3812 | - short | recursive ) echo "Configuration of xfce4-timer-plugin 1.5.0:";; |
3813 | + short | recursive ) echo "Configuration of xfce4-timer-plugin 1.6.0:";; |
3814 | esac |
3815 | cat <<\_ACEOF |
3816 | |
3817 | @@ -1584,7 +1584,7 @@ |
3818 | test -n "$ac_init_help" && exit $ac_status |
3819 | if $ac_init_version; then |
3820 | cat <<\_ACEOF |
3821 | -xfce4-timer-plugin configure 1.5.0 |
3822 | +xfce4-timer-plugin configure 1.6.0 |
3823 | generated by GNU Autoconf 2.69 |
3824 | |
3825 | Copyright (C) 2012 Free Software Foundation, Inc. |
3826 | @@ -1953,7 +1953,7 @@ |
3827 | This file contains any messages produced by compilers while |
3828 | running configure, to aid debugging if configure makes a mistake. |
3829 | |
3830 | -It was created by xfce4-timer-plugin $as_me 1.5.0, which was |
3831 | +It was created by xfce4-timer-plugin $as_me 1.6.0, which was |
3832 | generated by GNU Autoconf 2.69. Invocation command line was |
3833 | |
3834 | $ $0 $@ |
3835 | @@ -2770,7 +2770,7 @@ |
3836 | |
3837 | # Define the identity of the package. |
3838 | PACKAGE='xfce4-timer-plugin' |
3839 | - VERSION='1.5.0' |
3840 | + VERSION='1.6.0' |
3841 | |
3842 | |
3843 | cat >>confdefs.h <<_ACEOF |
3844 | @@ -12304,7 +12304,7 @@ |
3845 | |
3846 | |
3847 | |
3848 | - ALL_LINGUAS="ar ast ca cs da de el en_GB es eu fr gl hr hu id it ja ko lv nl pl pt pt_BR ru sk sq sr sv tr ug uk ur ur_PK zh_CN zh_TW " |
3849 | + ALL_LINGUAS="ar ast bg ca cs da de el en_AU en_GB es eu fr gl hr hu id it ja ko lv ms nb nl oc pl pt pt_BR ru sk sq sr sv th tr ug uk ur ur_PK zh_CN zh_TW " |
3850 | |
3851 | for ac_header in locale.h |
3852 | do : |
3853 | @@ -15178,7 +15178,7 @@ |
3854 | # report actual input values of CONFIG_FILES etc. instead of their |
3855 | # values after options handling. |
3856 | ac_log=" |
3857 | -This file was extended by xfce4-timer-plugin $as_me 1.5.0, which was |
3858 | +This file was extended by xfce4-timer-plugin $as_me 1.6.0, which was |
3859 | generated by GNU Autoconf 2.69. Invocation command line was |
3860 | |
3861 | CONFIG_FILES = $CONFIG_FILES |
3862 | @@ -15244,7 +15244,7 @@ |
3863 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
3864 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
3865 | ac_cs_version="\\ |
3866 | -xfce4-timer-plugin config.status 1.5.0 |
3867 | +xfce4-timer-plugin config.status 1.6.0 |
3868 | configured by $0, generated by GNU Autoconf 2.69, |
3869 | with options \\"\$ac_cs_config\\" |
3870 | |
3871 | |
3872 | === modified file 'configure.in' |
3873 | --- configure.in 2013-05-22 21:42:15 +0000 |
3874 | +++ configure.in 2014-07-15 20:47:56 +0000 |
3875 | @@ -10,12 +10,14 @@ |
3876 | |
3877 | dnl version info |
3878 | m4_define([xfce4_timer_version_major], [1]) |
3879 | -m4_define([xfce4_timer_version_minor], [5]) |
3880 | +m4_define([xfce4_timer_version_minor], [6]) |
3881 | m4_define([xfce4_timer_version_micro], [0]) |
3882 | -m4_define([xfce4_timer_version_build], [49a7be4]) |
3883 | +m4_define([xfce4_timer_version_build], [b92a1f2]) |
3884 | m4_define([xfce4_timer_version_tag]) # Leave empty only for releases, but use 'git' in most cases |
3885 | m4_define([xfce4_timer_version], [xfce4_timer_version_major().xfce4_timer_version_minor().xfce4_timer_version_micro()ifelse(xfce4_timer_version_tag(), [], [],[xfce4_timer_version_tag()-xfce4_timer_version_build()])]) |
3886 | |
3887 | +libexecdir = ${exec_prefix}/libexec |
3888 | + |
3889 | dnl init autoconf |
3890 | AC_INIT([xfce4-timer-plugin], [xfce4_timer_version], [ilgar_eroglu@yahoo.com]) |
3891 | AC_PREREQ([2.50]) |
3892 | @@ -39,7 +41,7 @@ |
3893 | AC_HEADER_STDC |
3894 | |
3895 | dnl Check for i18n support |
3896 | -XDT_I18N([ar ast ca cs da de el en_GB es eu fr gl hr hu id it ja ko lv nl pl pt pt_BR ru sk sq sr sv tr ug uk ur ur_PK zh_CN zh_TW ]) |
3897 | +XDT_I18N([ar ast bg ca cs da de el en_AU en_GB es eu fr gl hr hu id it ja ko lv ms nb nl oc pl pt pt_BR ru sk sq sr sv th tr ug uk ur ur_PK zh_CN zh_TW ]) |
3898 | |
3899 | dnl required |
3900 | XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.4.0]) |
3901 | |
3902 | === modified file 'debian/changelog' |
3903 | --- debian/changelog 2013-05-22 21:42:15 +0000 |
3904 | +++ debian/changelog 2014-07-15 20:47:56 +0000 |
3905 | @@ -1,3 +1,9 @@ |
3906 | +xfce4-timer-plugin (1.6.0-0ubuntu1) utopic; urgency=medium |
3907 | + |
3908 | + * New upstream release. |
3909 | + |
3910 | + -- Jackson Doak <noskcaj@ubuntu.com> Tue, 15 Jul 2014 08:18:33 +1000 |
3911 | + |
3912 | xfce4-timer-plugin (1.5.0-1) unstable; urgency=low |
3913 | |
3914 | * New upstream release. closes: #709338 |
3915 | |
3916 | === modified file 'debian/control' |
3917 | --- debian/control 2013-05-22 21:42:15 +0000 |
3918 | +++ debian/control 2014-07-15 20:47:56 +0000 |
3919 | @@ -1,7 +1,8 @@ |
3920 | Source: xfce4-timer-plugin |
3921 | Section: xfce |
3922 | Priority: optional |
3923 | -Maintainer: Debian Xfce Maintainers <pkg-xfce-devel@lists.alioth.debian.org> |
3924 | +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
3925 | +XSBC-Original-Maintainer: Debian Xfce Maintainers <pkg-xfce-devel@lists.alioth.debian.org> |
3926 | Uploaders: Yves-Alexis Perez <corsac@debian.org>, Lionel Le Folgoc <mrpouit@gmail.com> |
3927 | Build-Depends: debhelper (>= 9), libxml-parser-perl, |
3928 | xfce4-panel-dev, intltool, pkg-config, libglib2.0-dev, |
3929 | |
3930 | === modified file 'debian/patches/01_improve-timer-stop.patch' |
3931 | --- debian/patches/01_improve-timer-stop.patch 2013-05-22 21:42:15 +0000 |
3932 | +++ debian/patches/01_improve-timer-stop.patch 2014-07-15 20:47:56 +0000 |
3933 | @@ -1,11 +1,15 @@ |
3934 | +--- |
3935 | + src/xfcetimer.c | 2 ++ |
3936 | + 1 file changed, 2 insertions(+) |
3937 | + |
3938 | --- a/src/xfcetimer.c |
3939 | +++ b/src/xfcetimer.c |
3940 | -@@ -162,6 +162,8 @@ static gboolean update_function (gpointe |
3941 | +@@ -167,6 +167,8 @@ static gboolean update_function (gpointe |
3942 | } |
3943 | |
3944 | /* Countdown is over, stop timer and free resources */ |
3945 | + g_snprintf(tiptext,31,_("%ds left"),0); |
3946 | + gtk_tooltips_set_tip(pd->tip,GTK_WIDGET(pd->base),tiptext,NULL); |
3947 | |
3948 | - if( (strlen(pd->timeout_command)==0) || !pd->nowin_if_alarm ) { |
3949 | - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pd->pbar),1); |
3950 | + if(pd->timer) |
3951 | + g_timer_destroy(pd->timer); |
3952 | |
3953 | === modified file 'debian/patches/02_fix-format-string.patch' |
3954 | --- debian/patches/02_fix-format-string.patch 2013-05-22 21:42:15 +0000 |
3955 | +++ debian/patches/02_fix-format-string.patch 2014-07-15 20:47:56 +0000 |
3956 | @@ -1,13 +1,18 @@ |
3957 | Author: Yves-Alexis Perez <corsac@debian.org> |
3958 | Description: Fix format string issue |
3959 | Forwarded: https://bugzilla.xfce.org/show_bug.cgi?id=10110 |
3960 | +--- |
3961 | + src/xfcetimer.c | 2 +- |
3962 | + 1 file changed, 1 insertion(+), 1 deletion(-) |
3963 | + |
3964 | --- a/src/xfcetimer.c |
3965 | +++ b/src/xfcetimer.c |
3966 | -@@ -175,6 +175,7 @@ static gboolean update_function (gpointe |
3967 | - GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, |
3968 | +@@ -192,7 +192,7 @@ static gboolean update_function (gpointe |
3969 | + |
3970 | + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, |
3971 | GTK_MESSAGE_WARNING, |
3972 | - GTK_BUTTONS_CLOSE, |
3973 | -+ "%s", |
3974 | - dialog_message); |
3975 | - |
3976 | - g_signal_connect_swapped (dialog, "response", |
3977 | +- GTK_BUTTONS_NONE, dialog_message); |
3978 | ++ GTK_BUTTONS_NONE, "%s",dialog_message); |
3979 | + |
3980 | + gtk_window_set_title ((GtkWindow *) dialog, dialog_title); |
3981 | + |
3982 | |
3983 | === modified file 'icons/48x48/Makefile.in' |
3984 | --- icons/48x48/Makefile.in 2013-05-22 21:42:15 +0000 |
3985 | +++ icons/48x48/Makefile.in 2014-07-15 20:47:56 +0000 |
3986 | @@ -54,11 +54,10 @@ |
3987 | subdir = icons/48x48 |
3988 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in |
3989 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
3990 | -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ |
3991 | - $(top_srcdir)/configure.in |
3992 | +am__aclocal_m4_deps = $(top_srcdir)/configure.in |
3993 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
3994 | $(ACLOCAL_M4) |
3995 | -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
3996 | +mkinstalldirs = $(install_sh) -d |
3997 | CONFIG_HEADER = $(top_builddir)/config.h |
3998 | CONFIG_CLEAN_FILES = |
3999 | CONFIG_CLEAN_VPATH_FILES = |
4000 | |
4001 | === modified file 'icons/Makefile.in' |
4002 | --- icons/Makefile.in 2013-05-22 21:42:15 +0000 |
4003 | +++ icons/Makefile.in 2014-07-15 20:47:56 +0000 |
4004 | @@ -53,11 +53,10 @@ |
4005 | subdir = icons |
4006 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in |
4007 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
4008 | -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ |
4009 | - $(top_srcdir)/configure.in |
4010 | +am__aclocal_m4_deps = $(top_srcdir)/configure.in |
4011 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
4012 | $(ACLOCAL_M4) |
4013 | -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs |
4014 | +mkinstalldirs = $(install_sh) -d |
4015 | CONFIG_HEADER = $(top_builddir)/config.h |
4016 | CONFIG_CLEAN_FILES = |
4017 | CONFIG_CLEAN_VPATH_FILES = |
4018 | |
4019 | === removed file 'mkinstalldirs' |
4020 | --- mkinstalldirs 2011-09-04 22:46:46 +0000 |
4021 | +++ mkinstalldirs 1970-01-01 00:00:00 +0000 |
4022 | @@ -1,162 +0,0 @@ |
4023 | -#! /bin/sh |
4024 | -# mkinstalldirs --- make directory hierarchy |
4025 | - |
4026 | -scriptversion=2009-04-28.21; # UTC |
4027 | - |
4028 | -# Original author: Noah Friedman <friedman@prep.ai.mit.edu> |
4029 | -# Created: 1993-05-16 |
4030 | -# Public domain. |
4031 | -# |
4032 | -# This file is maintained in Automake, please report |
4033 | -# bugs to <bug-automake@gnu.org> or send patches to |
4034 | -# <automake-patches@gnu.org>. |
4035 | - |
4036 | -nl=' |
4037 | -' |
4038 | -IFS=" "" $nl" |
4039 | -errstatus=0 |
4040 | -dirmode= |
4041 | - |
4042 | -usage="\ |
4043 | -Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... |
4044 | - |
4045 | -Create each directory DIR (with mode MODE, if specified), including all |
4046 | -leading file name components. |
4047 | - |
4048 | -Report bugs to <bug-automake@gnu.org>." |
4049 | - |
4050 | -# process command line arguments |
4051 | -while test $# -gt 0 ; do |
4052 | - case $1 in |
4053 | - -h | --help | --h*) # -h for help |
4054 | - echo "$usage" |
4055 | - exit $? |
4056 | - ;; |
4057 | - -m) # -m PERM arg |
4058 | - shift |
4059 | - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } |
4060 | - dirmode=$1 |
4061 | - shift |
4062 | - ;; |
4063 | - --version) |
4064 | - echo "$0 $scriptversion" |
4065 | - exit $? |
4066 | - ;; |
4067 | - --) # stop option processing |
4068 | - shift |
4069 | - break |
4070 | - ;; |
4071 | - -*) # unknown option |
4072 | - echo "$usage" 1>&2 |
4073 | - exit 1 |
4074 | - ;; |
4075 | - *) # first non-opt arg |
4076 | - break |
4077 | - ;; |
4078 | - esac |
4079 | -done |
4080 | - |
4081 | -for file |
4082 | -do |
4083 | - if test -d "$file"; then |
4084 | - shift |
4085 | - else |
4086 | - break |
4087 | - fi |
4088 | -done |
4089 | - |
4090 | -case $# in |
4091 | - 0) exit 0 ;; |
4092 | -esac |
4093 | - |
4094 | -# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and |
4095 | -# mkdir -p a/c at the same time, both will detect that a is missing, |
4096 | -# one will create a, then the other will try to create a and die with |
4097 | -# a "File exists" error. This is a problem when calling mkinstalldirs |
4098 | -# from a parallel make. We use --version in the probe to restrict |
4099 | -# ourselves to GNU mkdir, which is thread-safe. |
4100 | -case $dirmode in |
4101 | - '') |
4102 | - if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then |
4103 | - echo "mkdir -p -- $*" |
4104 | - exec mkdir -p -- "$@" |
4105 | - else |
4106 | - # On NextStep and OpenStep, the `mkdir' command does not |
4107 | - # recognize any option. It will interpret all options as |
4108 | - # directories to create, and then abort because `.' already |
4109 | - # exists. |
4110 | - test -d ./-p && rmdir ./-p |
4111 | - test -d ./--version && rmdir ./--version |
4112 | - fi |
4113 | - ;; |
4114 | - *) |
4115 | - if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && |
4116 | - test ! -d ./--version; then |
4117 | - echo "mkdir -m $dirmode -p -- $*" |
4118 | - exec mkdir -m "$dirmode" -p -- "$@" |
4119 | - else |
4120 | - # Clean up after NextStep and OpenStep mkdir. |
4121 | - for d in ./-m ./-p ./--version "./$dirmode"; |
4122 | - do |
4123 | - test -d $d && rmdir $d |
4124 | - done |
4125 | - fi |
4126 | - ;; |
4127 | -esac |
4128 | - |
4129 | -for file |
4130 | -do |
4131 | - case $file in |
4132 | - /*) pathcomp=/ ;; |
4133 | - *) pathcomp= ;; |
4134 | - esac |
4135 | - oIFS=$IFS |
4136 | - IFS=/ |
4137 | - set fnord $file |
4138 | - shift |
4139 | - IFS=$oIFS |
4140 | - |
4141 | - for d |
4142 | - do |
4143 | - test "x$d" = x && continue |
4144 | - |
4145 | - pathcomp=$pathcomp$d |
4146 | - case $pathcomp in |
4147 | - -*) pathcomp=./$pathcomp ;; |
4148 | - esac |
4149 | - |
4150 | - if test ! -d "$pathcomp"; then |
4151 | - echo "mkdir $pathcomp" |
4152 | - |
4153 | - mkdir "$pathcomp" || lasterr=$? |
4154 | - |
4155 | - if test ! -d "$pathcomp"; then |
4156 | - errstatus=$lasterr |
4157 | - else |
4158 | - if test ! -z "$dirmode"; then |
4159 | - echo "chmod $dirmode $pathcomp" |
4160 | - lasterr= |
4161 | - chmod "$dirmode" "$pathcomp" || lasterr=$? |
4162 | - |
4163 | - if test ! -z "$lasterr"; then |
4164 | - errstatus=$lasterr |
4165 | - fi |
4166 | - fi |
4167 | - fi |
4168 | - fi |
4169 | - |
4170 | - pathcomp=$pathcomp/ |
4171 | - done |
4172 | -done |
4173 | - |
4174 | -exit $errstatus |
4175 | - |
4176 | -# Local Variables: |
4177 | -# mode: shell-script |
4178 | -# sh-indentation: 2 |
4179 | -# eval: (add-hook 'write-file-hooks 'time-stamp) |
4180 | -# time-stamp-start: "scriptversion=" |
4181 | -# time-stamp-format: "%:y-%02m-%02d.%02H" |
4182 | -# time-stamp-time-zone: "UTC" |
4183 | -# time-stamp-end: "; # UTC" |
4184 | -# End: |
4185 | |
4186 | === removed file 'po/ChangeLog' |
4187 | --- po/ChangeLog 2011-09-04 22:46:46 +0000 |
4188 | +++ po/ChangeLog 1970-01-01 00:00:00 +0000 |
4189 | @@ -1,224 +0,0 @@ |
4190 | -2009-08-08 Mike Massonnet <mmassonnet@xfce.org> |
4191 | - |
4192 | - * ast.po: Asturian translation added (Marcos Alvarez Costales) |
4193 | - |
4194 | -2009-07-25 Gabor Kelemen <kelemeng@gnome.hu> |
4195 | - |
4196 | - * hu.po: Translation reworked. |
4197 | - |
4198 | -2009-05-29 Mike Massonnet <mmassonnet@xfce.org> |
4199 | - |
4200 | - * ur_PK.po: Urdu Pakistan translation update (Muhammad Ali Makki) |
4201 | - * ur.po: Urdu translation update (Muhammad Ali Makki) |
4202 | - |
4203 | -2009-04-26 Stavros Giannouris <stavrosg@hellug.gr> |
4204 | - |
4205 | - * el.po, LINGUAS: Greek translation added (Evaggelos Balaskas) |
4206 | - |
4207 | -2009-04-16 Mike Massonnet <mmassonnet@xfce.org> |
4208 | - |
4209 | - * gl.po: Galician translation update (Leandro Regueiro) |
4210 | - |
4211 | -2009-03-30 Piotr Sokół <piotr.sokol@10g.pl> |
4212 | - |
4213 | - * pl.po: Polish translation update |
4214 | - |
4215 | -2009-03-14 Maximilian Schleiss <maximilian@xfce.org> |
4216 | - |
4217 | - * gl.po: Galician translation update (Leandro Regueiro) |
4218 | - |
4219 | -2009-03-06 Maximilian Schleiss <maximilian@xfce.org> |
4220 | - |
4221 | - * ca.po: Catalan translation update (Harald Servat) |
4222 | - |
4223 | -2009-03-05 Mike Massonnet <mmassonnet@xfce.org> |
4224 | - |
4225 | - * pt.po: Renamed pt_PT.po to pt.po (bug #4574) |
4226 | - |
4227 | -2009-03-01 Maximilian Schleiss <maximilian@xfce.org> |
4228 | - |
4229 | - * pl.po: Polish translation update (Piotr Sokół) |
4230 | - |
4231 | ->>>>>>> .r7285 |
4232 | -2009-02-22 Mike Massonnet <mmassonnet@xfce.org> |
4233 | - |
4234 | - * es.po: Add Spanish translation (Abel Martín) |
4235 | - |
4236 | -2009-02-20 Maximilian Schleiss <maximilian@xfce.org> |
4237 | - |
4238 | - * gl.po: Galician translation update (Leandro Regueiro) |
4239 | - |
4240 | -2009-02-07 Maximilian Schleiss <maximilian@xfce.org> |
4241 | - |
4242 | - * it.po; LINGUAS: Italian translation added (Cristian Marchi) |
4243 | - |
4244 | -2009-02-07 Alexander Toresson <eulex@xfce.org> |
4245 | - |
4246 | - * sv.po: Swedish translation update (Daniel Nylander) |
4247 | - |
4248 | -2009-02-01 Michal Várady <miko.vaji@gmail.com> |
4249 | - |
4250 | - * cs.po: Czech translation fixed |
4251 | - |
4252 | -2009-01-13 Alexander Toresson <eulex@xfce.org> |
4253 | - |
4254 | - * sv.po, LINGUAS: Swedish translation added (Daniel Nylander) |
4255 | - |
4256 | -2008-12-13 Maximilian Schleiss <maximilian@xfce.org> |
4257 | - |
4258 | - * zh_CN.po: Simplified Chinese translation added (Hunt Xu) |
4259 | - |
4260 | -2008-11-16 Eren Türkay <erenturkay@xfce.org> |
4261 | - |
4262 | - * tr.po: Turkish translation update (Gökmen Görgen) |
4263 | - |
4264 | -2008-11-12 Piarres Beobide <pi@beobide.net> |
4265 | - |
4266 | - * eu.po: Basque translation update |
4267 | - |
4268 | -2008-11-09 Maximilian Schleiss <maximilian@xfce.org> |
4269 | - |
4270 | - * sq.po: Albanian translation update (Besnik Bleta) |
4271 | - |
4272 | -2008-10-12 Lars Nielsen <lars@mit-web.dk> |
4273 | - |
4274 | - * da.po: Danish translation update |
4275 | - |
4276 | -2008-10-10 Maximilian Schleiss <maximilian@xfce.org> |
4277 | - |
4278 | - * ja.po: Japanese translation update (Nobuhiro Iwamatsu) |
4279 | - |
4280 | -2008-07-30 Og Maciel <ogmaciel@gnome.org> |
4281 | - |
4282 | - * pt_BR.po: Updated Brazilian Protuguese translation (Fábio Nogueira) |
4283 | - |
4284 | -2008-07-15 Mohamed Magdy <alnokta@xfce.org> |
4285 | - |
4286 | - * ar.po: Add Arabic translation |
4287 | - |
4288 | -2008-06-26 Maximilian Schleiss <maximilian@xfce.org> |
4289 | - |
4290 | - * gl.po, LINGUAS: Galician translation added (Leandro Regueiro) |
4291 | - |
4292 | -2008-06-25 Maximilian Schleiss <maximilian@xfce.org> |
4293 | - |
4294 | - * id.po, LINGUAS: Indonesian translation added (Andhika Padmawan) |
4295 | - |
4296 | -2008-05-27 Mike Massonnet <mmassonnet@xfce.org> |
4297 | - |
4298 | - * da.po, LINGUAS: Add Danish translation (Jens Hyllegaard) |
4299 | - |
4300 | -2008-05-14 Mike Massonnet <mmassonnet@xfce.org> |
4301 | - |
4302 | - * ja.po: Update Japanese translation (Nobuhiro Iwamatsu) |
4303 | - |
4304 | -2007-11-18 Maximilian Schleiss <maximilian@xfce.org> |
4305 | - |
4306 | - * lv.po: Latvian translation added |
4307 | - by Rihards Priedītis <rprieditis@inbox.lv> |
4308 | - |
4309 | -2007-11-15 Mike Massonnet <mmassonnet@xfce.org> |
4310 | - |
4311 | - * ur.po: Update translation by Muhammad Ali Makki <makki.ma@gmail.com> |
4312 | - * pk.po, ur.po: Rename pk.po to ur.po. |
4313 | - |
4314 | -2007-10-28 Mike Massonnet <mmassonnet@xfce.org> |
4315 | - |
4316 | - * pk.po: Add new translation by محمد علي المكي <makki.ma@gmail.com> |
4317 | - |
4318 | -2007-09-07 Og Maciel <ogmaciel@gnome.org> |
4319 | - |
4320 | - * pt_BR.po: Brazilian Protuguese translation added |
4321 | - by Vladimir Melo <vladimirmelo@foresightlinux.org> |
4322 | - |
4323 | -2007-07-08 Maximilian Schleiss <maximilian@xfce.org> |
4324 | - |
4325 | - * pt_PT.po: European Protuguese translation added |
4326 | - by Nuno Miguel <nunis@netcabo.pt> |
4327 | - |
4328 | -2007-03-31 Pau Rul-lan Ferragut <paurullan@bulma.net> |
4329 | - |
4330 | - * gb.po: British translation by Jeff Bailes <thepizzaking@gmail.com> |
4331 | - |
4332 | -2007-02-20 Maximilian Schleiss <maximilian@xfce.org> |
4333 | - |
4334 | - * fr.po: Modified the French translation. |
4335 | - |
4336 | -2007-02-02 Maximilian Schleiss <maximilian@xfce.org> |
4337 | - |
4338 | - * sq.po: Added the Albanian translation by |
4339 | - Besnik Bleta <besnik@programeshqip.org> |
4340 | - |
4341 | -2006-09-18 Pau Rul-lan Ferragut <paurullan@bulma.net> |
4342 | - |
4343 | - * ca.po: Add Catalan translation |
4344 | - |
4345 | -2006-09-17 Jean-François Wauthy <pollux@xfce.org> |
4346 | - |
4347 | - * cs.po: Updated Czech translations |
4348 | - * pl.po: Updated Polish translations |
4349 | - |
4350 | -2006-09-03 Jean-François Wauthy <pollux@xfce.org> |
4351 | - |
4352 | - * fr.po: Updated French translations |
4353 | - * pl.po: Updated Polish translations |
4354 | - |
4355 | -2006-08-29 Piarres Beobide <pi@beobide.net> |
4356 | - |
4357 | - * eu.po Basuqe trasnaltion update |
4358 | - |
4359 | -2006-08-27 Jean-François Wauthy <pollux@xfce.org> |
4360 | - |
4361 | - * cs.po: Add Czech translations |
4362 | - |
4363 | -2006-04-23 Kemal Ilgar Eroglu <kieroglu@math.washington.edu> |
4364 | - |
4365 | - * eu.po: Added the file check to configure.in . |
4366 | - * tr.po: Added Turkish translations. |
4367 | - |
4368 | -2006-04-23 Daichi Kawahata <daichi@xfce.org> |
4369 | - |
4370 | - * eu.po: Added Basque translations by Piarres Beobide |
4371 | - <pi@beobide.net>. |
4372 | - |
4373 | -2006-04-09 Daichi Kawahata <daichi@xfce.org> |
4374 | - |
4375 | - * ru.po: Added Russian translations by Andrey Fedoseev |
4376 | - <andrey.fedoseev@gmail.com>. |
4377 | - |
4378 | -2006-04-08 Daichi Kawahata <daichi@xfce.org> |
4379 | - |
4380 | - * pl.po: Added Polish translations by Piotr Malinski |
4381 | - <admin@rk.edu.pl>. |
4382 | - |
4383 | -2006-04-04 Daichi Kawahata <daichi@xfce.org> |
4384 | - |
4385 | - * ja.po: Updated Japanese translations. |
4386 | - * fr.po: Added French translations by Stephane Roy |
4387 | - <sroy@j2n.net>. |
4388 | - |
4389 | -2006-04-03 Daichi Kawahata <daichi@xfce.org> |
4390 | - |
4391 | - * ja.po: Updated Japanese translations. |
4392 | - |
4393 | -2006-04-02 Daichi Kawahata <daichi@xfce.org> |
4394 | - |
4395 | - * ja.po: Updated Japanese translations. |
4396 | - * hu.po, ja.po, xfce4-timer.pot: Added translatable strings. |
4397 | - * hu.po, ja.po, xfce4-timer.pot: Updated. |
4398 | - |
4399 | -2006-02-23 Szervac Attila <sas@321.hu> |
4400 | - |
4401 | - * hu.po: hu updates. |
4402 | - |
4403 | -2006-02-23 Daichi Kawahata <daichi@xfce.org> |
4404 | - |
4405 | - * xfce4-timer.pot: Added. |
4406 | - * ja.po: Added Japanese translations. |
4407 | - * POTFILES.in: Updated. |
4408 | - * Makefile.in.in: Removed as well. |
4409 | - |
4410 | -2005-12-01 Kemal Ilgar Eroglu <kieroglu@math.washington.edu> |
4411 | - |
4412 | - * ChangeLog, Makefile.in.in, POTFILES.in: Initial import. |
4413 | - |
4414 | |
4415 | === modified file 'po/ar.po' |
4416 | --- po/ar.po 2013-05-22 21:42:15 +0000 |
4417 | +++ po/ar.po 2014-07-15 20:47:56 +0000 |
4418 | @@ -1,158 +1,158 @@ |
4419 | -# mohammad <malham1@gmail.com>, 2012. |
4420 | -# Mohammad Alhargan <malham1@hotmail.com>, 2012. |
4421 | -# محمد الحرقان <malham1@gmail.com>, 2012. |
4422 | +# SOME DESCRIPTIVE TITLE. |
4423 | +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
4424 | +# This file is distributed under the same license as the PACKAGE package. |
4425 | +# |
4426 | +# Translators: |
4427 | +# mohammad alhargan <malham1@hotmail.com>, 2013 |
4428 | +# mohammad alhargan <malham1@hotmail.com>, 2012 |
4429 | +# mohammad alhargan <malham1@hotmail.com>, 2012 |
4430 | +# محمد الحرقان <malham1@gmail.com>, 2012 |
4431 | +# محمد الحرقان <malham1@gmail.com>, 2012 |
4432 | msgid "" |
4433 | msgstr "" |
4434 | -"Project-Id-Version: xfce\n" |
4435 | +"Project-Id-Version: Xfce Panel Plugins\n" |
4436 | "Report-Msgid-Bugs-To: \n" |
4437 | -"POT-Creation-Date: 2013-05-10 12:32+0300\n" |
4438 | -"PO-Revision-Date: 2012-11-18 22:49+0300\n" |
4439 | -"Last-Translator: محمد الحرقان <malham1@gmail.com>\n" |
4440 | -"Language-Team: http://www.vertaal.com.ar/files/factory/ar/list/\n" |
4441 | +"POT-Creation-Date: 2014-06-05 01:42+0300\n" |
4442 | +"PO-Revision-Date: 2013-10-24 04:45+0000\n" |
4443 | +"Last-Translator: mohammad alhargan <malham1@hotmail.com>\n" |
4444 | +"Language-Team: Arabic (http://www.transifex.com/projects/p/xfce/language/" |
4445 | +"ar/)\n" |
4446 | "Language: ar\n" |
4447 | "MIME-Version: 1.0\n" |
4448 | "Content-Type: text/plain; charset=UTF-8\n" |
4449 | "Content-Transfer-Encoding: 8bit\n" |
4450 | "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " |
4451 | -"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" |
4452 | -"X-Generator: Virtaal 0.7.1\n" |
4453 | -"X-Poedit-Language: Arabic\n" |
4454 | +"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" |
4455 | |
4456 | -#: ../src/xfcetimer.c:141 |
4457 | +#: ../src/xfcetimer.c:146 |
4458 | #, c-format |
4459 | msgid "%dh %dm %ds left" |
4460 | msgstr "%dس %dد %ds تبقت" |
4461 | |
4462 | -#: ../src/xfcetimer.c:144 |
4463 | +#: ../src/xfcetimer.c:149 |
4464 | #, c-format |
4465 | msgid "%dm %ds left" |
4466 | msgstr "%dد %dث تبقت" |
4467 | |
4468 | -#: ../src/xfcetimer.c:146 |
4469 | +#: ../src/xfcetimer.c:151 |
4470 | #, c-format |
4471 | msgid "%ds left" |
4472 | msgstr "%dث تبقت" |
4473 | |
4474 | -#: ../src/xfcetimer.c:149 |
4475 | +#: ../src/xfcetimer.c:154 |
4476 | msgid " (Paused)" |
4477 | -msgstr "" |
4478 | +msgstr " (مؤقتاً)" |
4479 | |
4480 | #. Display the name of the alarm when the countdown ends |
4481 | -#: ../src/xfcetimer.c:170 |
4482 | -#, fuzzy, c-format |
4483 | +#: ../src/xfcetimer.c:188 |
4484 | +#, c-format |
4485 | msgid "" |
4486 | "Beeep! :) \n" |
4487 | "Time is up for the alarm %s." |
4488 | msgstr "" |
4489 | -"بيييب! :) \n" |
4490 | -"حان الوقت!" |
4491 | +"ببب! :) \n" |
4492 | +"حان وقت التنبيه %s." |
4493 | |
4494 | -#: ../src/xfcetimer.c:462 |
4495 | +#: ../src/xfcetimer.c:198 |
4496 | #, fuzzy |
4497 | +msgid "Rerun the timer" |
4498 | +msgstr "استئناف التنبيه" |
4499 | + |
4500 | +#: ../src/xfcetimer.c:487 |
4501 | msgid "Resume timer" |
4502 | -msgstr "بدء تشغيل ضبط المؤقت" |
4503 | +msgstr "استئناف التنبيه" |
4504 | |
4505 | -#: ../src/xfcetimer.c:469 ../src/xfcetimer.c:525 |
4506 | +#: ../src/xfcetimer.c:494 ../src/xfcetimer.c:550 |
4507 | msgid "Stop timer" |
4508 | -msgstr "إيقاف ضبط المؤقت" |
4509 | +msgstr "إيقاف التنبيه" |
4510 | |
4511 | -#: ../src/xfcetimer.c:513 |
4512 | -#, fuzzy |
4513 | +#: ../src/xfcetimer.c:538 |
4514 | msgid "Pause timer" |
4515 | -msgstr "بدء تشغيل ضبط المؤقت" |
4516 | +msgstr "إيقاف التنبيه مؤقتاً" |
4517 | |
4518 | -#: ../src/xfcetimer.c:527 |
4519 | +#: ../src/xfcetimer.c:552 |
4520 | msgid "Start timer" |
4521 | -msgstr "بدء تشغيل ضبط المؤقت" |
4522 | +msgstr "تشغيل التنبيه" |
4523 | |
4524 | -#: ../src/xfcetimer.c:536 |
4525 | +#: ../src/xfcetimer.c:561 |
4526 | msgid "Stop the alarm" |
4527 | msgstr "إيقاف التنبيه" |
4528 | |
4529 | -#: ../src/xfcetimer.c:591 ../src/xfcetimer.c:662 |
4530 | +#: ../src/xfcetimer.c:618 ../src/xfcetimer.c:689 |
4531 | #, c-format |
4532 | msgid "%dh %dm %ds" |
4533 | msgstr "%dس %dد %dث" |
4534 | |
4535 | -#: ../src/xfcetimer.c:593 ../src/xfcetimer.c:664 |
4536 | +#: ../src/xfcetimer.c:620 ../src/xfcetimer.c:691 |
4537 | #, c-format |
4538 | msgid "%dm %ds" |
4539 | msgstr "%dد %dث" |
4540 | |
4541 | -#: ../src/xfcetimer.c:595 ../src/xfcetimer.c:666 |
4542 | +#: ../src/xfcetimer.c:622 ../src/xfcetimer.c:693 |
4543 | #, c-format |
4544 | msgid "%ds" |
4545 | msgstr "%dث" |
4546 | |
4547 | -#: ../src/xfcetimer.c:604 ../src/xfcetimer.c:675 |
4548 | +#: ../src/xfcetimer.c:631 ../src/xfcetimer.c:702 |
4549 | #, c-format |
4550 | msgid "At %02d:%02d" |
4551 | msgstr "عند %02d:%02d" |
4552 | |
4553 | -#: ../src/xfcetimer.c:774 |
4554 | -#, fuzzy |
4555 | +#: ../src/xfcetimer.c:801 |
4556 | msgid "Name:" |
4557 | -msgstr "اسم" |
4558 | +msgstr "الاسم:" |
4559 | |
4560 | #. ******** |
4561 | -#: ../src/xfcetimer.c:782 |
4562 | +#: ../src/xfcetimer.c:809 |
4563 | msgid "Enter the countdown time" |
4564 | msgstr "أدخل وقت العد التنازلي" |
4565 | |
4566 | -#: ../src/xfcetimer.c:785 |
4567 | +#: ../src/xfcetimer.c:812 |
4568 | msgid "Enter the time of alarm (24h format)" |
4569 | msgstr "أدخل وقت التنبيه (تنسيق 24 ساعة)" |
4570 | |
4571 | -#: ../src/xfcetimer.c:797 |
4572 | +#: ../src/xfcetimer.c:824 |
4573 | msgid "h " |
4574 | msgstr "س " |
4575 | |
4576 | -#: ../src/xfcetimer.c:802 |
4577 | +#: ../src/xfcetimer.c:829 |
4578 | msgid "m " |
4579 | msgstr "د " |
4580 | |
4581 | -#: ../src/xfcetimer.c:807 |
4582 | +#: ../src/xfcetimer.c:834 |
4583 | msgid "s " |
4584 | msgstr "ث " |
4585 | |
4586 | -#: ../src/xfcetimer.c:810 |
4587 | -#, fuzzy |
4588 | +#: ../src/xfcetimer.c:837 |
4589 | msgid "or" |
4590 | msgstr "أو" |
4591 | |
4592 | #. ************** |
4593 | -#: ../src/xfcetimer.c:830 |
4594 | -#, fuzzy |
4595 | +#: ../src/xfcetimer.c:857 |
4596 | msgid "Command to run:" |
4597 | -msgstr "" |
4598 | -"\n" |
4599 | -"الأمر للتشغيل" |
4600 | +msgstr "أمر لتشغيله:" |
4601 | |
4602 | -#: ../src/xfcetimer.c:860 |
4603 | +#: ../src/xfcetimer.c:887 |
4604 | msgid "Add new alarm" |
4605 | msgstr "أضف تنبيه جديد" |
4606 | |
4607 | -#: ../src/xfcetimer.c:897 |
4608 | +#: ../src/xfcetimer.c:924 |
4609 | msgid "Edit alarm" |
4610 | msgstr "حرّر المنبّه" |
4611 | |
4612 | -#: ../src/xfcetimer.c:1450 ../src/xfcetimer.c:1459 |
4613 | +#: ../src/xfcetimer.c:1495 ../src/xfcetimer.c:1504 |
4614 | msgid "Xfce4 Timer Options" |
4615 | -msgstr "خيارات ضبط مؤقت اكسفس4" |
4616 | +msgstr "خيارات ضبط تنبيه اكسفس4" |
4617 | |
4618 | -#: ../src/xfcetimer.c:1461 |
4619 | -#, fuzzy |
4620 | +#: ../src/xfcetimer.c:1506 |
4621 | msgid "Xfce 4 Timer Plugin" |
4622 | -msgstr "خيارات ضبط المؤقت Xfce4" |
4623 | +msgstr "ملحق تنبيه إكسفس 4" |
4624 | |
4625 | -#: ../src/xfcetimer.c:1507 |
4626 | -#, fuzzy |
4627 | +#: ../src/xfcetimer.c:1552 |
4628 | msgid "Timer name" |
4629 | -msgstr "" |
4630 | -"اسم\n" |
4631 | -"المؤقت" |
4632 | +msgstr "اسم المنبه" |
4633 | |
4634 | -#: ../src/xfcetimer.c:1512 |
4635 | +#: ../src/xfcetimer.c:1557 |
4636 | msgid "" |
4637 | "Countdown period /\n" |
4638 | "Alarm time" |
4639 | @@ -160,73 +160,56 @@ |
4640 | "فترة العد التنازلي /\n" |
4641 | "وقت التنبيه" |
4642 | |
4643 | -#: ../src/xfcetimer.c:1516 |
4644 | +#: ../src/xfcetimer.c:1561 |
4645 | msgid "Alarm command" |
4646 | msgstr "أمر التنبيه" |
4647 | |
4648 | -#: ../src/xfcetimer.c:1572 |
4649 | -#, fuzzy |
4650 | +#: ../src/xfcetimer.c:1617 |
4651 | msgid "Don't display a warning if an alarm command is set" |
4652 | -msgstr "" |
4653 | -"لا تعرض إطار التنبيه\n" |
4654 | -"إذا تم ضبط أمر التنبيه" |
4655 | +msgstr "لا تعرض تحذير إذا تم تعيين أمر تنبيه" |
4656 | |
4657 | -#: ../src/xfcetimer.c:1577 |
4658 | +#: ../src/xfcetimer.c:1622 |
4659 | msgid "Selecting a timer starts it" |
4660 | -msgstr "" |
4661 | +msgstr "تحديد منبه لتشغيله" |
4662 | |
4663 | #. Default alarm command config |
4664 | -#: ../src/xfcetimer.c:1585 |
4665 | -#, fuzzy |
4666 | +#: ../src/xfcetimer.c:1630 |
4667 | msgid "Use a default alarm command" |
4668 | -msgstr "تكرار أمر التنبيه:" |
4669 | +msgstr "استخدم أمر التنبيه الافتراضي" |
4670 | |
4671 | -#: ../src/xfcetimer.c:1592 |
4672 | -#, fuzzy |
4673 | +#: ../src/xfcetimer.c:1637 |
4674 | msgid "Default command: " |
4675 | -msgstr "أمر التنبيه" |
4676 | +msgstr "الأمر الافتراضي: " |
4677 | |
4678 | #. Alarm repetitions config |
4679 | -#: ../src/xfcetimer.c:1604 |
4680 | -#, fuzzy |
4681 | +#: ../src/xfcetimer.c:1649 |
4682 | msgid "Repeat the alarm command" |
4683 | -msgstr "تكرار أمر التنبيه:" |
4684 | +msgstr "تكرار أمر التنبيه" |
4685 | |
4686 | -#: ../src/xfcetimer.c:1611 |
4687 | +#: ../src/xfcetimer.c:1656 |
4688 | msgid "Number of repetitions" |
4689 | msgstr "مرات التكرار" |
4690 | |
4691 | -#: ../src/xfcetimer.c:1617 |
4692 | +#: ../src/xfcetimer.c:1662 |
4693 | msgid " Time interval (sec.)" |
4694 | msgstr " الفاصل الزمني (ثانية.)" |
4695 | |
4696 | -#: ../src/xfcetimer.c:1678 |
4697 | -#, fuzzy |
4698 | +#: ../src/xfcetimer.c:1723 |
4699 | msgid "About xfce4-timer-plugin" |
4700 | -msgstr "خيارات ضبط المؤقت Xfce4" |
4701 | +msgstr "حول xfce4-منبه--الملحق" |
4702 | |
4703 | -#: ../src/xfcetimer.c:1683 |
4704 | +#: ../src/xfcetimer.c:1728 |
4705 | msgid "A plugin to define countdown timers or alarms at given times." |
4706 | -msgstr "" |
4707 | +msgstr "ملحق عداد توقيت التنازلي أو تنبيه في أوقات محددة." |
4708 | |
4709 | -#: ../src/xfcetimer.c:1685 |
4710 | +#: ../src/xfcetimer.c:1730 |
4711 | msgid "Copyright (c) 2005-2013\n" |
4712 | -msgstr "" |
4713 | +msgstr "حقوق الطبع والنشر (ج) عام 2005-2013\n" |
4714 | |
4715 | #: ../src/xfce4-timer.desktop.in.in.h:1 |
4716 | msgid "Xfce4 Timer" |
4717 | -msgstr "مؤقت إكسفس 4" |
4718 | +msgstr "منبه إكسفس 4" |
4719 | |
4720 | #: ../src/xfce4-timer.desktop.in.in.h:2 |
4721 | msgid "Timer plugin for Xfce panel" |
4722 | -msgstr "المؤقت، ملحق لوحة إكس" |
4723 | - |
4724 | -#~ msgid "" |
4725 | -#~ "\n" |
4726 | -#~ "or\n" |
4727 | -#~ msgstr "" |
4728 | -#~ "\n" |
4729 | -#~ "أو\n" |
4730 | - |
4731 | -#~ msgid "Properties" |
4732 | -#~ msgstr "خصائص" |
4733 | +msgstr "التنبيه، ملحق لوحة إكس" |
4734 | |
4735 | === modified file 'po/ast.po' |
4736 | --- po/ast.po 2013-05-22 21:42:15 +0000 |
4737 | +++ po/ast.po 2014-07-15 20:47:56 +0000 |
4738 | @@ -1,152 +1,154 @@ |
4739 | +# SOME DESCRIPTIVE TITLE. |
4740 | +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
4741 | +# This file is distributed under the same license as the PACKAGE package. |
4742 | # |
4743 | +# Translators: |
4744 | +# Tornes Llume <l.lumex03.tornes@gmail.com>, 2014 |
4745 | +# Tornes Llume <l.lumex03.tornes@gmail.com>, 2014 |
4746 | msgid "" |
4747 | msgstr "" |
4748 | -"Project-Id-Version: xfce4-timer-plugin\n" |
4749 | +"Project-Id-Version: Xfce Panel Plugins\n" |
4750 | "Report-Msgid-Bugs-To: \n" |
4751 | -"POT-Creation-Date: 2013-05-10 12:32+0300\n" |
4752 | -"PO-Revision-Date: 2009-07-13 19:55+0100\n" |
4753 | -"Last-Translator: Marcos Antonio Alvarez Costales <marcoscostales@gmail.com>\n" |
4754 | -"Language-Team: Asturian <alministradores@softastur.org>\n" |
4755 | +"POT-Creation-Date: 2014-06-05 01:42+0300\n" |
4756 | +"PO-Revision-Date: 2014-05-08 07:48+0000\n" |
4757 | +"Last-Translator: Tornes Llume <l.lumex03.tornes@gmail.com>\n" |
4758 | +"Language-Team: Asturian (http://www.transifex.com/projects/p/xfce-panel-" |
4759 | +"plugins/language/ast/)\n" |
4760 | "Language: ast\n" |
4761 | "MIME-Version: 1.0\n" |
4762 | "Content-Type: text/plain; charset=UTF-8\n" |
4763 | "Content-Transfer-Encoding: 8bit\n" |
4764 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" |
4765 | |
4766 | -#: ../src/xfcetimer.c:141 |
4767 | +#: ../src/xfcetimer.c:146 |
4768 | #, c-format |
4769 | msgid "%dh %dm %ds left" |
4770 | msgstr "%dh %dm %ds restantes" |
4771 | |
4772 | -#: ../src/xfcetimer.c:144 |
4773 | +#: ../src/xfcetimer.c:149 |
4774 | #, c-format |
4775 | msgid "%dm %ds left" |
4776 | msgstr "%dm %ds restantes" |
4777 | |
4778 | -#: ../src/xfcetimer.c:146 |
4779 | +#: ../src/xfcetimer.c:151 |
4780 | #, c-format |
4781 | msgid "%ds left" |
4782 | msgstr "%ds restantes" |
4783 | |
4784 | -#: ../src/xfcetimer.c:149 |
4785 | +#: ../src/xfcetimer.c:154 |
4786 | msgid " (Paused)" |
4787 | -msgstr "" |
4788 | +msgstr " (Posáu)" |
4789 | |
4790 | #. Display the name of the alarm when the countdown ends |
4791 | -#: ../src/xfcetimer.c:170 |
4792 | -#, fuzzy, c-format |
4793 | +#: ../src/xfcetimer.c:188 |
4794 | +#, c-format |
4795 | msgid "" |
4796 | "Beeep! :) \n" |
4797 | "Time is up for the alarm %s." |
4798 | msgstr "" |
4799 | -"Biiip! :) \n" |
4800 | -"¡Acabóse'l tiempu!" |
4801 | - |
4802 | -#: ../src/xfcetimer.c:462 |
4803 | +"¡Biiiiiiip! :) \n" |
4804 | +"Escosóse'l tiempu pa la to alarma %s." |
4805 | + |
4806 | +#: ../src/xfcetimer.c:198 |
4807 | +#, fuzzy |
4808 | +msgid "Rerun the timer" |
4809 | +msgstr "Posar temporizador" |
4810 | + |
4811 | +#: ../src/xfcetimer.c:487 |
4812 | msgid "Resume timer" |
4813 | msgstr "" |
4814 | |
4815 | -#: ../src/xfcetimer.c:469 ../src/xfcetimer.c:525 |
4816 | +#: ../src/xfcetimer.c:494 ../src/xfcetimer.c:550 |
4817 | msgid "Stop timer" |
4818 | msgstr "Parar temporizador" |
4819 | |
4820 | -#: ../src/xfcetimer.c:513 |
4821 | -#, fuzzy |
4822 | +#: ../src/xfcetimer.c:538 |
4823 | msgid "Pause timer" |
4824 | -msgstr "Entamar temporizador" |
4825 | +msgstr "Posar temporizador" |
4826 | |
4827 | -#: ../src/xfcetimer.c:527 |
4828 | +#: ../src/xfcetimer.c:552 |
4829 | msgid "Start timer" |
4830 | -msgstr "Entamar temporizador" |
4831 | +msgstr "Aniciar temporizador" |
4832 | |
4833 | -#: ../src/xfcetimer.c:536 |
4834 | +#: ../src/xfcetimer.c:561 |
4835 | msgid "Stop the alarm" |
4836 | msgstr "Parar l'alarma" |
4837 | |
4838 | -#: ../src/xfcetimer.c:591 ../src/xfcetimer.c:662 |
4839 | +#: ../src/xfcetimer.c:618 ../src/xfcetimer.c:689 |
4840 | #, c-format |
4841 | msgid "%dh %dm %ds" |
4842 | msgstr "%dh %dm %ds" |
4843 | |
4844 | -#: ../src/xfcetimer.c:593 ../src/xfcetimer.c:664 |
4845 | +#: ../src/xfcetimer.c:620 ../src/xfcetimer.c:691 |
4846 | #, c-format |
4847 | msgid "%dm %ds" |
4848 | msgstr "%dm %ds" |
4849 | |
4850 | -#: ../src/xfcetimer.c:595 ../src/xfcetimer.c:666 |
4851 | +#: ../src/xfcetimer.c:622 ../src/xfcetimer.c:693 |
4852 | #, c-format |
4853 | msgid "%ds" |
4854 | msgstr "%ds" |
4855 | |
4856 | -#: ../src/xfcetimer.c:604 ../src/xfcetimer.c:675 |
4857 | +#: ../src/xfcetimer.c:631 ../src/xfcetimer.c:702 |
4858 | #, c-format |
4859 | msgid "At %02d:%02d" |
4860 | msgstr "A les %02d:%02d" |
4861 | |
4862 | -#: ../src/xfcetimer.c:774 |
4863 | -#, fuzzy |
4864 | +#: ../src/xfcetimer.c:801 |
4865 | msgid "Name:" |
4866 | -msgstr "Nome" |
4867 | +msgstr "Nome:" |
4868 | |
4869 | #. ******** |
4870 | -#: ../src/xfcetimer.c:782 |
4871 | +#: ../src/xfcetimer.c:809 |
4872 | msgid "Enter the countdown time" |
4873 | -msgstr "Meta'l tiempu de cuenta atrás" |
4874 | +msgstr "Introduz el tiempu de la cuenta atrás" |
4875 | |
4876 | -#: ../src/xfcetimer.c:785 |
4877 | +#: ../src/xfcetimer.c:812 |
4878 | msgid "Enter the time of alarm (24h format)" |
4879 | -msgstr "Entre la hora d'alarma (formatu 24h)" |
4880 | +msgstr "Introduz la hora d'alarma (formatu 24h)" |
4881 | |
4882 | -#: ../src/xfcetimer.c:797 |
4883 | +#: ../src/xfcetimer.c:824 |
4884 | msgid "h " |
4885 | msgstr "h " |
4886 | |
4887 | -#: ../src/xfcetimer.c:802 |
4888 | +#: ../src/xfcetimer.c:829 |
4889 | msgid "m " |
4890 | msgstr "m " |
4891 | |
4892 | -#: ../src/xfcetimer.c:807 |
4893 | +#: ../src/xfcetimer.c:834 |
4894 | msgid "s " |
4895 | msgstr "s " |
4896 | |
4897 | -#: ../src/xfcetimer.c:810 |
4898 | -#, fuzzy |
4899 | +#: ../src/xfcetimer.c:837 |
4900 | msgid "or" |
4901 | msgstr "o" |
4902 | |
4903 | #. ************** |
4904 | -#: ../src/xfcetimer.c:830 |
4905 | -#, fuzzy |
4906 | +#: ../src/xfcetimer.c:857 |
4907 | msgid "Command to run:" |
4908 | -msgstr "" |
4909 | -"\n" |
4910 | -"El comandu a executar" |
4911 | +msgstr "Comandu pa executar:" |
4912 | |
4913 | -#: ../src/xfcetimer.c:860 |
4914 | +#: ../src/xfcetimer.c:887 |
4915 | msgid "Add new alarm" |
4916 | -msgstr "Amestar nueva alarma" |
4917 | +msgstr "Amestar alarma nueva" |
4918 | |
4919 | -#: ../src/xfcetimer.c:897 |
4920 | +#: ../src/xfcetimer.c:924 |
4921 | msgid "Edit alarm" |
4922 | msgstr "Editar alarma" |
4923 | |
4924 | -#: ../src/xfcetimer.c:1450 ../src/xfcetimer.c:1459 |
4925 | +#: ../src/xfcetimer.c:1495 ../src/xfcetimer.c:1504 |
4926 | msgid "Xfce4 Timer Options" |
4927 | msgstr "Opciones del temporizador de Xfce4" |
4928 | |
4929 | -#: ../src/xfcetimer.c:1461 |
4930 | -#, fuzzy |
4931 | +#: ../src/xfcetimer.c:1506 |
4932 | msgid "Xfce 4 Timer Plugin" |
4933 | -msgstr "Opciones del temporizador de Xfce4" |
4934 | +msgstr "Complementu temporizador Xfce 4" |
4935 | |
4936 | -#: ../src/xfcetimer.c:1507 |
4937 | -#, fuzzy |
4938 | +#: ../src/xfcetimer.c:1552 |
4939 | msgid "Timer name" |
4940 | -msgstr "" |
4941 | -"Nome del\n" |
4942 | -"temporizador" |
4943 | +msgstr "Nome del temporizador" |
4944 | |
4945 | -#: ../src/xfcetimer.c:1512 |
4946 | +#: ../src/xfcetimer.c:1557 |
4947 | msgid "" |
4948 | "Countdown period /\n" |
4949 | "Alarm time" |
4950 | @@ -154,58 +156,53 @@ |
4951 | "Periodu de cuenta atrás /\n" |
4952 | "Hora d'alarma" |
4953 | |
4954 | -#: ../src/xfcetimer.c:1516 |
4955 | +#: ../src/xfcetimer.c:1561 |
4956 | msgid "Alarm command" |
4957 | msgstr "Comandu d'alarma" |
4958 | |
4959 | -#: ../src/xfcetimer.c:1572 |
4960 | -#, fuzzy |
4961 | +#: ../src/xfcetimer.c:1617 |
4962 | msgid "Don't display a warning if an alarm command is set" |
4963 | -msgstr "" |
4964 | -"Nun amosar la ventana d'alvertencia\n" |
4965 | -"si se configuró un comandu d'alarma" |
4966 | +msgstr "Nun amosar un avisu si s'afita un comandu d'alarma" |
4967 | |
4968 | -#: ../src/xfcetimer.c:1577 |
4969 | +#: ../src/xfcetimer.c:1622 |
4970 | msgid "Selecting a timer starts it" |
4971 | -msgstr "" |
4972 | +msgstr "Esbillar un temporizador col qu'entamar" |
4973 | |
4974 | #. Default alarm command config |
4975 | -#: ../src/xfcetimer.c:1585 |
4976 | -#, fuzzy |
4977 | +#: ../src/xfcetimer.c:1630 |
4978 | msgid "Use a default alarm command" |
4979 | -msgstr "Repetir el comandu d'alarma:" |
4980 | +msgstr "Usar un comandu d'alarma por defeutu" |
4981 | |
4982 | -#: ../src/xfcetimer.c:1592 |
4983 | -#, fuzzy |
4984 | +#: ../src/xfcetimer.c:1637 |
4985 | msgid "Default command: " |
4986 | -msgstr "Comandu d'alarma" |
4987 | +msgstr "Comandu por defeutu:" |
4988 | |
4989 | #. Alarm repetitions config |
4990 | -#: ../src/xfcetimer.c:1604 |
4991 | -#, fuzzy |
4992 | +#: ../src/xfcetimer.c:1649 |
4993 | msgid "Repeat the alarm command" |
4994 | -msgstr "Repetir el comandu d'alarma:" |
4995 | +msgstr "Repetir comandu d'alarma" |
4996 | |
4997 | -#: ../src/xfcetimer.c:1611 |
4998 | +#: ../src/xfcetimer.c:1656 |
4999 | msgid "Number of repetitions" |
5000 | msgstr "Númberu de repeticiones" |
The diff has been truncated for viewing.
Uploaded, thanks!