[evolution/gtk-builder] Deal with custom widgets in mail-dialogs.ui.



commit be36d0b27c082348a8c815ab9128ae3af48fe275
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Nov 1 16:54:45 2009 -0600

    Deal with custom widgets in mail-dialogs.ui.

 mail/em-vfolder-rule.c      |   51 +---
 mail/mail-dialogs.ui        |  698 +++++++++++++++++++------------------------
 mail/message-tag-followup.c |   58 ++---
 widgets/misc/e-dateedit.c   |   45 +++-
 4 files changed, 369 insertions(+), 483 deletions(-)
---
diff --git a/mail/em-vfolder-rule.c b/mail/em-vfolder-rule.c
index b1a3f76..4b44ffc 100644
--- a/mail/em-vfolder-rule.c
+++ b/mail/em-vfolder-rule.c
@@ -570,57 +570,17 @@ source_remove(GtkWidget *widget, struct _source_data *data)
 	set_sensitive(data);
 }
 
-GtkWidget *em_vfolder_editor_sourcelist_new(gchar *widget_name, gchar *string1, gchar *string2,
-					  gint int1, gint int2);
-
-GtkWidget *
-em_vfolder_editor_sourcelist_new(gchar *widget_name, gchar *string1, gchar *string2, gint int1, gint int2)
-{
-	GtkWidget *table, *scrolled;
-	GtkTreeSelection *selection;
-	GtkCellRenderer *renderer;
-	GtkListStore *model;
-
-	scrolled = gtk_scrolled_window_new(NULL, NULL);
-	gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN);
-	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
-					GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
-	model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
-	table = gtk_tree_view_new_with_model((GtkTreeModel *)model);
-	gtk_tree_view_set_headers_visible((GtkTreeView *)table, FALSE);
-
-	renderer = gtk_cell_renderer_text_new();
-	gtk_tree_view_insert_column_with_attributes((GtkTreeView *)table, -1,
-						     _("Search Folder source"), renderer,
-						     "text", 0, NULL);
-
-	selection = gtk_tree_view_get_selection((GtkTreeView *)table);
-	gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
-
-	gtk_container_add(GTK_CONTAINER(scrolled), table);
-
-	g_object_set_data((GObject *)scrolled, "table", table);
-	g_object_set_data((GObject *)scrolled, "model", model);
-
-	gtk_widget_show(scrolled);
-	gtk_widget_show(table);
-
-	g_object_unref (model);
-
-	return scrolled;
-}
-
 static GtkWidget *
 get_widget(EFilterRule *fr, ERuleContext *rc)
 {
 	EMVFolderRule *vr =(EMVFolderRule *)fr;
-	GtkWidget *widget, *frame, *list;
+	GtkWidget *widget, *frame;
 	struct _source_data *data;
 	GtkRadioButton *rb;
 	const gchar *source;
 	GtkTreeIter iter;
 	GtkBuilder *builder;
+	GObject *object;
 	gint i;
 
         widget = E_FILTER_RULE_CLASS(parent_class)->get_widget(fr, rc);
@@ -641,9 +601,10 @@ get_widget(EFilterRule *fr, ERuleContext *rc)
 		g_signal_connect(data->buttons[i], "clicked", edit_buttons[i].func, data);
 	}
 
