[ease/origin/plugins] Add a spinner to the Flickr dialog, and drop dependency on libsexy for the OpenClipart one.



commit fd6011307b8a061821a39cf74fd2d9ab1b160c81
Author: Stéphane Maniaci <stephane maniaci gmail com>
Date:   Sat Jun 19 02:10:34 2010 +0200

    Add a spinner to the Flickr dialog, and drop dependency on libsexy for the OpenClipart one.

 plugins/Makefile                   |    2 +-
 plugins/flickr.vala                |   11 ++++++++++-
 src/ease-plugin-import-dialog.vala |   13 ++++++++++---
 3 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/plugins/Makefile b/plugins/Makefile
index 5bdfb63..9d3afd1 100644
--- a/plugins/Makefile
+++ b/plugins/Makefile
@@ -1,5 +1,5 @@
 CFLAGS = --pkg gtk+-2.0 --pkg gmodule-2.0 --pkg json-glib-1.0 --pkg rest-extras-0.6
-OCAFLAGS = --pkg gtk+-2.0 --pkg libsexy --pkg rest-extras-0.6 --pkg libxml-2.0 --pkg gee-1.0 -o openclipart
+OCAFLAGS = --pkg gtk+-2.0 --pkg rest-extras-0.6 --pkg libxml-2.0 --pkg gee-1.0 -o openclipart
 
 flickr:flickr.vala
 	valac $(CFLAGS) flickr.vala
diff --git a/plugins/flickr.vala b/plugins/flickr.vala
index 9422efc..c5ba28c 100644
--- a/plugins/flickr.vala
+++ b/plugins/flickr.vala
@@ -21,6 +21,8 @@ public class FlickrFetcher {
 	private Gtk.Button search_button;
 	private Gtk.IconView iconview;
 	private Gtk.Builder builder;
+	private Gtk.VBox vbox;
+	private Gtk.Spinner spinner;
 
 	private Gtk.ListStore store;
 
@@ -83,7 +85,7 @@ public class FlickrFetcher {
 			error ("Couldn't parse JSON data: %s", e.message);
 		}
 
-		print ("Payload: %s\nDELIMIT", jsondata);
+		// print ("Payload: %s\nDELIMIT", jsondata);
 		Json.Object obj = parser.get_root().get_object ();
 		var photos = obj.get_object_member ("photos");
 		var photo_array = photos.get_array_member ("photo");
@@ -128,7 +130,11 @@ public class FlickrFetcher {
 		string tags = entry.delimit (" ", ',');
 		search_entry.set_text (tags);
 
+		this.vbox.pack_start (this.spinner);
+		this.vbox.reorder_child (this.spinner, 2);
+		this.spinner.start ();
 		string answer = get_flickr_photos_from_tags (tags);
+		this.spinner.stop ();
 		parse_flickr_photos (answer);
 	}
 
@@ -159,6 +165,9 @@ public class FlickrFetcher {
 		search_button = builder.get_object ("searchbutton") as Gtk.Button;
 		search_entry = builder.get_object ("searchentry") as Gtk.Entry;
 		store = builder.get_object ("liststore1") as Gtk.ListStore;
+		vbox = builder.get_object ("vbox1") as Gtk.VBox;
+		spinner = new Gtk.Spinner ();
+		spinner.show ();
 
 		iconview.set_pixbuf_column (2);
 		iconview.set_text_column (1);
diff --git a/src/ease-plugin-import-dialog.vala b/src/ease-plugin-import-dialog.vala
index b1c7a24..9f13e40 100644
--- a/src/ease-plugin-import-dialog.vala
+++ b/src/ease-plugin-import-dialog.vala
@@ -40,7 +40,7 @@ public abstract class Ease.PluginImportDialog : Gtk.Dialog
 	/**
 	 * Search field.
 	 */
-	protected Sexy.IconEntry search;
+	protected Gtk.Entry search;
 	
 	/**
 	 * Search button.
@@ -110,8 +110,9 @@ public abstract class Ease.PluginImportDialog : Gtk.Dialog
 	public PluginImportDialog()
 	{
 		// search field
-		search = new Sexy.IconEntry();
-		search.add_clear_button();
+		search = new Gtk.Entry();
+		search.set_icon_from_icon_name(Gtk.EntryIconPosition.SECONDARY, "gtk-clear");
+		search.icon_release.connect( () => { clear_selection(); });
 		
 		// search button
 		button = new Gtk.Button.from_stock("gtk-find");
@@ -191,6 +192,12 @@ public abstract class Ease.PluginImportDialog : Gtk.Dialog
 	 *
 	 * @param call The completed Rest.ProxyCall.
 	 */
+
+	private void clear_selection()
+	{
+		this.search.text = "";
+	}
+
 	private void on_call_finish(Rest.ProxyCall call)
 	{
 		// remove the spinner



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