[file-roller] locationbar: added the home button
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] locationbar: added the home button
- Date: Sat, 21 Dec 2013 16:01:51 +0000 (UTC)
commit 77fd8dd4bcdadad6e20c5ff71b4a7a0d9d148355
Author: Paolo Bacchilega <paobac src gnome org>
Date: Fri Dec 20 19:07:20 2013 +0100
locationbar: added the home button
src/fr-window-actions-callbacks.c | 9 +++++++++
src/fr-window-actions-callbacks.h | 1 +
src/fr-window-actions-entries.h | 1 +
src/fr-window.c | 6 ++++++
4 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/fr-window-actions-callbacks.c b/src/fr-window-actions-callbacks.c
index 4bd3802..7ac1e2a 100644
--- a/src/fr-window-actions-callbacks.c
+++ b/src/fr-window-actions-callbacks.c
@@ -123,6 +123,15 @@ fr_window_activate_go_forward (GSimpleAction *action,
void
+fr_window_activate_go_home (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ fr_window_go_to_location (FR_WINDOW (user_data), "/", FALSE);
+}
+
+
+void
fr_window_activate_save_as (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
diff --git a/src/fr-window-actions-callbacks.h b/src/fr-window-actions-callbacks.h
index 86f8672..9f9fd3d 100644
--- a/src/fr-window-actions-callbacks.h
+++ b/src/fr-window-actions-callbacks.h
@@ -33,6 +33,7 @@ DEF_ACTION_CALLBACK (fr_window_activate_edit_password)
DEF_ACTION_CALLBACK (fr_window_activate_extract_files)
DEF_ACTION_CALLBACK (fr_window_activate_go_back)
DEF_ACTION_CALLBACK (fr_window_activate_go_forward)
+DEF_ACTION_CALLBACK (fr_window_activate_go_home)
DEF_ACTION_CALLBACK (fr_window_activate_save_as)
DEF_ACTION_CALLBACK (fr_window_activate_test_archive)
DEF_ACTION_CALLBACK (fr_window_activate_view_properties)
diff --git a/src/fr-window-actions-entries.h b/src/fr-window-actions-entries.h
index ad05bc2..1a3c02d 100644
--- a/src/fr-window-actions-entries.h
+++ b/src/fr-window-actions-entries.h
@@ -36,6 +36,7 @@ static const GActionEntry fr_window_actions[] = {
{ "extract-files", fr_window_activate_extract_files },
{ "go-back", fr_window_activate_go_back },
{ "go-forward", fr_window_activate_go_forward },
+ { "go-home", fr_window_activate_go_home },
{ "save-as", fr_window_activate_save_as },
{ "test-archive", fr_window_activate_test_archive },
{ "view-properties", fr_window_activate_view_properties },
diff --git a/src/fr-window.c b/src/fr-window.c
index 7d73e99..2dc8444 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -1701,6 +1701,7 @@ fr_window_update_current_location (FrWindow *window)
fr_window_enable_action (window, "go-back", window->priv->archive_present && (current_dir != NULL) &&
(window->priv->history_current != NULL) && (window->priv->history_current->next != NULL));
fr_window_enable_action (window, "go-forward", window->priv->archive_present && (current_dir != NULL)
&& (window->priv->history_current != NULL) && (window->priv->history_current->prev != NULL));
+ fr_window_enable_action (window, "go-home", 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);
@@ -5659,6 +5660,11 @@ fr_window_construct (FrWindow *window)
FALSE,
FALSE,
0);
+ gtk_box_pack_start (GTK_BOX (navigation_commands),
+ _gtk_header_bar_create_image_button ("user-home-symbolic", _("Go to the home
location"), "win.go-home"),
+ FALSE,
+ FALSE,
+ 0);
/*gtk_style_context_add_class (gtk_widget_get_style_context (navigation_commands),
GTK_STYLE_CLASS_LINKED);*/
gtk_widget_show_all (navigation_commands);
gtk_widget_set_margin_right (navigation_commands, 12);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]