-	list = e_builder_get_widget(builder, "source_list");
-	data->list =(GtkTreeView *)g_object_get_data((GObject *)list, "table");
-	data->model =(GtkListStore *)g_object_get_data((GObject *)list, "model");
+	object = gtk_builder_get_object (builder, "source_list");
+	data->list = GTK_TREE_VIEW (object);
+	object = gtk_builder_get_object (builder, "source_model");
+	data->model = GTK_LIST_STORE (object);
 
 	source = NULL;
 	while ((source = em_vfolder_rule_next_source(vr, source))) {
diff --git a/mail/mail-dialogs.ui b/mail/mail-dialogs.ui
index 142eb7f..fd8674f 100644
--- a/mail/mail-dialogs.ui
+++ b/mail/mail-dialogs.ui
@@ -1,7 +1,10 @@
 <?xml version="1.0"?>
 <interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkListStore" id="model1">
     <columns>
+      <!-- column-name gchararray -->
       <column type="gchararray"/>
     </columns>
     <data>
@@ -13,10 +16,8 @@
       </row>
     </data>
   </object>
-  <!-- interface-requires gtk+ 2.16 -->
-  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkDialog" id="message_security_dialog">
-    <property name="visible">True</property>
+    <property name="visible">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes">Security Information</property>
     <property name="type_hint">dialog</property>
@@ -24,15 +25,18 @@
     <child internal-child="vbox">
       <object class="GtkVBox" id="dialog-vbox2">
         <property name="visible">True</property>
+        <property name="orientation">vertical</property>
         <property name="spacing">6</property>
         <child>
           <object class="GtkVBox" id="vbox161">
             <property name="visible">True</property>
             <property name="border_width">12</property>
+            <property name="orientation">vertical</property>
             <property name="spacing">18</property>
             <child>
               <object class="GtkVBox" id="frame5">
                 <property name="visible">True</property>
+                <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkLabel" id="label464">
@@ -69,6 +73,7 @@
                         <child>
                           <object class="GtkVBox" id="signature_vbox">
                             <property name="visible">True</property>
+                            <property name="orientation">vertical</property>
                             <child>
                               <placeholder/>
                             </child>
@@ -94,6 +99,7 @@
             <child>
               <object class="GtkVBox" id="frame6">
                 <property name="visible">True</property>
+                <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkLabel" id="label477">
@@ -130,6 +136,7 @@
                         <child>
                           <object class="GtkVBox" id="encryption_vbox">
                             <property name="visible">True</property>
+                            <property name="orientation">vertical</property>
                             <child>
                               <placeholder/>
                             </child>
@@ -198,10 +205,12 @@
     <child internal-child="vbox">
       <object class="GtkVBox" id="dialog-vbox1">
         <property name="visible">True</property>
+        <property name="orientation">vertical</property>
         <child>
           <object class="GtkVBox" id="vbox2">
             <property name="visible">True</property>
             <property name="border_width">12</property>
+            <property name="orientation">vertical</property>
             <property name="spacing">12</property>
             <child>
               <object class="GtkHBox" id="hbox1">
@@ -309,19 +318,22 @@
       </object>
     </child>
     <action-widgets>
+      <action-widget response="0">refresh_button</action-widget>
       <action-widget response="-7">close_button</action-widget>
     </action-widgets>
   </object>
   <object class="GtkDialog" id="license_dialog">
-    <property name="visible">True</property>
+    <property name="visible">False</property>
     <property name="title" translatable="yes">License Agreement</property>
     <property name="type_hint">dialog</property>
     <child internal-child="vbox">
       <object class="GtkVBox" id="dialog_vbox">
         <property name="visible">True</property>
+        <property name="orientation">vertical</property>
         <child>
           <object class="GtkVBox" id="vbox1">
             <property name="visible">True</property>
+            <property name="orientation">vertical</property>
             <child>
               <object class="GtkLabel" id="license_top_label">
                 <property name="visible">True</property>
@@ -407,7 +419,6 @@
                           <object class="GtkImage" id="image1">
                             <property name="visible">True</property>
                             <property name="stock">gtk-yes</property>
-                            <property name="icon-size">4</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -452,397 +463,350 @@
       <action-widget response="-3">lic_yes_button</action-widget>
     </action-widgets>
   </object>
-  <object class="GtkDialog" id="followup_editor">
+  <object class="GtkListStore" id="source_model">
+    <columns>
+      <!-- column-name Translated Source Name -->
+      <column type="gchararray"/>
+      <!-- column-name Raw Source Name -->
+      <column type="gpointer"/>
+    </columns>
+  </object>
+  <object class="GtkVBox" id="toplevel">
+    <property name="visible">True</property>
     <property name="border_width">6</property>
-    <property name="title" translatable="yes">Flag to Follow Up</property>
-    <property name="type_hint">dialog</property>
-    <property name="has_separator">False</property>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="vbox3">
+    <property name="orientation">vertical</property>
+    <property name="spacing">12</property>
+    <child>
+      <object class="GtkHBox" id="hbox2">
         <property name="visible">True</property>
-        <property name="spacing">12</property>
+        <property name="spacing">6</property>
         <child>
-          <object class="GtkVBox" id="toplevel">
+          <object class="GtkImage" id="pixmap">
             <property name="visible">True</property>
-            <property name="border_width">6</property>
-            <property name="spacing">12</property>
-            <child>
-              <object class="GtkHBox" id="hbox2">
-                <property name="visible">True</property>
-                <property name="spacing">6</property>
-                <child>
-                  <object class="GtkImage" id="pixmap">
-                    <property name="visible">True</property>
-                    <property name="icon_name">stock_mail-flag-for-followup</property>
-                    <property name="icon-size">6</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="lblDirections">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">The messages you have selected for follow up are listed below.
-Please select a follow up action from the "Flag" menu.</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
+            <property name="icon_name">stock_mail-flag-for-followup</property>
+            <property name="icon-size">6</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="lblDirections">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">The messages you have selected for follow up are listed below.
+elect a follow up action from the "Flag" menu.</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">False</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkScrolledWindow" id="scrolledwindow1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="hscrollbar_policy">automatic</property>
+        <property name="vscrollbar_policy">automatic</property>
+        <property name="shadow_type">in</property>
+        <child>
+          <object class="GtkTreeView" id="message_list">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="position">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkTable" id="table2">
+        <property name="visible">True</property>
+        <property name="n_rows">3</property>
+        <property name="n_columns">3</property>
+        <property name="column_spacing">6</property>
+        <property name="row_spacing">6</property>
+        <child>
+          <object class="GtkLabel" id="label3">
+            <property name="visible">True</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">_Flag:</property>
+            <property name="use_underline">True</property>
+            <property name="justify">center</property>
+          </object>
+          <packing>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"></property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label4">
+            <property name="visible">True</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">_Due By:</property>
+            <property name="use_underline">True</property>
+            <property name="justify">center</property>
+          </object>
+          <packing>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"></property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="clear">
+            <property name="label">gtk-clear</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="use_stock">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="right_attach">3</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"></property>
+          </packing>
+        </child>
+        <child>
+          <object class="EDateEdit" id="target_date">
+            <property name="allow-no-date-set">True</property>
+            <property name="visible">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">3</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="y_options">GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="completed">
+            <property name="label" translatable="yes">Co_mpleted</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="use_underline">True</property>
+            <property name="draw_indicator">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">3</property>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"></property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkComboBoxEntry" id="combo">
+            <property name="visible">True</property>
+            <property name="model">model1</property>
             <child>
-              <object class="GtkScrolledWindow" id="scrolledwindow1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="hscrollbar_policy">automatic</property>
-                <property name="vscrollbar_policy">automatic</property>
-                <property name="shadow_type">in</property>
-                <child>
-                  <object class="GtkTreeView" id="message_list">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
+              <object class="GtkCellRendererText" id="renderer1"/>
+              <attributes>
+                <attribute name="text">0</attribute>
+              </attributes>
             </child>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"></property>
+          </packing>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">False</property>
+        <property name="position">2</property>
+      </packing>
+    </child>
+  </object>
+  <object class="GtkVBox" id="vfolder_source_frame">
+    <property name="visible">True</property>
+    <property name="orientation">vertical</property>
+    <property name="spacing">6</property>
+    <child>
+      <object class="GtkLabel" id="label13">
+        <property name="visible">True</property>
+        <property name="xalign">0</property>
+        <property name="label" translatable="yes">&lt;b&gt;Search Folder Sources&lt;/b&gt;</property>
+        <property name="use_markup">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">False</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkHBox" id="hbox9">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkLabel" id="label14">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">    </property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkVBox" id="vbox5">
+            <property name="visible">True</property>
+            <property name="border_width">6</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">6</property>
             <child>
-              <object class="GtkTable" id="table2">
+              <object class="GtkRadioButton" id="local_rb">
+                <property name="label" translatable="yes">All local folders</property>
                 <property name="visible">True</property>
-                <property name="n_rows">3</property>
-                <property name="n_columns">3</property>
-                <property name="column_spacing">6</property>
-                <property name="row_spacing">6</property>
-                <child>
-                  <object class="GtkLabel" id="label3">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">_Flag:</property>
-                    <property name="use_underline">True</property>
-                    <property name="justify">center</property>
-                  </object>
-                  <packing>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label4">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">_Due By:</property>
-                    <property name="use_underline">True</property>
-                    <property name="justify">center</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkButton" id="clear">
-                    <property name="label">gtk-clear</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_stock">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">2</property>
-                    <property name="right_attach">3</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="Custom" id="target_date">
-                    <property name="visible">True</property>
-                    <property name="creation_function">target_date_new</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">3</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="completed">
-                    <property name="label" translatable="yes">Co_mpleted</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">3</property>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkComboBoxEntry" id="combo">
-                    <property name="visible">True</property>
-                    <property name="model">model1</property>
-                    <child>
-                      <object class="GtkCellRendererText" id="renderer1"/>
-                      <attributes>
-                        <attribute name="text">0</attribute>
-                      </attributes>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="draw_indicator">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
-                <property name="position">2</property>
+                <property name="position">0</property>
               </packing>
             </child>
-          </object>
-          <packing>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="hbuttonbox1">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="button4">
-                <property name="label">gtk-ok</property>
+              <object class="GtkRadioButton" id="remote_rb">
+                <property name="label" translatable="yes">All active remote folders</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="can_default">True</property>
                 <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
+                <property name="use_underline">True</property>
+                <property name="draw_indicator">True</property>
+                <property name="group">local_rb</property>
               </object>
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
-                <property name="position">0</property>
+                <property name="position">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="button5">
-                <property name="label">gtk-cancel</property>
+              <object class="GtkRadioButton" id="local_and_remote_rb">
+                <property name="label" translatable="yes">All local and active remote folders</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="can_default">True</property>
                 <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
+                <property name="use_underline">True</property>
+                <property name="draw_indicator">True</property>
+                <property name="group">local_rb</property>
               </object>
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
-                <property name="position">1</property>
+                <property name="position">2</property>
               </packing>
             </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-  </object>
-  <object class="GtkDialog" id="vfolder-source">
-    <property name="visible">True</property>
-    <property name="border_width">6</property>
-    <property name="type_hint">dialog</property>
-    <property name="has_separator">False</property>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox3">
-        <property name="visible">True</property>
-        <property name="spacing">6</property>
-        <child>
-          <object class="GtkVBox" id="vfolder_source_frame">
-            <property name="visible">True</property>
-            <property name="spacing">6</property>
             <child>
-              <object class="GtkLabel" id="label13">
+              <object class="GtkRadioButton" id="specific_rb">
+                <property name="label" translatable="yes">Specific folders</property>
                 <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">&lt;b&gt;Search Folder Sources&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="draw_indicator">True</property>
+                <property name="group">local_rb</property>
               </object>
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
-                <property name="position">0</property>
+                <property name="position">3</property>
               </packing>
             </child>
             <child>
-              <object class="GtkHBox" id="hbox9">
+              <object class="GtkHBox" id="source_selector">
                 <property name="visible">True</property>
+                <property name="spacing">6</property>
                 <child>
-                  <object class="GtkLabel" id="label14">
+                  <object class="GtkScrolledWindow" id="source_scrolled_window">
                     <property name="visible">True</property>
-                    <property name="label" translatable="yes">    </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>
+                    <child>
+                      <object class="GtkTreeView" id="source_list">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="model">source_model</property>
+                        <property name="headers_visible">False</property>
+                        <child>
+                          <object class="GtkTreeViewColumn" id="source_column">
+                            <property name="title">column</property>
+                            <child>
+                              <object class="GtkCellRendererText" id="source_renderer"/>
+                              <attributes>
+                                <attribute name="text">0</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
                   </object>
                   <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkVBox" id="vbox5">
+                  <object class="GtkVBox" id="vbox4">
                     <property name="visible">True</property>
-                    <property name="border_width">6</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkRadioButton" id="local_rb">
-                        <property name="label" translatable="yes">All local folders</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkRadioButton" id="remote_rb">
-                        <property name="label" translatable="yes">All active remote folders</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">local_rb</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkRadioButton" id="local_and_remote_rb">
-                        <property name="label" translatable="yes">All local and active remote folders</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">local_rb</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkRadioButton" id="specific_rb">
-                        <property name="label" translatable="yes">Specific folders</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">local_rb</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">3</property>
-                      </packing>
-                    </child>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">1</property>
                     <child>
-                      <object class="GtkHBox" id="source_selector">
+                      <object class="GtkVButtonBox" id="vbuttonbox3">
                         <property name="visible">True</property>
+                        <property name="orientation">vertical</property>
                         <property name="spacing">6</property>
                         <child>
-                          <object class="Custom" id="source_list">
+                          <object class="GtkButton" id="source_add">
+                            <property name="label">gtk-add</property>
                             <property name="visible">True</property>
-                            <property name="creation_function">em_vfolder_editor_sourcelist_new</property>
+                            <property name="can_focus">True</property>
+                            <property name="can_default">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_stock">True</property>
                           </object>
                           <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
                             <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkVBox" id="vbox4">
+                          <object class="GtkButton" id="source_remove">
+                            <property name="label">gtk-remove</property>
                             <property name="visible">True</property>
-                            <property name="spacing">1</property>
-                            <child>
-                              <object class="GtkVButtonBox" id="vbuttonbox3">
-                                <property name="visible">True</property>
-                                <property name="spacing">6</property>
-                                <child>
-                                  <object class="GtkButton" id="source_add">
-                                    <property name="label">gtk-add</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="can_default">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="use_stock">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">False</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkButton" id="source_remove">
-                                    <property name="label">gtk-remove</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="can_default">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="use_stock">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">False</property>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
+                            <property name="can_focus">True</property>
+                            <property name="can_default">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_stock">True</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -852,86 +816,32 @@ Please select a follow up action from the "Flag" menu.</property>
                         </child>
                       </object>
                       <packing>
-                        <property name="position">4</property>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
                       </packing>
                     </child>
                   </object>
                   <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
               </object>
               <packing>
-                <property name="position">1</property>
+                <property name="position">4</property>
               </packing>
             </child>
           </object>
           <packing>
-            <property name="padding">3</property>
             <property name="position">1</property>
           </packing>
         </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area3">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="cancel_button">
-                <property name="label">gtk-cancel</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="apply_button">
-                <property name="label">gtk-apply</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="ok_button">
-                <property name="label">gtk-ok</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
       </object>
+      <packing>
+        <property name="position">1</property>
+      </packing>
     </child>
-    <action-widgets>
-      <action-widget response="-6">cancel_button</action-widget>
-      <action-widget response="-5">ok_button</action-widget>
-    </action-widgets>
   </object>
 </interface>
diff --git a/mail/message-tag-followup.c b/mail/message-tag-followup.c
index 39283a2..dcd6a05 100644
--- a/mail/message-tag-followup.c
+++ b/mail/message-tag-followup.c
@@ -224,36 +224,6 @@ locale_supports_12_hour_format (void)
 	return s[0] != '\0';
 }
 
