[anjuta] project-wizard: Add a title to each wizard page



commit 75e4565c5b2518971a1a2f6b8e3061eb0778c097
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Thu Dec 8 19:37:56 2011 +0100

    project-wizard: Add a title to each wizard page

 plugins/project-wizard/anjuta-project-wizard.ui |  283 ++++++++++++++++-------
 plugins/project-wizard/druid.c                  |   19 ++-
 2 files changed, 210 insertions(+), 92 deletions(-)
---
diff --git a/plugins/project-wizard/anjuta-project-wizard.ui b/plugins/project-wizard/anjuta-project-wizard.ui
index 37ed386..419cf94 100644
--- a/plugins/project-wizard/anjuta-project-wizard.ui
+++ b/plugins/project-wizard/anjuta-project-wizard.ui
@@ -7,79 +7,107 @@
     <property name="skip_taskbar_hint">True</property>
     <property name="skip_pager_hint">True</property>
     <child>
-      <object class="GtkNotebook" id="project_book">
+      <object class="GtkVBox" id="project_page">
         <property name="visible">True</property>
-        <property name="can_focus">True</property>
-        <property name="border_width">6</property>
         <child>
-          <object class="GtkScrolledWindow" id="scrolledwindow1">
+          <object class="GtkLabel" id="label3">
+            <property name="visible">True</property>
+            <property name="xalign">0</property>
+            <property name="yalign">0</property>
+            <property name="label" translatable="yes">Select a project type</property>
+            <property name="use_markup">True</property>
+            <property name="wrap">True</property>
+            <attributes>
+              <attribute name="font-desc" value="Bold 14"/>
+            </attributes>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkNotebook" id="project_book">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="hscrollbar_policy">automatic</property>
-            <property name="vscrollbar_policy">automatic</property>
-            <property name="shadow_type">in</property>
+            <property name="border_width">6</property>
             <child>
-              <object class="GtkIconView" id="project_list">
-                <property name="width_request">468</property>
-                <property name="height_request">198</property>
+              <object class="GtkScrolledWindow" id="scrolledwindow1">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="has_tooltip">True</property>
-                <property name="selection_mode">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"/>
+                <property name="hscrollbar_policy">automatic</property>
+                <property name="vscrollbar_policy">automatic</property>
+                <property name="shadow_type">in</property>
+                <child>
+                  <object 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="selection_mode">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"/>
+                  </object>
+                </child>
               </object>
             </child>
-          </object>
-        </child>
-        <child type="tab">
-          <object class="GtkLabel" id="project_book_label">
-            <property name="visible">True</property>
-            <property name="xpad">5</property>
+            <child type="tab">
+              <object class="GtkLabel" id="project_book_label">
+                <property name="visible">True</property>
+                <property name="xpad">5</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
           </object>
           <packing>
-            <property name="tab_fill">False</property>
+            <property name="expand">True</property>
+            <property name="padding">6</property>
+            <property name="position">1</property>
           </packing>
         </child>
       </object>
       <packing>
         <property name="page_type">intro</property>
-        <property name="title">Select project type</property>
+        <property name="title">Select project</property>
         <property name="header_image">applogo.png</property>
       </packing>
     </child>
     <child>
-      <object class="GtkHBox" id="error_page">
+      <object class="GtkVBox" id="error_page">
         <property name="visible">True</property>
-        <property name="spacing">6</property>
         <child>
-          <object class="GtkImage" id="error_icon">
+          <object class="GtkLabel" id="error_title">
             <property name="visible">True</property>
+            <property name="xalign">0</property>
             <property name="yalign">0</property>
-            <property name="ypad">6</property>
-            <property name="stock">gtk-dialog-error</property>
-            <property name="icon-size">6</property>
+            <property name="label" translatable="yes">Select a project type</property>
+            <property name="use_markup">True</property>
+            <property name="wrap">True</property>
+            <attributes>
+              <attribute name="font-desc" value="Bold 14"/>
+            </attributes>
           </object>
           <packing>
             <property name="expand">False</property>
-            <property name="padding">6</property>
             <property name="position">0</property>
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="error_vbox">
+          <object class="GtkHBox" id="hbox1">
             <property name="visible">True</property>
             <property name="spacing">6</property>
             <child>
