anjuta r4574 - in trunk: . plugins/project-wizard



Author: sgranjoux
Date: Sun Jan 11 21:28:18 2009
New Revision: 4574
URL: http://svn.gnome.org/viewvc/anjuta?rev=4574&view=rev

Log:
	* plugins/project-wizard/druid.c,
	plugins/project-wizard/druid.h,
	plugins/project-wizard/property.c,
	plugins/project-wizard/property.h,
	plugins/project-wizard/header.c,
	plugins/project-wizard/anjuta-project-wizard.glade,
	plugins/project-wizard/Makefile.am,
	configure.in:
	Partial fix #513156: Replace GnomeDruid by GtkAssistant and
	GnomeIconList by GtkIconView
	Use GtkBuilder instead of libglade
	gtk_assistant_set_current_page need gtk 2.19.10


Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/plugins/project-wizard/Makefile.am
   trunk/plugins/project-wizard/anjuta-project-wizard.glade
   trunk/plugins/project-wizard/druid.c
   trunk/plugins/project-wizard/druid.h
   trunk/plugins/project-wizard/header.c
   trunk/plugins/project-wizard/property.c
   trunk/plugins/project-wizard/property.h

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Sun Jan 11 21:28:18 2009
@@ -24,7 +24,7 @@
 
 GLIB_REQUIRED=2.16.0
 GDK_PIXBUF_REQUIRED=2.0.0
-GTK_REQUIRED=2.12.0
+GTK_REQUIRED=2.12.10
 ORBIT_REQUIRED=2.6.0
 LIBGLADE_REQUIRED=2.3.0
 GNOME_REQUIRED=2.12.0

Modified: trunk/plugins/project-wizard/Makefile.am
==============================================================================
--- trunk/plugins/project-wizard/Makefile.am	(original)
+++ trunk/plugins/project-wizard/Makefile.am	Sun Jan 11 21:28:18 2009
@@ -3,7 +3,7 @@
 
 # Plugin glade file
 wizard_gladedir = $(anjuta_glade_dir)
-wizard_glade_DATA = anjuta-project-wizard.glade \
+wizard_glade_DATA = anjuta-project-wizard.ui \
 	applogo.png \
 	appwizard.png
 
@@ -21,6 +21,10 @@
 plugin_in_files = anjuta-project-wizard.plugin.in
 %.plugin: %.plugin.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
 
+# Create .ui file from .glade file
+%.ui: %.glade
+	gtk-builder-convert $< $@ 
+
 wizard_plugindir = $(anjuta_plugin_dir)
 wizard_plugin_DATA = $(plugin_in_files:.plugin.in=.plugin)
 

Modified: trunk/plugins/project-wizard/anjuta-project-wizard.glade
==============================================================================
--- trunk/plugins/project-wizard/anjuta-project-wizard.glade	(original)
+++ trunk/plugins/project-wizard/anjuta-project-wizard.glade	Sun Jan 11 21:28:18 2009
@@ -1,636 +1,212 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd";>
-
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
 <glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkWindow" id="druid_window">
