[nautilus-actions] Restore an operational toolbar



commit d56bc2978a43a20a1dcd36cd2c6cd7361ba7a189
Author: Pierre Wieser <pwieser trychlos org>
Date:   Thu Jun 25 17:20:42 2015 +0200

    Restore an operational toolbar

 src/nact/Makefile.am                          |    7 +-
 src/nact/gtk-convert.png                      |  Bin 0 -> 910 bytes
 src/nact/nact-main-window.c                   |    9 +-
 src/nact/nact-main-window.ui                  |   18 +++-
 src/nact/nact-menu.c                          |   11 +-
 src/nact/nact-toolbar.ui                      |  152 ++++++++++++++++++++++++-
 src/nact/nautilus-actions-config-tool.actions |    8 +-
 7 files changed, 184 insertions(+), 21 deletions(-)
---
diff --git a/src/nact/Makefile.am b/src/nact/Makefile.am
index d9febbb..ec1f189 100644
--- a/src/nact/Makefile.am
+++ b/src/nact/Makefile.am
@@ -29,6 +29,8 @@ bin_PROGRAMS = \
        nautilus-actions-config-tool                                            \
        $(NULL)
 
+icon_fname = $(datadir)/icons/hicolor/48x48/apps/nautilus-actions.png
+
 ui_datadir = $(pkgdatadir)/ui
 
 egg_platform_defines = -DEGG_SM_CLIENT_BACKEND_XSMP
@@ -38,6 +40,7 @@ AM_CPPFLAGS += \
        -I $(top_srcdir)/src                                                            \
        -DGNOMELOCALEDIR=\""$(datadir)/locale"\"                        \
        -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_NACT}\"                         \
+       -DICON_FNAME=\"$(icon_fname)\"                                          \
        -DPKGUIDIR=\"$(ui_datadir)\"                                            \
        $(egg_platform_defines)                                                         \
        $(NAUTILUS_ACTIONS_CFLAGS)                                                      \
@@ -150,7 +153,6 @@ nautilus_actions_config_tool_LDADD = \
 
 actions_files = \
        nautilus-actions-config-tool.actions                            \
-       nautilus-actions-maintainer.actions                                     \
        $(NULL)
 
 ui_files = \
@@ -168,9 +170,10 @@ ui_files = \
        $(NULL)
 
 images_files = \
+       gtk-convert.png                                                                         \
+       gtk-index.png                                                                           \
        locked.png                                                                                      \
        transparent.png                                                                         \
-       gtk-index.png                                                                           \
        $(NULL)
 
 ui_data_DATA = \
diff --git a/src/nact/gtk-convert.png b/src/nact/gtk-convert.png
new file mode 100644
index 0000000..1d37231
Binary files /dev/null and b/src/nact/gtk-convert.png differ
diff --git a/src/nact/nact-main-window.c b/src/nact/nact-main-window.c
index 8dd162a..a816aee 100644
--- a/src/nact/nact-main-window.c
+++ b/src/nact/nact-main-window.c
@@ -147,6 +147,7 @@ enum {
 static const gchar     *st_xmlui_filename         = PKGUIDIR "/nact-main-window.ui";
 static const gchar     *st_toplevel_name          = "MainWindow";
 static const gchar     *st_wsp_name               = NA_IPREFS_MAIN_WINDOW_WSP;
+static const gchar     *st_icon_filename          = ICON_FNAME;
 
 static gint             st_burst_timeout          = 2500;              /* burst timeout in msec */
 static BaseWindowClass *st_parent_class           = NULL;
@@ -717,12 +718,12 @@ setup_main_ui( NactMainWindow *main_window )
        top_widget = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( top_window ), "top" );
        g_return_if_fail( top_widget && GTK_IS_CONTAINER( top_widget ));
 
-       /* reparent */
+       /* reparent
+        */
        g_object_ref( top_widget );
        gtk_container_remove( GTK_CONTAINER( top_window ), top_widget );
        gtk_container_add( GTK_CONTAINER( main_window ), top_widget );
        g_object_unref( top_widget );
-
        gtk_widget_destroy( GTK_WIDGET( top_window ));
        g_object_unref( builder );
 
@@ -750,6 +751,10 @@ setup_main_ui( NactMainWindow *main_window )
        g_return_if_fail( alignment && GTK_IS_CONTAINER( alignment ));
        gtk_container_add( GTK_CONTAINER( alignment ), GTK_WIDGET( bar ));
        main_window->private->statusbar = bar;
