aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/em-vfolder-rule.c48
-rw-r--r--mail/em-vfolder-rule.h4
-rw-r--r--mail/mail-dialogs.glade103
4 files changed, 114 insertions, 48 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 24754d5d53..1d4c4dc4ef 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,12 @@
2006-07-11 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-07-11 Johnny Jacob <johnnyjacob@gmail.com>
+
** Fixes Bug # 324241
* mail/em-composer-prefs.c (em_composer_prefs_construct): Changed
diff --git a/mail/em-vfolder-rule.c b/mail/em-vfolder-rule.c
index 467392c685..848d6dc5c5 100644
--- a/mail/em-vfolder-rule.c
+++ b/mail/em-vfolder-rule.c
@@ -57,9 +57,9 @@ static void em_vfolder_rule_finalise(GObject *obj);
/* DO NOT internationalise these strings */
static 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;
- with = gtk_option_menu_get_history((GtkOptionMenu *)widget);
- if (with < EM_VFOLDER_RULE_WITH_SPECIFIC || with > EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE)
+ group = gtk_radio_button_get_group (widget);
+
+ 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;
}
@@ -598,7 +613,8 @@ get_widget(FilterRule *fr, RuleContext *rc)
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;
@@ -641,9 +657,23 @@ get_widget(FilterRule *fr, RuleContext *rc)
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);
diff --git a/mail/em-vfolder-rule.h b/mail/em-vfolder-rule.h
index 717df74709..b5afa50c74 100644
--- a/mail/em-vfolder-rule.h
+++ b/mail/em-vfolder-rule.h
@@ -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;
diff --git a/mail/mail-dialogs.glade b/mail/mail-dialogs.glade
index 89093ec45a..45677b6ffe 100644
--- a/mail/mail-dialogs.glade
+++ b/mail/mail-dialogs.glade
@@ -1600,48 +1600,77 @@ Please select a follow up action from the &quot;Flag&quot; menu.</property>
<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>
+ <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="convertwidget9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">specific folders only</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="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="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="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="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>
- <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>
</widget>
<packing>
<property name="padding">0</property>
@@ -1651,7 +1680,7 @@ Please select a follow up action from the &quot;Flag&quot; menu.</property>
</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>