-GtkWidget *target_date_new (const gchar *s1, const gchar *s2, gint i1, gint i2);
-
-GtkWidget *
-target_date_new (const gchar *s1, const gchar *s2, gint i1, gint i2)
-{
-	gboolean time_24hour = TRUE;
-	GConfClient *gconf;
-	GtkWidget *widget;
-	gint start;
-
-	widget = e_date_edit_new ();
-	e_date_edit_set_show_date (E_DATE_EDIT (widget), TRUE);
-	e_date_edit_set_show_time (E_DATE_EDIT (widget), TRUE);
-
-	/* Note that this is 0 (Sun) to 6 (Sat), conver to 0 (mon) to 6 (sun) */
-	start = (get_week_start_day () + 6) % 7;
-
-	if (locale_supports_12_hour_format ()) {
-		gconf = mail_config_get_gconf_client ();
-		time_24hour = gconf_client_get_bool (gconf, "/apps/evolution/calendar/display/use_24hour_format", NULL);
-	}
-
-	e_date_edit_set_week_start_day (E_DATE_EDIT (widget), start);
-	e_date_edit_set_use_24_hour_format (E_DATE_EDIT (widget), time_24hour);
-	e_date_edit_set_allow_no_date_set (E_DATE_EDIT (widget), TRUE);
-	e_date_edit_set_time_popup_range (E_DATE_EDIT (widget), 0, 24);
-
-	return widget;
-}
-
 static void
 construct (MessageTagEditor *editor)
 {
@@ -262,6 +232,8 @@ construct (MessageTagEditor *editor)
 	GtkListStore *model;
 	GtkWidget *widget;
 	GtkBuilder *builder;
+	gboolean time_24hour;
+	gint start;
 	gint i;
 
 	gtk_window_set_title (GTK_WINDOW (editor), _("Flag to Follow Up"));
@@ -277,10 +249,9 @@ construct (MessageTagEditor *editor)
 	e_load_ui_builder_definition (builder, "mail-dialogs.ui");
 
 	widget = e_builder_get_widget (builder, "toplevel");
-
-	/* reparent */
-	gtk_widget_reparent (widget, GTK_DIALOG (editor)->vbox);
-	gtk_box_set_child_packing (GTK_BOX (GTK_DIALOG (editor)->vbox), widget, TRUE, TRUE, 6, GTK_PACK_START);
+	gtk_box_pack_start (
+		GTK_BOX (GTK_DIALOG (editor)->vbox),
+		widget, TRUE, TRUE, 6);
 
 	widget = e_builder_get_widget (builder, "pixmap");
 	gtk_image_set_from_icon_name (
@@ -306,8 +277,23 @@ construct (MessageTagEditor *editor)
 	gtk_combo_box_set_active (followup->combo_entry, DEFAULT_FLAG);
 
 	followup->target_date = E_DATE_EDIT (e_builder_get_widget (builder, "target_date"));
-	/* glade bug, need to show this ourselves */
-	gtk_widget_show ((GtkWidget *) followup->target_date);
+
+	/* Note that this is 0 (Sun) to 6 (Sat),
+	 * convert to 0 (Mon) to 6 (Sun). */
+	start = (get_week_start_day () + 6) % 7;
+
+	if (locale_supports_12_hour_format ()) {
+		GConfClient *client;
+		const gchar *key;
+
+		client = gconf_client_get_default ();
+		key = "/apps/evolution/calendar/display/use_24hour_format";
+		time_24hour = gconf_client_get_bool (client, key, NULL);
+		g_object_unref (client);
+	}
+
+	e_date_edit_set_week_start_day (followup->target_date, start);
+	e_date_edit_set_use_24_hour_format (followup->target_date, time_24hour);
 	e_date_edit_set_time (followup->target_date, (time_t) -1);
 
 	followup->completed = GTK_TOGGLE_BUTTON (e_builder_get_widget (builder, "completed"));
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index a1cdb2d..d712e98 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -40,6 +40,7 @@
 #include <libedataserver/e-time-utils.h>
 #include <libedataserver/e-data-server-util.h>
 #include <e-util/e-util.h>
+#include <e-util/e-binding.h>
 #include "e-calendar.h"
 
 #define E_DATE_EDIT_GET_PRIVATE(obj) \
@@ -112,10 +113,13 @@ struct _EDateEditPrivate {
 
 	/* set to TRUE when the date has been changed by typing to the entry */
 	gboolean has_been_changed;
+
+	gboolean allow_no_date_set;
 };
 
 enum {
 	PROP_0,
+	PROP_ALLOW_NO_DATE_SET,
 	PROP_SHOW_DATE,
 	PROP_SHOW_TIME,
 	PROP_SHOW_WEEK_NUMBERS,
@@ -209,6 +213,12 @@ date_edit_set_property (GObject *object,
                         GParamSpec *pspec)
 {
 	switch (property_id) {
+		case PROP_ALLOW_NO_DATE_SET:
+			e_date_edit_set_allow_no_date_set (
+				E_DATE_EDIT (object),
+				g_value_get_boolean (value));
+			return;
+
 		case PROP_SHOW_DATE:
 			e_date_edit_set_show_date (
 				E_DATE_EDIT (object),
@@ -250,6 +260,12 @@ date_edit_get_property (GObject *object,
                         GParamSpec *pspec)
 {
 	switch (property_id) {
+		case PROP_ALLOW_NO_DATE_SET:
+			g_value_set_boolean (
+				value, e_date_edit_get_allow_no_date_set (
+				E_DATE_EDIT (object)));
+			return;
+
 		case PROP_SHOW_DATE:
 			g_value_set_boolean (
 				value, e_date_edit_get_show_date (
@@ -322,6 +338,16 @@ date_edit_class_init (EDateEditClass *class)
 
 	g_object_class_install_property (
 		object_class,
+		PROP_ALLOW_NO_DATE_SET,
+		g_param_spec_boolean (
+			"allow-no-date-set",
+			"Allow No Date Set",
+			NULL,
+			FALSE,
+			G_PARAM_READWRITE));
+
+	g_object_class_install_property (
+		object_class,
 		PROP_SHOW_DATE,
 		g_param_spec_boolean (
 			"show-date",
@@ -633,6 +659,9 @@ create_children			(EDateEdit	*dedit)
 	gtk_container_add (GTK_CONTAINER (bbox), priv->none_button);
 	g_signal_connect (priv->none_button, "clicked",
 			  G_CALLBACK (on_date_popup_none_button_clicked), dedit);
+	e_binding_new (
+		dedit, "allow-no-date-set",
+		priv->none_button, "visible");
 }
 
 /* GtkWidget::mnemonic_activate() handler for the EDateEdit */
@@ -1206,24 +1235,22 @@ e_date_edit_set_use_24_hour_format (EDateEdit *dedit,
 /* Whether we allow the date to be set to 'None'. e_date_edit_get_time() will
    return (time_t) -1 in this case. */
 gboolean
-e_date_edit_get_allow_no_date_set	(EDateEdit	*dedit)
+e_date_edit_get_allow_no_date_set (EDateEdit *dedit)
 {
 	g_return_val_if_fail (E_IS_DATE_EDIT (dedit), FALSE);
 
-	return GTK_WIDGET_VISIBLE (dedit->priv->none_button);
+	return dedit->priv->allow_no_date_set;
 }
 
 void
-e_date_edit_set_allow_no_date_set	(EDateEdit	*dedit,
-					 gboolean	 allow_no_date_set)
+e_date_edit_set_allow_no_date_set (EDateEdit *dedit,
+                                   gboolean allow_no_date_set)
 {
 	g_return_if_fail (E_IS_DATE_EDIT (dedit));
 
-	if (allow_no_date_set) {
-		gtk_widget_show (dedit->priv->none_button);
-	} else {
-		gtk_widget_hide (dedit->priv->none_button);
+	dedit->priv->allow_no_date_set = allow_no_date_set;
 
+	if (!allow_no_date_set) {
 		/* If the date is showing, we make sure it isn't 'None' (we
 		   don't really mind if the time is empty), else if just the
 		   time is showing we make sure it isn't 'None'. */
@@ -1235,6 +1262,8 @@ e_date_edit_set_allow_no_date_set	(EDateEdit	*dedit,
 				e_date_edit_set_time (dedit, 0);
 		}
 	}
+
+	g_object_notify (G_OBJECT (dedit), "allow-no-date-set");
 }
 
 /* The range of time to show in the time combo popup. */



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