[Xfce4-commits] [apps/xfburn] 16/42: upadated the menubar UI

noreply at xfce.org noreply at xfce.org
Tue Oct 15 02:21:59 CEST 2019


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

k   a   t   a   n   a   s   t   e   e   l       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 apps/xfburn.

commit 097d52a326118983df2228d18ff83c8e38c2a3cc
Author: Rene Kjellerup <rk.katana.steel at gmail.com>
Date:   Tue Dec 4 14:26:34 2018 -0800

    upadated the menubar UI
    
    included the app prefix in the UI,
    and now the menubar is operational.
---
 xfburn.ui                   | 22 +++++++++++-----------
 xfburn/xfburn-main-window.c | 18 +++++-------------
 2 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/xfburn.ui b/xfburn.ui
index c5802fc..d1ad38d 100644
--- a/xfburn.ui
+++ b/xfburn.ui
@@ -6,23 +6,23 @@
       <section>
         <item>
           <attribute name="label">New _data composition</attribute>
-          <attribute name="action">new-data-composition</attribute>
+          <attribute name="action">app.new-data-composition</attribute>
         </item>
         <item>
           <attribute name="label">New _audio composition</attribute>
-          <attribute name="action">new-audio-composition</attribute>
+          <attribute name="action">app.new-audio-composition</attribute>
         </item>
       </section>
       <section>
         <item>
           <attribute name="label">_Close composition</attribute>
-          <attribute name="action">close-composition</attribute>
+          <attribute name="action">app.close-composition</attribute>
         </item>
       </section>
       <section>
         <item>
           <attribute name="label">_Quit</attribute>
-          <attribute name="action">quit</attribute>
+          <attribute name="action">app.quit</attribute>
         </item>
       </section>
     </submenu>
@@ -31,7 +31,7 @@
       <section>
         <item>
           <attribute name="label">Prefere_nce</attribute>
-          <attribute name="action">preferences</attribute>
+          <attribute name="action">app.preferences</attribute>
         </item>
       </section>
     </submenu>
@@ -40,11 +40,11 @@
       <section>
         <item>
           <attribute name="label">Blank CD-RW</attribute>
-          <attribute name="action">blank-disc</attribute>
+          <attribute name="action">app.blank-disc</attribute>
         </item>
         <item>
           <attribute name="label">Burn Image</attribute>
-          <attribute name="action">burn-image</attribute>
+          <attribute name="action">app.burn-image</attribute>
         </item>
 <!--        <placeholder name="placeholder-action-cd"/>  -->
       </section>
@@ -54,17 +54,17 @@
       <section>
         <item>
           <attribute name="label">Refresh</attribute>
-          <attribute name="action">refresh</attribute>
+          <attribute name="action">app.refresh</attribute>
         </item>
       </section>
       <section>
         <item>
           <attribute name="label">Show Toolbars</attribute>
-          <attribute name="action">show-toolbar</attribute>
+          <attribute name="action">app.show-toolbar</attribute>
         </item>
         <item>
           <attribute name="label">Show Filebrowser</attribute>
-          <attribute name="action">show-filebrowser</attribute>
+          <attribute name="action">app.show-filebrowser</attribute>
         </item>
 <!--         <placeholder name="placeholder-show"/>   -->
       </section>
@@ -74,7 +74,7 @@
       <section>
         <item>
           <attribute name="label">About</attribute>
-          <attribute name="action">about</attribute>
+          <attribute name="action">app.about</attribute>
         </item>
       </section>
     </submenu>
diff --git a/xfburn/xfburn-main-window.c b/xfburn/xfburn-main-window.c
index a79b480..7233e39 100644
--- a/xfburn/xfburn-main-window.c
+++ b/xfburn/xfburn-main-window.c
@@ -46,7 +46,6 @@
 
 /* private struct */
 typedef struct {
-  GActionGroup *action_group;
   GSimpleActionGroup *action_map;
   GtkBuilder *ui_manager;
 
@@ -265,18 +264,11 @@ xfburn_main_window_init (XfburnMainWindow * mainwin)
   priv->ui_manager = gtk_builder_new ();
   gtk_builder_set_translation_domain (priv->ui_manager, GETTEXT_PACKAGE);
 
-  priv->action_group = gtk_action_group_new ("xfburn-main-window");
   priv->action_map = g_simple_action_group_new();
 
   g_action_map_add_action_entries (priv->action_map, action_entries, G_N_ELEMENTS(action_entries), mainwin);
   g_action_map_add_action_entries (priv->action_map, toggle_action_entries, G_N_ELEMENTS(toggle_action_entries), mainwin);
-  /* gtk_action_group_add_actions (priv->action_group, action_entries, G_N_ELEMENTS (action_entries),
-                                GTK_WIDGET (mainwin));
-  gtk_action_group_add_toggle_actions (priv->action_group, toggle_action_entries,
-                                       G_N_ELEMENTS (toggle_action_entries), GTK_WIDGET (mainwin));
 
-  gtk_ui_manager_insert_action_group (priv->ui_manager, priv->action_group, 0);
-  */
   xfce_resource_push_path (XFCE_RESOURCE_DATA, DATADIR);
   file = xfce_resource_lookup (XFCE_RESOURCE_DATA, "xfburn/xfburn.3.ui");
 
@@ -303,11 +295,11 @@ xfburn_main_window_init (XfburnMainWindow * mainwin)
 
   /* menubar */
   GMenuModel *menu_model = (GMenuModel*)gtk_builder_get_object (priv->ui_manager, "main-menu");
-
-  priv->menubar = gtk_menu_bar_new_from_model(menu_model);
+  
+  priv->menubar = gtk_menu_bar_new_from_model (menu_model);
   if (G_LIKELY (priv->menubar != NULL)) {
-    gtk_widget_insert_action_group(priv->menubar, "xfburn", priv->action_map);
-    gtk_box_pack_start (GTK_BOX (vbox), priv->menubar,FALSE,TRUE,5);
+    gtk_widget_insert_action_group (priv->menubar, "app", priv->action_map);
+    gtk_box_pack_start (GTK_BOX (vbox), priv->menubar, FALSE, FALSE, 0);
     gtk_widget_show (priv->menubar);
   }
 
@@ -631,7 +623,7 @@ static void
 action_show_toolbar (GAction * action, GVariant* param, XfburnMainWindow * window)
 {
   XfburnMainWindowPrivate *priv = XFBURN_MAIN_WINDOW_GET_PRIVATE (window);
-  gboolean toggle = g_variant_get_boolean  (g_action_get_state (action));
+  gboolean toggle = g_variant_get_boolean (g_action_get_state (action));
 
   xfburn_settings_set_boolean ("show-toolbar", toggle);
 

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


More information about the Xfce4-commits mailing list