[gthumb] added the delete metadata command in the tool list
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] added the delete metadata command in the tool list
- Date: Sun, 29 May 2011 15:32:50 +0000 (UTC)
commit 269b8e68f3e556a9e46192f5d9f7d176e3c6dc7a
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat May 28 18:31:23 2011 +0200
added the delete metadata command in the tool list
extensions/edit_metadata/actions.c | 7 +++++
extensions/edit_metadata/actions.h | 1 +
extensions/edit_metadata/callbacks.c | 27 +++++++++++++++++---
.../edit_metadata/edit_metadata.extension.in.in | 1 +
extensions/edit_metadata/main.c | 2 +-
extensions/list_tools/callbacks.c | 1 +
6 files changed, 34 insertions(+), 5 deletions(-)
---
diff --git a/extensions/edit_metadata/actions.c b/extensions/edit_metadata/actions.c
index fc2be9c..c1ac26e 100644
--- a/extensions/edit_metadata/actions.c
+++ b/extensions/edit_metadata/actions.c
@@ -108,3 +108,10 @@ gth_browser_activate_action_edit_tag_files (GtkAction *action,
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (browser));
gtk_window_present (GTK_WINDOW (dialog));
}
+
+
+void
+gth_browser_activate_action_tool_delete_metadata (GtkAction *action,
+ GthBrowser *browser)
+{
+}
diff --git a/extensions/edit_metadata/actions.h b/extensions/edit_metadata/actions.h
index ccc5ad9..d7fe22e 100644
--- a/extensions/edit_metadata/actions.h
+++ b/extensions/edit_metadata/actions.h
@@ -28,5 +28,6 @@
DEFINE_ACTION(gth_browser_activate_action_edit_metadata)
DEFINE_ACTION(gth_browser_activate_action_edit_tag_files)
+DEFINE_ACTION(gth_browser_activate_action_tool_delete_metadata)
#endif /* ACTIONS_H */
diff --git a/extensions/edit_metadata/callbacks.c b/extensions/edit_metadata/callbacks.c
index 54efad6..4881298 100644
--- a/extensions/edit_metadata/callbacks.c
+++ b/extensions/edit_metadata/callbacks.c
@@ -72,6 +72,16 @@ static const char *fixed_ui_info =
"</ui>";
+static const char *fixed_ui_file_tools_info =
+"<ui>"
+" <popup name='ListToolsPopup'>"
+" <placeholder name='Tools_2'>"
+" <menuitem name='DeleteMetadata' action='Tool_DeleteMetadata'/>"
+" </placeholder>"
+" </popup>"
+"</ui>";
+
+
static const char *browser_ui_info =
"<ui>"
" <toolbar name='ToolBar'>"
@@ -105,7 +115,12 @@ static GtkActionEntry edit_metadata_action_entries[] = {
{ "Edit_QuickTagOther", NULL,
N_("Other..."), NULL,
N_("Choose another tag"),
- G_CALLBACK (gth_browser_activate_action_edit_tag_files) }
+ G_CALLBACK (gth_browser_activate_action_edit_tag_files) },
+
+ { "Tool_DeleteMetadata", NULL,
+ N_("Delete Metadata"), NULL,
+ N_("Delete the embedded and attached metadata of the selected files"),
+ G_CALLBACK (gth_browser_activate_action_tool_delete_metadata) }
};
@@ -162,6 +177,11 @@ edit_metadata__gth_browser_construct_cb (GthBrowser *browser)
g_error_free (error);
}
+ if (gth_main_extension_is_active ("list_tools") && ! gtk_ui_manager_add_ui_from_string (gth_browser_get_ui_manager (browser), fixed_ui_file_tools_info, -1, &error)) {
+ g_message ("building menus failed: %s", error->message);
+ g_error_free (error);
+ }
+
gtk_tool_item_set_is_important (GTK_TOOL_ITEM (gtk_ui_manager_get_widget (gth_browser_get_ui_manager (browser), "/Fullscreen_ToolBar/Edit_Actions/Edit_Metadata")), TRUE);
data->monitor_events = g_signal_connect (gth_main_get_default_monitor (),
@@ -223,7 +243,6 @@ void
edit_metadata__gth_browser_update_sensitivity_cb (GthBrowser *browser)
{
BrowserData *data;
- GtkAction *action;
int n_selected;
gboolean sensitive;
@@ -232,9 +251,9 @@ edit_metadata__gth_browser_update_sensitivity_cb (GthBrowser *browser)
n_selected = gth_file_selection_get_n_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
- action = gtk_action_group_get_action (data->actions, "Edit_Metadata");
sensitive = (n_selected > 0);
- g_object_set (action, "sensitive", sensitive, NULL);
+ g_object_set (gtk_action_group_get_action (data->actions, "Edit_Metadata"), "sensitive", sensitive, NULL);
+ g_object_set (gtk_action_group_get_action (data->actions, "Tool_DeleteMetadata"), "sensitive", sensitive, NULL);
}
diff --git a/extensions/edit_metadata/edit_metadata.extension.in.in b/extensions/edit_metadata/edit_metadata.extension.in.in
index a133e9c..c5358a6 100644
--- a/extensions/edit_metadata/edit_metadata.extension.in.in
+++ b/extensions/edit_metadata/edit_metadata.extension.in.in
@@ -10,3 +10,4 @@ Category=Metadata
[Loader]
Type=module
File=%LIBRARY%
+After=list_tools
diff --git a/extensions/edit_metadata/main.c b/extensions/edit_metadata/main.c
index 2666fc9..286c30e 100644
--- a/extensions/edit_metadata/main.c
+++ b/extensions/edit_metadata/main.c
@@ -31,7 +31,7 @@ G_MODULE_EXPORT void
gthumb_extension_activate (void)
{
gth_main_register_type ("edit-metadata-dialog-page", GTH_TYPE_EDIT_COMMENT_PAGE);
- gth_hook_add_callback ("gth-browser-construct", 5, G_CALLBACK (edit_metadata__gth_browser_construct_cb), NULL);
+ gth_hook_add_callback ("gth-browser-construct", 7, G_CALLBACK (edit_metadata__gth_browser_construct_cb), NULL);
gth_hook_add_callback ("gth-browser-set-current-page", 5, G_CALLBACK (edit_metadata__gth_browser_set_current_page_cb), NULL);
gth_hook_add_callback ("gth-browser-update-sensitivity", 10, G_CALLBACK (edit_metadata__gth_browser_update_sensitivity_cb), NULL);
gth_hook_add_callback ("gth-browser-file-list-popup-before", 5, G_CALLBACK (edit_metadata__gth_browser_file_list_popup_before_cb), NULL);
diff --git a/extensions/list_tools/callbacks.c b/extensions/list_tools/callbacks.c
index 7af6d3c..d961fd7 100644
--- a/extensions/list_tools/callbacks.c
+++ b/extensions/list_tools/callbacks.c
@@ -49,6 +49,7 @@ static const char *fixed_ui_info =
*/
" <popup name='ListToolsPopup'>"
" <placeholder name='Tools'/>"
+" <placeholder name='Tools_2'/>"
" <separator name='ToolsSeparator'/>"
" <placeholder name='Scripts'/>"
" <separator name='ScriptsListSeparator'/>"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]