[easytag] Move parent directory action to the Go menu



commit a1aae3d38e9c439a2ecac02a8393f95619e707e3
Author: David King <amigadave amigadave com>
Date:   Sat May 18 12:39:12 2013 +0100

    Move parent directory action to the Go menu

 src/bar.c        |    3 +++
 src/bar.h        |    1 +
 src/browser.c    |   24 ++----------------------
 src/browser.h    |    1 +
 src/ui_manager.h |    1 +
 5 files changed, 8 insertions(+), 22 deletions(-)
---
diff --git a/src/bar.c b/src/bar.c
index 923ccf9..b6f1d0b 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -247,6 +247,9 @@ void Create_UI (GtkWidget **ppmenubar, GtkWidget **pptoolbar)
         { AM_LOAD_MUSIC_DIR, "folder-music", _("Music Directory"), NULL,
           _("Go to music directory"),
           G_CALLBACK (Browser_Load_Music_Directory) },
+        { AM_LOAD_PARENT_DIR, GTK_STOCK_JUMP_TO, _("_Parent Directory"),
+          "<Alt>Up", _("Go to parent directory"),
+          G_CALLBACK (et_browser_on_action_parent_directory) },
         { AM_LOAD_DEFAULT_DIR, GTK_STOCK_JUMP_TO, _("_Default Directory"),
           "<Control>D", _("Go to default directory"),
           G_CALLBACK (Browser_Load_Default_Directory) },
diff --git a/src/bar.h b/src/bar.h
index 5ad2984..d189a4e 100644
--- a/src/bar.h
+++ b/src/bar.h
@@ -75,6 +75,7 @@ GtkWidget *CheckMenuItemBrowseHiddenDirMainMenu;
 #define AM_LOAD_DOCUMENTS_DIR       "GoToDocument"
 #define AM_LOAD_DOWNLOADS_DIR       "GoToDownload"
 #define AM_LOAD_MUSIC_DIR           "GoToMusic"
+#define AM_LOAD_PARENT_DIR "GoToParent"
 #define AM_LOAD_DEFAULT_DIR         "GoToDefaultPath"
 #define AM_SET_PATH_AS_DEFAULT      "SetDefaultPath"
 #define AM_RENAME_DIR               "RenameDir"
diff --git a/src/browser.c b/src/browser.c
index 1cbd8ab..c21bd5a 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -65,7 +65,6 @@ static GtkTreeStore *directoryTreeModel;
 static GtkListStore *fileListModel;
 static GtkWidget    *BrowserLabel;
 static GtkWidget    *BrowserButton;
-static GtkWidget    *BrowserParentButton;
 static GtkWidget    *BrowserNoteBook;
 static GtkListStore *artistListModel;
 static GtkListStore *albumListModel;
@@ -146,8 +145,6 @@ static void Browser_List_Select_File_By_Iter (GtkTreeIter *iter,
 
 static void Browser_Entry_Activated (void);
 
-static void Browser_Parent_Button_Clicked (void);
-
 static void Browser_Artist_List_Load_Files (ET_File *etfile_to_select);
 static void Browser_Artist_List_Row_Selected (GtkTreeSelection *selection,
                                               gpointer data);
@@ -404,8 +401,8 @@ void Browser_Entry_Set_Text (gchar *text)
 /*
  * Button to go to parent directory
  */
-static void
-Browser_Parent_Button_Clicked (void)
+void
+et_browser_on_action_parent_directory (void)
 {
     gchar *parent_dir, *path;
 
@@ -3140,8 +3137,6 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
     GtkWidget *ScrollWindowArtistList;
     GtkWidget *ScrollWindowAlbumList;
     GtkWidget *Label;
-    GIcon *parent_folder;
-    GtkWidget *Icon;
     gsize i;
     GtkCellRenderer *renderer;
     GtkTreeViewColumn *column;
@@ -3168,21 +3163,6 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
     gtk_box_pack_start(GTK_BOX(VerticalBox),HBox,FALSE,TRUE,0);
 
     /*
-     * The button to go to the parent directory
-     */
-    BrowserParentButton = gtk_button_new();
-    parent_folder = g_themed_icon_new ("go-up");
-    /* TODO: On Win32, GTK_ICON_SIZE_BUTTON enlarge the combobox. */
-    Icon = gtk_image_new_from_gicon (parent_folder,
-                                     GTK_ICON_SIZE_MENU);
-    g_object_unref (parent_folder);
-    gtk_container_add(GTK_CONTAINER(BrowserParentButton),Icon);
-    gtk_box_pack_start(GTK_BOX(HBox),BrowserParentButton,FALSE,FALSE,0);
-    gtk_button_set_relief(GTK_BUTTON(BrowserParentButton),GTK_RELIEF_NONE);
-    g_signal_connect(G_OBJECT(BrowserParentButton),"clicked",G_CALLBACK(Browser_Parent_Button_Clicked),NULL);
-    gtk_widget_set_tooltip_text(BrowserParentButton,_("Go to parent directory"));
-
-    /*
      * The entry box for displaying path
      */
     if (BrowserEntryModel != NULL)
diff --git a/src/browser.h b/src/browser.h
index 5c35faa..9df5475 100644
--- a/src/browser.h
+++ b/src/browser.h
@@ -175,6 +175,7 @@ void                 Browser_Load_Desktop_Directory                 (void);
 void            Browser_Load_Documents_Directory               (void);
 void            Browser_Load_Downloads_Directory               (void);
 void            Browser_Load_Music_Directory                   (void);
+void et_browser_on_action_parent_directory (void);
 
 void         Browser_Load_Default_Directory         (void);
 void         Browser_Reload_Directory               (void);
diff --git a/src/ui_manager.h b/src/ui_manager.h
index 8125de5..71411a5 100644
--- a/src/ui_manager.h
+++ b/src/ui_manager.h
@@ -166,6 +166,7 @@ static const gchar *ui_xml =
 "      <menuitem action='GoToDocument' />"
 "      <menuitem action='GoToDownload' />"
 "      <menuitem action='GoToMusic' />"
+"      <menuitem action='GoToParent' />"
 "      <menuitem action='GoToDefaultPath' />"
 "      <separator />"
 


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