[evolution-patches] [UIHACKFEST] [Mailer] Fix for 246235



HI

Patch for 246235.

Please review.

Thanks
Johnny
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3768
diff -u -p -r1.3768 ChangeLog
--- mail/ChangeLog	10 Jan 2006 08:10:29 -0000	1.3768
+++ mail/ChangeLog	12 Jan 2006 13:48:31 -0000
@@ -1,3 +1,10 @@
+2006-01-12  Johnny Jacob  <johnnyjacob gmail com>
+
+	FIxes #246235.
+	* em-vfolder-rule.c (get_widget) : Deleted the option menu and
+	replaced with radio buttons.
+	* mail-dialogs.glade : Removed option menu and added radio buttons
+
 2006-01-10  Simon Zheng  <simon zheng sun com>
 
 	* em-composer-utils.c:
Index: mail/em-vfolder-rule.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-vfolder-rule.c,v
retrieving revision 1.9
diff -u -p -r1.9 em-vfolder-rule.c
--- mail/em-vfolder-rule.c	18 Dec 2005 08:24:26 -0000	1.9
+++ mail/em-vfolder-rule.c	12 Jan 2006 13:49:08 -0000
@@ -57,9 +57,9 @@ static void em_vfolder_rule_finalise(GOb
 /* DO NOT internationalise these strings */
 const char *with_names[] = {
 	"specific",
-	"local",
+	"local_remote_active",
 	"remote_active",
-	"local_remote_active"
+	"local",
 };
 
 static FilterRuleClass *parent_class = NULL;
@@ -256,7 +256,6 @@ xml_encode(FilterRule *fr)
 	EMVFolderRule *vr =(EMVFolderRule *)fr;
 	xmlNodePtr node, set, work;
 	GList *l;
-	
         node = FILTER_RULE_CLASS(parent_class)->xml_encode(fr);
 	g_assert(node != NULL);
 	g_assert(vr->with >= 0 && vr->with < sizeof(with_names)/sizeof(with_names[0]));
@@ -373,6 +372,7 @@ struct _source_data {
 	const char *current;
 	GtkListStore *model;
 	GtkTreeView *list;
+	GtkWidget *source_selector;
 	GtkButton *buttons[BUTTON_LAST];
 };
 
@@ -414,10 +414,25 @@ static void
 select_source_with_changed(GtkWidget *widget, struct _source_data *data)
 {
 	em_vfolder_rule_with_t with;
+	GList *group = NULL;
+	gboolean sensitive = FALSE;
+	gint i = 0;	
+
+	if ( !gtk_toggle_button_get_active (widget) )
+		return;
+
+	group = gtk_radio_button_get_group (widget);
 
-	with = gtk_option_menu_get_history((GtkOptionMenu *)widget);
-	if (with < EM_VFOLDER_RULE_WITH_SPECIFIC || with > EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE)
+	for (i=0; i< g_list_length(group); i++) {
+		if ( g_list_nth_data (group, with = i) == widget ) 
+			break;
+	}
+
+	if ( with < EM_VFOLDER_RULE_WITH_SPECIFIC || with > EM_VFOLDER_RULE_WITH_LOCAL )
 		with = 0;
+
+	gtk_widget_set_sensitive (data->source_selector, !with );
+
 	data->vr->with = with;
 }
 
@@ -596,7 +611,8 @@ get_widget(FilterRule *fr, RuleContext *
 	EMVFolderRule *vr =(EMVFolderRule *)fr;
 	GtkWidget *widget, *frame, *list;
 	struct _source_data *data;
-	GtkOptionMenu *omenu;
+	GtkRadioButton *rb;
+	GList *group;
 	const char *source;
 	GtkTreeIter iter;
 	GladeXML *gui;
@@ -638,10 +654,24 @@ get_widget(FilterRule *fr, RuleContext *
 	}
 	
 	g_signal_connect(data->list, "cursor-changed", G_CALLBACK(select_source), data);
-	
-	omenu =(GtkOptionMenu *)glade_xml_get_widget(gui, "source_option");
-	gtk_option_menu_set_history(omenu, vr->with);
-	g_signal_connect(omenu, "changed", G_CALLBACK(select_source_with_changed), data);
+
+	rb = (GtkRadioButton *)glade_xml_get_widget (gui, "local_rb");
+	g_signal_connect (GTK_WIDGET(rb), "toggled", G_CALLBACK(select_source_with_changed), data);
+
+	rb = (GtkRadioButton *)glade_xml_get_widget (gui, "remote_rb");
+	g_signal_connect (GTK_WIDGET(rb), "toggled", G_CALLBACK(select_source_with_changed), data);
+
+	rb = (GtkRadioButton *)glade_xml_get_widget (gui, "local_and_remote_rb");
+	g_signal_connect (GTK_WIDGET(rb), "toggled", G_CALLBACK(select_source_with_changed), data);
+
+	rb = (GtkRadioButton *)glade_xml_get_widget (gui, "specific_rb");
+	g_signal_connect (GTK_WIDGET(rb), "toggled", G_CALLBACK(select_source_with_changed), data);
+
+	data->source_selector = (GtkWidget *)glade_xml_get_widget (gui, "source_selector");
+
+	rb = g_list_nth_data(gtk_radio_button_get_group (rb), vr->with);
+	gtk_toggle_button_set_active (rb, TRUE);
+	gtk_signal_emit_by_name (rb, "toggled");
 	
 	set_sensitive(data);
 		
Index: mail/em-vfolder-rule.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-vfolder-rule.h,v
retrieving revision 1.1
diff -u -p -r1.1 em-vfolder-rule.h
--- mail/em-vfolder-rule.h	17 Jun 2004 07:34:49 -0000	1.1
+++ mail/em-vfolder-rule.h	12 Jan 2006 13:49:13 -0000
@@ -34,9 +34,9 @@
 /* perhaps should be bits? */
 enum _em_vfolder_rule_with_t {
 	EM_VFOLDER_RULE_WITH_SPECIFIC,
-	EM_VFOLDER_RULE_WITH_LOCAL,
-	EM_VFOLDER_RULE_WITH_REMOTE_ACTIVE,
 	EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE,
+	EM_VFOLDER_RULE_WITH_REMOTE_ACTIVE,
+	EM_VFOLDER_RULE_WITH_LOCAL,
 };
 
 typedef struct _EMVFolderRule EMVFolderRule;
Index: mail/mail-dialogs.glade
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-dialogs.glade,v
retrieving revision 1.6
diff -u -p -r1.6 mail-dialogs.glade
--- mail/mail-dialogs.glade	20 Dec 2005 10:05:37 -0000	1.6
+++ mail/mail-dialogs.glade	12 Jan 2006 13:49:27 -0000
@@ -1599,48 +1599,76 @@ Please select a follow up action from th
 		  <property name="spacing">6</property>
 
 		  <child>
-		    <widget class="GtkOptionMenu" id="source_option">
+		    <widget class="GtkRadioButton" id="local_rb">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
-		      <property name="history">0</property>
-
-		      <child internal-child="menu">
-			<widget class="GtkMenu" id="convertwidget8">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget9">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">specific folders only</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
+		      <property name="label" translatable="yes">All local folders</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
 
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget10">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">with all local folders</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
+		  <child>
+		    <widget class="GtkRadioButton" id="remote_rb">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">All active remote folders</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <property name="group">local_rb</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
 
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget11">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">with all active remote folders</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
+		  <child>
+		    <widget class="GtkRadioButton" id="local_and_remote_rb">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">All local and active remote folders</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <property name="group">local_rb</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
 
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget12">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">with all local and active remote folders</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
+		  <child>
+		    <widget class="GtkRadioButton" id="specific_rb">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">Specific folders</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <property name="group">local_rb</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -1650,7 +1678,7 @@ Please select a follow up action from th
 		  </child>
 
 		  <child>
-		    <widget class="GtkHBox" id="hbox3">
+		    <widget class="GtkHBox" id="source_selector">
 		      <property name="visible">True</property>
 		      <property name="homogeneous">False</property>
 		      <property name="spacing">6</property>


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