[gthumb: 14/23] work queues: added some info on how to use the selections
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb: 14/23] work queues: added some info on how to use the selections
- Date: Sun, 4 Mar 2012 17:56:24 +0000 (UTC)
commit 2012f8b4607154146cfe019d12c5cfd83f7cb64c
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Mar 3 18:06:56 2012 +0100
work queues: added some info on how to use the selections
extensions/work_queues/callbacks.c | 26 ++++++++++++++++++++++++++
extensions/work_queues/callbacks.h | 3 ++-
extensions/work_queues/main.c | 1 +
3 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/extensions/work_queues/callbacks.c b/extensions/work_queues/callbacks.c
index 498de18..6fb57a3 100644
--- a/extensions/work_queues/callbacks.c
+++ b/extensions/work_queues/callbacks.c
@@ -145,3 +145,29 @@ work_queues__gth_browser_file_list_key_press_cb (GthBrowser *browser,
return result;
}
+
+
+void
+work_queues__gth_browser_update_extra_widget_cb (GthBrowser *browser)
+{
+ GthFileData *location_data;
+ GtkWidget *extra_widget;
+ int n_queue;
+ char *msg;
+
+ location_data = gth_browser_get_location_data (browser);
+ if (! _g_content_type_is_a (g_file_info_get_content_type (location_data->info), "gthumb/queue"))
+ return;
+
+ n_queue = g_file_info_get_attribute_int32 (location_data->info, "gthumb::n-queue");
+ extra_widget = gth_browser_get_list_extra_widget (browser);
+ gth_embedded_dialog_set_gicon (GTH_EMBEDDED_DIALOG (extra_widget), g_file_info_get_icon (location_data->info), GTK_ICON_SIZE_DIALOG);
+ gth_embedded_dialog_set_primary_text (GTH_EMBEDDED_DIALOG (extra_widget), g_file_info_get_display_name (location_data->info));
+ if (n_queue > 0)
+ msg = g_strdup_printf (_("Use Alt-%d to add files to this selection, Ctrl-%d to view this selection."), n_queue, n_queue);
+ else
+ msg = NULL;
+ gth_embedded_dialog_set_secondary_text (GTH_EMBEDDED_DIALOG (extra_widget), msg);
+
+ g_free (msg);
+}
diff --git a/extensions/work_queues/callbacks.h b/extensions/work_queues/callbacks.h
index fcb6970..e60f773 100644
--- a/extensions/work_queues/callbacks.h
+++ b/extensions/work_queues/callbacks.h
@@ -24,8 +24,9 @@
#include <gthumb.h>
-void work_queues__gth_browser_construct_cb (GthBrowser *browser);
+void work_queues__gth_browser_construct_cb (GthBrowser *browser);
gpointer work_queues__gth_browser_file_list_key_press_cb (GthBrowser *browser,
GdkEventKey *event);
+void work_queues__gth_browser_update_extra_widget_cb (GthBrowser *browser);
#endif /* CALLBACKS_H */
diff --git a/extensions/work_queues/main.c b/extensions/work_queues/main.c
index 66b8844..d8fd88d 100644
--- a/extensions/work_queues/main.c
+++ b/extensions/work_queues/main.c
@@ -33,6 +33,7 @@ gthumb_extension_activate (void)
gth_main_register_file_source (GTH_TYPE_FILE_SOURCE_WORK_QUEUES);
gth_hook_add_callback ("gth-browser-construct", 10, G_CALLBACK (work_queues__gth_browser_construct_cb), NULL);
gth_hook_add_callback ("gth-browser-file-list-key-press", 10, G_CALLBACK (work_queues__gth_browser_file_list_key_press_cb), NULL);
+ gth_hook_add_callback ("gth-browser-update-extra-widget", 20, G_CALLBACK (work_queues__gth_browser_update_extra_widget_cb), NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]