<para>This action cannot be undone.</para>\r
</warning>\r
<para>Irrespective of their position in a hierarchy in the right-hand box, all keywords are written as individual entries into metadata. When metadata for an image is read in, Geeqie will attempt to recreate any hierarchies within the data, and display it accordingly in the right-hand box.</para>\r
- <para>Right-click on the left-hand box allows the keywords to be written to the currently selected files - the keywords may be either added to the existing contents, or entirely replace the existing content.</para>\r
+ <para>\r
+ Right-click on the left-hand box allows the selected keywords to be written to the currently selected files - the keywords may be either added to the existing contents, or entirely replace the existing content.\r
+ <warning>\r
+ <para>Keyword completion is used when selecting keywords. If the selected area includes part of a keyword, the selection will autmatically be expanded to cover the whole keyword. If no text is selected, all keywords will be used.</para>\r
+ </warning>\r
+ </para>\r
<para>\r
Right-click on the right-hand box allows a connection to be made between a keyword and a mark. The\r
<link linkend="GuideImageMarks" endterm="titleGuideImageMarks" />\r
return list;
}
+static GList *keyword_list_pull_selected(GtkWidget *text_widget)
+{
+ GList *list;
+ gchar *text;
+
+ text = text_widget_text_pull_selected(text_widget);
+ list = string_to_keywords_list(text);
+
+ g_free(text);
+
+ return list;
+}
+
/* the "changed" signal should be blocked before calling this */
static void keyword_list_push(GtkWidget *textview, GList *list)
{
GList *list = NULL;
GList *work;
- keywords = keyword_list_pull(pkd->keyword_view);
+ keywords = keyword_list_pull_selected(pkd->keyword_view);
list = layout_selection_list(pkd->pane.lw);
list = file_data_process_groups_in_selection(list, FALSE, NULL);
PaneKeywordsData *pkd = data;
menu_item_add_divider(GTK_WIDGET(menu));
- menu_item_add_stock(GTK_WIDGET(menu), _("Add keywords to selected files"), GTK_STOCK_ADD, G_CALLBACK(bar_pane_keywords_sel_add_cb), pkd);
- menu_item_add_stock(GTK_WIDGET(menu), _("Replace existing keywords in selected files"), GTK_STOCK_CONVERT, G_CALLBACK(bar_pane_keywords_sel_replace_cb), pkd);
+ menu_item_add_stock(GTK_WIDGET(menu), _("Add selected keywords to selected files"), GTK_STOCK_ADD, G_CALLBACK(bar_pane_keywords_sel_add_cb), pkd);
+ menu_item_add_stock(GTK_WIDGET(menu), _("Replace existing keywords in selected files with selected keywords"), GTK_STOCK_CONVERT, G_CALLBACK(bar_pane_keywords_sel_replace_cb), pkd);
}
}
+gchar *text_widget_text_pull_selected(GtkWidget *text_widget)
+{
+ if (GTK_IS_TEXT_VIEW(text_widget))
+ {
+ GtkTextBuffer *buffer;
+ GtkTextIter start, end;
+ GtkTextIter selection_start, selection_end;
+
+ buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_widget));
+ gtk_text_buffer_get_bounds(buffer, &start, &end);
+
+ if (gtk_text_buffer_get_selection_bounds(buffer, &start, &end))
+ {
+ gtk_text_iter_set_line_offset(&start, 0);
+ gtk_text_iter_forward_to_line_end(&end);
+ }
+
+ return gtk_text_buffer_get_text(buffer, &start, &end, FALSE);
+ }
+ else if (GTK_IS_ENTRY(text_widget))
+ {
+ return g_strdup(gtk_entry_get_text(GTK_ENTRY(text_widget)));
+ }
+ else
+ {
+ return NULL;
+ }
+
+}
+
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
GCallback func, gpointer data);
gchar *text_widget_text_pull(GtkWidget *text_widget);
+gchar *text_widget_text_pull_selected(GtkWidget *text_widget);
#endif
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
<p class="para block block-first">This action cannot be undone.</p>
</div></div>
<p class="para block">Irrespective of their position in a hierarchy in the right-hand box, all keywords are written as individual entries into metadata. When metadata for an image is read in, Geeqie will attempt to recreate any hierarchies within the data, and display it accordingly in the right-hand box.</p>
-<p class="para block">Right-click on the left-hand box allows the keywords to be written to the currently selected files - the keywords may be either added to the existing contents, or entirely replace the existing content.</p>
+<p class="para block">
+ Right-click on the left-hand box allows the selected keywords to be written to the currently selected files - the keywords may be either added to the existing contents, or entirely replace the existing content.
+ <div class="admonition block warning block-first block-indent"><div class="warning-inner">
+ <p class="para block block-first">Keyword completion is used when selecting keywords. If the selected area includes part of a keyword, the selection will autmatically be expanded to cover the whole keyword. If no text is selected, all keywords will be used.</p>
+ </div></div>
+ </p>
<p class="para block">
Right-click on the right-hand box allows a connection to be made between a keyword and a mark. The
<a class="link" href="GuideImageMarks.html" title="Marking Images">Marking Images</a>