-  <property name="visible">True</property>
-  <property name="title" translatable="yes">Application Assistant</property>
-  <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_CENTER</property>
-  <property name="modal">False</property>
-  <property name="default_width">500</property>
-  <property name="default_height">460</property>
-  <property name="resizable">True</property>
-  <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
-  <signal name="delete_event" handler="on_druid_delete" last_modification_time="Sun, 12 Dec 2004 10:54:32 GMT"/>
-
-  <child>
-    <widget class="GnomeDruid" id="druid">
-      <property name="border_width">4</property>
-      <property name="visible">True</property>
-      <property name="show_help">False</property>
-      <signal name="cancel" handler="on_druid_cancel" last_modification_time="Sun, 12 Dec 2004 08:34:18 GMT"/>
-
-      <child>
-	<widget class="GnomeDruidPageEdge" id="start_page">
-	  <property name="visible">True</property>
-	  <property name="position">GNOME_EDGE_START</property>
-	  <property name="title" translatable="yes">Application Assistant</property>
-	  <property name="text" translatable="yes">The Application Assistant will generate a basic skeleton for a project, including all of the build files. It will ask for details of the initial structure for the application. Please answer the questions carefully, as it may not be possible to change some of the settings later.</property>
-	  <property name="background_color">#3d3d8281b7b7</property>
-	  <property name="logo_background_color">#3d3d8280b7b7</property>
-	  <property name="textbox_color">#ffffffffffff</property>
-	  <property name="logo">applogo.png</property>
-	  <property name="watermark">appwizard.png</property>
-	</widget>
-      </child>
-
-      <child>
-	<widget class="GnomeDruidPageStandard" id="selection_page">
-	  <property name="visible">True</property>
-	  <property name="title" translatable="yes">Project Type</property>
-	  <property name="background">#3d3d8281b7b7</property>
-	  <property name="logo_background">#3d3d827fb7b7</property>
-	  <property name="logo">applogo.png</property>
-	  <signal name="next" handler="on_druid_next" last_modification_time="Sun, 12 Dec 2004 08:33:49 GMT"/>
-
-	  <child internal-child="vbox">
-	    <widget class="GtkVBox" id="druid-vbox1">
-	      <property name="border_width">16</property>
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">6</property>
-
-	      <child>
-		<widget class="GtkFrame" id="frame1">
-		  <property name="visible">True</property>
-		  <property name="label_xalign">0</property>
-		  <property name="label_yalign">0.5</property>
-		  <property name="shadow_type">GTK_SHADOW_NONE</property>
-
-		  <child>
-		    <widget class="GtkVBox" id="vbox4">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkFrame" id="frame2">
-			  <property name="visible">True</property>
-			  <property name="label_xalign">0</property>
-			  <property name="label_yalign">0.5</property>
-			  <property name="shadow_type">GTK_SHADOW_NONE</property>
-
-			  <child>
-			    <widget class="GtkLabel" id="label2">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">&lt;b&gt;Select the type of application to be developed&lt;/b&gt;</property>
-			      <property name="use_underline">False</property>
-			      <property name="use_markup">True</property>
-			      <property name="justify">GTK_JUSTIFY_LEFT</property>
-			      <property name="wrap">False</property>
-			      <property name="selectable">False</property>
-			      <property name="xalign">0</property>
-			      <property name="yalign">0</property>
-			      <property name="xpad">0</property>
-			      <property name="ypad">5</property>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkFrame" id="frame3">
-			  <property name="border_width">5</property>
-			  <property name="visible">True</property>
-			  <property name="label_xalign">0</property>
-			  <property name="label_yalign">0.5</property>
-			  <property name="shadow_type">GTK_SHADOW_NONE</property>
-
-			  <child>
-			    <widget class="GtkNotebook" id="project_book">
-			      <property name="visible">True</property>
-			      <property name="can_focus">True</property>
-			      <property name="show_tabs">True</property>
-			      <property name="show_border">True</property>
-			      <property name="tab_pos">GTK_POS_TOP</property>
-			      <property name="scrollable">False</property>
-			      <property name="enable_popup">False</property>
-
-			      <child>
-				<widget class="GtkVBox" id="project_table">
-				  <property name="visible">True</property>
-				  <property name="homogeneous">False</property>
-				  <property name="spacing">0</property>
-				  <signal name="map" handler="on_druid_project_map_page" last_modification_time="Sun, 06 Feb 2005 10:33:42 GMT"/>
-
-				  <child>
-				    <widget class="GtkFrame" id="frame16">
-				      <property name="border_width">5</property>
-				      <property name="visible">True</property>
-				      <property name="label_xalign">0</property>
-				      <property name="label_yalign">0.5</property>
-				      <property name="shadow_type">GTK_SHADOW_NONE</property>
-
-				      <child>
-					<widget class="GtkScrolledWindow" id="project_scroll_list">
-					  <property name="visible">True</property>
-					  <property name="can_focus">True</property>
-					  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-					  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-					  <property name="shadow_type">GTK_SHADOW_IN</property>
-					  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-					  <child>
-					    <widget class="GnomeIconList" id="project_list">
-					      <property name="visible">True</property>
-					      <property name="can_focus">True</property>
-					      <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-					      <property name="icon_width">78</property>
-					      <property name="row_spacing">4</property>
-					      <property name="column_spacing">2</property>
-					      <property name="text_spacing">2</property>
-					      <property name="text_editable">False</property>
-					      <property name="text_static">False</property>
-					      <signal name="select_icon" handler="on_druid_project_select_icon" last_modification_time="Sun, 30 Jan 2005 10:24:12 GMT"/>
-					    </widget>
-					  </child>
-					</widget>
-				      </child>
-				    </widget>
-				    <packing>
-				      <property name="padding">0</property>
-				      <property name="expand">True</property>
-				      <property name="fill">True</property>
-				    </packing>
-				  </child>
-
-				  <child>
-				    <widget class="GtkFrame" id="frame17">
-				      <property name="visible">True</property>
-				      <property name="label_xalign">0</property>
-				      <property name="label_yalign">0.5</property>
-				      <property name="shadow_type">GTK_SHADOW_NONE</property>
-
-				      <child>
-					<widget class="GtkScrolledWindow" id="scrolledwindow14">
-					  <property name="visible">True</property>
-					  <property name="can_focus">True</property>
-					  <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
-					  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-					  <property name="shadow_type">GTK_SHADOW_NONE</property>
-					  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-					  <child>
-					    <widget class="GtkViewport" id="viewport2">
-					      <property name="visible">True</property>
-					      <property name="shadow_type">GTK_SHADOW_NONE</property>
-
-					      <child>
-						<widget class="GtkLabel" id="project_description">
-						  <property name="visible">True</property>
-						  <property name="label" translatable="yes">label</property>
-						  <property name="use_underline">False</property>
-						  <property name="use_markup">False</property>
-						  <property name="justify">GTK_JUSTIFY_LEFT</property>
-						  <property name="wrap">True</property>
-						  <property name="selectable">False</property>
-						  <property name="xalign">0</property>
-						  <property name="yalign">0</property>
-						  <property name="xpad">10</property>
-						  <property name="ypad">5</property>
-						</widget>
-					      </child>
-					    </widget>
-					  </child>
-					</widget>
-				      </child>
-
-				      <child>
-					<widget class="GtkLabel" id="label43">
-					  <property name="visible">True</property>
-					  <property name="label" translatable="yes">&lt;b&gt;Project description:&lt;/b&gt;</property>
-					  <property name="use_underline">False</property>
-					  <property name="use_markup">True</property>
-					  <property name="justify">GTK_JUSTIFY_LEFT</property>
-					  <property name="wrap">False</property>
-					  <property name="selectable">False</property>
-					  <property name="xalign">0.5</property>
-					  <property name="yalign">0.5</property>
-					  <property name="xpad">0</property>
-					  <property name="ypad">0</property>
-					</widget>
-					<packing>
-					  <property name="type">label_item</property>
-					</packing>
-				      </child>
-				    </widget>
-				    <packing>
-				      <property name="padding">0</property>
-				      <property name="expand">False</property>
-				      <property name="fill">True</property>
-				    </packing>
-				  </child>
-				</widget>
-				<packing>
-				  <property name="tab_expand">False</property>
-				  <property name="tab_fill">True</property>
-				</packing>
-			      </child>
-
-			      <child>
-				<widget class="GtkLabel" id="project_book_label">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">label49</property>
-				  <property name="use_underline">False</property>
-				  <property name="use_markup">False</property>
-				  <property name="justify">GTK_JUSTIFY_LEFT</property>
-				  <property name="wrap">False</property>
-				  <property name="selectable">False</property>
-				  <property name="xalign">0.5</property>
-				  <property name="yalign">0.5</property>
-				  <property name="xpad">5</property>
-				  <property name="ypad">0</property>
-				</widget>
-				<packing>
-				  <property name="type">tab</property>
-				</packing>
-			      </child>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-		    </widget>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">True</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-	    </widget>
-	  </child>
-	</widget>
-      </child>
-
-      <child>
-	<widget class="GnomeDruidPageStandard" id="property_page">
-	  <property name="visible">True</property>
-	  <property name="title" translatable="yes">Basic Information</property>
-	  <property name="background">#3d3d8281b7b7</property>
-	  <property name="logo_background">#3d3d8281b7b7</property>
-	  <property name="logo">applogo.png</property>
-	  <signal name="next" handler="on_druid_next" last_modification_time="Sun, 12 Dec 2004 08:34:40 GMT"/>
-	  <signal name="back" handler="on_druid_back" last_modification_time="Sun, 12 Dec 2004 08:35:02 GMT"/>
-
-	  <child internal-child="vbox">
-	    <widget class="GtkVBox" id="druid-vbox2">
-	      <property name="border_width">16</property>
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">6</property>
-
-	      <child>
-		<widget class="GtkFrame" id="frame13">
-		  <property name="visible">True</property>
-		  <property name="label_xalign">0</property>
-		  <property name="label_yalign">0.5</property>
-		  <property name="shadow_type">GTK_SHADOW_NONE</property>
-
-		  <child>
-		    <widget class="GtkVBox" id="vbox5">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkFrame" id="frame15">
-			  <property name="visible">True</property>
-			  <property name="label_xalign">0</property>
-			  <property name="label_yalign">0.5</property>
-			  <property name="shadow_type">GTK_SHADOW_NONE</property>
-
-			  <child>
-			    <widget class="GtkLabel" id="property_label">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Enter the basic Project information</property>
-			      <property name="use_underline">False</property>
-			      <property name="use_markup">False</property>
-			      <property name="justify">GTK_JUSTIFY_LEFT</property>
-			      <property name="wrap">False</property>
-			      <property name="selectable">False</property>
-			      <property name="xalign">0</property>
-			      <property name="yalign">0</property>
-			      <property name="xpad">0</property>
-			      <property name="ypad">5</property>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkScrolledWindow" id="scrolledwindow2">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
-			  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-			  <property name="shadow_type">GTK_SHADOW_NONE</property>
-			  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-			  <child>
-			    <widget class="GtkViewport" id="viewport1">
-			      <property name="visible">True</property>
-			      <property name="shadow_type">GTK_SHADOW_NONE</property>
-
-			      <child>
-				<widget class="GtkTable" id="property_table">
-				  <property name="border_width">5</property>
-				  <property name="visible">True</property>
-				  <property name="n_rows">5</property>
-				  <property name="n_columns">2</property>
-				  <property name="homogeneous">False</property>
-				  <property name="row_spacing">5</property>
-				  <property name="column_spacing">5</property>
-
-				  <child>
-				    <widget class="GtkLabel" id="label29">
-				      <property name="visible">True</property>
-				      <property name="label" translatable="yes">Project Name:</property>
-				      <property name="use_underline">False</property>
-				      <property name="use_markup">False</property>
-				      <property name="justify">GTK_JUSTIFY_LEFT</property>
-				      <property name="wrap">False</property>
-				      <property name="selectable">False</property>
-				      <property name="xalign">0</property>
-				      <property name="yalign">0.5</property>
-				      <property name="xpad">5</property>
-				      <property name="ypad">5</property>
-				    </widget>
-				    <packing>
-				      <property name="left_attach">0</property>
-				      <property name="right_attach">1</property>
-				      <property name="top_attach">0</property>
-				      <property name="bottom_attach">1</property>
-				      <property name="x_options">fill</property>
-				      <property name="y_options"></property>
-				    </packing>
-				  </child>
-
-				  <child>
-				    <widget class="GtkLabel" id="label30">
-				      <property name="visible">True</property>
-				      <property name="label" translatable="yes">Version:</property>
-				      <property name="use_underline">False</property>
-				      <property name="use_markup">False</property>
-				      <property name="justify">GTK_JUSTIFY_LEFT</property>
-				      <property name="wrap">False</property>
-				      <property name="selectable">False</property>
-				      <property name="xalign">0</property>
-				      <property name="yalign">0.5</property>
-				      <property name="xpad">5</property>
-				      <property name="ypad">5</property>
-				    </widget>
-				    <packing>
-				      <property name="left_attach">0</property>
-				      <property name="right_attach">1</property>
-				      <property name="top_attach">1</property>
-				      <property name="bottom_attach">2</property>
-				      <property name="x_options">fill</property>
-				      <property name="y_options"></property>
-				    </packing>
-				  </child>
-
-				  <child>
-				    <widget class="GtkLabel" id="label31">
-				      <property name="visible">True</property>
-				      <property name="label" translatable="yes">Author:</property>
-				      <property name="use_underline">False</property>
-				      <property name="use_markup">True</property>
-				      <property name="justify">GTK_JUSTIFY_LEFT</property>
-				      <property name="wrap">False</property>
-				      <property name="selectable">False</property>
-				      <property name="xalign">0</property>
-				      <property name="yalign">0.5</property>
-				      <property name="xpad">5</property>
-				      <property name="ypad">5</property>
-				    </widget>
-				    <packing>
-				      <property name="left_attach">0</property>
-				      <property name="right_attach">1</property>
-				      <property name="top_attach">2</property>
-				      <property name="bottom_attach">3</property>
-				      <property name="x_options">fill</property>
-				      <property name="y_options"></property>
-				    </packing>
-				  </child>
-
-				  <child>
-				    <widget class="GtkLabel" id="label32">
-				      <property name="visible">True</property>
-				      <property name="label" translatable="yes">License:</property>
-				      <property name="use_underline">False</property>
-				      <property name="use_markup">True</property>
-				      <property name="justify">GTK_JUSTIFY_LEFT</property>
-				      <property name="wrap">False</property>
-				      <property name="selectable">False</property>
-				      <property name="xalign">0</property>
-				      <property name="yalign">0.5</property>
-				      <property name="xpad">5</property>
-				      <property name="ypad">5</property>
-				    </widget>
-				    <packing>
-				      <property name="left_attach">0</property>
-				      <property name="right_attach">1</property>
-				      <property name="top_attach">3</property>
-				      <property name="bottom_attach">4</property>
-				      <property name="x_options">fill</property>
-				      <property name="y_options"></property>
-				    </packing>
-				  </child>
-
-				  <child>
-				    <widget class="GtkEntry" id="entry17">
-				      <property name="visible">True</property>
-				      <property name="can_focus">True</property>
-				      <property name="editable">True</property>
-				      <property name="visibility">True</property>
-				      <property name="max_length">0</property>
-				      <property name="text" translatable="yes"></property>
-				      <property name="has_frame">True</property>
-				      <property name="activates_default">False</property>
-				    </widget>
-				    <packing>
-				      <property name="left_attach">1</property>
-				      <property name="right_attach">2</property>
-				      <property name="top_attach">0</property>
-				      <property name="bottom_attach">1</property>
-				      <property name="y_options"></property>
-				    </packing>
-				  </child>
-
-				  <child>
-				    <widget class="GtkEntry" id="entry18">
-				      <property name="visible">True</property>
-				      <property name="can_focus">True</property>
-				      <property name="editable">True</property>
-				      <property name="visibility">True</property>
-				      <property name="max_length">0</property>
-				      <property name="text" translatable="yes"></property>
-				      <property name="has_frame">True</property>
-				      <property name="invisible_char" translatable="yes">*</property>
-				      <property name="activates_default">False</property>
-				    </widget>
-				    <packing>
-				      <property name="left_attach">1</property>
-				      <property name="right_attach">2</property>
-				      <property name="top_attach">1</property>
-				      <property name="bottom_attach">2</property>
-				      <property name="y_options"></property>
-				    </packing>
-				  </child>
-
-				  <child>
-				    <widget class="GtkEntry" id="entry19">
-				      <property name="visible">True</property>
-				      <property name="can_focus">True</property>
-				      <property name="editable">True</property>
-				      <property name="visibility">True</property>
-				      <property name="max_length">0</property>
-				      <property name="text" translatable="yes"></property>
-				      <property name="has_frame">True</property>
-				      <property name="invisible_char" translatable="yes">*</property>
-				      <property name="activates_default">False</property>
-				    </widget>
-				    <packing>
-				      <property name="left_attach">1</property>
-				      <property name="right_attach">2</property>
-				      <property name="top_attach">2</property>
-				      <property name="bottom_attach">3</property>
-				      <property name="y_options"></property>
-				    </packing>
-				  </child>
-
-				  <child>
-				    <widget class="GtkLabel" id="label42">
-				      <property name="visible">True</property>
-				      <property name="label" translatable="yes">Destination:</property>
-				      <property name="use_underline">False</property>
-				      <property name="use_markup">True</property>
-				      <property name="justify">GTK_JUSTIFY_LEFT</property>
-				      <property name="wrap">False</property>
-				      <property name="selectable">False</property>
-				      <property name="xalign">0</property>
-				      <property name="yalign">0.5</property>
-				      <property name="xpad">5</property>
-				      <property name="ypad">5</property>
-				    </widget>
-				    <packing>
-				      <property name="left_attach">0</property>
-				      <property name="right_attach">1</property>
-				      <property name="top_attach">4</property>
-				      <property name="bottom_attach">5</property>
-				      <property name="x_options">fill</property>
-				      <property name="y_options"></property>
-				    </packing>
-				  </child>
-
-				  <child>
-				    <widget class="GtkComboBox" id="combobox1">
-				      <property name="visible">True</property>
-				    </widget>
-				    <packing>
-				      <property name="left_attach">1</property>
-				      <property name="right_attach">2</property>
-				      <property name="top_attach">3</property>
-				      <property name="bottom_attach">4</property>
-				      <property name="x_options">fill</property>
-				      <property name="y_options">fill</property>
-				    </packing>
-				  </child>
-
-				  <child>
-				    <widget class="GnomeFileEntry" id="fileentry1">
-				      <property name="visible">True</property>
-				      <property name="max_saved">10</property>
-				      <property name="directory_entry">True</property>
-				      <property name="modal">False</property>
-				      <property name="use_filechooser">False</property>
-
-				      <child internal-child="entry">
-					<widget class="GtkEntry" id="combo-entry1">
-					  <property name="visible">True</property>
-					  <property name="can_focus">True</property>
-					  <property name="editable">True</property>
-					  <property name="visibility">True</property>
-					  <property name="max_length">0</property>
-					  <property name="text" translatable="yes"></property>
-					  <property name="has_frame">True</property>
-					  <property name="invisible_char" translatable="yes">*</property>
-					  <property name="activates_default">False</property>
-					</widget>
-				      </child>
-				    </widget>
-				    <packing>
-				      <property name="left_attach">1</property>
-				      <property name="right_attach">2</property>
-				      <property name="top_attach">4</property>
-				      <property name="bottom_attach">5</property>
-				      <property name="y_options"></property>
-				    </packing>
-				  </child>
-				</widget>
-			      </child>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-		    </widget>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">True</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-	    </widget>
-	  </child>
-	</widget>
-      </child>
-
-      <child>
-	<widget class="GnomeDruidPageEdge" id="finish_page">
-	  <property name="visible">True</property>
-	  <property name="position">GNOME_EDGE_FINISH</property>
-	  <property name="title" translatable="yes">Summary</property>
-	  <property name="background_color">#3d3d8281b7b7</property>
-	  <property name="logo_background_color">#3d3d8281b7b7</property>
-	  <property name="logo">applogo.png</property>
-	  <property name="watermark">appwizard.png</property>
-	  <signal name="back" handler="on_druid_back" last_modification_time="Sun, 12 Dec 2004 08:35:22 GMT"/>
-	  <signal name="finish" handler="on_druid_finish" last_modification_time="Mon, 13 Dec 2004 21:05:17 GMT"/>
-	</widget>
-      </child>
-    </widget>
-  </child>
-</widget>
-
+  <widget class="GtkAssistant" id="druid_window">
+    <property name="skip_taskbar_hint">True</property>
+    <property name="skip_pager_hint">True</property>
+    <child>
+      <widget class="GtkNotebook" id="project_book">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="border_width">6</property>
+        <child>
+          <widget class="GtkScrolledWindow" id="scrolledwindow1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+            <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+            <property name="shadow_type">GTK_SHADOW_IN</property>
+            <child>
+              <widget class="GtkIconView" id="project_list">
+                <property name="width_request">468</property>
+                <property name="height_request">198</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="has_tooltip">True</property>
+                <property name="pixbuf_column">0</property>
+                <property name="text_column">1</property>
+                <property name="selection_mode">GTK_SELECTION_BROWSE</property>
+                <property name="row_spacing">0</property>
+                <property name="column_spacing">12</property>
+                <property name="tooltip_column">2</property>
+                <signal name="selection_changed" handler="on_druid_project_select_icon"/>
+              </widget>
+            </child>
+          </widget>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="project_book_label">
+            <property name="visible">True</property>
+            <property name="xpad">5</property>
+            <property name="label" translatable="yes">label49</property>
+          </widget>
+          <packing>
+            <property name="type">tab</property>
+            <property name="tab_fill">False</property>
+          </packing>
+        </child>
+      </widget>
+      <packing>
+        <property name="page_type">GTK_ASSISTANT_PAGE_INTRO</property>
+        <property name="title">Select project type</property>
+        <property name="header_image">applogo.png</property>
+      </packing>
+    </child>
+    <child>
+      <widget class="GtkHBox" id="hbox1">
+        <property name="visible">True</property>
+        <property name="spacing">6</property>
+        <child>
+          <widget class="GtkImage" id="error_icon">
+            <property name="visible">True</property>
+            <property name="yalign">0</property>
+            <property name="ypad">6</property>
+            <property name="stock">gtk-dialog-error</property>
+            <property name="icon_size">6</property>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="padding">6</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkVBox" id="vbox1">
+            <property name="visible">True</property>
+            <property name="spacing">6</property>
+            <child>
+              <widget class="GtkLabel" id="error_message">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">Error</property>
+                <property name="use_markup">True</property>
+                <property name="wrap">True</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="padding">6</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkExpander" id="error_detail">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <child>
+                  <widget class="GtkLabel" id="label2">
+                    <property name="visible">True</property>
+                    <property name="xalign">0</property>
+                    <property name="xpad">24</property>
+                    <property name="label" translatable="yes">label</property>
+                    <property name="wrap">True</property>
+                  </widget>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label1">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Details&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </widget>
+                  <packing>
+                    <property name="type">label_item</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </widget>
+      <packing>
+        <property name="title">Error</property>
+        <property name="header_image">applogo.png</property>
+      </packing>
+    </child>
+    <child>
+      <widget class="GtkLabel" id="progress_page">
+        <property name="visible">True</property>
+        <property name="wrap">True</property>
+      </widget>
+      <packing>
+        <property name="page_type">GTK_ASSISTANT_PAGE_PROGRESS</property>
+        <property name="title">Application Assistant</property>
+        <property name="header_image">applogo.png</property>
+      </packing>
+    </child>
+    <child>
+      <widget class="GtkLabel" id="finish_page">
+        <property name="visible">True</property>
+        <property name="label" translatable="yes">Page de confirmation</property>
+        <property name="use_markup">True</property>
+      </widget>
+      <packing>
+        <property name="page_type">GTK_ASSISTANT_PAGE_CONFIRM</property>
+        <property name="title">Summary</property>
+        <property name="header_image">applogo.png</property>
+        <property name="sidebar_image">appwizard.png</property>
+      </packing>
+    </child>
+    <child>
+      <widget class="GtkScrolledWindow" id="property_page">
+        <property name="can_focus">True</property>
+        <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+        <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+        <child>
+          <widget class="GtkViewport" id="viewport1">
+            <property name="shadow_type">GTK_SHADOW_NONE</property>
+            <child>
+              <widget class="GtkTable" id="property_table">
+                <property name="border_width">5</property>
+                <property name="n_rows">5</property>
+                <property name="n_columns">2</property>
+                <property name="column_spacing">6</property>
+                <property name="row_spacing">6</property>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+              </widget>
+            </child>
+          </widget>
+        </child>
+      </widget>
+      <packing>
+        <property name="header_image">applogo.png</property>
+      </packing>
+    </child>
+    <child>
+      <placeholder/>
+    </child>
+  </widget>
 </glade-interface>

