[Xfce4-commits] [apps/squeeze] 03/03: Added Go menu

noreply at xfce.org noreply at xfce.org
Sun Nov 16 16:58:18 CET 2014


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

peter pushed a commit to branch stephan/new-ui
in repository apps/squeeze.

commit 9e042478d1983834029ccb35004ad97d716ef4e5
Author: Peter de Ridder <peter at xfce.org>
Date:   Wed Nov 5 18:54:42 2014 +0100

    Added Go menu
---
 libsqueeze/scanf-parser.c |    2 +-
 src/main_window.c         |  139 ++++++++++++++++++++++++++++++++++++++++++++-
 src/main_window_ui.xml    |    8 +++
 3 files changed, 146 insertions(+), 3 deletions(-)

diff --git a/libsqueeze/scanf-parser.c b/libsqueeze/scanf-parser.c
index d2c2db6..81cb474 100644
--- a/libsqueeze/scanf-parser.c
+++ b/libsqueeze/scanf-parser.c
@@ -519,7 +519,7 @@ skip_datetime (
         LSQScanfParser *parser
     )
 {
-    gchar *ptr;
+    gchar *ptr = NULL;
     gchar *cur;
     const gchar *delim;
 
diff --git a/src/main_window.c b/src/main_window.c
index 7f01ea5..b6ab48d 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -79,6 +79,30 @@ cb_sq_main_window_reload (
     );
 
 static void
+cb_sq_main_window_go_up (
+        GtkAction *,
+        gpointer
+    );
+
+static void
+cb_sq_main_window_go_back (
+        GtkAction *,
+        gpointer
+    );
+
+static void
+cb_sq_main_window_go_forward (
+        GtkAction *,
+        gpointer
+    );
+
+static void
+cb_sq_main_window_go_home (
+        GtkAction *,
+        gpointer
+    );
+
+static void
 cb_sq_main_window_contents (
         GtkAction *,
         gpointer
@@ -173,6 +197,35 @@ static GtkActionEntry action_entries[] =
         NULL,
         N_("_Location Selector"),
         NULL },
+    /* View Menu */
+    { "go-menu",
+        NULL,
+        N_("_Go"),
+        NULL },
+    { "parent-node",
+        GTK_STOCK_GO_UP, /* Icon-name */
+        N_("Open _Parent"), /* Label-text */
+        "<alt>Up", /* Keyboard shortcut */
+        N_("Open the parent folder"), /* Tooltip text */
+        G_CALLBACK( cb_sq_main_window_go_up ) },
+    { "back",
+        GTK_STOCK_GO_BACK, /* Icon-name */
+        N_("_Back"), /* Label-text */
+        "<alt>Left", /* Keyboard shortcut */
+        N_("Open previous visited folder"), /* Tooltip text */
+        G_CALLBACK( cb_sq_main_window_go_back ) },
+    { "forward",
+        GTK_STOCK_GO_FORWARD, /* Icon-name */
+        N_("Forward"), /* Label-text */
+        "<alt>Right", /* Keyboard shortcut */
+        N_("Open next visited folder"), /* Tooltip text */
+        G_CALLBACK( cb_sq_main_window_go_forward ) },
+    { "root-node",
+        GTK_STOCK_HOME, /* Icon-name */
+        N_("Open _Root"), /* Label-text */
+        "<alt>Home", /* Keyboard shortcut */
+        N_("Open the rooot folder"), /* Tooltip text */
+        G_CALLBACK( cb_sq_main_window_go_home ) },
     /* Help Menu */
     { "help-menu",
         NULL,
@@ -591,6 +644,81 @@ cb_sq_main_window_reload (
 }
 
 static void
+cb_sq_main_window_go_up (
+        GtkAction *action,
+        gpointer   user_data
+    )
+{
+    SQMainWindow *window = SQ_MAIN_WINDOW (user_data);
+    LSQArchiveIter *cwd;
+
+    cwd = sq_archive_store_get_root( window->archive_store );
+    if ( NULL == cwd )
+        return;
+    cwd = lsq_archive_iter_get_parent( cwd );
+    if ( NULL == cwd )
+        return;
+
+    /* for now unset and set the model */
+    gtk_tree_view_set_model(
+            GTK_TREE_VIEW( window->tree_view ),
+            NULL
+        );
+    sq_archive_store_set_root( window->archive_store, cwd );
+    lsq_archive_iter_unref( cwd );
+    gtk_tree_view_set_model(
+            GTK_TREE_VIEW( window->tree_view ),
+            GTK_TREE_MODEL( window->archive_store )
+        );
+}
+
+static void
+cb_sq_main_window_go_back (
+        GtkAction *action,
+        gpointer   user_data
+    )
+{
+    return;
+}
+
+static void
+cb_sq_main_window_go_forward (
+        GtkAction *action,
+        gpointer   user_data
+    )
+{
+    return;
+}
+
+static void
+cb_sq_main_window_go_home (
+        GtkAction *action,
+        gpointer   user_data
+    )
+{
+    SQMainWindow *window = SQ_MAIN_WINDOW (user_data);
+    LSQArchive *archive;
+    LSQArchiveIter *root;
+
+    archive = sq_archive_store_get_archive( window->archive_store );
+    if ( NULL == archive )
+        return;
+    root = lsq_archive_get_iter( archive, NULL );
+
+    /* for now unset and set the model */
+    gtk_tree_view_set_model(
+            GTK_TREE_VIEW( window->tree_view ),
+            NULL
+        );
+    sq_archive_store_set_root( window->archive_store, root );
+    lsq_archive_iter_unref( root );
+    gtk_tree_view_set_model(
+            GTK_TREE_VIEW( window->tree_view ),
+            GTK_TREE_MODEL( window->archive_store )
+        );
+}
+
+static void
 cb_sq_main_window_contents (
         GtkAction *action,
         gpointer   user_data
@@ -716,8 +844,15 @@ cb_sq_main_window_row_activated (
 
     if ( lsq_archive_iter_is_directory( entry ) )
     {
+        /* for now unset and set the model */
+        gtk_tree_view_set_model(
+                GTK_TREE_VIEW( window->tree_view ),
+                NULL
+            );
         sq_archive_store_set_root( window->archive_store, entry );
+        gtk_tree_view_set_model(
+                GTK_TREE_VIEW( window->tree_view ),
+                GTK_TREE_MODEL( window->archive_store )
+            );
     }
-
-    lsq_archive_iter_unref( entry );
 }
diff --git a/src/main_window_ui.xml b/src/main_window_ui.xml
index 85f5444..c464b0e 100644
--- a/src/main_window_ui.xml
+++ b/src/main_window_ui.xml
@@ -20,6 +20,14 @@
             </menu>
             <menuitem action="view-menubar" />
         </menu>
+        <menu action="go-menu">
+            <menuitem action="parent-node" />
+            <menuitem action="back" />
+            <menuitem action="forward" />
+            <separator />
+
+            <menuitem action="root-node" />
+        </menu>
         <menu action="help-menu">
             <menuitem action="contents"/>
             <menuitem action="about"/>

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


More information about the Xfce4-commits mailing list