[Xfce4-commits] [panel-plugins/xfce4-timer-plugin] 19/22: When paused, now show list alarms

noreply at xfce.org noreply at xfce.org
Sat Dec 30 06:16:40 CET 2017


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-timer-plugin.

commit 7c740040e869ee9a973132dc9291028767ddac39
Author: Daniel Muñiz Fontoira <dani at damufo.com>
Date:   Tue Dec 19 23:37:01 2017 +0100

    When paused, now show list alarms
---
 panel-plugin/xfcetimer.c | 77 ++++++++++++++++++++++++------------------------
 1 file changed, 38 insertions(+), 39 deletions(-)

diff --git a/panel-plugin/xfcetimer.c b/panel-plugin/xfcetimer.c
index 7c1291f..d1c4a16 100644
--- a/panel-plugin/xfcetimer.c
+++ b/panel-plugin/xfcetimer.c
@@ -488,26 +488,6 @@ make_menu (plugin_data *pd)
 
   pd->menu = gtk_menu_new ();
 
-  /* If the alarm is paused, the only option is to resume or stop */
-  if (pd->is_paused)
-    {
-      menuitem = gtk_menu_item_new_with_label (_ ("Resume timer"));
-
-      gtk_menu_shell_append (GTK_MENU_SHELL (pd->menu), menuitem);
-      g_signal_connect (G_OBJECT (menuitem), "activate",
-                        G_CALLBACK (pause_resume_selected), pd);
-      gtk_widget_show (menuitem);
-
-      menuitem = gtk_menu_item_new_with_label (_ ("Stop timer"));
-
-      gtk_menu_shell_append (GTK_MENU_SHELL (pd->menu), menuitem);
-      g_signal_connect (G_OBJECT (menuitem), "activate",
-                        G_CALLBACK (start_stop_selected), pd);
-      gtk_widget_show (menuitem);
-      gtk_widget_show (pd->menu);
-      return;
-    }
-
   list = pd->alarm_list;
 
   while (list)
@@ -540,39 +520,58 @@ make_menu (plugin_data *pd)
   menuitem = gtk_separator_menu_item_new ();
   gtk_menu_shell_append (GTK_MENU_SHELL (pd->menu), menuitem);
 
-  /* Pause menu item */
-  if (pd->timer_on && !pd->is_paused && pd->is_countdown)
+  /* If the alarm is paused, the only option is to resume or stop */
+  if (pd->is_paused)
     {
-      menuitem = gtk_menu_item_new_with_label (_ ("Pause timer"));
+      menuitem = gtk_menu_item_new_with_label (_ ("Resume timer"));
 
       gtk_menu_shell_append (GTK_MENU_SHELL (pd->menu), menuitem);
       g_signal_connect (G_OBJECT (menuitem), "activate",
                         G_CALLBACK (pause_resume_selected), pd);
-    }
+      gtk_widget_show (menuitem);
 
-  /* Start/stop menu item */
-  if (!pd->alarm_repeating)
-    {
-      if (pd->timer_on)
-        menuitem = gtk_menu_item_new_with_label (_ ("Stop timer"));
-      else
-        menuitem = gtk_menu_item_new_with_label (_ ("Start timer"));
+      menuitem = gtk_menu_item_new_with_label (_ ("Stop timer"));
 
       gtk_menu_shell_append (GTK_MENU_SHELL (pd->menu), menuitem);
       g_signal_connect (G_OBJECT (menuitem), "activate",
                         G_CALLBACK (start_stop_selected), pd);
+      gtk_widget_show (menuitem);
     }
-
-  /* Stop repeating alarm if so */
-  if (pd->alarm_repeating)
+  else
     {
-      menuitem = gtk_menu_item_new_with_label (_ ("Stop the alarm"));
+      /* Pause menu item */
+      if (pd->timer_on && !pd->is_paused && pd->is_countdown)
+        {
+          menuitem = gtk_menu_item_new_with_label (_ ("Pause timer"));
 
-      gtk_menu_shell_append (GTK_MENU_SHELL (pd->menu), menuitem);
-      g_signal_connect (G_OBJECT (menuitem), "activate",
-                        G_CALLBACK (stop_repeating_alarm), pd);
-    }
+          gtk_menu_shell_append (GTK_MENU_SHELL (pd->menu), menuitem);
+          g_signal_connect (G_OBJECT (menuitem), "activate",
+                            G_CALLBACK (pause_resume_selected), pd);
+        }
+
+      /* Start/stop menu item */
+      if (!pd->alarm_repeating)
+        {
+          if (pd->timer_on)
+            menuitem = gtk_menu_item_new_with_label (_ ("Stop timer"));
+          else
+            menuitem = gtk_menu_item_new_with_label (_ ("Start timer"));
 
+          gtk_menu_shell_append (GTK_MENU_SHELL (pd->menu), menuitem);
+          g_signal_connect (G_OBJECT (menuitem), "activate",
+                            G_CALLBACK (start_stop_selected), pd);
+        }
+
+      /* Stop repeating alarm if so */
+      if (pd->alarm_repeating)
+        {
+          menuitem = gtk_menu_item_new_with_label (_ ("Stop the alarm"));
+
+          gtk_menu_shell_append (GTK_MENU_SHELL (pd->menu), menuitem);
+          g_signal_connect (G_OBJECT (menuitem), "activate",
+                            G_CALLBACK (stop_repeating_alarm), pd);
+        }
+    }
   gtk_widget_show_all (pd->menu);
 }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list