Modified: trunk/plugins/project-wizard/druid.c
==============================================================================
--- trunk/plugins/project-wizard/druid.c	(original)
+++ trunk/plugins/project-wizard/druid.c	Sun Jan 11 21:28:18 2009
@@ -51,8 +51,6 @@
 /* Uncomment if you want to keep project wizards in a non-standard dir 
 #define LOCAL_PROJECT_WIZARD_DIRECTORY anjuta_utils_data_dir/projects/ 
 */
-#define PIXMAP_APPWIZ_LOGO PACKAGE_DATA_DIR"/glade/applogo.png"
-#define PIXMAP_APPWIZ_WATERMARK PACKAGE_DATA_DIR"/glade/appwizard.png"
 
 /* Default property name useable in wizard file
  *---------------------------------------------------------------------------*/
@@ -64,47 +62,41 @@
 /* Widget and signal name found in glade file
  *---------------------------------------------------------------------------*/
 
+#define GTK_BUILDER_UI_FILE PACKAGE_DATA_DIR"/glade/anjuta-project-wizard.ui"
+
 #define NEW_PROJECT_DIALOG "druid_window"
-#define PROJECT_SELECTION_LIST "project_list"
-#define PROJECT_SELECTION_SCROLL_LIST "project_scroll_list"
-#define PROJECT_SELECTION_FRAME "project_table"
-#define PROJECT_SELECTION_BOOK "project_book"
-#define PROJECT_SELECTION_BOOK_LABEL "project_book_label"
-#define PROJECT_DESCRIPTION "project_description"
-#define DRUID_WIDGET "druid"
-#define DRUID_START_PAGE "start_page"
-#define DRUID_SELECTION_PAGE "selection_page"
-#define DRUID_PROPERTY_PAGE "property_page"
-#define DRUID_PROPERTY_LABEL "property_label"
-#define DRUID_PROPERTY_TABLE "property_table"
-#define DRUID_FINISH_PAGE "finish_page"
-
-#define DRUID_DELETE_SIGNAL "on_druid_delete"
-#define DRUID_CANCEL_SIGNAL "on_druid_cancel"
-#define DRUID_BACK_SIGNAL "on_druid_back"
-#define DRUID_NEXT_SIGNAL "on_druid_next"
-#define DRUID_FINISH_SIGNAL "on_druid_finish"
-#define DRUID_PROJECT_SELECT_ICON_SIGNAL "on_druid_project_select_icon"
-#define DRUID_PROJECT_SELECT_PAGE_SIGNAL "on_druid_project_map_page"
+#define PROJECT_LIST "project_list"
+#define PROJECT_BOOK "project_book"
+#define PROPERTY_TABLE "property_table"
+#define ERROR_ICON "error_icon"
+#define ERROR_MESSAGE "error_message"
+#define ERROR_DETAIL "error_detail"
+
+#define PROJECT_PAGE 0
+#define ERROR_PAGE 1
+#define PROGRESS_PAGE 2
+#define FINISH_PAGE 3
+#define PROPERTY_PAGE 4
 
 /*---------------------------------------------------------------------------*/
 
 struct _NPWDruid
 {
-	GtkWidget* dialog;
+	GtkWindow* window;
+	
 	GtkNotebook* project_book;
-	GList *stuff_list;
-	GnomeDruid* druid;
-	const gchar* project_file;
-	GnomeDruidPage* selection_page;
-	GnomeDruidPageStandard* property_page;
-	GtkLabel* property_label;
-	GtkTable* property_table;
-	GnomeDruidPage* finish_page;
+	GtkImage *error_icon;
+	GtkLabel *error_message;
+	GtkWidget *error_detail;
+
 	GtkTooltips *tooltips;
+	
+	const gchar* project_file;
 	NPWPlugin* plugin;
 	
-	guint page;
+	gint next_page;
+	gint last_page;
+	
 	GQueue* page_list;
 	GHashTable* values;
 	NPWPageParser* parser;
@@ -114,48 +106,95 @@
 	gboolean busy;
 };
 
-typedef struct _NPWDruidAndTextBuffer
-{
-	NPWDruid* druid;
-	GtkLabel* description;
-	NPWHeader* header;
-} NPWDruidAndTextBuffer;
-
-typedef union _NPWDruidStuff
-{
-	NPWDruidAndTextBuffer a;
-} NPWDruidStuff;
-
+/* column of the icon view */
+enum {
+	PIXBUF_COLUMN,
+	TEXT_COLUMN,
+	DESC_COLUMN,
+	DATA_COLUMN
+};
 
-/* Create start and finish pages
+/* Create error page
  *---------------------------------------------------------------------------*/
 
-/* libGlade doesn't seem to set these parameters for the start and end page */
+/* Fill dialog page */
 static void
