From fcaf6442f0085d728de9e295208afbb2aff6c1e9 Mon Sep 17 00:00:00 2001 From: zhuyaliang <15132211195@163.com> Date: Thu, 4 May 2023 20:31:32 +0800 Subject: Replace deprecated functions and fix compilation warnings Replacing GtkAction with GAction Replacing GtkUIManager with GtkBuilder --- src/actions.c | 418 ++++++++++++------ src/actions.h | 234 +++++++--- src/fr-command-7z.c | 2 - src/fr-command.c | 2 +- src/fr-command.h | 2 +- src/fr-window.c | 354 +++++++-------- src/glib-utils.c | 2 +- src/ui.h | 281 ++++-------- src/ui/menus-toolbars.ui | 1075 +++++++++++++++++++++++++++++++++++++++++----- 9 files changed, 1676 insertions(+), 694 deletions(-) diff --git a/src/actions.c b/src/actions.c index 5b749a8..a02e969 100644 --- a/src/actions.c +++ b/src/actions.c @@ -46,6 +46,35 @@ /* -- new archive -- */ +static struct +{ + const char *id; + void (* activate) (GtkMenuItem *menuitem, + gpointer user_data); +} engramp_menu_popup [] = { + {"popup_open_item", activate_popup_open}, + {"popup_open_select_item", activate_popup_open_select}, + {"popup_extract_item", activate_popup_extract}, + {"popup_cut_item", activate_popup_cut}, + {"popup_paste_item", activate_popup_paste}, + {"popup_rename_item", activate_popup_rename}, + {"popup_delete_item", activate_popup_delete}, + {"popup_open_item1", activate_popup_open_folder}, + {"popup_extract_item1", activate_popup_extract}, + {"popup_cut_item1", activate_popup_cut}, + {"popup_copy_item1", activate_popup_copy}, + {"popup_paste_item1", activate_popup_paste}, + {"popup_rename_item1", activate_popup_rename}, + {"popup_delete_item1", activate_popup_delete}, + {"popup_open_item2", activate_popup_open_folder_from_sidebar}, + {"popup_extract_item2", activate_popup_extract_folder_from_sidebar}, + {"popup_cut_item2", activate_popup_cut_folder_from_sidebar}, + {"popup_copy_item2", activate_popup_copy_folder_from_sidebar}, + {"popup_paste_item2", activate_popup_paste_folder_from_sidebar}, + {"popup_rename_item2", activate_popup_rename_folder_from_sidebar}, + {"popup_delete_item2", activate_popup_delete_folder_from_sidebar}, +}; + static void new_archive (DlgNewData *data, char *uri) @@ -302,6 +331,26 @@ new_file_response_cb (GtkWidget *w, } } +void +init_engramp_menu_popup (FrWindow *window, + GtkBuilder *ui) +{ + int i; + + int n_entries = G_N_ELEMENTS (engramp_menu_popup); + + for (i = 0 ; i < n_entries; i++) + { + GtkWidget *widget = (GtkWidget *)gtk_builder_get_object (ui, engramp_menu_popup[i].id); + + if (engramp_menu_popup[i].activate != NULL) + g_signal_connect (widget, + "activate", + G_CALLBACK (engramp_menu_popup[i].activate), + window); + } +} + void show_new_archive_dialog (FrWindow *window, const char *archive_name) @@ -321,8 +370,9 @@ show_new_archive_dialog (FrWindow *window, } void -activate_action_new (GtkAction *action, - gpointer data) +activate_action_new (GSimpleAction *action, + GVariant *parameter, + gpointer data) { show_new_archive_dialog ((FrWindow*)data, NULL); } @@ -376,8 +426,9 @@ open_file_response_cb (GtkWidget *w, } void -activate_action_open (GtkAction *action, - gpointer data) +activate_action_open (GSimpleAction *action, + GVariant *parameter, + gpointer data) { GtkWidget *file_sel; FrWindow *window = data; @@ -461,8 +512,9 @@ save_file_response_cb (GtkWidget *w, } void -activate_action_save_as (GtkAction *action, - gpointer callback_data) +activate_action_save_as (GSimpleAction *action, + GVariant *parameter, + gpointer callback_data) { FrWindow *window = callback_data; DlgNewData *data; @@ -502,8 +554,9 @@ activate_action_save_as (GtkAction *action, } void -activate_action_test_archive (GtkAction *action, - gpointer data) +activate_action_test_archive (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; @@ -511,8 +564,9 @@ activate_action_test_archive (GtkAction *action, } void -activate_action_properties (GtkAction *action, - gpointer data) +activate_action_properties (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; @@ -520,8 +574,9 @@ activate_action_properties (GtkAction *action, } void -activate_action_close (GtkAction *action, - gpointer data) +activate_action_close (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; @@ -529,106 +584,73 @@ activate_action_close (GtkAction *action, } void -activate_action_add_files (GtkAction *action, - gpointer data) +activate_action_add_files (GSimpleAction *action, + GVariant *parameter, + gpointer data) { add_files_cb (NULL, data); } void -activate_action_add_folder (GtkAction *action, - gpointer data) +activate_action_add_folder (GSimpleAction *action, + GVariant *parameter, + gpointer data) { add_folder_cb (NULL, data); } void -activate_action_extract (GtkAction *action, - gpointer data) +activate_action_extract (GSimpleAction *action, + GVariant *parameter, + gpointer data) { dlg_extract (NULL, data); } void -activate_action_extract_folder_from_sidebar (GtkAction *action, - gpointer data) -{ - dlg_extract_folder_from_sidebar (NULL, data); -} - -void -activate_action_copy (GtkAction *action, - gpointer data) +activate_action_copy (GSimpleAction *action, + GVariant *parameter, + gpointer data) { fr_window_copy_selection ((FrWindow*) data, FALSE); } void -activate_action_cut (GtkAction *action, - gpointer data) +activate_action_cut (GSimpleAction *action, + GVariant *parameter, + gpointer data) { fr_window_cut_selection ((FrWindow*) data, FALSE); } void -activate_action_paste (GtkAction *action, - gpointer data) +activate_action_paste (GSimpleAction *action, + GVariant *parameter, + gpointer data) { fr_window_paste_selection ((FrWindow*) data, FALSE); } void -activate_action_rename (GtkAction *action, - gpointer data) +activate_action_rename (GSimpleAction *action, + GVariant *parameter, + gpointer data) { fr_window_rename_selection ((FrWindow*) data, FALSE); } void -activate_action_delete (GtkAction *action, - gpointer data) +activate_action_delete (GSimpleAction *action, + GVariant *parameter, + gpointer data) { dlg_delete (NULL, data); } void -activate_action_copy_folder_from_sidebar (GtkAction *action, - gpointer data) -{ - fr_window_copy_selection ((FrWindow*) data, TRUE); -} - -void -activate_action_cut_folder_from_sidebar (GtkAction *action, - gpointer data) -{ - fr_window_cut_selection ((FrWindow*) data, TRUE); -} - -void -activate_action_paste_folder_from_sidebar (GtkAction *action, - gpointer data) -{ - fr_window_paste_selection ((FrWindow*) data, TRUE); -} - -void -activate_action_rename_folder_from_sidebar (GtkAction *action, - gpointer data) -{ - fr_window_rename_selection ((FrWindow*) data, TRUE); -} - -void -activate_action_delete_folder_from_sidebar (GtkAction *action, - gpointer data) -{ - dlg_delete_from_sidebar (NULL, data); -} - -void -activate_action_find (GtkAction *action, - gpointer data) +activate_action_find (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; @@ -636,8 +658,9 @@ activate_action_find (GtkAction *action, } void -activate_action_select_all (GtkAction *action, - gpointer data) +activate_action_select_all (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; @@ -645,8 +668,9 @@ activate_action_select_all (GtkAction *action, } void -activate_action_deselect_all (GtkAction *action, - gpointer data) +activate_action_deselect_all (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; @@ -654,93 +678,73 @@ activate_action_deselect_all (GtkAction *action, } void -activate_action_open_with (GtkAction *action, - gpointer data) +activate_action_open_with (GSimpleAction *action, + GVariant *parameter, + gpointer data) { open_with_cb (NULL, (FrWindow*) data); } void -activate_action_view_or_open (GtkAction *action, - gpointer data) -{ - FrWindow *window = data; - GList *file_list; - - file_list = fr_window_get_file_list_selection (window, FALSE, NULL); - if (file_list == NULL) - return; - fr_window_open_files (window, file_list, FALSE); - path_list_free (file_list); -} - -void -activate_action_open_folder (GtkAction *action, - gpointer data) -{ - FrWindow *window = data; - fr_window_current_folder_activated (window, FALSE); -} - -void -activate_action_open_folder_from_sidebar (GtkAction *action, - gpointer data) -{ - FrWindow *window = data; - fr_window_current_folder_activated (window, TRUE); -} - -void -activate_action_password (GtkAction *action, - gpointer data) +activate_action_password (GSimpleAction *action, + GVariant *parameter, + gpointer data) { dlg_password (NULL, (FrWindow*) data); } void -activate_action_view_toolbar (GtkAction *action, - gpointer data) +activate_action_view_toolbar (GSimpleAction *action, + GVariant *state, + gpointer data) { GSettings *settings; settings = g_settings_new (ENGRAMPA_SCHEMA_UI); - g_settings_set_boolean (settings, PREF_UI_VIEW_TOOLBAR, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))); + g_settings_set_boolean (settings, PREF_UI_VIEW_TOOLBAR, g_variant_get_boolean (state)); + g_simple_action_set_state (action, state); g_object_unref (settings); } void -activate_action_view_statusbar (GtkAction *action, - gpointer data) +activate_action_view_statusbar (GSimpleAction *action, + GVariant *state, + gpointer data) { GSettings *settings; settings = g_settings_new (ENGRAMPA_SCHEMA_UI); - g_settings_set_boolean (settings, PREF_UI_VIEW_STATUSBAR, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))); + g_settings_set_boolean (settings, PREF_UI_VIEW_STATUSBAR, g_variant_get_boolean (state)); + g_simple_action_set_state (action, state); g_object_unref (settings); } void -activate_action_view_folders (GtkAction *action, - gpointer data) +activate_action_view_folders (GSimpleAction *action, + GVariant *state, + gpointer data) { GSettings *settings; settings = g_settings_new (ENGRAMPA_SCHEMA_UI); - g_settings_set_boolean (settings, PREF_UI_VIEW_FOLDERS, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))); + g_settings_set_boolean (settings, PREF_UI_VIEW_FOLDERS, g_variant_get_boolean (state)); + g_simple_action_set_state (action, state); g_object_unref (settings); } void -activate_action_stop (GtkAction *action, - gpointer data) +activate_action_stop (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; fr_window_stop (window); } void -activate_action_reload (GtkAction *action, - gpointer data) +activate_action_reload (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; @@ -748,48 +752,54 @@ activate_action_reload (GtkAction *action, } void -activate_action_last_output (GtkAction *action, - gpointer data) +activate_action_last_output (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; fr_window_view_last_output (window, _("Last Output")); } void -activate_action_go_back (GtkAction *action, - gpointer data) +activate_action_go_back (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; fr_window_go_back (window); } void -activate_action_go_forward (GtkAction *action, - gpointer data) +activate_action_go_forward (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; fr_window_go_forward (window); } void -activate_action_go_up (GtkAction *action, - gpointer data) +activate_action_go_up (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; fr_window_go_up_one_level (window); } void -activate_action_go_home (GtkAction *action, - gpointer data) +activate_action_go_home (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; fr_window_go_to_location (window, "/", FALSE); } void -activate_action_manual (GtkAction *action, - gpointer data) +activate_action_manual (GSimpleAction *action, + GVariant *parameter, + gpointer data) { FrWindow *window = data; @@ -800,8 +810,9 @@ activate_action_manual (GtkAction *action, #define EMAILIFY(string) (g_strdelimit ((string), "%", '@')) void -activate_action_about (GtkAction *action, - gpointer gp) +activate_action_about (GSimpleAction *action, + GVariant *parameter, + gpointer gp) { FrWindow *window = gp; const char *documenters [] = { @@ -866,3 +877,136 @@ activate_action_about (GtkAction *action, g_strfreev (authors); g_free (license_text); } + +void +activate_toggle (GSimpleAction *action, + GVariant *parameter, + gpointer user_data) +{ + GVariant *state; + state = g_action_get_state (G_ACTION (action)); + g_action_change_state (G_ACTION (action), g_variant_new_boolean (!g_variant_get_boolean (state))); + g_variant_unref (state); +} + +void +activate_popup_open (GtkMenuItem *menuitem, + gpointer data) +{ + FrWindow *window = data; + GList *file_list; + + file_list = fr_window_get_file_list_selection (window, FALSE, NULL); + if (file_list == NULL) + return; + fr_window_open_files (window, file_list, FALSE); + path_list_free (file_list); + +} + +void +activate_popup_open_select (GtkMenuItem *menuitem, + gpointer data) +{ + open_with_cb (NULL, (FrWindow*) data); +} + +void +activate_popup_extract (GtkMenuItem *menuitem, + gpointer data) +{ + dlg_extract (NULL, data); +} + +void +activate_popup_cut (GtkMenuItem *menuitem, + gpointer data) +{ + fr_window_cut_selection ((FrWindow*) data, FALSE); +} + +void +activate_popup_paste (GtkMenuItem *menuitem, + gpointer data) +{ + fr_window_paste_selection ((FrWindow*) data, FALSE); +} + +void +activate_popup_rename (GtkMenuItem *menuitem, + gpointer data) +{ + fr_window_rename_selection ((FrWindow*) data, FALSE); +} + +void +activate_popup_delete (GtkMenuItem *menuitem, + gpointer data) +{ + dlg_delete (NULL, data); +} + +void +activate_popup_open_folder (GtkMenuItem *menuitem, + gpointer data) +{ + FrWindow *window = data; + fr_window_current_folder_activated (window, FALSE); +} + +void +activate_popup_copy (GtkMenuItem *menuitem, + gpointer data) +{ + fr_window_copy_selection ((FrWindow*) data, FALSE); +} + +void +activate_popup_open_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data) +{ + FrWindow *window = data; + fr_window_current_folder_activated (window, TRUE); +} + +void +activate_popup_extract_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data) +{ + dlg_extract_folder_from_sidebar (NULL, data); +} + +void +activate_popup_copy_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data) +{ + fr_window_copy_selection ((FrWindow*) data, TRUE); +} + +void +activate_popup_cut_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data) +{ + fr_window_cut_selection ((FrWindow*) data, TRUE); +} + +void +activate_popup_paste_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data) +{ + fr_window_paste_selection ((FrWindow*) data, TRUE); +} + +void +activate_popup_rename_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data) +{ + fr_window_rename_selection ((FrWindow*) data, TRUE); +} + +void +activate_popup_delete_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data) +{ + dlg_delete_from_sidebar (NULL, data); +} diff --git a/src/actions.h b/src/actions.h index 41ab4b6..4664e37 100644 --- a/src/actions.h +++ b/src/actions.h @@ -26,55 +26,189 @@ #include #include "fr-window.h" -void show_new_archive_dialog (FrWindow *window, const char *archive_name); - -void activate_action_new (GtkAction *action, gpointer data); -void activate_action_open (GtkAction *action, gpointer data); -void activate_action_save_as (GtkAction *action, gpointer data); -void activate_action_test_archive (GtkAction *action, gpointer data); -void activate_action_properties (GtkAction *action, gpointer data); -void activate_action_close (GtkAction *action, gpointer data); -void activate_action_quit (GtkAction *action, gpointer data); - -void activate_action_add_files (GtkAction *action, gpointer data); -void activate_action_add_folder (GtkAction *action, gpointer data); -void activate_action_extract (GtkAction *action, gpointer data); -void activate_action_extract_folder_from_sidebar (GtkAction *action, gpointer data); - -void activate_action_copy (GtkAction *action, gpointer data); -void activate_action_cut (GtkAction *action, gpointer data); -void activate_action_paste (GtkAction *action, gpointer data); -void activate_action_rename (GtkAction *action, gpointer data); -void activate_action_delete (GtkAction *action, gpointer data); - -void activate_action_copy_folder_from_sidebar (GtkAction *action, gpointer data); -void activate_action_cut_folder_from_sidebar (GtkAction *action, gpointer data); -void activate_action_paste_folder_from_sidebar (GtkAction *action, gpointer data); -void activate_action_rename_folder_from_sidebar (GtkAction *action, gpointer data); -void activate_action_delete_folder_from_sidebar (GtkAction *action, gpointer data); - -void activate_action_find (GtkAction *action, gpointer data); -void activate_action_select_all (GtkAction *action, gpointer data); -void activate_action_deselect_all (GtkAction *action, gpointer data); -void activate_action_open_with (GtkAction *action, gpointer data); -void activate_action_view_or_open (GtkAction *action, gpointer data); -void activate_action_open_folder (GtkAction *action, gpointer data); -void activate_action_open_folder_from_sidebar (GtkAction *action, gpointer data); -void activate_action_password (GtkAction *action, gpointer data); - -void activate_action_view_toolbar (GtkAction *action, gpointer data); -void activate_action_view_statusbar (GtkAction *action, gpointer data); -void activate_action_view_folders (GtkAction *action, gpointer data); -void activate_action_stop (GtkAction *action, gpointer data); -void activate_action_reload (GtkAction *action, gpointer data); -void activate_action_last_output (GtkAction *action, gpointer data); - -void activate_action_go_back (GtkAction *action, gpointer data); -void activate_action_go_forward (GtkAction *action, gpointer data); -void activate_action_go_up (GtkAction *action, gpointer data); -void activate_action_go_home (GtkAction *action, gpointer data); - -void activate_action_manual (GtkAction *action, gpointer data); -void activate_action_about (GtkAction *action, gpointer data); +void show_new_archive_dialog (FrWindow *window, + const char *archive_name); +void activate_action_new (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_open (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_save_as (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_test_archive (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_properties (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_close (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_quit (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_add_files (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_add_folder (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_extract (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_copy (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_cut (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_paste (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_rename (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_delete (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_find (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_select_all (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_deselect_all (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_open_with (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_password (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_view_toolbar (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_view_statusbar (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_view_folders (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_stop (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_reload (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_last_output (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_go_back (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_go_forward (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_go_up (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_go_home (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_manual (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_action_about (GSimpleAction *action, + GVariant *parameter, + gpointer data); + +void activate_toggle (GSimpleAction *action, + GVariant *parameter, + gpointer user_data); + +void activate_popup_open (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_open_select (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_extract (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_cut (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_paste (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_rename (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_delete (GtkMenuItem *menuitem, + gpointer data); + +void init_engramp_menu_popup (FrWindow *window, + GtkBuilder *ui); + +void activate_popup_open_folder (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_copy (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_open_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_extract_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_copy_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_cut_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_paste_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_rename_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data); + +void activate_popup_delete_folder_from_sidebar (GtkMenuItem *menuitem, + gpointer data); #endif /* ACTIONS_H */ diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c index d1617ae..7b40d5e 100644 --- a/src/fr-command-7z.c +++ b/src/fr-command-7z.c @@ -407,8 +407,6 @@ static void process_line__delete (char *line, gpointer data) { - FrCommand *comm = FR_COMMAND (data); - if ((strstr (line, "Wrong password?") != NULL) || (strstr (line, "Enter password") != NULL)) { diff --git a/src/fr-command.c b/src/fr-command.c index 2305032..dcbe9ad 100644 --- a/src/fr-command.c +++ b/src/fr-command.c @@ -79,7 +79,7 @@ const char *action_names[] = { "NONE", "CREATING_ARCHIVE", "SAVING_REMOTE_ARCHIVE" }; -#if MATE_ENABLE_DEBUG +#ifdef MATE_ENABLE_DEBUG const char * get_action_name (FrAction action) { return action_names[action]; diff --git a/src/fr-command.h b/src/fr-command.h index 751b1bb..e2c0b4c 100644 --- a/src/fr-command.h +++ b/src/fr-command.h @@ -60,7 +60,7 @@ typedef enum { FR_ACTION_SAVING_REMOTE_ARCHIVE /* copying the archive to a remote location */ } FrAction; -#if MATE_ENABLE_DEBUG +#ifdef MATE_ENABLE_DEBUG const char * get_action_name (FrAction action); #endif diff --git a/src/fr-window.c b/src/fr-window.c index 665670d..424cad4 100644 --- a/src/fr-window.c +++ b/src/fr-window.c @@ -314,7 +314,10 @@ struct _FrWindowPrivateData { FrArchive *copy_from_archive; - GtkActionGroup *actions; + GActionGroup *actions; + GtkBuilder *ui_manager; + GtkWidget *menubar_recentmenu; + GtkWidget *toolbar_recentmenu; GtkWidget *file_popup_menu; GtkWidget *folder_popup_menu; @@ -604,6 +607,12 @@ fr_window_free_private_data (FrWindow *window) if (window->priv->settings_caja) _g_object_unref (window->priv->settings_caja); + + if (window->priv->ui_manager) + { + g_object_unref (window->priv->ui_manager); + window->priv->ui_manager = NULL; + } } static void @@ -1594,13 +1603,13 @@ get_tree_iter_from_path (FrWindow *window, static void set_sensitive (FrWindow *window, - const char *action_name, - gboolean sensitive) + const char *id, + gboolean sensitive) { - GtkAction *action; + GtkWidget *widget; - action = gtk_action_group_get_action (window->priv->actions, action_name); - g_object_set (action, "sensitive", sensitive, NULL); + widget = (GtkWidget *)gtk_builder_get_object (window->priv->ui_manager, id); + g_object_set (widget, "sensitive", sensitive, NULL); } static void @@ -1619,10 +1628,10 @@ fr_window_update_current_location (FrWindow *window) gtk_entry_set_text (GTK_ENTRY (window->priv->location_entry), window->priv->archive_present? current_dir: ""); - set_sensitive (window, "GoBack", window->priv->archive_present && (current_dir != NULL) && (window->priv->history_current != NULL) && (window->priv->history_current->next != NULL)); - set_sensitive (window, "GoForward", window->priv->archive_present && (current_dir != NULL) && (window->priv->history_current != NULL) && (window->priv->history_current->prev != NULL)); - set_sensitive (window, "GoUp", window->priv->archive_present && (current_dir != NULL) && (strcmp (current_dir, "/") != 0)); - set_sensitive (window, "GoHome", window->priv->archive_present); + set_sensitive (window, "tool_goback_item", window->priv->archive_present && (current_dir != NULL) && (window->priv->history_current != NULL) && (window->priv->history_current->next != NULL)); + set_sensitive (window, "tool_gonext_item", window->priv->archive_present && (current_dir != NULL) && (window->priv->history_current != NULL) && (window->priv->history_current->prev != NULL)); + set_sensitive (window, "tool_goup_item", window->priv->archive_present && (current_dir != NULL) && (strcmp (current_dir, "/") != 0)); + set_sensitive (window, "tool_gohome_item", window->priv->archive_present); gtk_widget_set_sensitive (window->priv->location_entry, window->priv->archive_present); gtk_widget_set_sensitive (window->priv->location_label, window->priv->archive_present); gtk_widget_set_sensitive (window->priv->filter_entry, window->priv->archive_present); @@ -1933,10 +1942,10 @@ set_active (FrWindow *window, const char *action_name, gboolean is_active) { - GtkAction *action; + GAction *action; - action = gtk_action_group_get_action (window->priv->actions, action_name); - gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), is_active); + action = g_action_map_lookup_action (G_ACTION_MAP (window->priv->actions), action_name); + g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean (is_active)); } static void @@ -1958,7 +1967,9 @@ fr_window_update_paste_command_sensitivity (FrWindow *window, ro = ! no_archive && window->archive->read_only; compr_file = ! no_archive && window->archive->is_compressed_file; - set_sensitive (window, "Paste", ! no_archive && ! ro && ! running && ! compr_file && (window->priv->list_mode != FR_WINDOW_LIST_MODE_FLAT) && gtk_clipboard_wait_is_target_available (clipboard, FR_SPECIAL_URI_LIST)); + set_sensitive (window, "paste_item", ! no_archive && ! ro && ! running && ! compr_file && (window->priv->list_mode != FR_WINDOW_LIST_MODE_FLAT) && gtk_clipboard_wait_is_target_available (clipboard, FR_SPECIAL_URI_LIST)); + set_sensitive (window, "popup_paste_item", ! no_archive && ! ro && ! running && ! compr_file && (window->priv->list_mode != FR_WINDOW_LIST_MODE_FLAT) && gtk_clipboard_wait_is_target_available (clipboard, FR_SPECIAL_URI_LIST)); + set_sensitive (window, "popup_paste_item1", ! no_archive && ! ro && ! running && ! compr_file && (window->priv->list_mode != FR_WINDOW_LIST_MODE_FLAT) && gtk_clipboard_wait_is_target_available (clipboard, FR_SPECIAL_URI_LIST)); } static void @@ -1987,36 +1998,44 @@ fr_window_update_sensitivity (FrWindow *window) one_file_selected = n_selected == 1; dir_selected = selection_has_a_dir (window); - set_sensitive (window, "AddFiles", ! no_archive && ! ro && ! running && ! compr_file); - set_sensitive (window, "AddFiles_Toolbar", ! no_archive && ! ro && ! running && ! compr_file); - set_sensitive (window, "AddFolder", ! no_archive && ! ro && ! running && ! compr_file); - set_sensitive (window, "AddFolder_Toolbar", ! no_archive && ! ro && ! running && ! compr_file); - set_sensitive (window, "Copy", ! no_archive && ! ro && ! running && ! compr_file && sel_not_null && (window->priv->list_mode != FR_WINDOW_LIST_MODE_FLAT)); - set_sensitive (window, "Cut", ! no_archive && ! ro && ! running && ! compr_file && sel_not_null && (window->priv->list_mode != FR_WINDOW_LIST_MODE_FLAT)); - set_sensitive (window, "Delete", ! no_archive && ! ro && ! window->priv->archive_new && ! running && ! compr_file); - set_sensitive (window, "DeselectAll", ! no_archive && sel_not_null); - set_sensitive (window, "Extract", file_op); - set_sensitive (window, "Extract_Toolbar", file_op); - set_sensitive (window, "Find", ! no_archive); - set_sensitive (window, "LastOutput", ((window->archive != NULL) + set_sensitive (window, "add_files_item", ! no_archive && ! ro && ! running && ! compr_file); + set_sensitive (window, "tool_add_files_item", ! no_archive && ! ro && ! running && ! compr_file); + set_sensitive (window, "add_folder_item", ! no_archive && ! ro && ! running && ! compr_file); + set_sensitive (window, "tool_add_folder_item", ! no_archive && ! ro && ! running && ! compr_file); + set_sensitive (window, "copy_item", ! no_archive && ! ro && ! running && ! compr_file && sel_not_null && (window->priv->list_mode != FR_WINDOW_LIST_MODE_FLAT)); + set_sensitive (window, "popup_copy_item", ! no_archive && ! ro && ! running && ! compr_file && sel_not_null && (window->priv->list_mode != FR_WINDOW_LIST_MODE_FLAT)); + set_sensitive (window, "popup_copy_item1", ! no_archive && ! ro && ! running && ! compr_file && sel_not_null && (window->priv->list_mode != FR_WINDOW_LIST_MODE_FLAT)); + set_sensitive (window, "cut_item", ! no_archive && ! ro && ! running && ! compr_file && sel_not_null && (window->priv->list_mode != FR_WINDOW_LIST_MODE_FLAT)); + set_sensitive (window, "popup_cut_item", ! no_archive && ! ro && ! running && ! compr_file && sel_not_null && (window->priv->list_mode != FR_WINDOW_LIST_MODE_FLAT)); + set_sensitive (window, "popup_cut_item1", ! no_archive && ! ro && ! running && ! compr_file && sel_not_null && (window->priv->list_mode != FR_WINDOW_LIST_MODE_FLAT)); + set_sensitive (window, "delete_item", ! no_archive && ! ro && ! window->priv->archive_new && ! running && ! compr_file); + set_sensitive (window, "popup_delete_item", ! no_archive && ! ro && ! window->priv->archive_new && ! running && ! compr_file); + set_sensitive (window, "popup_delete_item1", ! no_archive && ! ro && ! window->priv->archive_new && ! running && ! compr_file); + set_sensitive (window, "deselect_all_item", ! no_archive && sel_not_null); + set_sensitive (window, "extract_item", file_op); + set_sensitive (window, "tool_extract_item", file_op); + set_sensitive (window, "find_item", ! no_archive); + set_sensitive (window, "last_output_item", ((window->archive != NULL) && (window->archive->process != NULL) && (window->archive->process->out.raw != NULL))); - set_sensitive (window, "New", ! running); - set_sensitive (window, "Open", ! running); - set_sensitive (window, "Open_Toolbar", ! running); - set_sensitive (window, "OpenSelection", file_op && sel_not_null && ! dir_selected); - set_sensitive (window, "OpenFolder", file_op && one_file_selected && dir_selected); - set_sensitive (window, "Password", ! running && (window->priv->asked_for_password || (! no_archive && window->archive->command->propPassword))); - set_sensitive (window, "Properties", file_op); - set_sensitive (window, "Close", !running || window->priv->stoppable); - set_sensitive (window, "Reload", ! (no_archive || running)); - set_sensitive (window, "Rename", ! no_archive && ! ro && ! running && ! compr_file && one_file_selected); - set_sensitive (window, "SaveAs", ! no_archive && ! compr_file && ! running); - set_sensitive (window, "SelectAll", ! no_archive); - set_sensitive (window, "Stop", running && window->priv->stoppable); - set_sensitive (window, "TestArchive", ! no_archive && ! running && window->archive->command->propTest); - set_sensitive (window, "ViewSelection", file_op && one_file_selected && ! dir_selected); - set_sensitive (window, "ViewSelection_Toolbar", file_op && one_file_selected && ! dir_selected); + set_sensitive (window, "new_item", ! running); + set_sensitive (window, "tool_new_item", ! running); + set_sensitive (window, "open_item", ! running); + set_sensitive (window, "popup_open_select_item", file_op && sel_not_null && ! dir_selected); + set_sensitive (window, "popup_open_item1", file_op && one_file_selected && dir_selected); + set_sensitive (window, "password_item", ! running && (window->priv->asked_for_password || (! no_archive && window->archive->command->propPassword))); + set_sensitive (window, "properties_item", file_op); + set_sensitive (window, "close_item", !running || window->priv->stoppable); + set_sensitive (window, "reload_item", ! (no_archive || running)); + set_sensitive (window, "rename_item", ! no_archive && ! ro && ! running && ! compr_file && one_file_selected); + set_sensitive (window, "popup_rename_item", ! no_archive && ! ro && ! running && ! compr_file && one_file_selected); + set_sensitive (window, "popup_rename_item1", ! no_archive && ! ro && ! running && ! compr_file && one_file_selected); + set_sensitive (window, "open_saveas_item", ! no_archive && ! compr_file && ! running); + set_sensitive (window, "select_all_item", ! no_archive); + set_sensitive (window, "stop_item", running && window->priv->stoppable); + set_sensitive (window, "tool_stop_item", running && window->priv->stoppable); + set_sensitive (window, "test_integrity_item", ! no_archive && ! running && window->archive->command->propTest); + set_sensitive (window, "popup_open_item", file_op && one_file_selected && ! dir_selected); if (window->priv->progress_dialog != NULL) gtk_dialog_set_response_sensitive (GTK_DIALOG (window->priv->progress_dialog), @@ -2025,15 +2044,15 @@ fr_window_update_sensitivity (FrWindow *window) fr_window_update_paste_command_sensitivity (window, NULL); - set_sensitive (window, "SelectAll", (window->priv->current_view_length > 0) && (window->priv->current_view_length != n_selected)); - set_sensitive (window, "DeselectAll", n_selected > 0); - set_sensitive (window, "OpenRecent", ! running); - set_sensitive (window, "OpenRecent_Toolbar", ! running); + set_sensitive (window, "select_all_item", (window->priv->current_view_length > 0) && (window->priv->current_view_length != n_selected)); + set_sensitive (window, "deselect_all_item", n_selected > 0); + set_sensitive (window, "open_recent_item", ! running); + set_sensitive (window, "tool_open_recent_item", ! running); - set_sensitive (window, "ViewFolders", (window->priv->list_mode == FR_WINDOW_LIST_MODE_AS_DIR)); + set_sensitive (window, "view_folder_item", (window->priv->list_mode == FR_WINDOW_LIST_MODE_AS_DIR)); - set_sensitive (window, "ViewAllFiles", ! window->priv->filter_mode); - set_sensitive (window, "ViewAsFolder", ! window->priv->filter_mode); + set_sensitive (window, "view_all_files_item", ! window->priv->filter_mode); + set_sensitive (window, "view_as_folder_item", ! window->priv->filter_mode); } static gboolean @@ -2112,7 +2131,7 @@ progress_dialog_delete_event (GtkWidget *caller, FrWindow *window) { if (window->priv->stoppable) { - activate_action_stop (NULL, window); + activate_action_stop (NULL, NULL, window); close_progress_dialog (window, TRUE); } @@ -2204,7 +2223,7 @@ progress_dialog_response (GtkDialog *dialog, switch (response_id) { case GTK_RESPONSE_CANCEL: if (window->priv->stoppable) { - activate_action_stop (NULL, window); + activate_action_stop (NULL, NULL, window); close_progress_dialog (window, TRUE); } break; @@ -4466,7 +4485,7 @@ key_press_cb (GtkWidget *widget, switch (event->keyval) { case GDK_KEY_Escape: - activate_action_stop (NULL, window); + activate_action_stop (NULL, NULL, window); if (window->priv->filter_mode) fr_window_deactivate_filter (window); retval = TRUE; @@ -4882,15 +4901,11 @@ pref_history_len_changed (GSettings *settings, { FrWindow *window = user_data; int limit; - GtkAction *action; limit = g_settings_get_int (settings, PREF_UI_HISTORY_LEN); - action = gtk_action_group_get_action (window->priv->actions, "OpenRecent"); - gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (action), limit); - - action = gtk_action_group_get_action (window->priv->actions, "OpenRecent_Toolbar"); - gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (action), limit); + gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (window->priv->menubar_recentmenu), limit); + gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (window->priv->toolbar_recentmenu), limit); } static void @@ -4899,7 +4914,6 @@ pref_view_toolbar_changed (GSettings *settings, gpointer user_data) { FrWindow *window = user_data; - fr_window_set_toolbar_visibility (window, g_settings_get_boolean (settings, key)); } @@ -4992,7 +5006,8 @@ fr_window_stoppable_cb (FrCommand *command, FrWindow *window) { window->priv->stoppable = stoppable; - set_sensitive (window, "Stop", stoppable); + set_sensitive (window, "stop_item", stoppable); + set_sensitive (window, "tool_stop_item", stoppable); if (window->priv->progress_dialog != NULL) gtk_dialog_set_response_sensitive (GTK_DIALOG (window->priv->progress_dialog), GTK_RESPONSE_OK, @@ -5051,15 +5066,11 @@ fr_window_fake_load (FrArchive *archive, static void menu_item_select_cb (GtkMenuItem *proxy, - FrWindow *window) + FrWindow *window) { - GtkAction *action; char *message; - action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (proxy)); - g_return_if_fail (action != NULL); - - g_object_get (G_OBJECT (action), "tooltip", &message, NULL); + message = gtk_widget_get_tooltip_text (GTK_WIDGET (proxy)); if (message) { gtk_statusbar_push (GTK_STATUSBAR (window->priv->statusbar), window->priv->help_message_cid, message); @@ -5069,47 +5080,22 @@ menu_item_select_cb (GtkMenuItem *proxy, static void menu_item_deselect_cb (GtkMenuItem *proxy, - FrWindow *window) + FrWindow *window) { gtk_statusbar_pop (GTK_STATUSBAR (window->priv->statusbar), window->priv->help_message_cid); } static void -disconnect_proxy_cb (GtkUIManager *manager, - GtkAction *action, - GtkWidget *proxy, - FrWindow *window) -{ - if (GTK_IS_MENU_ITEM (proxy)) { - g_signal_handlers_disconnect_by_func - (proxy, G_CALLBACK (menu_item_select_cb), window); - g_signal_handlers_disconnect_by_func - (proxy, G_CALLBACK (menu_item_deselect_cb), window); - } -} - -static void -connect_proxy_cb (GtkUIManager *manager, - GtkAction *action, - GtkWidget *proxy, - FrWindow *window) -{ - if (GTK_IS_MENU_ITEM (proxy)) { - g_signal_connect (proxy, "select", - G_CALLBACK (menu_item_select_cb), window); - g_signal_connect (proxy, "deselect", - G_CALLBACK (menu_item_deselect_cb), window); - } -} - -static void -view_as_radio_action (GtkAction *action, - GtkRadioAction *current, - gpointer data) +view_all_files_selected_toggled (GtkMenuItem *menuitem, + gpointer data) { FrWindow *window = data; - fr_window_set_list_mode (window, gtk_radio_action_get_current_value (current)); + + if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem))) + fr_window_set_list_mode (window, FR_WINDOW_LIST_MODE_FLAT); + else + fr_window_set_list_mode (window, FR_WINDOW_LIST_MODE_AS_DIR); } static void @@ -5125,31 +5111,34 @@ recent_chooser_item_activated_cb (GtkRecentChooser *chooser, } } -static void -fr_window_init_recent_chooser (FrWindow *window, - GtkRecentChooser *chooser) +static GtkWidget * +fr_window_create_recent_chooser (FrWindow *window) { - GtkRecentFilter *filter; - int i; + GtkRecentManager *manager; + GtkRecentFilter *filter; + GtkWidget *menu; + int i; - g_return_if_fail (chooser != NULL); + manager = gtk_recent_manager_get_default (); + menu = gtk_recent_chooser_menu_new_for_manager (manager); filter = gtk_recent_filter_new (); gtk_recent_filter_set_name (filter, _("All archives")); for (i = 0; open_type[i] != -1; i++) gtk_recent_filter_add_mime_type (filter, mime_type_desc[open_type[i]].mime_type); gtk_recent_filter_add_application (filter, "Engrampa"); - gtk_recent_chooser_add_filter (chooser, filter); + gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (menu), filter); - gtk_recent_chooser_set_local_only (chooser, FALSE); - gtk_recent_chooser_set_limit (chooser, g_settings_get_int (window->priv->settings_ui, PREF_UI_HISTORY_LEN)); - gtk_recent_chooser_set_show_not_found (chooser, TRUE); - gtk_recent_chooser_set_sort_type (chooser, GTK_RECENT_SORT_MRU); + gtk_recent_chooser_set_local_only (GTK_RECENT_CHOOSER (menu), FALSE); + gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (menu), g_settings_get_int (window->priv->settings_ui, PREF_UI_HISTORY_LEN)); + gtk_recent_chooser_set_show_not_found (GTK_RECENT_CHOOSER (menu), TRUE); + gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (menu), GTK_RECENT_SORT_MRU); - g_signal_connect (G_OBJECT (chooser), + g_signal_connect (G_OBJECT (menu), "item_activated", G_CALLBACK (recent_chooser_item_activated_cb), window); + return menu; } static void @@ -5245,17 +5234,6 @@ fr_window_attach (FrWindow *window, 1, 1); } -static void -set_action_important (GtkUIManager *ui, - const char *action_name) -{ - GtkAction *action; - - action = gtk_ui_manager_get_action (ui, action_name); - g_object_set (action, "is_important", TRUE, NULL); - g_object_unref (action); -} - static void fr_window_construct (FrWindow *window) { @@ -5271,10 +5249,13 @@ fr_window_construct (FrWindow *window) GtkWidget *sidepane_title_box; GtkWidget *sidepane_title_label; GtkWidget *close_sidepane_button; + GtkWidget *menu_radio_files; + GtkWidget *menuitem; GtkTreeSelection *selection; - GtkActionGroup *actions; - GtkAction *action; - GtkUIManager *ui; + GActionGroup *actions; + GSimpleAction *action; + GtkAccelGroup *accel_group; + GtkBuilder *ui; GError *error = NULL; GSettingsSchemaSource *schema_source; GSettingsSchema *caja_schema; @@ -5661,94 +5642,85 @@ fr_window_construct (FrWindow *window) /* Build the menu and the toolbar. */ - ui = gtk_ui_manager_new (); + window->priv->ui_manager = ui = gtk_builder_new (); - window->priv->actions = actions = gtk_action_group_new ("Actions"); - - /* open recent toolbar item action */ - - action = g_object_new (GTK_TYPE_RECENT_ACTION, - "name", "OpenRecent", - /* Translators: this is the label for the "open recent file" sub-menu. */ - "label", _("Open _Recent"), - "tooltip", _("Open a recently used archive"), - "stock-id", "gtk-open", - NULL); - fr_window_init_recent_chooser (window, GTK_RECENT_CHOOSER (action)); - gtk_action_group_add_action (actions, action); - g_object_unref (action); - - /* open recent toolbar item action */ - - action = g_object_new (GTK_TYPE_RECENT_ACTION, - "name", "OpenRecent_Toolbar", - "label", _("Open"), - "tooltip", _("Open a recently used archive"), - "stock-id", "gtk-open", - "is-important", TRUE, - NULL); - fr_window_init_recent_chooser (window, GTK_RECENT_CHOOSER (action)); - g_signal_connect (action, - "activate", - G_CALLBACK (activate_action_open), - window); - gtk_action_group_add_action (actions, action); - g_object_unref (action); + window->priv->actions = actions = (GActionGroup*)g_simple_action_group_new (); /* other actions */ + g_action_map_add_action_entries (G_ACTION_MAP (actions), + action_entries, G_N_ELEMENTS (action_entries), + window); - gtk_action_group_set_translation_domain (actions, NULL); - gtk_action_group_add_actions (actions, - action_entries, - n_action_entries, - window); - gtk_action_group_add_toggle_actions (actions, - action_toggle_entries, - n_action_toggle_entries, - window); - gtk_action_group_add_radio_actions (actions, - view_as_entries, - n_view_as_entries, - window->priv->list_mode, - G_CALLBACK (view_as_radio_action), - window); - - g_signal_connect (ui, "connect_proxy", - G_CALLBACK (connect_proxy_cb), window); - g_signal_connect (ui, "disconnect_proxy", - G_CALLBACK (disconnect_proxy_cb), window); - - gtk_ui_manager_insert_action_group (ui, actions, 0); - gtk_window_add_accel_group (GTK_WINDOW (window), - gtk_ui_manager_get_accel_group (ui)); + accel_group = gtk_accel_group_new (); + gtk_widget_insert_action_group (GTK_WIDGET (window), "win", actions); + gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); /* Add a hidden short cut Ctrl-Q for power users */ - gtk_accel_group_connect (gtk_ui_manager_get_accel_group (ui), + gtk_accel_group_connect (accel_group, GDK_KEY_q, GDK_CONTROL_MASK, 0, g_cclosure_new_swap (G_CALLBACK (fr_window_close), window, NULL)); - if (! gtk_ui_manager_add_ui_from_resource (ui, ENGRAMPA_RESOURCE_UI_PATH G_DIR_SEPARATOR_S "menus-toolbars.ui", &error)) { + if (! gtk_builder_add_from_resource (ui, ENGRAMPA_RESOURCE_UI_PATH G_DIR_SEPARATOR_S "menus-toolbars.ui", &error)) { g_message ("building menus failed: %s", error->message); g_error_free (error); } + /*Add shortcut keys*/ + for (gulong i = 0; i < G_N_ELEMENTS (menu_keybindings); i++) + { + menuitem = (GtkWidget*)gtk_builder_get_object (ui, menu_keybindings[i].widget_id); + gtk_widget_add_accelerator (menuitem, "activate", accel_group, + menu_keybindings[i].keyval, + menu_keybindings[i].modifier, + GTK_ACCEL_VISIBLE); + } + + gtk_builder_add_callback_symbols (ui, + "menu_item_select_cb", G_CALLBACK (menu_item_select_cb), + "menu_item_deselect_cb", G_CALLBACK (menu_item_deselect_cb), + NULL); + gtk_builder_connect_signals (ui, window); + /* open recent toolbar item action */ - menubar = gtk_ui_manager_get_widget (ui, "/MenuBar"); + window->priv->menubar_recentmenu = fr_window_create_recent_chooser (window); + menuitem = (GtkWidget *)gtk_builder_get_object (ui, "open_recent_item"); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), window->priv->menubar_recentmenu); + + /* open recent toolbar item action */ + menuitem = (GtkWidget *)gtk_builder_get_object (ui, "tool_open_recent_item"); + window->priv->toolbar_recentmenu = fr_window_create_recent_chooser (window); + gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (menuitem), window->priv->toolbar_recentmenu); + + if (window->priv->list_mode == FR_WINDOW_LIST_MODE_FLAT) + action = g_simple_action_new_stateful ("ViewAllFiles", G_VARIANT_TYPE ("s"), g_variant_new_string ("files")); + else + action = g_simple_action_new_stateful ("ViewAllFiles", G_VARIANT_TYPE ("s"), g_variant_new_string ("folder")); + + g_action_map_add_action (G_ACTION_MAP (actions), G_ACTION (action)); + g_object_unref (action); + + menubar = (GtkWidget *)gtk_builder_get_object (ui, "engrampamenubar"); fr_window_attach (FR_WINDOW (window), menubar, FR_WINDOW_AREA_MENUBAR); gtk_widget_show (menubar); - window->priv->toolbar = toolbar = gtk_ui_manager_get_widget (ui, "/ToolBar"); + window->priv->toolbar = toolbar = (GtkWidget *)gtk_builder_get_object (ui, "engrampatoolbar"); gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), TRUE); gtk_style_context_add_class (gtk_widget_get_style_context (toolbar), GTK_STYLE_CLASS_PRIMARY_TOOLBAR); - set_action_important (ui, "/ToolBar/Extract_Toolbar"); /* location bar */ - window->priv->location_bar = gtk_ui_manager_get_widget (ui, "/LocationBar"); + window->priv->location_bar = (GtkWidget *)gtk_builder_get_object (ui, "locationbar"); gtk_toolbar_set_show_arrow (GTK_TOOLBAR (window->priv->location_bar), FALSE); gtk_toolbar_set_style (GTK_TOOLBAR (window->priv->location_bar), GTK_TOOLBAR_BOTH_HORIZ); gtk_style_context_add_class (gtk_widget_get_style_context (window->priv->location_bar), GTK_STYLE_CLASS_TOOLBAR); - set_action_important (ui, "/LocationBar/GoBack"); + init_engramp_menu_popup (window, ui); + + /* file list mode */ + menu_radio_files = (GtkWidget *)gtk_builder_get_object (ui, "view_all_files_item"); + g_signal_connect (G_OBJECT (menu_radio_files), + "toggled", + G_CALLBACK (view_all_files_selected_toggled), + window); /* current location */ location_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); @@ -5800,9 +5772,9 @@ fr_window_construct (FrWindow *window) else gtk_widget_hide (toolbar); - window->priv->file_popup_menu = gtk_ui_manager_get_widget (ui, "/FilePopupMenu"); - window->priv->folder_popup_menu = gtk_ui_manager_get_widget (ui, "/FolderPopupMenu"); - window->priv->sidebar_folder_popup_menu = gtk_ui_manager_get_widget (ui, "/SidebarFolderPopupMenu"); + window->priv->file_popup_menu = (GtkWidget *)gtk_builder_get_object (ui, "FilePopupMenu"); + window->priv->folder_popup_menu = (GtkWidget *)gtk_builder_get_object (ui, "FolderPopupMenu"); + window->priv->sidebar_folder_popup_menu = (GtkWidget *)gtk_builder_get_object (ui, "SidebarFolderPopupMenu"); /* Create the statusbar. */ diff --git a/src/glib-utils.c b/src/glib-utils.c index 88b90c9..c7cb78c 100644 --- a/src/glib-utils.c +++ b/src/glib-utils.c @@ -240,7 +240,7 @@ g_utf8_strchug (char *string) c = g_utf8_get_char (scan); } - g_memmove (string, scan, strlen (scan) + 1); + memmove (string, scan, strlen (scan) + 1); return string; } diff --git a/src/ui.h b/src/ui.h index ce77575..aadacbe 100644 --- a/src/ui.h +++ b/src/ui.h @@ -25,217 +25,80 @@ #include "actions.h" -static GtkActionEntry action_entries[] = { - { "FileMenu", NULL, N_("_Archive"), NULL, NULL, NULL }, - { "EditMenu", NULL, N_("_Edit"), NULL, NULL, NULL }, - { "ViewMenu", NULL, N_("_View"), NULL, NULL, NULL }, - { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL }, - { "ArrangeFilesMenu", NULL, N_("_Arrange Files"), NULL, NULL, NULL }, - - { "About", "help-about", - N_("_About"), NULL, - N_("Information about the program"), - G_CALLBACK (activate_action_about) }, - { "AddFiles", "add-files-to-archive", - N_("_Add Files…"), NULL, - N_("Add files to the archive"), - G_CALLBACK (activate_action_add_files) }, - { "AddFiles_Toolbar", "add-files-to-archive", - N_("Add Files"), NULL, - N_("Add files to the archive"), - G_CALLBACK (activate_action_add_files) }, - { "AddFolder", "add-folder-to-archive", - N_("Add a _Folder…"), NULL, - N_("Add a folder to the archive"), - G_CALLBACK (activate_action_add_folder) }, - { "AddFolder_Toolbar", "add-folder-to-archive", - N_("Add Folder"), NULL, - N_("Add a folder to the archive"), - G_CALLBACK (activate_action_add_folder) }, - { "Close", "window-close", - N_("_Close"), "W", - N_("Close the current archive"), - G_CALLBACK (activate_action_close) }, - { "Contents", "help-browser", - N_("Contents"), "F1", - N_("Display the Engrampa Manual"), - G_CALLBACK (activate_action_manual) }, - - { "Copy", "edit-copy", - N_("_Copy"), "C", - N_("Copy the selection"), - G_CALLBACK (activate_action_copy) }, - { "Cut", "edit-cut", - N_("Cu_t"), "X", - N_("Cut the selection"), - G_CALLBACK (activate_action_cut) }, - { "Paste", "edit-paste", - N_("_Paste"), "V", - N_("Paste the clipboard"), - G_CALLBACK (activate_action_paste) }, - { "Rename", NULL, - N_("_Rename…"), "F2", - N_("Rename the selection"), - G_CALLBACK (activate_action_rename) }, - { "Delete", "edit-delete", - N_("_Delete"), "Delete", - N_("Delete the selection from the archive"), - G_CALLBACK (activate_action_delete) }, - - { "CopyFolderFromSidebar", "edit-copy", - N_("_Copy"), "C", - N_("Copy the selection"), - G_CALLBACK (activate_action_copy_folder_from_sidebar) }, - { "CutFolderFromSidebar", "edit-cut", - N_("Cu_t"), "X", - N_("Cut the selection"), - G_CALLBACK (activate_action_cut_folder_from_sidebar) }, - { "PasteFolderFromSidebar", "edit-paste", - N_("_Paste"), "V", - N_("Paste the clipboard"), - G_CALLBACK (activate_action_paste_folder_from_sidebar) }, - { "RenameFolderFromSidebar", NULL, - N_("_Rename…"), "F2", - N_("Rename the selection"), - G_CALLBACK (activate_action_rename_folder_from_sidebar) }, - { "DeleteFolderFromSidebar", "edit-delete", - N_("_Delete"), "Delete", - N_("Delete the selection from the archive"), - G_CALLBACK (activate_action_delete_folder_from_sidebar) }, - - { "DeselectAll", NULL, - N_("Dese_lect All"), "A", - N_("Deselect all files"), - G_CALLBACK (activate_action_deselect_all) }, - { "Extract", "extract-archive", - N_("_Extract…"), "E", - N_("Extract files from the archive"), - G_CALLBACK (activate_action_extract) }, - { "ExtractFolderFromSidebar", "extract-archive", - N_("_Extract…"), NULL, - N_("Extract files from the archive"), - G_CALLBACK (activate_action_extract_folder_from_sidebar) }, - { "Extract_Toolbar", "extract-archive", - N_("Extract"), NULL, - N_("Extract files from the archive"), - G_CALLBACK (activate_action_extract) }, - { "Find", "edit-find", - N_("Find…"), "F", - NULL, - G_CALLBACK (activate_action_find) }, - - { "LastOutput", NULL, - N_("_Last Output"), NULL, - N_("View the output produced by the last executed command"), - G_CALLBACK (activate_action_last_output) }, - { "New", "document-new", - N_("New…"), "N", - N_("Create a new archive"), - G_CALLBACK (activate_action_new) }, - { "Open", "document-open", - N_("Open…"), "O", - N_("Open archive"), - G_CALLBACK (activate_action_open) }, - { "Open_Toolbar", "document-open", - N_("_Open"), "O", - N_("Open archive"), - G_CALLBACK (activate_action_open) }, - { "OpenSelection", NULL, - N_("_Open With…"), NULL, - N_("Open selected files with an application"), - G_CALLBACK (activate_action_open_with) }, - { "Password", NULL, - N_("Pass_word…"), NULL, - N_("Specify a password for this archive"), - G_CALLBACK (activate_action_password) }, - { "Properties", "document-properties", - N_("_Properties"), "Return", - N_("Show archive properties"), - G_CALLBACK (activate_action_properties) }, - { "Reload", "view-refresh", - N_("_Refresh"), "R", - N_("Reload current archive"), - G_CALLBACK (activate_action_reload) }, - { "SaveAs", "document-save-as", - N_("Save As…"), NULL, - N_("Save the current archive with a different name"), - G_CALLBACK (activate_action_save_as) }, - { "SelectAll", "edit-select-all", - N_("Select _All"), "A", - N_("Select all files"), - G_CALLBACK (activate_action_select_all) }, - { "Stop", "process-stop", - N_("_Stop"), "Escape", - N_("Stop current operation"), - G_CALLBACK (activate_action_stop) }, - { "TestArchive", NULL, - N_("_Test Integrity"), NULL, - N_("Test whether the archive contains errors"), - G_CALLBACK (activate_action_test_archive) }, - { "ViewSelection", "document-open", - N_("_Open"), "O", - N_("Open the selected file"), - G_CALLBACK (activate_action_view_or_open) }, - { "ViewSelection_Toolbar", "document-open", - N_("_Open"), "O", - N_("Open the selected file"), - G_CALLBACK (activate_action_view_or_open) }, - { "OpenFolder", "document-open", - N_("_Open"), "O", - N_("Open the selected folder"), - G_CALLBACK (activate_action_open_folder) }, - { "OpenFolderFromSidebar", "document-open", - N_("_Open"), "O", - N_("Open the selected folder"), - G_CALLBACK (activate_action_open_folder_from_sidebar) }, - - { "GoBack", "go-previous", - NULL, NULL, - N_("Go to the previous visited location"), - G_CALLBACK (activate_action_go_back) }, - { "GoForward", "go-next", - NULL, NULL, - N_("Go to the next visited location"), - G_CALLBACK (activate_action_go_forward) }, - { "GoUp", "go-up", - NULL, NULL, - N_("Go up one level"), - G_CALLBACK (activate_action_go_up) }, - { "GoHome", "go-home", - NULL, NULL, - /* Translators: the home location is the home folder. */ - N_("Go to the home location"), - G_CALLBACK (activate_action_go_home) }, -}; -static guint n_action_entries = G_N_ELEMENTS (action_entries); - -static GtkToggleActionEntry action_toggle_entries[] = { - { "ViewToolbar", NULL, - N_("_Toolbar"), NULL, - N_("View the main toolbar"), - G_CALLBACK (activate_action_view_toolbar), - TRUE }, - { "ViewStatusbar", NULL, - N_("Stat_usbar"), NULL, - N_("View the statusbar"), - G_CALLBACK (activate_action_view_statusbar), - TRUE }, - { "ViewFolders", NULL, - N_("_Folders"), "F9", - N_("View the folders pane"), - G_CALLBACK (activate_action_view_folders), - FALSE }, +static GActionEntry action_entries[] = { + /* FileMenu */ + { "New", activate_action_new, NULL, NULL, NULL, { 0 } }, + { "Open", activate_action_open, NULL, NULL, NULL, { 0 } }, + { "SaveAs", activate_action_save_as, NULL, NULL, NULL, { 0 } }, + { "Extract", activate_action_extract, NULL, NULL, NULL, { 0 } }, + { "TestArchive", activate_action_test_archive, NULL, NULL, NULL, { 0 } }, + { "Properties", activate_action_properties, NULL, NULL, NULL, { 0 } }, + { "Close", activate_action_close, NULL, NULL, NULL, { 0 } }, + /* EditMenu */ + { "Copy", activate_action_copy, NULL, NULL, NULL, { 0 } }, + { "Cut", activate_action_cut, NULL, NULL, NULL, { 0 } }, + { "Paste", activate_action_paste, NULL, NULL, NULL, { 0 } }, + { "Rename", activate_action_rename, NULL, NULL, NULL, { 0 } }, + { "Delete", activate_action_delete, NULL, NULL, NULL, { 0 } }, + { "SelectAll", activate_action_select_all, NULL, NULL, NULL, { 0 } }, + { "DeselectAll", activate_action_deselect_all, NULL, NULL, NULL, { 0 } }, + { "Find", activate_action_find, NULL, NULL, NULL, { 0 } }, + { "AddFiles", activate_action_add_files, NULL, NULL, NULL, { 0 } }, + { "AddFolder", activate_action_add_folder, NULL, NULL, NULL, { 0 } }, + { "Password", activate_action_password, NULL, NULL, NULL, { 0 } }, + /* ViewMenu */ + { "ViewToolbar", activate_toggle, NULL, "true", activate_action_view_toolbar, { 0 } }, + { "ViewStatusbar", activate_toggle, NULL, "true", activate_action_view_statusbar, { 0 } }, + { "ViewFolders", activate_toggle, NULL, "false", activate_action_view_folders, { 0 } }, + { "LastOutput", activate_action_last_output, NULL, NULL, NULL, { 0 } }, + { "Stop", activate_action_stop, NULL, NULL, NULL, { 0 } }, + { "Reload", activate_action_reload, NULL, NULL, NULL, { 0 } }, + /* HelpMenu */ + { "About", activate_action_about, NULL, NULL, NULL, { 0 } }, + { "Contents", activate_action_manual, NULL, NULL, NULL, { 0 } }, + /* Toolbar */ + { "OpenRecent_Toolbar", activate_action_open, NULL, NULL, NULL, { 0 } }, + { "ExtractToolbar", activate_action_extract, NULL, NULL, NULL, { 0 } }, + { "AddFilesToolbar", activate_action_add_files, NULL, NULL, NULL, { 0 } }, + { "AddFolderToolbar", activate_action_add_folder, NULL, NULL, NULL, { 0 } }, + /* LocationBar*/ + { "GoBack", activate_action_go_back, NULL, NULL, NULL, { 0 } }, + { "GoForward", activate_action_go_forward, NULL, NULL, NULL, { 0 } }, + { "GoUp", activate_action_go_up, NULL, NULL, NULL, { 0 } }, + { "GoHome", activate_action_go_home, NULL, NULL, NULL, { 0 } }, }; -static guint n_action_toggle_entries = G_N_ELEMENTS (action_toggle_entries); -static GtkRadioActionEntry view_as_entries[] = { - { "ViewAllFiles", NULL, - N_("View All _Files"), "1", - " ", FR_WINDOW_LIST_MODE_FLAT }, - { "ViewAsFolder", NULL, - N_("View as a F_older"), "2", - " ", FR_WINDOW_LIST_MODE_AS_DIR }, +static const struct { + guint keyval; + GdkModifierType modifier; + const gchar *widget_id; +} menu_keybindings [] = { + { GDK_KEY_N, GDK_CONTROL_MASK, "new_item"}, + { GDK_KEY_O, GDK_CONTROL_MASK, "open_item"}, + { GDK_KEY_O, GDK_CONTROL_MASK, "open_recent_item"}, + { GDK_KEY_E, GDK_CONTROL_MASK, "extract_item"}, + { GDK_KEY_Return, GDK_MOD1_MASK, "properties_item"}, + { GDK_KEY_W, GDK_CONTROL_MASK, "close_item"}, + { GDK_KEY_X, GDK_CONTROL_MASK, "cut_item"}, + { GDK_KEY_C, GDK_CONTROL_MASK, "copy_item"}, + { GDK_KEY_V, GDK_CONTROL_MASK, "paste_item"}, + { GDK_KEY_F2, 0, "rename_item"}, + { GDK_KEY_Delete, 0, "delete_item"}, + { GDK_KEY_A, GDK_CONTROL_MASK, "select_all_item"}, + { GDK_KEY_A, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "deselect_all_item"}, + { GDK_KEY_F, GDK_CONTROL_MASK, "find_item"}, + { GDK_KEY_F9, 0, "view_folder_item"}, + { GDK_KEY_1, GDK_CONTROL_MASK, "view_all_files_item"}, + { GDK_KEY_2, GDK_CONTROL_MASK, "view_as_folder_item"}, + { GDK_KEY_Escape, 0, "stop_item"}, + { GDK_KEY_R, GDK_CONTROL_MASK, "reload_item"}, + { GDK_KEY_F1, 0, "help_item"}, + { GDK_KEY_O, GDK_CONTROL_MASK, "popup_open_item2"}, + { GDK_KEY_X, GDK_CONTROL_MASK, "popup_cut_item2"}, + { GDK_KEY_C, GDK_CONTROL_MASK, "popup_copy_item2"}, + { GDK_KEY_V, GDK_CONTROL_MASK, "popup_paste_item2"}, + { GDK_KEY_F2, 0, "popup_rename_item2"}, + { GDK_KEY_Delete, 0, "popup_delete_item2"}, }; -static guint n_view_as_entries = G_N_ELEMENTS (view_as_entries); #endif /* UI_H */ diff --git a/src/ui/menus-toolbars.ui b/src/ui/menus-toolbars.ui index c5dc080..eb51baf 100644 --- a/src/ui/menus-toolbars.ui +++ b/src/ui/menus-toolbars.ui @@ -1,102 +1,973 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + True + False + document-new + + + True + False + document-open + + + True + False + document-open + + + True + False + document-open + + + True + False + document-open + + + True + False + gtk-open + + + True + False + document-save-as + + + True + False + extract-archive + + + True + False + extract-archive + + + True + False + extract-archive + + + True + False + extract-archive + + + True + False + document-properties + + + True + False + window-close + + + True + False + edit-copy + + + True + False + edit-copy + + + True + False + edit-copy + + + True + False + edit-copy + + + True + False + edit-cut + + + True + False + edit-cut + + + True + False + edit-cut + + + True + False + edit-cut + + + True + False + edit-paste + + + True + False + edit-paste + + + True + False + edit-paste + + + True + False + edit-paste + + + True + False + edit-delete + + + True + False + edit-delete + + + True + False + edit-delete + + + True + False + edit-delete + + + True + False + edit-select-all + + + True + False + edit-find + + + True + False + add-files-to-archive + + + True + False + add-folder-to-archive + + + True + False + process-stop + + + True + False + view-refresh + + + True + False + help-browser + + + True + False + help-about + + + + 1 + + + The menubar + + + + + 1 + _Archive + 1 + + + + + 1 + New… + Create a new archive + 1 + + + menu_icon_new + win.New + + + + + 1 + Open… + Open archive + 1 + + + menu_icon_open + win.Open + + + + + 1 + Open _Recent + Open a recently used archive + 1 + menu_icon_open_recent + + + + + + + 1 + Save As… + Save the current archive with a different name + 1 + menu_icon_save_as + win.SaveAs + + + + + + + 1 + + + + + 1 + _Extract… + Extract files from the archive + 1 + menu_icon_extract + win.Extract + + + + + + + 1 + _Test Integrity + Test whether the archive contains errors + 1 + win.TestArchive + + + + + + + 1 + + + + + 1 + _Properties + Show archive properties + 1 + menu_icon_properties + win.Properties + + + + + + + 1 + + + + + 1 + _Close + Close the current archive + 1 + menu_icon_close + win.Close + + + + + + + + + + + 1 + _Edit + 1 + + + + + 1 + _Copy + Copy the selection + 1 + menu_icon_copy + win.Copy + + + + + + + 1 + Cu_t + Cut the selection + 1 + menu_icon_cut + win.Cut + + + + + + + 1 + _Paste + Paste the clipboard + 1 + menu_icon_paste + win.Paste + + + + + + + 1 + _Rename… + Rename the selection + 1 + win.Rename + + + + + + + 1 + _Delete + Delete the selection from the archive + 1 + menu_icon_delete + win.Delete + + + + + + + 1 + + + + + 1 + Select _All + Select all files + 1 + menu_icon_select_all + win.SelectAll + + + + + + + 1 + Dese_lect All + Deselect all files + 1 + win.DeselectAll + + + + + + + 1 + + + + + 1 + Find… + 1 + menu_icon_find + win.Find + + + + + 1 + + + + + 1 + _Add Files… + Add files to the archive + 1 + menu_icon_add_files + win.AddFiles + + + + + + + 1 + Add a _Folder… + Add a folder to the archive + 1 + menu_icon_add_folder + win.AddFolder + + + + + + + 1 + + + + + 1 + Pass_word… + Specify a password for this archive + 1 + win.Password + + + + + + + + + + + 1 + _View + 1 + + + + + 1 + _Toolbar + View the main toolbar + 1 + win.ViewToolbar + + + + + + + 1 + Stat_usbar + View the statusbar + 1 + win.ViewStatusbar + + + + + + + 1 + _Folders + View the folders pane + 1 + win.ViewFolders + + + + + + + 1 + 0 + + + + + 1 + View All _Files + True + 1 + win.ViewAllFiles + 'files' + + + + + 1 + View as a F_older + 1 + view_all_files_item + True + win.ViewAllFiles + 'folder' + + + + + 1 + 0 + + + + + 1 + _Last Output + View the output produced by the last executed command + 1 + win.LastOutput + + + + + + + 1 + 0 + + + + + 1 + _Stop + Stop current operation + 1 + menu_icon_stop + win.Stop + + + + + + + 1 + _Refresh + Reload current archive + 1 + menu_icon_reload + win.Reload + + + + + + + + + + + 1 + _Help + 1 + + + + + 1 + Contents + Dis_Archiveplay the Engrampa Manual + 1 + menu_icon_help + win.Contents + + + + + + + 1 + _About + Information about the program + 1 + menu_icon_about + win.About + + + + + + + + + + + 1 + + + The Toolbar + + + + + 1 + document-new + win.New + + + + + 1 + Open + document-open + 1 + Open a recently used archive + win.OpenRecent_Toolbar + + + + + 1 + + + + + 1 + Extract + extract-archive + Extract files from the archive + win.ExtractToolbar + + + + + 1 + + + + + 1 + add-files-to-archive + Add files to the archive + win.AddFilesToolbar + + + + + 1 + add-folder-to-archive + Add a folder to the archive + win.AddFolderToolbar + + + + + 1 + + + + + 1 + process-stop + Stop current operation + win.Stop + + + + + 1 + + + The Location Toolbar + + + + + 1 + go-previous + Go to the previous visited location + win.GoBack + + + + + 1 + go-next + Go to the next visited location + win.GoForward + + + + + 1 + go-up + Go up one level + win.GoUp + + + + + 1 + go-home + Go to the home location + win.GoHome + + + + + + 1 + + + 1 + _Open + Open the selected file + 1 + menu_icon_open1 + + + + + 1 + _Open With… + Open selected files with an application + 1 + + + + + 1 + + + + + 1 + _Extract… + Extract files from the archive + 1 + menu_icon_extract1 + + + + + 1 + + + + + 1 + Cu_t + Cut the selection + 1 + menu_icon_cut1 + + + + + 1 + _Copy + Copy the selection + 1 + menu_icon_copy1 + + + + + 1 + _Paste + Paste the clipboard + 1 + menu_icon_paste1 + + + + + 1 + _Rename… + Rename the selection + 1 + + + + + 1 + _Delete + Delete the selection from the archive + 1 + menu_icon_delete1 + + + + + 1 + + + 1 + _Open + Open the selected folder + 1 + menu_icon_open2 + + + + + 1 + + + + + 1 + _Extract… + Extract folder from the archive + 1 + menu_icon_extract2 + + + + + 1 + + + + + 1 + Cu_t + Cut the selection + 1 + menu_icon_cut2 + + + + + 1 + _Copy + Copy the selection + 1 + menu_icon_copy2 + + + + + 1 + _Paste + Paste the clipboard + 1 + menu_icon_paste2 + + + + + 1 + _Rename… + Rename the selection + 1 + + + + + 1 + _Delete + Delete the selection from the archive + 1 + menu_icon_delete2 + + + + + 1 + + + 1 + _Open + Open the selected folder + 1 + menu_icon_open3 + + + + + 1 + + + + + 1 + _Extract… + Extract folder from the archive + 1 + menu_icon_extract3 + + + + + 1 + + + + + 1 + Cu_t + Cut the selection + 1 + menu_icon_cut3 + + + + + 1 + _Copy + Copy the selection + 1 + menu_icon_copy3 + + + + + 1 + _Paste + Paste the clipboard + 1 + menu_icon_paste3 + + + + + 1 + _Rename… + Rename the selection + 1 + + + + + 1 + _Delete + Delete the selection from the archive + 1 + menu_icon_delete3 + + + + -- cgit v1.2.1