-              <object class="GtkLabel" id="error_message">
+              <object class="GtkImage" id="error_icon">
                 <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>
+                <property name="ypad">6</property>
+                <property name="stock">gtk-dialog-error</property>
+                <property name="icon-size">6</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -88,25 +116,48 @@
               </packing>
             </child>
             <child>
-              <object class="GtkExpander" id="error_detail">
+              <object class="GtkVBox" id="error_vbox">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
                 <child>
-                  <object class="GtkLabel" id="label2">
+                  <object class="GtkLabel" id="error_message">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
-                    <property name="xpad">24</property>
+                    <property name="yalign">0</property>
+                    <property name="label" translatable="yes">Error</property>
+                    <property name="use_markup">True</property>
                     <property name="wrap">True</property>
                   </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="padding">6</property>
+                    <property name="position">0</property>
+                  </packing>
                 </child>
-                <child type="label">
-                  <object class="GtkLabel" id="label1">
+                <child>
+                  <object class="GtkExpander" id="error_detail">
                     <property name="visible">True</property>
-                    <property name="label" translatable="yes">Details</property>
-                    <attributes>
-                      <attribute name="weight" value="bold"/>
-                    </attributes>
+                    <property name="can_focus">True</property>
+                    <child>
+                      <object class="GtkLabel" id="label2">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="xpad">24</property>
+                        <property name="wrap">True</property>
+                      </object>
+                    </child>
+                    <child type="label">
+                      <object class="GtkLabel" id="label1">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">Details</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                    </child>
                   </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
                 </child>
               </object>
               <packing>
@@ -115,6 +166,7 @@
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
             <property name="position">1</property>
           </packing>
         </child>
@@ -136,9 +188,35 @@
       </packing>
     </child>
     <child>
-      <object class="GtkLabel" id="finish_page">
+      <object class="GtkVBox" id="finish_page">
         <property name="visible">True</property>
-        <property name="use_markup">True</property>
+        <child>
+          <object class="GtkLabel" id="label4">
+            <property name="visible">True</property>
+            <property name="xalign">0</property>
+            <property name="yalign">0</property>
+            <property name="label" translatable="yes">Summary</property>
+            <property name="use_markup">True</property>
+            <property name="wrap">True</property>
+            <attributes>
+              <attribute name="font-desc" value="Bold 14"/>
+            </attributes>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="finish_text">
+            <property name="visible">True</property>
+            <property name="use_markup">True</property>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
       </object>
       <packing>
         <property name="page_type">confirm</property>
@@ -148,53 +226,80 @@
       </packing>
     </child>
     <child>
-      <object class="GtkScrolledWindow" id="property_page">
-        <property name="can_focus">True</property>
-        <property name="hscrollbar_policy">never</property>
-        <property name="vscrollbar_policy">automatic</property>
+      <object class="GtkVBox" id="property_page">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkLabel" id="property_title">
+            <property name="visible">True</property>
+            <property name="xalign">0</property>
+            <property name="yalign">0</property>
+            <property name="use_markup">True</property>
+            <property name="wrap">True</property>
+            <attributes>
+              <attribute name="font-desc" value="Bold 14"/>
+            </attributes>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="padding">6</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
         <child>
-          <object class="GtkViewport" id="viewport1">
-            <property name="shadow_type">none</property>
+          <object class="GtkScrolledWindow" id="scrolledwindow2">
+            <property name="can_focus">True</property>
+            <property name="hscrollbar_policy">never</property>
+            <property name="vscrollbar_policy">automatic</property>
             <child>
-              <object 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>
+              <object class="GtkViewport" id="viewport1">
+                <property name="shadow_type">none</property>
                 <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
+                  <object 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>
+                  </object>
                 </child>
               </object>
             </child>
           </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="padding">6</property>
+            <property name="position">1</property>
+          </packing>
         </child>
       </object>
       <packing>
diff --git a/plugins/project-wizard/druid.c b/plugins/project-wizard/druid.c
index 258ab29..089eb94 100644
--- a/plugins/project-wizard/druid.c
+++ b/plugins/project-wizard/druid.c
@@ -65,11 +65,14 @@
 #define NEW_PROJECT_DIALOG "druid_window"
 #define PROJECT_LIST "project_list"
 #define PROJECT_BOOK "project_book"