-npw_druid_fix_edge_pages (NPWDruid* this, GladeXML* xml)
+npw_druid_fill_error_page (NPWDruid* druid, GtkMessageType type, const gchar *detail, const gchar *mesg,...)
 {
-	GdkColor bg_color = {0, 15616, 33280, 46848};
-	GtkWidget* page;
-	GdkPixbuf* pixbuf;
-
-	/* Start page */
-	page = glade_xml_get_widget (xml, DRUID_START_PAGE);
-	gnome_druid_page_edge_set_bg_color (GNOME_DRUID_PAGE_EDGE (page), &bg_color);
-	gnome_druid_page_edge_set_logo_bg_color (GNOME_DRUID_PAGE_EDGE (page), &bg_color);
-	pixbuf = gdk_pixbuf_new_from_file (PIXMAP_APPWIZ_WATERMARK, NULL);
-	gnome_druid_page_edge_set_watermark (GNOME_DRUID_PAGE_EDGE (page), pixbuf);
-	g_object_unref (pixbuf);
-	pixbuf = gdk_pixbuf_new_from_file (PIXMAP_APPWIZ_LOGO, NULL);
-	gnome_druid_page_edge_set_logo (GNOME_DRUID_PAGE_EDGE (page), pixbuf);
-
-	/* Finish page */
-	page = glade_xml_get_widget (xml, DRUID_FINISH_PAGE);
-	gnome_druid_page_edge_set_bg_color (GNOME_DRUID_PAGE_EDGE (page), &bg_color);
-	gnome_druid_page_edge_set_logo_bg_color (GNOME_DRUID_PAGE_EDGE (page), &bg_color);
-	gnome_druid_page_edge_set_logo (GNOME_DRUID_PAGE_EDGE (page), pixbuf);
-	g_object_unref (pixbuf);
+	GtkAssistant *assistant;
+	GtkWidget *page;
+	va_list args;
+	gchar *message;
+	const gchar *stock_id = NULL;
+	const gchar *title = NULL;
+	
+	assistant = GTK_ASSISTANT (druid->window);
+	page = gtk_assistant_get_nth_page (assistant, ERROR_PAGE);
+	
+	/* Set dialog kind */
+	switch (type)
+	{
+	case GTK_MESSAGE_INFO:
+		stock_id = GTK_STOCK_DIALOG_INFO;
+		title = _("Information");
+		break;
+	case GTK_MESSAGE_QUESTION:
+		stock_id = GTK_STOCK_DIALOG_QUESTION;
+		title = _("Warning");
+		break;
+	case GTK_MESSAGE_WARNING:
+		stock_id = GTK_STOCK_DIALOG_WARNING;
+		title = _("Warning");
+		break;
+	case GTK_MESSAGE_ERROR:
+		stock_id = GTK_STOCK_DIALOG_ERROR;
+		title = _("Error");
+		break;
+	case GTK_MESSAGE_OTHER:
+		title = _("Message");
+		break;
+	default:
+		g_warning ("Unknown GtkMessageType %u", type);
+		break;
+	}	
+	gtk_assistant_set_page_title (assistant, page, title);
+	if (type == GTK_MESSAGE_ERROR)
+	{
+		gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT);
+		gtk_assistant_set_page_complete (assistant, page, FALSE);
+	}
+	else
+	{
+		gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_PROGRESS);
+		gtk_assistant_set_page_complete (assistant, page, TRUE);
+	}
+	gtk_image_set_from_stock (druid->error_icon, stock_id, GTK_ICON_SIZE_DIALOG);
+	
+	/* Set message */
+	va_start (args, mesg);
+	message = g_strdup_vprintf (mesg, args);
+	va_end (args);
+	gtk_label_set_markup (druid->error_message, message);
+	g_free (message);
+	
+	/* Set detail */
+	if (detail == NULL)
+	{
+		gtk_widget_hide (druid->error_detail);
+	}
+	else
+	{
+		GtkLabel *label;
+		
+		gtk_widget_show (druid->error_detail);
+		label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (druid->error_detail)));
+		gtk_label_set_text (label, detail);
+	}
 }
 
+/* Create finish page
+ *---------------------------------------------------------------------------*/
+
 static void
 cb_druid_add_summary_property (NPWProperty* property, gpointer user_data)
 {
@@ -163,69 +202,69 @@
 
 	if (npw_property_get_options (property) & NPW_SUMMARY_OPTION)
 	{
-		g_string_append (text, _(npw_property_get_label (property)));
-		g_string_append (text, npw_property_get_value (property));
-		g_string_append (text, "\n");
+		g_string_append_printf (text, "%s %s\n",
+								_(npw_property_get_label (property)), 
+								npw_property_get_value (property));
 	}
 }
 
 /* Fill last page (summary) */
 static void
-npw_druid_fill_summary (NPWDruid* this)
+npw_druid_fill_summary_page (NPWDruid* druid)
 {
 	NPWPage* page;
 	guint i;
 	GString* text;
+	GtkLabel* label;
 
-	text = g_string_new (_("Confirm the following information:\n\n"));
+	text = g_string_new (_("<b>Confirm the following information:</b>\n\n"));
 
 	/* The project type is translated too, it is something like
 	 * generic, GNOME applet, Makefile project... */
-	g_string_append_printf (text, _("Project Type: %s\n"), _(npw_header_get_name (this->header)));
+	g_string_append_printf (text, _("Project Type: %s\n"), _(npw_header_get_name (druid->header)));
 
-	for (i = 0; (page = g_queue_peek_nth (this->page_list, i)) != NULL; ++i)
+	for (i = 0; (page = g_queue_peek_nth (druid->page_list, i)) != NULL; ++i)
 	{
 		npw_page_foreach_property (page, (GFunc)cb_druid_add_summary_property, text);
 	}
-
-	gnome_druid_page_edge_set_text (GNOME_DRUID_PAGE_EDGE (this->finish_page), text->str);
+	
+	label = GTK_LABEL (gtk_assistant_get_nth_page (GTK_ASSISTANT (druid->window), FINISH_PAGE));
+	gtk_label_set_markup (label, text->str);
 	g_string_free (text, TRUE);
+	
+	gtk_assistant_set_page_complete (GTK_ASSISTANT (druid->window), GTK_WIDGET (label), TRUE);
 }
 
-
 /* Create project selection page
  *---------------------------------------------------------------------------*/
 
-/* Display project information */
+/* Update selected project */
 static void
-on_druid_project_select_icon (GnomeIconList* iconlist, gint idx, GdkEvent* event, gpointer user_data)
+on_druid_project_update_selected (GtkIconView* view, NPWDruid *druid)
 {
-	NPWHeader* header;
-	NPWDruidAndTextBuffer* data = (NPWDruidAndTextBuffer *)user_data;
-
-	header = (NPWHeader*)gnome_icon_list_get_icon_data (iconlist, idx);
-	data->header = header;
-
-	/* As the icon list is in Browse mode, this function is called after inserting the 
-	 * first item but before setting the associated data, so header could be NULL */
-	if (header != NULL)
+	GList *selected;
+	NPWHeader* header = NULL;
+	
+	/* No item can be selected when the view is mapped */
+	selected = gtk_icon_view_get_selected_items (view);
+	if (selected != NULL)
 	{
-		gtk_label_set_text (data->description, _(npw_header_get_description (header)));
-		data->druid->header = header;
+		GtkTreeIter iter;
+		GtkTreeModel *model;
+	
+		model = gtk_icon_view_get_model (view);
+		if (gtk_tree_model_get_iter (model, &iter, (GtkTreePath *)selected->data))
+		{
+			gtk_tree_model_get	(model, &iter, DATA_COLUMN, &header, -1);
+		}
+		gtk_tree_path_free ((GtkTreePath *)selected->data);
+		g_list_free (selected);
 	}
-}
 
-/* Reselect default icon in page */
-static void
-on_druid_project_select_page (GtkWidget* widget, gpointer user_data)
-{
-	/* NPWHeader* header; */
-	NPWDruidAndTextBuffer* data = (NPWDruidAndTextBuffer *)user_data;
-
-	g_return_if_fail (data->header != NULL);
-
-	gtk_label_set_text (data->description, _(npw_header_get_description (data->header)));
-	data->druid->header = data->header;
+	druid->header = header;
+	gtk_assistant_set_page_complete (GTK_ASSISTANT (druid->window),
+									 gtk_assistant_get_nth_page (GTK_ASSISTANT (druid->window),PROJECT_PAGE),
+									 header != NULL);
 }
 
 /* Add a project in the icon list */