+
+       /* application icon
+        */
+       gtk_window_set_default_icon_from_file( st_icon_filename, NULL );
 }
 
 /*
diff --git a/src/nact/nact-main-window.ui b/src/nact/nact-main-window.ui
index 7c7f1f9..b2a294b 100644
--- a/src/nact/nact-main-window.ui
+++ b/src/nact/nact-main-window.ui
@@ -2299,7 +2299,23 @@ Note: this is not yet implemented in Nautilus-Actions.</property>
                               </packing>
                             </child>
                             <child>
-                              <placeholder/>
+                              <object class="GtkFrame" id="frame2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="hexpand">True</property>
+                                <property name="label_xalign">0</property>
+                                <property name="shadow_type">none</property>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child type="label_item">
+                                  <placeholder/>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="left_attach">2</property>
+                                <property name="top_attach">2</property>
+                              </packing>
                             </child>
                             <child>
                               <placeholder/>
diff --git a/src/nact/nact-menu.c b/src/nact/nact-menu.c
index 3d729a2..167eb03 100644
--- a/src/nact/nact-menu.c
+++ b/src/nact/nact-menu.c
@@ -48,7 +48,7 @@
 #include "nact-preferences-editor.h"
 #include "nact-tree-view.h"
 
-static const gchar *st_ui_actions       = PKGUIDIR "/nautilus-actions-config-tool.actions";
+static const gchar *st_uixml_actions    = PKGUIDIR "/nautilus-actions-config-tool.actions";
 static const gchar *st_ui_app_menu      = "app-menu";
 static const gchar *st_ui_menubar       = "menubar";
 
@@ -205,12 +205,12 @@ nact_menu_app( NactApplication *application )
 
        error = NULL;
        builder = gtk_builder_new();
-       if( gtk_builder_add_from_file( builder, st_ui_actions, &error )){
+       if( gtk_builder_add_from_file( builder, st_uixml_actions, &error )){
 
                appmenu = G_MENU_MODEL( gtk_builder_get_object( builder, st_ui_app_menu ));
                if( !appmenu ){
                        g_warning( "%s: unable to find '%s' object in '%s' file",
-                                       thisfn, st_ui_app_menu, st_ui_actions );
+                                       thisfn, st_ui_app_menu, st_uixml_actions );
                } else {
                        gtk_application_set_app_menu( GTK_APPLICATION( application ), appmenu );
                }
@@ -218,7 +218,7 @@ nact_menu_app( NactApplication *application )
                menubar = G_MENU_MODEL( gtk_builder_get_object( builder, st_ui_menubar ));
                if( !menubar ){
                        g_warning( "%s: unable to find '%s' object in '%s' file",
-                                       thisfn, st_ui_menubar, st_ui_actions );
+                                       thisfn, st_ui_menubar, st_uixml_actions );
                } else {
                        gtk_application_set_menubar( GTK_APPLICATION( application ), menubar );
                }
@@ -361,7 +361,10 @@ nact_menu_win( NactMainWindow *main_window )
                                        main_window, MAIN_SIGNAL_UPDATE_SENSITIVITIES,
                                        G_CALLBACK( on_update_sensitivities ), NULL );
 
+       /* install autosave */
        nact_menu_file_init( main_window );
+
+       /* install toolbar submenu */
        nact_menu_view_init( main_window );
 }
 
diff --git a/src/nact/nact-toolbar.ui b/src/nact/nact-toolbar.ui
index 0eaad0f..ae4c99b 100644
--- a/src/nact/nact-toolbar.ui
+++ b/src/nact/nact-toolbar.ui
@@ -7,6 +7,96 @@
     <property name="can_focus">False</property>
     <property name="toolbar_style">both-horiz</property>
     <property name="icon_size">2</property>
+    <child>
+      <object class="GtkToolButton" id="cut-btn">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="tooltip_text" translatable="yes">Cut the selected item(s) to the clipboard</property>
+        <property name="action_name">win.cut</property>
+        <property name="label" translatable="yes">C_ut</property>
+        <property name="use_underline">True</property>
+        <property name="icon_name">edit-cut</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="copy-btn">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="tooltip_text" translatable="yes">Copy the selected item(s) to the 
clipboard</property>
+        <property name="action_name">win.copy</property>
+        <property name="label" translatable="yes">C_opy</property>
+        <property name="use_underline">True</property>
+        <property name="icon_name">edit-copy</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="paste-btn">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="tooltip_text" translatable="yes">Insert the content of the clipboard just before the 
current position</property>
+        <property name="action_name">win.paste</property>
+        <property name="label" translatable="yes">P_aste</property>
+        <property name="use_underline">True</property>
+        <property name="icon_name">edit-paste</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="delete-btn">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="tooltip_text" translatable="yes">Delete the selected item(s)</property>
+        <property name="action_name">win.delete</property>
+        <property name="label" translatable="yes">_Delete</property>
+        <property name="use_underline">True</property>
+        <property name="icon_name">edit-delete</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="reload-btn">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="tooltip_text" translatable="yes">Cancel your current modifications and reload the 
initial list of menus and actions</property>
+        <property name="action_name">win.reload</property>
+        <property name="label" translatable="yes">_Reload</property>
+        <property name="use_underline">True</property>
+        <property name="icon_name">view-refresh</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="preferences-btn">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="tooltip_text" translatable="yes">Edit your preferences</property>
+        <property name="action_name">app.preferences</property>
+        <property name="label" translatable="yes">_Preferences</property>
+        <property name="use_underline">True</property>
+        <property name="icon_name">preferences-system</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
   </object>
   <object class="GtkToolbar" id="file-toolbar">
     <property name="visible">True</property>