-#define PROJECT_PAGE "project_book"
+#define PROJECT_PAGE "project_page"
 #define ERROR_PAGE "error_page"
+#define ERROR_TITLE "error_title"
 #define PROGRESS_PAGE "progress_page"
 #define FINISH_PAGE "finish_page"
+#define FINISH_TEXT "finish_text"
 #define PROPERTY_PAGE "property_page"
+#define PROPERTY_TITLE "property_title"
 #define PROPERTY_TABLE "property_table"
 #define ERROR_VBOX "error_vbox"
 #define ERROR_ICON "error_icon"
@@ -79,7 +82,6 @@
 
 #define PROJECT_PAGE_INDEX 0
 
-
 /*---------------------------------------------------------------------------*/
 
 struct _NPWDruid
@@ -88,6 +90,7 @@ struct _NPWDruid
 
 	GtkNotebook* project_book;
 	GtkWidget *error_page;
+	GtkWidget *error_title;
 	GtkVBox *error_vbox;
 	GtkWidget *error_extra_widget;
 	GtkImage *error_icon;
@@ -97,6 +100,7 @@ struct _NPWDruid
 	GtkWidget *project_page;
 	GtkWidget *progress_page;
 	GtkWidget *finish_page;
+	GtkWidget *finish_text;
 
 	const gchar* project_file;
 	NPWPlugin* plugin;
@@ -168,6 +172,7 @@ npw_druid_fill_error_page (NPWDruid* druid, GtkWidget *extra_widget, GtkMessageT
 		g_warning ("Unknown GtkMessageType %u", type);
 		break;
 	}
+	gtk_label_set_text (GTK_LABEL (druid->error_title), title);
 	gtk_assistant_set_page_title (assistant, page, title);
 	if (type == GTK_MESSAGE_ERROR)
 	{
@@ -253,7 +258,7 @@ npw_druid_fill_summary_page (NPWDruid* druid)
 		npw_page_foreach_property (page, (GFunc)cb_druid_add_summary_property, text);
 	}
 
-	label = GTK_LABEL (druid->finish_page);
+	label = GTK_LABEL (druid->finish_text);
 	gtk_label_set_markup (label, text->str);
 	g_string_free (text, TRUE);
 
@@ -497,6 +502,8 @@ static void
 npw_druid_fill_property_page (NPWDruid* druid, NPWPage* page)
 {
 	GtkWidget *widget;
+	GList *children;
+	GtkLabel *label;
 	NPWDruidAddPropertyData data;
 
 	/* Add page to assistant, after current page */
@@ -506,6 +513,10 @@ npw_druid_fill_property_page (NPWDruid* druid, NPWPage* page)
 	gtk_container_foreach (GTK_CONTAINER (npw_page_get_widget (page)), cb_druid_destroy_widget, NULL);
 
 	/* Update title	*/
+	children = gtk_container_get_children (GTK_CONTAINER (widget));
+	label = GTK_LABEL (g_list_nth_data (children, 0));
+	g_list_free (children);
+	gtk_label_set_text (label, npw_page_get_label (page));
 	gtk_assistant_set_page_title (GTK_ASSISTANT (druid->window), widget, npw_page_get_label (page));
 
 	/* Add new widget */
@@ -1125,6 +1136,7 @@ npw_druid_create_assistant (NPWDruid* druid, const gchar *directory)
 	                                 NEW_PROJECT_DIALOG, &assistant,
 	                                 PROJECT_BOOK, &druid->project_book,
 	                                 ERROR_VBOX, &druid->error_vbox,
+	                                 ERROR_TITLE, &druid->error_title,
 	                                 ERROR_ICON, &druid->error_icon,
 	                                 ERROR_MESSAGE, &druid->error_message,
 	                                 ERROR_DETAIL, &druid->error_detail,
@@ -1132,6 +1144,7 @@ npw_druid_create_assistant (NPWDruid* druid, const gchar *directory)
 	                                 ERROR_PAGE, &druid->error_page,
 	                                 PROGRESS_PAGE, &druid->progress_page,
 	                                 FINISH_PAGE, &druid->finish_page,
+	                                 FINISH_TEXT, &druid->finish_text,
 	                                 PROPERTY_PAGE, &property_page,
 	                                 NULL);
 	druid->window = GTK_WINDOW (assistant);



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