@@ -233,92 +272,110 @@
 cb_druid_insert_project_icon (gpointer data, gpointer user_data)
 {
 	NPWHeader *header = (NPWHeader *)data;
-	GnomeIconList* list = GNOME_ICON_LIST (user_data);
-	gint idx;
-
-	idx = gnome_icon_list_append (list, npw_header_get_iconfile (header), _(npw_header_get_name (header)));
-	gnome_icon_list_set_icon_data (list, idx, header);
+	GtkListStore* store = GTK_LIST_STORE (user_data);
+	GtkTreeIter iter;
+	GdkPixbuf *pixbuf;
+
+	gtk_list_store_append (store, &iter);
+	pixbuf = gdk_pixbuf_new_from_file (npw_header_get_iconfile (header), NULL);
+	gtk_list_store_set (store, &iter, PIXBUF_COLUMN, pixbuf,
+						TEXT_COLUMN, _(npw_header_get_name (header)),
+						DESC_COLUMN, _(npw_header_get_description (header)),
+						DATA_COLUMN, header,
+						-1);
+	g_object_unref (pixbuf);
 }
 
 /* Add a page in the project notebook */
 static void
 cb_druid_insert_project_page (gpointer value, gpointer user_data)
 {
-	NPWDruid* this = (NPWDruid*)user_data;
-	GladeXML* xml;
+	NPWDruid* druid = (NPWDruid*)user_data;
+	GtkBuilder *builder;
 	GtkWidget* label;
-	GtkWidget* frame;
-	GnomeIconList* list;
-	GtkLabel* desc;
+	GtkWidget* child;
+	GtkWidget* assistant;
+	GtkIconView* view;
+	GtkNotebook *book;
+	GtkListStore *store;
 	GList *template_list = (GList *)value;
 	const gchar* category;
-	NPWDruidAndTextBuffer* data;
 
 	category = npw_header_get_category ((NPWHeader *)template_list->data);
 	
-	/* Create new frame according to glade file */
-	xml = glade_xml_new (GLADE_FILE, PROJECT_SELECTION_FRAME, NULL);
-	g_return_if_fail (xml != NULL);
-
-	frame = glade_xml_get_widget (xml, PROJECT_SELECTION_FRAME);
-	list = GNOME_ICON_LIST (glade_xml_get_widget (xml, PROJECT_SELECTION_LIST));
-	desc = GTK_LABEL (glade_xml_get_widget (xml, PROJECT_DESCRIPTION));
-
-	g_list_foreach (template_list, cb_druid_insert_project_icon, list); 
-
-	/* put druid address and corresponding text buffer in one structure 
-	 * to pass them to a call back function as an unique pointer */
-	data = g_slice_new (NPWDruidAndTextBuffer);
-	this->stuff_list = g_list_prepend (this->stuff_list, data);
-	data->druid = this;
-	data->description = desc;
-	data->header = (NPWHeader*)gnome_icon_list_get_icon_data (list, 0);
-	glade_xml_signal_connect_data (xml, DRUID_PROJECT_SELECT_ICON_SIGNAL, GTK_SIGNAL_FUNC (on_druid_project_select_icon), data);
-	glade_xml_signal_connect_data (xml, DRUID_PROJECT_SELECT_PAGE_SIGNAL, GTK_SIGNAL_FUNC (on_druid_project_select_page), data);
-
-	g_object_unref (xml);
-
-	/* Create label */
-	xml = glade_xml_new (GLADE_FILE, PROJECT_SELECTION_BOOK_LABEL, NULL);
-	g_return_if_fail (xml != NULL);
-	label = glade_xml_get_widget (xml, PROJECT_SELECTION_BOOK_LABEL);
-	g_object_unref (xml);
-	gtk_label_set_text (GTK_LABEL(label), (const gchar *)category);
-
-	gtk_notebook_append_page (this->project_book, frame, label);
+	/* Build another complete wizard dialog from the gtk builder file 
+	 * but keep only the project selection notebook page */
+	builder = gtk_builder_new ();
+	if (!gtk_builder_add_from_file (builder, GTK_BUILDER_UI_FILE, NULL))
+	{
+		g_warn_if_reached ();
+		g_object_unref (builder); 
+		return;
+	}
+	
+	/* Fill icon view */
+	view = GTK_ICON_VIEW (gtk_builder_get_object (builder, PROJECT_LIST));
+	store = gtk_list_store_new (4, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
+	g_list_foreach (template_list, cb_druid_insert_project_icon, store); 
+	gtk_icon_view_set_model (view, GTK_TREE_MODEL (store));
+	
+	/* Connect signal to update dialog */
+	g_signal_connect (G_OBJECT (view), "selection-changed", G_CALLBACK (on_druid_project_update_selected), druid);
+	g_signal_connect (G_OBJECT (view), "map", G_CALLBACK (on_druid_project_update_selected), druid);
+
+	/* Set new page label */
+	assistant = GTK_WIDGET (gtk_builder_get_object (builder, NEW_PROJECT_DIALOG));
+	book = GTK_NOTEBOOK (gtk_assistant_get_nth_page (GTK_ASSISTANT (assistant), PROJECT_PAGE));
+	child = gtk_notebook_get_nth_page (book, 0);
+	label = gtk_notebook_get_tab_label (book, child);
+	gtk_label_set_text (GTK_LABEL(label), (const gchar *)category);	
+	
+	/* Pick up the filled project selection page from the newly created dialog
+	 * add it to the wizard project notebook and destroy the dialog 
+	 */
+	gtk_notebook_remove_page (book, 0);
+	gtk_notebook_append_page (druid->project_book, child, label);
+	gtk_widget_destroy (assistant);
+	
+	g_object_unref (builder);
 }
 
 /* Fill project selection page */
 static gboolean
-npw_druid_fill_selection_page (NPWDruid* this)
+npw_druid_fill_selection_page (NPWDruid* druid)
 {
 	gboolean ok;
 	gchar* local_dir;
 
+	/* Remove all previous data */
+	druid->project_book = GTK_NOTEBOOK (gtk_assistant_get_nth_page (GTK_ASSISTANT (druid->window), PROJECT_PAGE));
+	gtk_notebook_remove_page(druid->project_book, 0);	
+	npw_header_list_free (druid->header_list);	
+	
 	/* Create list of projects */
-	if (this->header_list != NULL) npw_header_list_free (this->header_list);
-	this->header_list = npw_header_list_new ();	
+	druid->header_list = npw_header_list_new ();	
 
 	/* Fill list with all project in directory */
-	ok = npw_header_list_readdir (&this->header_list, PROJECT_WIZARD_DIRECTORY);
+	ok = npw_header_list_readdir (&druid->header_list, PROJECT_WIZARD_DIRECTORY);
 #ifdef LOCAL_PROJECT_WIZARD_DIRECTORY
 	local_dir = g_build_filename (g_get_home_dir(), LOCAL_PROJECT_WIZARD_DIRECTORY, NULL);
 #else
 	local_dir = anjuta_util_get_user_data_file_path ("projects/",NULL);
 #endif
-	ok = npw_header_list_readdir (&this->header_list, local_dir) || ok;
+	ok = npw_header_list_readdir (&druid->header_list, local_dir) || ok;
 	g_free (local_dir);
+	
 	if (!ok)
 	{
-		anjuta_util_dialog_error (GTK_WINDOW (ANJUTA_PLUGIN (this->plugin)->shell),_("Unable to find any project template in %s"), PROJECT_WIZARD_DIRECTORY);		
+		anjuta_util_dialog_error (GTK_WINDOW (ANJUTA_PLUGIN (druid->plugin)->shell),_("Unable to find any project template in %s"), PROJECT_WIZARD_DIRECTORY);		
 		return FALSE;
 	}
 
-	/* Add all notebook page */
-	gtk_notebook_remove_page(this->project_book, 0);	
-	
-	g_list_foreach (this->header_list, cb_druid_insert_project_page, this);
+	/* Add all necessary notebook page */
+	g_list_foreach (druid->header_list, cb_druid_insert_project_page, druid);
 
+	gtk_widget_show_all (GTK_WIDGET (druid->project_book));
+	
 	return TRUE;
 }
 
@@ -330,6 +387,7 @@
 {
 	NPWDruid* druid;
 	guint row;
+	GtkTable *table;
 } NPWDruidAddPropertyData;
 
 static void
@@ -370,69 +428,99 @@
 		}
 
 		/* Add label and entry */
-		gtk_table_resize (data->druid->property_table, data->row + 1, 2);
+		gtk_table_resize (data->table, data->row + 1, 2);
 		label = gtk_label_new (_(npw_property_get_label (property)));
 		gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
-		gtk_misc_set_padding (GTK_MISC (label), 5, 5);
-		gtk_table_attach (data->druid->property_table, label, 0, 1, data->row, data->row + 1,
+		gtk_misc_set_padding (GTK_MISC (label), 6, 6);
+		gtk_table_attach (data->table, label, 0, 1, data->row, data->row + 1,
 			(GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0);
-		gtk_table_attach (data->druid->property_table, entry, 1, 2, data->row, data->row + 1,
+		gtk_table_attach (data->table, entry, 1, 2, data->row, data->row + 1,
 			(GtkAttachOptions)(GTK_EXPAND|GTK_FILL), (GtkAttachOptions)(0), 0, 0);
-
+		
 		data->row++;
 	}
 };
 
-static gboolean
-npw_druid_fill_property_page (NPWDruid* this, NPWPage* page)
+static void
+npw_druid_fill_property_page (NPWDruid* druid, NPWPage* page)
 {
+	GtkWidget *widget;
 	NPWDruidAddPropertyData data;
-	PangoAttribute* attr;
-	PangoAttrList* attr_list;
+
+	widget = gtk_assistant_get_nth_page (GTK_ASSISTANT (druid->window), druid->next_page);
 	
 	/* Remove previous widgets */
-	gtk_container_foreach (GTK_CONTAINER (this->property_table), cb_druid_destroy_widget, NULL);
-
+	gtk_container_foreach (GTK_CONTAINER (npw_page_get_widget (page)), cb_druid_destroy_widget, NULL);
+ 		
 	/* Update title	*/
-	gnome_druid_page_standard_set_title (this->property_page, _(npw_page_get_label (page)));
-	gtk_label_set_text (this->property_label, _(npw_page_get_description (page)));
-	attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
-	attr->start_index = 0;
-	attr->end_index = G_MAXINT;
-	attr_list = pango_attr_list_new ();
-	pango_attr_list_insert (attr_list, attr);
-	gtk_label_set_attributes (this->property_label, attr_list);
-	pango_attr_list_unref (attr_list);
-	
+	gtk_assistant_set_page_title (GTK_ASSISTANT (druid->window), widget, _(npw_page_get_label (page)));
+
 	/* Add new widget */
-	data.druid = this;
+	data.druid = druid;
 	data.row = 0;
+	data.table = GTK_TABLE (npw_page_get_widget (page));
 	npw_page_foreach_property (page, (GFunc)cb_druid_add_property, &data);
-
-	/* Change page only if current is project selection page */
-	gnome_druid_set_page (this->druid, GNOME_DRUID_PAGE (this->property_page));
-	gtk_widget_show_all (this->dialog);
-
-	return TRUE;
+	
+	gtk_widget_show_all (widget);
 }
 
 /* Handle page cache
  *---------------------------------------------------------------------------*/
 
 static NPWPage*
-npw_druid_add_new_page (NPWDruid* this)
+npw_druid_add_new_page (NPWDruid* druid)
 {
 	NPWPage* page;
 
 	/* Get page in cache */
-	page = g_queue_peek_nth (this->page_list, this->page);
+	page = g_queue_peek_nth (druid->page_list, druid->next_page - PROPERTY_PAGE);
 	if (page == NULL)
 	{
 		/* Page not found in cache, create */
-		page = npw_page_new (this->values);
+		GtkBuilder *builder;
+		GtkWidget *widget;
+		GtkAssistantPageType type;
+		GdkPixbuf *pixbuf;
+		GtkWidget *table;
+		GtkAssistant *assistant;
+
+		/* Build another complete wizard dialog from the gtk builder file 
+	 	* but keep only the property assistant page */
+		builder = gtk_builder_new ();
+		if (!gtk_builder_add_from_file (builder, GTK_BUILDER_UI_FILE, NULL))
+		{
+			g_warn_if_reached ();
+			g_object_unref (builder); 
+			
+			return NULL;
+		}
+		assistant = GTK_ASSISTANT (gtk_builder_get_object (builder, NEW_PROJECT_DIALOG));
+		table = GTK_WIDGET (gtk_builder_get_object (builder, PROPERTY_TABLE));
+		
+		widget = gtk_assistant_get_nth_page (assistant, PROPERTY_PAGE);
+		type = gtk_assistant_get_page_type (assistant, widget);
+		pixbuf = gtk_assistant_get_page_header_image (assistant, widget);
+		if (pixbuf) g_object_ref (pixbuf);
+		gtk_container_remove (GTK_CONTAINER (assistant), widget);
+		gtk_assistant_insert_page (GTK_ASSISTANT (druid->window), widget, druid->next_page);
+		gtk_assistant_set_page_type (GTK_ASSISTANT (druid->window), widget, type);
+		if (pixbuf != NULL)
+		{	
+			gtk_assistant_set_page_header_image (GTK_ASSISTANT (druid->window), widget, pixbuf);
+			g_object_ref (pixbuf);
+		}
+		gtk_assistant_set_page_complete (GTK_ASSISTANT (druid->window), widget, TRUE);		
+		gtk_widget_destroy (GTK_WIDGET (assistant));
+		
+		/* Builder get reference on all built widget, so unref it when all work is done */		
+		g_object_unref (builder);
+		
+		/* Create new page */
+		page = npw_page_new (druid->values);
+		npw_page_set_widget (page, table);
 
 		/* Add page in cache */
-		g_queue_push_tail (this->page_list, page);
+		g_queue_push_tail (druid->page_list, page);
 	}
 
 	return page;
@@ -441,14 +529,21 @@
 /* Remove all following page */
 
 static void
-npw_druid_remove_following_page (NPWDruid* this)
+npw_druid_remove_following_page (NPWDruid* druid)
 {
 	NPWPage* page;
+	gint num = druid->next_page;
 
 	for(;;)
 	{
-		page = g_queue_pop_nth (this->page_list, this->page);
+		GtkWidget *widget;
+		
+		page = g_queue_pop_nth (druid->page_list, num - PROPERTY_PAGE);
 		if (page == NULL) break;
+		
+		widget = gtk_assistant_get_nth_page (GTK_ASSISTANT (druid->window), num);
+		gtk_container_remove (GTK_CONTAINER (druid->window), widget);
+		
 		npw_page_free (page);
 	}
 }
@@ -459,8 +554,10 @@
 typedef struct _NPWSaveValidPropertyData
 {
 	GtkWindow *parent;
-	gboolean next;
 	gboolean modified;
+	GString *error;
+	GString *warning;
+	
 } NPWSaveValidPropertyData;
 
 static void
@@ -480,16 +577,9 @@
 	{
 		if ((value == NULL) || (strlen (value) <= 0))
 		{
-			if (data->next == TRUE)
-			{
-				/* First error message */
-				data->next = FALSE;
-
-				/* Show error message. */
-				anjuta_util_dialog_error (data->parent,
-					_("Field \"%s\" is mandatory. Please enter it."),
-					_(npw_property_get_label (property)));
-			}
+			g_string_append_printf (data->error,
+									_("\nField \"%s\" is mandatory. Please enter it."),
+									_(npw_property_get_label (property)));
 			npw_property_remove_value (property);
 		}
 	}
@@ -497,23 +587,19 @@
 	/* Check restricted property */
 	if (modified && !npw_property_is_valid_restriction (property))
 	{
-		if (data->next == TRUE)
+		NPWPropertyRestriction restriction = npw_property_get_restriction (property);
+		
+		switch (restriction)
 		{
-			NPWPropertyRestriction restriction = npw_property_get_restriction (property);
-			/* First error message */
-			data->next = FALSE;
-
-			switch (restriction)
-			{
-			case NPW_FILENAME_RESTRICTION:
-				/* Show error message. */
-				anjuta_util_dialog_error (data->parent,
-					_("Field \"%s\" must start with a letter, a digit or an underscore and contains only letters, digits, underscore, minus and dot. Please fix it."),
-					_(npw_property_get_label (property)));
-				break;
-			default:
-				break;
-			}
+		case NPW_FILENAME_RESTRICTION:
+			g_string_append_printf (data->error,
+									_("Field \"%s\" must start with a letter, a digit or an underscore and contains only letters, digits, underscore, minus and dot. Please fix it."),
+									_(npw_property_get_label (property)));
+			break;
+		default:
+			g_string_append_printf (data->error,
+									_("Unknown error."));
+									
 		}
 		npw_property_remove_value (property);
 	}
@@ -538,115 +624,95 @@
 
 		if (exist)
 		{
-			if (data->next == TRUE)
-			{
-				/* First error message */
-				gboolean yes;
-
-				yes = anjuta_util_dialog_boolean_question (data->parent, is_directory ? 
-					_("Directory \"%s\" is not empty. Project creation could fail if some files "
-					  "cannot be written. Do you want to continue?") :
-					_("File \"%s\" already exists. Do you want to overwrite it?"),
-			       		value);
-
-				if (!yes)
-				{
-					data->next = FALSE;
-					npw_property_remove_value (property);
-				}
-			}
-			else
-			{
-				/* value is not invalid */
-				npw_property_remove_value (property);
-			}
+			g_string_append_printf (data->warning, is_directory ? 
+										_("Directory \"%s\" is not empty. Project creation could fail if some files "
+										  "cannot be written. Do you want to continue?") :
+											_("File \"%s\" already exists. Do you want to overwrite it?"),
+										value);
 		}
 	}
 };
 
