gimp r26287 - in branches/soc-2008-tagging: . app/widgets



Author: aurisj
Date: Tue Jul 22 19:39:15 2008
New Revision: 26287
URL: http://svn.gnome.org/viewvc/gimp?rev=26287&view=rev

Log:
2008-07-22  Aurimas JuÅka  <aurisj svn gnome org>

	* app/widgets/gimpcombotagentry.c
	* app/widgets/gimpdatafactoryview.c
	* app/widgets/gimptagentry.[ch]: trigger immediate tag assignment when
	toggling tags in the popup list.



Modified:
   branches/soc-2008-tagging/ChangeLog
   branches/soc-2008-tagging/app/widgets/gimpcombotagentry.c
   branches/soc-2008-tagging/app/widgets/gimpdatafactoryview.c
   branches/soc-2008-tagging/app/widgets/gimptagentry.c
   branches/soc-2008-tagging/app/widgets/gimptagentry.h

Modified: branches/soc-2008-tagging/app/widgets/gimpcombotagentry.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcombotagentry.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpcombotagentry.c	Tue Jul 22 19:39:15 2008
@@ -690,8 +690,8 @@
       g_string_append (tag_str, tag);
     }
 
-  gtk_entry_set_text (GTK_ENTRY (combo_entry->tag_entry), tag_str->str);
-  gtk_editable_set_position (GTK_EDITABLE (combo_entry->tag_entry), -1);
+  gimp_tag_entry_set_tag_string (GIMP_TAG_ENTRY (combo_entry->tag_entry),
+                                 tag_str->str);
 
   g_string_free (tag_str, TRUE);
   g_strfreev (current_tags);

Modified: branches/soc-2008-tagging/app/widgets/gimpdatafactoryview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdatafactoryview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpdatafactoryview.c	Tue Jul 22 19:39:15 2008
@@ -81,15 +81,15 @@
 static void
 gimp_data_factory_view_init (GimpDataFactoryView *view)
 {
-  view->edit_button      = NULL;
-  view->new_button       = NULL;
-  view->duplicate_button = NULL;
-  view->delete_button    = NULL;
-  view->refresh_button   = NULL;
-
-  view->filtered_container = NULL;
-
-  view->selected_items   = NULL;
+  view->edit_button             = NULL;
+  view->new_button              = NULL;
+  view->duplicate_button        = NULL;
+  view->delete_button           = NULL;
+  view->refresh_button          = NULL;
+  view->filtered_container      = NULL;
+  view->query_tag_entry         = NULL;
+  view->assign_tag_entry        = NULL;
+  view->selected_items          = NULL;
 }
 
 GtkWidget *
@@ -263,13 +263,14 @@
                                     GimpViewable        *viewable)
 {
   GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (editor);
-  GList               *active_items = NULL;
 
   if (GIMP_CONTAINER_EDITOR_CLASS (parent_class)->select_item)
     GIMP_CONTAINER_EDITOR_CLASS (parent_class)->select_item (editor, viewable);
 
   if (view->assign_tag_entry)
     {
+      GList    *active_items = NULL;
+
       if (viewable)
         {
           active_items = g_list_append (active_items, viewable);
@@ -280,7 +281,7 @@
     }
   else
     {
-      active_items = g_list_append (active_items, viewable);
+      view->selected_items = g_list_append (view->selected_items, viewable);
     }
 }
 

Modified: branches/soc-2008-tagging/app/widgets/gimptagentry.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptagentry.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimptagentry.c	Tue Jul 22 19:39:15 2008
@@ -200,6 +200,19 @@
     }
 }
 
+void
+gimp_tag_entry_set_tag_string (GimpTagEntry    *tag_entry,
+                               const gchar     *tag_string)
+{
+  gtk_entry_set_text (GTK_ENTRY (tag_entry), tag_string);
+  gtk_editable_set_position (GTK_EDITABLE (tag_entry), -1);
+
+  if (tag_entry->mode == GIMP_TAG_ENTRY_MODE_ASSIGN)
+    {
+      gimp_tag_entry_assign_tags (tag_entry);
+    }
+}
+
 static void
 gimp_tag_entry_changed (GtkEntry          *entry,
                         gpointer           unused)

Modified: branches/soc-2008-tagging/app/widgets/gimptagentry.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptagentry.h	(original)
+++ branches/soc-2008-tagging/app/widgets/gimptagentry.h	Tue Jul 22 19:39:15 2008
@@ -63,5 +63,7 @@
 void        gimp_tag_entry_set_selected_items (GimpTagEntry            *tag_entry,
                                                GList                   *items);
 gchar **    gimp_tag_entry_parse_tags         (GimpTagEntry            *entry);
+void        gimp_tag_entry_set_tag_string     (GimpTagEntry            *tag_entry,
+                                               const gchar             *tag_string);
 
 #endif  /*  __GIMP_TAG_ENTRY_H__  */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]