@@ -18,10 +108,10 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="tooltip_text" translatable="yes">Define a new action</property>
-        <property name="is_important">True</property>
-        <property name="action_name">new-action</property>
+        <property name="action_name">win.new-action</property>
         <property name="label" translatable="yes">New _action</property>
         <property name="use_underline">True</property>
+        <property name="icon_name">document-new</property>
       </object>
       <packing>
         <property name="expand">False</property>
@@ -33,10 +123,10 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="tooltip_text" translatable="yes">Save the items tree</property>
-        <property name="is_important">True</property>
-        <property name="action_name">save</property>
+        <property name="action_name">win.save</property>
         <property name="label" translatable="yes">_Save</property>
         <property name="use_underline">True</property>
+        <property name="icon_name">document-save</property>
       </object>
       <packing>
         <property name="expand">False</property>
@@ -48,10 +138,10 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="tooltip_text" translatable="yes">Quit the application</property>
-        <property name="is_important">True</property>
-        <property name="action_name">quit</property>
+        <property name="action_name">app.quit</property>
         <property name="label" translatable="yes">_Quit</property>
         <property name="use_underline">True</property>
+        <property name="icon_name">application-exit</property>
       </object>
       <packing>
         <property name="expand">False</property>
@@ -64,11 +154,61 @@
     <property name="can_focus">False</property>
     <property name="toolbar_style">both-horiz</property>
     <property name="icon_size">2</property>
+    <child>
+      <object class="GtkToolButton" id="help-btn">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="tooltip_text" translatable="yes">Display help about this program</property>
+        <property name="action_name">app.help</property>
+        <property name="label" translatable="yes">_Help</property>
+        <property name="use_underline">True</property>
+        <property name="icon_name">help-browser</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="about-btn">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="tooltip_text" translatable="yes">Display informations about this program</property>
+        <property name="action_name">app.about</property>
+        <property name="label" translatable="yes">_About...</property>
+        <property name="use_underline">True</property>
+        <property name="icon_name">help-about</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+  </object>
+  <object class="GtkImage" id="image1">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="pixbuf">gtk-convert.png</property>
   </object>
   <object class="GtkToolbar" id="tools-toolbar">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="toolbar_style">both-horiz</property>
     <property name="icon_size">2</property>
+    <child>
+      <object class="GtkToolButton" id="import-btn">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="tooltip_text" translatable="yes">Import one or more actions from external files into 
your configuration</property>
+        <property name="action_name">win.import</property>
+        <property name="label" translatable="yes">_Import...</property>
+        <property name="use_underline">True</property>
+        <property name="icon_widget">image1</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
   </object>
 </interface>
diff --git a/src/nact/nautilus-actions-config-tool.actions b/src/nact/nautilus-actions-config-tool.actions
index dde9bf0..f0a8366 100644
--- a/src/nact/nautilus-actions-config-tool.actions
+++ b/src/nact/nautilus-actions-config-tool.actions
@@ -6,10 +6,8 @@
           <attribute name="label" translatable="yes">Pre_ferences</attribute>
           <attribute name="action">app.preferences</attribute>
         </item>
-      </section>
-      <section>
         <item>
-          <attribute name="label" translatable="yes">_Content</attribute>
+          <attribute name="label" translatable="yes">_Help</attribute>
           <attribute name="action">app.help</attribute>
           <attribute name="accel">F1</attribute>
         </item>
@@ -17,11 +15,9 @@
           <attribute name="label" translatable="yes">_About Nautilus-Actions</attribute>
           <attribute name="action">app.about</attribute>
         </item>
-      </section>
-      <section>
         <item>
           <attribute name="label" translatable="yes">_Quit</attribute>
-          <attribute name="action">win.quit</attribute>
+          <attribute name="action">app.quit</attribute>
         </item>
       </section>
   </menu>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]