-static void
-cb_save_old_property (NPWProperty* property, gpointer user_data)
-{
-	if (npw_property_save_value_from_widget (property))
-	{
-		*(gboolean *)user_data = TRUE;
-	}
-};
-
-/* Save values and check them, if it's possible to go to next page */
+/* Save values and check them, return TRUE if it's possible to go to
+ * next page */
 
 static gboolean
-npw_druid_save_valid_values (NPWDruid* this)
+npw_druid_save_valid_values (NPWDruid* druid)
 {
 	NPWPage* page;
 	NPWSaveValidPropertyData data;
+	gboolean ok = TRUE;
 
-	page = g_queue_peek_nth (this->page_list, this->page - 1);
+	page = g_queue_peek_nth (druid->page_list, druid->next_page - PROPERTY_PAGE - 1);
 	data.modified = FALSE;
-	data.next = TRUE;
-	data.parent = GTK_WINDOW (this->dialog);
+	data.parent = GTK_WINDOW (druid->window);
+	data.error = g_string_new (NULL);
+	data.warning = g_string_new (NULL);
 	npw_page_foreach_property (page, (GFunc)cb_save_valid_property, &data);
 
-	if (data.modified) npw_druid_remove_following_page (this);
-
-	return data.next;
-}
-
-/* Save current value, but do not check anything  */
-
-static void
-npw_druid_save_old_values (NPWDruid* this)
-{
-	NPWPage* page;
-	gboolean modified;
+	if (data.modified) npw_druid_remove_following_page (druid);
+	
+	if (data.error->len)
+	{
+		npw_druid_fill_error_page (druid,
+								   GTK_MESSAGE_ERROR,
+								   NULL,
+									"<b>%s</b>\n\n%s",
+									_("Invalid entry"),
+									data.error->str);
+		gtk_assistant_set_current_page (GTK_ASSISTANT (druid->window), ERROR_PAGE);
+		ok = FALSE;
+	}
+	else if (data.warning->len)
+	{
+		npw_druid_fill_error_page (druid,
+								   GTK_MESSAGE_WARNING,
+								   NULL,
+									"<b>%s</b>\n\n%s",
+									_("Dubious entry"),
+									data.warning->str);
+		gtk_assistant_set_current_page (GTK_ASSISTANT (druid->window), ERROR_PAGE);
+		ok = FALSE;
+	}
+	
+	g_string_free (data.error, TRUE);
+	g_string_free (data.warning, TRUE);
 
-	page = g_queue_peek_nth (this->page_list, this->page - 1);
-	modified = FALSE;
-	npw_page_foreach_property (page, (GFunc)cb_save_old_property, &modified);
+	return ok;
 }
 
-
 /* Druid GUI functions
  *---------------------------------------------------------------------------*/
 
 static void
-npw_druid_set_busy (NPWDruid *this, gboolean busy_state)
+npw_druid_set_busy (NPWDruid *druid, gboolean busy_state)
 {
-	if (this->busy == busy_state)
+	if (druid->busy == busy_state)
 		return;
 	
 	/* Set busy state */
-	gnome_druid_set_buttons_sensitive (GNOME_DRUID (this->druid),
-									   !busy_state, !busy_state,
-									   !busy_state, TRUE);
 	if (busy_state)
-		anjuta_status_busy_push (anjuta_shell_get_status (ANJUTA_PLUGIN (this->plugin)->shell, NULL));
+		anjuta_status_busy_push (anjuta_shell_get_status (ANJUTA_PLUGIN (druid->plugin)->shell, NULL));
 	else
-		anjuta_status_busy_pop (anjuta_shell_get_status (ANJUTA_PLUGIN (this->plugin)->shell, NULL));
-	this->busy = busy_state;
+		anjuta_status_busy_pop (anjuta_shell_get_status (ANJUTA_PLUGIN (druid->plugin)->shell, NULL));
+	druid->busy = busy_state;
 }
 
 /* Druid call backs
  *---------------------------------------------------------------------------*/
 
-static gboolean
-on_druid_cancel (GtkWidget* window, NPWDruid* druid)
+static void
+on_druid_cancel (GtkAssistant* window, NPWDruid* druid)
 {
-	DEBUG_PRINT ("%s", "Project wizard canceled");
 	anjuta_plugin_deactivate (ANJUTA_PLUGIN (druid->plugin));
 	npw_druid_free (druid);
-
-	return TRUE;
 }
 
-static gboolean
-on_druid_delete (GtkWidget* window, GdkEvent* event, NPWDruid* druid)
+static void
+on_druid_close (GtkAssistant* window, NPWDruid* druid)
 {
-	DEBUG_PRINT ("%s", "Project wizard canceled");
 	anjuta_plugin_deactivate (ANJUTA_PLUGIN (druid->plugin));
 	npw_druid_free (druid);
-
-	return TRUE;
 }
 
 static gboolean
@@ -655,7 +721,7 @@
 {
 	if (event->keyval == GDK_Escape)
 	{
-		npw_druid_free (druid);
+		on_druid_cancel (GTK_ASSISTANT (widget), druid);
 		return TRUE;
 	}
 	return FALSE;
@@ -664,23 +730,25 @@
 static void
 on_druid_get_new_page (NPWAutogen* gen, gpointer data)
 {
-	NPWDruid* this = (NPWDruid *)data;
+	NPWDruid* druid = (NPWDruid *)data;
 	NPWPage* page;
 
-	page = g_queue_peek_nth (this->page_list, this->page - 1);
+	page = g_queue_peek_nth (druid->page_list, druid->next_page - PROPERTY_PAGE);
 
 	if (npw_page_get_name (page) == NULL)
 	{
 		/* no page, display finish page */
-		npw_druid_fill_summary (this);
-		gnome_druid_set_page (this->druid, this->finish_page);
+		npw_druid_fill_summary_page (druid);
+		
+		gtk_assistant_set_current_page (GTK_ASSISTANT (druid->window), FINISH_PAGE);
 	}
 	else
 	{
 		/* display property page */
-		npw_druid_fill_property_page (this, page);
+		npw_druid_fill_property_page (druid, page);
+
+		gtk_assistant_set_current_page (GTK_ASSISTANT (druid->window), druid->next_page);
 	}
-	npw_druid_set_busy (this, FALSE);
 }
 
 static void
@@ -691,14 +759,14 @@
 	npw_page_parser_parse (parser, output, strlen (output), NULL);
 }
 
