[gthumb] headerbar: added a button to go to the catalogs root
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] headerbar: added a button to go to the catalogs root
- Date: Mon, 31 Jul 2017 06:07:07 +0000 (UTC)
commit 9641273645be69d0bbd264368bf84631fff2e207
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Jul 4 13:34:51 2017 +0200
headerbar: added a button to go to the catalogs root
extensions/catalogs/callbacks.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/extensions/catalogs/callbacks.c b/extensions/catalogs/callbacks.c
index 2053ac1..3d66c6e 100644
--- a/extensions/catalogs/callbacks.c
+++ b/extensions/catalogs/callbacks.c
@@ -140,6 +140,20 @@ monitor_folder_changed_cb (GthMonitor *monitor,
}
+static void
+catalogs_button_clicked_cb (GtkButton *button,
+ gpointer user_data)
+{
+ GthBrowser *browser = user_data;
+ GFile *location;
+
+ location = g_file_new_for_uri ("catalog:///");
+ gth_browser_go_to (browser, location, NULL);
+
+ g_object_unref (location);
+}
+
+
void
catalogs__gth_browser_construct_cb (GthBrowser *browser)
{
@@ -164,6 +178,16 @@ catalogs__gth_browser_construct_cb (GthBrowser *browser)
fixed_menu_entries,
G_N_ELEMENTS (fixed_menu_entries));
+ {
+ GtkWidget *button;
+
+ button = _gtk_image_button_new_for_header_bar ("file-library-symbolic");
+ gtk_widget_set_tooltip_text (button, _("Catalogs"));
+ gtk_widget_show (button);
+ g_signal_connect (button, "clicked", G_CALLBACK (catalogs_button_clicked_cb), browser);
+ gtk_box_pack_start (GTK_BOX (gth_browser_get_headerbar_section (browser,
GTH_BROWSER_HEADER_SECTION_BROWSER_LOCATIONS)), button, FALSE, FALSE, 0);
+ }
+
data->monitor_events = g_signal_connect (gth_main_get_default_monitor (),
"folder-changed",
G_CALLBACK (monitor_folder_changed_cb),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]