[evolution/webkit] Bug #641939 - [publish-calendar] Doesn't read online state on start



commit c38f9e644b84e975d9b5108b05880e02c4a64565
Author: Milan Crha <mcrha redhat com>
Date:   Wed Mar 9 11:52:31 2011 +0100

    Bug #641939 - [publish-calendar] Doesn't read online state on start

 plugins/publish-calendar/publish-calendar.c  |    4 +++-
 plugins/publish-calendar/publish-calendar.ui |   21 +++++++++++++++++++++
 plugins/publish-calendar/url-editor-dialog.c |   11 ++++++++++-
 3 files changed, 34 insertions(+), 2 deletions(-)
---
diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c
index da93063..3ea3747 100644
--- a/plugins/publish-calendar/publish-calendar.c
+++ b/plugins/publish-calendar/publish-calendar.c
@@ -934,8 +934,10 @@ e_plugin_lib_enable (EPlugin *ep, gint enable)
 
 	if (shell) {
 		g_signal_handlers_disconnect_by_func (shell, G_CALLBACK (online_state_changed), NULL);
-		if (enable)
+		if (enable) {
+			online = e_shell_get_online (shell);
 			g_signal_connect (shell, "notify::online", G_CALLBACK (online_state_changed), NULL);
+		}
 	}
 
 	if (enable) {
diff --git a/plugins/publish-calendar/publish-calendar.ui b/plugins/publish-calendar/publish-calendar.ui
index 4320523..efd9613 100644
--- a/plugins/publish-calendar/publish-calendar.ui
+++ b/plugins/publish-calendar/publish-calendar.ui
@@ -401,6 +401,8 @@
                   </object>
                   <packing>
                     <property name="position">0</property>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
                   </packing>
                 </child>
                 <child>
@@ -436,6 +438,8 @@
                   </object>
                   <packing>
                     <property name="position">1</property>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
                   </packing>
                 </child>
                 <child>
@@ -471,16 +475,21 @@
                   </object>
                   <packing>
                     <property name="position">2</property>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
                   </packing>
                 </child>
               </object>
               <packing>
                 <property name="position">1</property>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
               </packing>
             </child>
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">False</property>
             <property name="position">1</property>
           </packing>
         </child>
@@ -543,6 +552,7 @@
                       </object>
                       <packing>
                         <property name="expand">False</property>
+                        <property name="fill">True</property>
                         <property name="pack_type">end</property>
                         <property name="position">1</property>
                       </packing>
@@ -550,6 +560,8 @@
                   </object>
                   <packing>
                     <property name="position">0</property>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
                   </packing>
                 </child>
                 <child>
@@ -578,6 +590,7 @@
                       </object>
                       <packing>
                         <property name="expand">False</property>
+                        <property name="fill">True</property>
                         <property name="pack_type">end</property>
                         <property name="position">1</property>
                       </packing>
@@ -585,6 +598,8 @@
                   </object>
                   <packing>
                     <property name="position">1</property>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
                   </packing>
                 </child>
                 <child>
@@ -614,6 +629,7 @@
                       </object>
                       <packing>
                         <property name="expand">False</property>
+                        <property name="fill">True</property>
                         <property name="pack_type">end</property>
                         <property name="position">1</property>
                       </packing>
@@ -621,6 +637,8 @@
                   </object>
                   <packing>
                     <property name="position">2</property>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
                   </packing>
                 </child>
                 <child>
@@ -642,11 +660,14 @@
               </object>
               <packing>
                 <property name="position">1</property>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
               </packing>
             </child>
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">False</property>
             <property name="position">3</property>
           </packing>
         </child>
diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c
index 4af662d..9c49dcb 100644
--- a/plugins/publish-calendar/url-editor-dialog.c
+++ b/plugins/publish-calendar/url-editor-dialog.c
@@ -209,7 +209,8 @@ publish_service_changed (GtkComboBox *combo, UrlEditorDialog *dialog)
 		break;
 	case TYPE_URI:
 		gtk_label_set_text_with_mnemonic (GTK_LABEL (dialog->server_label), "_Location (URI):");
-		gtk_entry_set_text (GTK_ENTRY (dialog->server_entry), "");
+		if (uri->service_type != TYPE_URI)
+			gtk_entry_set_text (GTK_ENTRY (dialog->server_entry), "");
 		gtk_widget_hide (dialog->file_hbox);
 		gtk_widget_hide (dialog->optional_label);
 		gtk_widget_hide (dialog->port_hbox);
@@ -319,6 +320,9 @@ set_from_uri (UrlEditorDialog *dialog)
 	if (euri->path)
 		gtk_entry_set_text (GTK_ENTRY (dialog->file_entry), euri->path);
 
+	if (uri->service_type == TYPE_URI)
+		gtk_entry_set_text (GTK_ENTRY (dialog->server_entry), uri->location);
+
 	gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->publish_service), uri->service_type);
 
 	e_uri_free (euri);
@@ -426,6 +430,7 @@ url_editor_dialog_construct (UrlEditorDialog *dialog)
 		if (uri->location && strlen (uri->location)) {
 			set_from_uri (dialog);
 		}
+
 		gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->publish_frequency), uri->publish_frequency);
 		gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->type_selector), uri->publish_format);
 
@@ -443,6 +448,10 @@ url_editor_dialog_construct (UrlEditorDialog *dialog)
 	gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->fb_duration_spin), uri->fb_duration_value);
 	gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->fb_duration_combo), uri->fb_duration_type);
 
+	type_selector_changed (GTK_COMBO_BOX (dialog->type_selector), dialog);
+	frequency_changed_cb (GTK_COMBO_BOX (dialog->publish_frequency), dialog);
+	publish_service_changed (GTK_COMBO_BOX (dialog->publish_service), dialog);
+
 	g_signal_connect (G_OBJECT (dialog->publish_service), "changed",           G_CALLBACK (publish_service_changed),  dialog);
 	g_signal_connect (G_OBJECT (dialog->type_selector),   "changed",           G_CALLBACK (type_selector_changed),    dialog);
 	g_signal_connect (G_OBJECT (dialog->publish_frequency),   "changed",           G_CALLBACK (frequency_changed_cb),    dialog);



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