-static void
-check_and_warn_missing (NPWDruid *this)
+static gboolean
+check_and_warn_missing (NPWDruid *druid)
 {
 	GList *missing_programs, *missing_packages;
 	GString *missing_message = NULL;
 	
-	missing_programs = npw_header_check_required_programs (this->header);
-	missing_packages = npw_header_check_required_packages (this->header);
+	missing_programs = npw_header_check_required_programs (druid->header);
+	missing_packages = npw_header_check_required_packages (druid->header);
 	
 	if (missing_programs || missing_packages)
 	{
@@ -729,134 +797,127 @@
 	
 	if (missing_message)
 	{
-		GtkWidget *dialog, *detail_label, *expander;
-				
 		g_string_prepend (missing_message, _(
 		 "Some important programs or development packages required to build "
 		 "this project are missing. Please make sure they are "
 		 "installed properly before generating the project.\n"));
-		dialog =
-			gtk_message_dialog_new_with_markup (GTK_WINDOW (this->dialog),
-												GTK_DIALOG_DESTROY_WITH_PARENT,
-												GTK_MESSAGE_WARNING,
-												GTK_BUTTONS_CLOSE,
-												"<b>%s</b>\n\n%s",
-												_("Missing components"),
-												missing_message->str);
-		detail_label = gtk_label_new (
-		  _("The missing programs are usually part of some distrubution "
-			"packages and can be searched in your Application Manager. "
-			"Similarly, the development packages are contained in special "
-			"packages that your distribution provide to allow development "
-			"of projects based on them. They usually end with -dev or "
-			"-devel suffix in package names and can be found by searching "
-			"in your Application Manager."));
-		gtk_label_set_line_wrap (GTK_LABEL (detail_label), TRUE);
-		gtk_widget_show (detail_label);
-		
-		expander = gtk_expander_new ("<b>Details</b>");
-		gtk_expander_set_use_markup (GTK_EXPANDER (expander), TRUE);
-		gtk_container_add (GTK_CONTAINER (expander), detail_label);
-		gtk_box_pack_start_defaults (GTK_BOX (GTK_DIALOG (dialog)->vbox),
-									 expander);
-		gtk_widget_show (expander);
-		
-		gtk_dialog_run (GTK_DIALOG (dialog));
-		gtk_widget_destroy (dialog);
+
+		npw_druid_fill_error_page (druid,
+								   GTK_MESSAGE_WARNING,
+								  _("The missing programs are usually part of some distrubution "
+									"packages and can be searched in your Application Manager. "
+									"Similarly, the development packages are contained in special "
+									"packages that your distribution provide to allow development "
+									"of projects based on them. They usually end with -dev or "
+									"-devel suffix in package names and can be found by searching "
+									"in your Application Manager."),
+									"<b>%s</b>\n\n%s",
+									_("Missing components"),
+									missing_message->str);
 		g_string_free (missing_message, TRUE);
+		
+		gtk_assistant_set_current_page (GTK_ASSISTANT (druid->window), ERROR_PAGE);
 	}
+	
+	return !missing_message;
 }
 
-static gboolean
-on_druid_next (GnomeDruidPage* page, GtkWidget* widget, NPWDruid* this)
+/* This function is called to compute the next page AND to determine the status
+ * of last button: it does not mean that the user go to the next page. 
+ * We need this information to generate the next page just before displaying it.
+ * So a progress page is inserted between all pages of the wizard. We use the
+ * prepare signal handler of this page to compute the next page and switch to
+ * it using gtk_assistant_set_current_page(). */
+static gint
+on_druid_next (gint page, gpointer user_data)
 {
-	/* Skip if busy */
-	if (this->busy) return TRUE;
-		
-	/* Set busy */
-	npw_druid_set_busy (this, TRUE);
+	return page == FINISH_PAGE ? -1 : PROGRESS_PAGE;
+}
 
-	if (this->page == 0)
+static void
+on_druid_prepare (GtkAssistant* assistant, GtkWidget *page, NPWDruid* druid)
+{
+	gint current_page = gtk_assistant_get_current_page (assistant);
+	
+	if (current_page == PROGRESS_PAGE)
 	{
-		const gchar* new_project;
+		/* Generate the next page */
 
-		/* Current is Select project page */
-		new_project = npw_header_get_filename (this->header);
-		
-		/* Check if necessary programs for this project is installed */
-		check_and_warn_missing (this);
-		
-		if (this->project_file != new_project)
+		if (druid->next_page == PROPERTY_PAGE)
 		{
-			/* Change project */
+			const gchar* new_project;
 
-			this->project_file = new_project;
-			npw_druid_remove_following_page (this);
-			npw_autogen_set_input_file (this->gen, this->project_file, "[+","+]");
+			new_project = npw_header_get_filename (druid->header);
+			
+			if (druid->project_file != new_project)
+			{	
+				if (druid->last_page != ERROR_PAGE)
+				/* Check if necessary programs for this project is installed */
+				if (!check_and_warn_missing (druid))
+				{   
+					return;
+				}   
+				
+				/* Change project */
+				druid->project_file = new_project;
+				npw_druid_remove_following_page (druid);
+				npw_autogen_set_input_file (druid->gen, druid->project_file, "[+","+]");
+				
+			}
 		}
-	}
-	else
-	{
-		/* Current is one of the property page */
-		if (!npw_druid_save_valid_values (this))
+		else
 		{
-			/* Error stay on this page */
-			npw_druid_set_busy (this, FALSE);
+			if (!npw_druid_save_valid_values (druid))
+			{
+				/* Display error */
+				gtk_assistant_set_current_page (assistant, ERROR_PAGE);
+				
+				return;
+			}
+		}
 
-			return TRUE;
+		if (g_queue_peek_nth (druid->page_list, druid->next_page - PROPERTY_PAGE) == NULL)
+		{
+			/* Regenerate new page */
+			gtk_assistant_set_page_complete (assistant, page, FALSE);
+			if (druid->parser != NULL)
+				npw_page_parser_free (druid->parser);
+			druid->parser = npw_page_parser_new (npw_druid_add_new_page (druid), druid->project_file, druid->next_page - PROPERTY_PAGE);
+			
+			npw_autogen_set_output_callback (druid->gen, on_druid_parse_page, druid->parser);
+			npw_autogen_write_definition_file (druid->gen, druid->values);
+			npw_autogen_execute (druid->gen, on_druid_get_new_page, druid, NULL);
+		}
+		else
+		{
+			/* Page is already in cache */
+			on_druid_get_new_page (NULL, (gpointer)druid);
 		}
 	}
-	this->page++;
-
-	if (g_queue_peek_nth (this->page_list, this->page - 1) == NULL)
+	else if (current_page == ERROR_PAGE)
 	{
-		/* Regenerate new page */
-		if (this->parser != NULL)
-			npw_page_parser_free (this->parser);
-		this->parser = npw_page_parser_new (npw_druid_add_new_page (this), this->project_file, this->page - 1);
-		npw_autogen_set_output_callback (this->gen, on_druid_parse_page, this->parser);
-		npw_autogen_write_definition_file (this->gen, this->values);
-		npw_autogen_execute (this->gen, on_druid_get_new_page, this, NULL);
+		druid->last_page = ERROR_PAGE;
 	}
-	else
+	else if (current_page == PROJECT_PAGE)
 	{
-		/* Page is already in cache */
-		on_druid_get_new_page (NULL, (gpointer)this);
+		druid->last_page = current_page;
+		druid->next_page = PROPERTY_PAGE;
 	}
-
-	return TRUE;
-}
-
-static gboolean
-on_druid_back (GnomeDruidPage* dpage, GtkWidget* widget, NPWDruid* druid)
-{
-	/* Skip if busy */
-	if (druid->busy) return TRUE;
-
-	g_return_val_if_fail (druid->page > 0, TRUE);
-
-	npw_druid_save_old_values (druid);
-
-	druid->page--;
-	if (druid->page == 0)
+	else if (current_page == FINISH_PAGE)
 	{
-		/* Go back to project selection page */
-		gnome_druid_set_page (druid->druid, druid->selection_page);
+		npw_druid_set_busy (druid, FALSE);
 	}
-	else
+	else if (current_page >= PROPERTY_PAGE)
 	{
-		NPWPage* page;
-
-		page = g_queue_peek_nth (druid->page_list, druid->page - 1);
-		/* Create property page */
-		npw_druid_fill_property_page (druid, page);
+		npw_druid_set_busy (druid, FALSE);
+		druid->last_page = current_page;
+		druid->next_page = current_page + 1;
 	}
-
-	return TRUE;
+	
 }
 
 static void
-on_druid_finish (GnomeDruidPage* page, GtkWidget* widget, NPWDruid* druid)
+on_druid_finish (GtkAssistant* assistant, NPWDruid* druid)
 {
 	NPWInstall* inst;
 
@@ -864,41 +925,88 @@
 	npw_install_set_property (inst, druid->values);
 	npw_install_set_wizard_file (inst, npw_header_get_filename (druid->header));
 	npw_install_launch (inst);
-
-	npw_druid_free (druid);
 }
 
-static void
-npw_druid_connect_all_signal (NPWDruid* this, GladeXML* xml)
+static GtkWidget*
+npw_druid_create_assistant (NPWDruid* druid)
 {
-	glade_xml_signal_connect_data (xml, DRUID_DELETE_SIGNAL, GTK_SIGNAL_FUNC (on_druid_delete), this);
-	glade_xml_signal_connect_data (xml, DRUID_CANCEL_SIGNAL, GTK_SIGNAL_FUNC (on_druid_cancel), this);
-	glade_xml_signal_connect_data (xml, DRUID_FINISH_SIGNAL, GTK_SIGNAL_FUNC (on_druid_finish), this);
-	glade_xml_signal_connect_data (xml, DRUID_NEXT_SIGNAL, GTK_SIGNAL_FUNC (on_druid_next), this);
-	glade_xml_signal_connect_data (xml, DRUID_BACK_SIGNAL, GTK_SIGNAL_FUNC (on_druid_back), this);
+	AnjutaShell *shell;
+	GtkBuilder *builder;
+	GtkAssistant *assistant;
+	GtkWidget *page;
+	
+	g_return_val_if_fail (druid->window == NULL, NULL);
+	
+	shell = ANJUTA_PLUGIN (druid->plugin)->shell;
+
+	/* Create GtkAssistant using GtkBuilder, glade doesn't seem to work*/
+	builder = gtk_builder_new ();
+	if (!gtk_builder_add_from_file (builder, GTK_BUILDER_UI_FILE, NULL))
+	{
+		anjuta_util_dialog_error (GTK_WINDOW (shell),
+								  _("Unable to build project assistant user interface reading %s."), GTK_BUILDER_UI_FILE);
+		return NULL;
+	}
+	assistant = GTK_ASSISTANT (gtk_builder_get_object (builder, NEW_PROJECT_DIALOG));
+	druid->window = GTK_WINDOW (assistant);
+	druid->project_book = GTK_NOTEBOOK (gtk_builder_get_object (builder, PROJECT_BOOK));
+	druid->error_icon = GTK_IMAGE (gtk_builder_get_object (builder, ERROR_ICON));
+	druid->error_message = GTK_LABEL (gtk_builder_get_object (builder, ERROR_MESSAGE));
+	druid->error_detail = GTK_WIDGET (gtk_builder_get_object (builder, ERROR_DETAIL));
+	gtk_window_set_transient_for (GTK_WINDOW (assistant), GTK_WINDOW (shell));
+	g_object_unref (builder);
+
+	/* Connect assistant signals */
+	gtk_assistant_set_forward_page_func (assistant, on_druid_next, druid, NULL);
+	g_signal_connect (G_OBJECT (assistant), "prepare", G_CALLBACK (on_druid_prepare), druid);
+	g_signal_connect (G_OBJECT (assistant), "apply", G_CALLBACK (on_druid_finish), druid);
+	g_signal_connect (G_OBJECT (assistant), "cancel", G_CALLBACK (on_druid_cancel), druid);
+	g_signal_connect (G_OBJECT (assistant), "close", G_CALLBACK (on_druid_close), druid);
+	g_signal_connect(G_OBJECT(assistant), "key-press-event", G_CALLBACK(on_project_wizard_key_press_event), druid);
+
+	/* Setup project selection page */
+	if (!npw_druid_fill_selection_page (druid))
+	{
+		return NULL;
+	}
+
+	/* Use progress page to stop the flow */
+	/*page = gtk_assistant_get_nth_page (assistant, PROGRESS_PAGE);
+	gtk_assistant_set_page_complete (assistant, page, FALSE);*/
+	
+	/* Remove property page, will be created later as needed */
+	page = gtk_assistant_get_nth_page (assistant, PROPERTY_PAGE);
+	gtk_container_remove (GTK_CONTAINER (assistant), page);
+	
+	/* Add dialog widget to anjuta status. */
+	anjuta_status_add_widget (anjuta_shell_get_status (shell, NULL), GTK_WIDGET (assistant));
+	
+	gtk_widget_show_all (GTK_WIDGET (assistant));
+	
+	return GTK_WIDGET(assistant);
 }
 
 /* Add default property
  *---------------------------------------------------------------------------*/
 
 static void
-npw_druid_add_default_property (NPWDruid* this)
+npw_druid_add_default_property (NPWDruid* druid)
 {
 	NPWValue* value;
 	gchar* s;
 	/* gchar* email; */
 	AnjutaPreferences* pref;
 
-	pref = anjuta_shell_get_preferences (ANJUTA_PLUGIN (this->plugin)->shell, NULL);
+	pref = anjuta_shell_get_preferences (ANJUTA_PLUGIN (druid->plugin)->shell, NULL);
 
 	/* Add default base project directory */
-	value = npw_value_heap_find_value (this->values, ANJUTA_PROJECT_DIRECTORY_PROPERTY);
+	value = npw_value_heap_find_value (druid->values, ANJUTA_PROJECT_DIRECTORY_PROPERTY);
 	s = anjuta_preferences_get (pref, "anjuta.project.directory");
 	npw_value_set_value (value, s == NULL ? "~" : s, NPW_VALID_VALUE);
 	g_free (s);
 	
 	/* Add user name */
-	value = npw_value_heap_find_value (this->values, USER_NAME_PROPERTY);
+	value = npw_value_heap_find_value (druid->values, USER_NAME_PROPERTY);
 	s = anjuta_preferences_get (pref, "anjuta.user.name");
 	if (!s || strlen(s) == 0)
 	{
@@ -911,7 +1019,7 @@
 		g_free (s);
 	}
 	/* Add Email address */
-	value = npw_value_heap_find_value (this->values, EMAIL_ADDRESS_PROPERTY);
+	value = npw_value_heap_find_value (druid->values, EMAIL_ADDRESS_PROPERTY);
 	s = anjuta_preferences_get (pref, "anjuta.user.email");
 	/* If Email address not defined in Preferences */
 	if (!s || strlen(s) == 0)
@@ -930,12 +1038,7 @@
 NPWDruid*
 npw_druid_new (NPWPlugin* plugin)
 {
-	GladeXML* xml;
-	/* GtkContainer* project_scroll; */
-	NPWDruid* this;
-
-	/* Skip if already created */
-	if (plugin->druid != NULL) return plugin->druid;
+	NPWDruid* druid;
 
 	/* Check if autogen is present */
 	if (!npw_check_autogen())
@@ -944,102 +1047,59 @@
 		return NULL;
 	}	
 
-	this = g_new0(NPWDruid, 1);
-	xml = glade_xml_new (GLADE_FILE, NEW_PROJECT_DIALOG, NULL);
-	if ((this == NULL) || (xml == NULL))
-	{
-		anjuta_util_dialog_error (NULL, _("Unable to build project assistant user interface."));
-		g_free (this);
-
-		return NULL;
-	}
-
-	/* Get reference on all useful widget */
-	this->dialog = glade_xml_get_widget (xml, NEW_PROJECT_DIALOG);
-	gtk_window_set_transient_for (GTK_WINDOW (this->dialog),
-								  GTK_WINDOW (ANJUTA_PLUGIN (plugin)->shell));
-	this->tooltips = NULL;
-	/* add GtkIconView in the program as it's not handled by libglade */
-	this->druid = GNOME_DRUID (glade_xml_get_widget (xml, DRUID_WIDGET));
-	this->selection_page = GNOME_DRUID_PAGE (glade_xml_get_widget (xml, DRUID_SELECTION_PAGE));
-	this->project_book = GTK_NOTEBOOK (glade_xml_get_widget (xml, PROJECT_SELECTION_BOOK));
-	this->property_page = GNOME_DRUID_PAGE_STANDARD (glade_xml_get_widget (xml, DRUID_PROPERTY_PAGE));
-	this->property_label = GTK_LABEL (glade_xml_get_widget (xml, DRUID_PROPERTY_LABEL));
-	this->property_table = GTK_TABLE (glade_xml_get_widget (xml, DRUID_PROPERTY_TABLE));
-	this->finish_page = GNOME_DRUID_PAGE (glade_xml_get_widget (xml, DRUID_FINISH_PAGE));
-	this->page = 0;
-	this->project_file = NULL;
-	this->busy = FALSE;
-	this->page_list = g_queue_new ();
-	this->values = npw_value_heap_new ();
-	this->gen = npw_autogen_new ();
-	this->plugin = plugin;
-
-	npw_druid_fix_edge_pages (this, xml);
-	npw_druid_connect_all_signal (this, xml);
-	g_object_unref (xml);
-
-	if (!npw_druid_fill_selection_page (this))
+	druid = g_new0(NPWDruid, 1);
+	druid->plugin = plugin;
+	druid->tooltips = NULL;
+	druid->project_file = NULL;
+	druid->busy = FALSE;
+	druid->page_list = g_queue_new ();
+	druid->values = npw_value_heap_new ();
+	druid->gen = npw_autogen_new ();
+	druid->plugin = plugin;
+	
+	if (npw_druid_create_assistant (druid) == NULL)
 	{
-		/* No project available */
-		npw_druid_free (this);
-
+		npw_druid_free (druid);
+		
 		return NULL;
 	}
-
-	/* Add dialog widget to anjuta status. */
-	anjuta_status_add_widget (anjuta_shell_get_status (ANJUTA_PLUGIN (plugin)->shell, NULL), this->dialog);
-
-	/* Needed by GnomeDruid widget */
-	gtk_widget_show_all (this->dialog);
-
-	g_signal_connect(G_OBJECT(this->dialog), "key-press-event",
-			G_CALLBACK(on_project_wizard_key_press_event), this);
 	
-	plugin->druid = this;
-	npw_druid_add_default_property (this);
-
-	return this;
-}
+	npw_druid_add_default_property (druid);
 
-static void
-npw_druid_stuff_free (NPWDruidStuff *stuff)
-{
-	g_slice_free (NPWDruidStuff, stuff);
+	return druid;
 }
 
 void
-npw_druid_free (NPWDruid* this)
+npw_druid_free (NPWDruid* druid)
 {
 	/* NPWPage* page; */
 
-	g_return_if_fail (this != NULL);
+	g_return_if_fail (druid != NULL);
 
-	if (this->tooltips)
+	if (druid->tooltips)
 	{
-		g_object_unref (this->tooltips);
-		this->tooltips = NULL;
+		g_object_unref (druid->tooltips);
+		druid->tooltips = NULL;
 	}
+	
 	/* Delete page list */
-	this->page = 0;
-	npw_druid_remove_following_page (this);
-	g_queue_free (this->page_list);
-	npw_value_heap_free (this->values);
-	npw_autogen_free (this->gen);
-	if (this->parser != NULL) npw_page_parser_free (this->parser);
-	g_list_foreach (this->stuff_list, (GFunc)npw_druid_stuff_free, NULL);
-	g_list_free (this->stuff_list);
-	npw_header_list_free (this->header_list);
-	gtk_widget_destroy (this->dialog);
-	this->plugin->druid = NULL;
-	g_free (this);
+	druid->next_page = PROPERTY_PAGE;
+	npw_druid_remove_following_page (druid);
+	g_queue_free (druid->page_list);
+	npw_value_heap_free (druid->values);
+	npw_autogen_free (druid->gen);
+	if (druid->parser != NULL) npw_page_parser_free (druid->parser);
+	npw_header_list_free (druid->header_list);
+	gtk_widget_destroy (GTK_WIDGET (druid->window));
+	druid->plugin->druid = NULL;
+	g_free (druid);
 }
 
 void
-npw_druid_show (NPWDruid* this)
+npw_druid_show (NPWDruid* druid)
 {
-	g_return_if_fail (this);
+	g_return_if_fail (druid != NULL);
 
 	/* Display dialog box */
-	if (this->dialog) gtk_window_present (GTK_WINDOW (this->dialog));
+	if (druid->window) gtk_window_present (druid->window);
 }

Modified: trunk/plugins/project-wizard/druid.h
==============================================================================
--- trunk/plugins/project-wizard/druid.h	(original)
+++ trunk/plugins/project-wizard/druid.h	Sun Jan 11 21:28:18 2009
@@ -21,7 +21,6 @@
 #ifndef __DRUID_H__
 #define __DRUID_H__
 
-#define GLADE_FILE PACKAGE_DATA_DIR"/glade/anjuta-project-wizard.glade"
 #define ICON_FILE "anjuta-project-wizard-plugin-48.png"
 
 #include <glib.h> 
@@ -30,8 +29,8 @@
 typedef struct _NPWDruid NPWDruid;
 
 NPWDruid* npw_druid_new (struct _NPWPlugin* plugin);
-void npw_druid_free (NPWDruid* this);
+void npw_druid_free (NPWDruid* druid);
 
-void npw_druid_show (NPWDruid* this);
+void npw_druid_show (NPWDruid* druid);
 
 #endif

Modified: trunk/plugins/project-wizard/header.c
==============================================================================
--- trunk/plugins/project-wizard/header.c	(original)
+++ trunk/plugins/project-wizard/header.c	Sun Jan 11 21:28:18 2009
@@ -214,8 +214,6 @@
 void
 npw_header_list_free (GList* list)
 {
-	g_return_if_fail (list != NULL);
-
 	g_list_foreach (list, (GFunc)remove_category, NULL);
 	g_list_free (list);
 }

Modified: trunk/plugins/project-wizard/property.c
==============================================================================
--- trunk/plugins/project-wizard/property.c	(original)
+++ trunk/plugins/project-wizard/property.c	Sun Jan 11 21:28:18 2009
@@ -49,6 +49,7 @@
 	gchar* name;
 	gchar* label;
 	gchar* description;
+	GtkWidget *widget;
 };
 
 struct _NPWProperty {
@@ -733,6 +734,18 @@
 }
 
 void
+npw_page_set_widget (NPWPage* page, GtkWidget *widget)
+{
+	page->widget = widget;
+}
+
+GtkWidget*
+npw_page_get_widget (const NPWPage* page)
+{
+	return page->widget;
+}
+
+void
 npw_page_foreach_property (const NPWPage* page, GFunc func, gpointer data)
 {
 	g_list_foreach (page->properties, func, data);

Modified: trunk/plugins/project-wizard/property.h
==============================================================================
--- trunk/plugins/project-wizard/property.h	(original)
+++ trunk/plugins/project-wizard/property.h	Sun Jan 11 21:28:18 2009
@@ -125,6 +125,9 @@
 void npw_page_set_description (NPWPage* page, const gchar* name);
 const gchar* npw_page_get_description (const NPWPage* page);
 
+void npw_page_set_widget (NPWPage* page, GtkWidget *widget);
+GtkWidget *npw_page_get_widget (const NPWPage *page);
+
 void npw_page_foreach_property (const NPWPage* page, GFunc func, gpointer data);
 void npw_page_add_property (NPWPage* page, NPWProperty* prop);
 



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