aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-05-03 06:58:18 +0800
committerChris Lahey <clahey@src.gnome.org>2002-05-03 06:58:18 +0800
commit13711e101fa7c465b14dd2b10941839056cd2e5c (patch)
tree27f7cdeb99b6b4e507955d5437e95c7b5d999150
parent8c9242e0613f52e74e58fd2c61d0f2f5438309bc (diff)
downloadgsoc2013-evolution-13711e101fa7c465b14dd2b10941839056cd2e5c.tar
gsoc2013-evolution-13711e101fa7c465b14dd2b10941839056cd2e5c.tar.gz
gsoc2013-evolution-13711e101fa7c465b14dd2b10941839056cd2e5c.tar.bz2
gsoc2013-evolution-13711e101fa7c465b14dd2b10941839056cd2e5c.tar.lz
gsoc2013-evolution-13711e101fa7c465b14dd2b10941839056cd2e5c.tar.xz
gsoc2013-evolution-13711e101fa7c465b14dd2b10941839056cd2e5c.tar.zst
gsoc2013-evolution-13711e101fa7c465b14dd2b10941839056cd2e5c.zip
Desensitize the to, cc, and bcc buttons if there's no selection here.
2002-05-02 Christopher James Lahey <clahey@ximian.com> * gui/component/select-names/e-select-names.c (selection_change): Desensitize the to, cc, and bcc buttons if there's no selection here. Fixes Ximian bug #21482. svn path=/trunk/; revision=16671
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/gui/component/select-names/e-select-names.c28
2 files changed, 34 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index b0c427de31..446dc10662 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,9 @@
+2002-05-02 Christopher James Lahey <clahey@ximian.com>
+
+ * gui/component/select-names/e-select-names.c (selection_change):
+ Desensitize the to, cc, and bcc buttons if there's no selection
+ here. Fixes Ximian bug #21482.
+
2002-05-01 Christopher James Lahey <clahey@ximian.com>
* gui/contact-list-editor/e-contact-list-editor.c (verbs): Changed
diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c
index 7e9b2a6409..3f5c32d38e 100644
--- a/addressbook/gui/component/select-names/e-select-names.c
+++ b/addressbook/gui/component/select-names/e-select-names.c
@@ -69,6 +69,7 @@ typedef struct {
ESelectNamesTextModel *text_model;
ESelectNames *names;
GtkWidget *label;
+ GtkWidget *button;
} ESelectNamesChild;
struct _ESelectNamesFolder {
@@ -271,6 +272,25 @@ add_address(ETable *table, int row, int col, GdkEvent *event, ESelectNames *name
}
}
+static void
+sensitize_button (gpointer key, gpointer data, gpointer user_data)
+{
+ gboolean *sensitive = user_data;
+ ESelectNamesChild *child = data;
+
+ gtk_widget_set_sensitive (child->button, *sensitive);
+}
+
+static void
+selection_change (ETable *table, ESelectNames *names)
+{
+ gboolean sensitive;
+
+ sensitive = e_table_selected_count (table) > 0;
+
+ g_hash_table_foreach (names->children, sensitize_button, &sensitive);
+}
+
static void *
esn_get_key_fn (ETableModel *source, int row, void *closure)
{
@@ -829,6 +849,9 @@ e_select_names_init (ESelectNames *e_select_names)
gtk_signal_connect (GTK_OBJECT (e_table_scrolled_get_table (e_select_names->table)), "double_click",
GTK_SIGNAL_FUNC (add_address), e_select_names);
+ gtk_signal_connect (GTK_OBJECT (e_table_scrolled_get_table (e_select_names->table)), "selection_change",
+ GTK_SIGNAL_FUNC (selection_change), e_select_names);
+ selection_change (e_table_scrolled_get_table (e_select_names->table), e_select_names);
}
static void e_select_names_child_free(char *key, ESelectNamesChild *child, ESelectNames *e_select_names)
@@ -979,6 +1002,7 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E
GtkWidget *label;
GtkTable *table;
char *label_text;
+ ETable *etable;
GtkWidget *sw;
GtkWidget *recipient_table;
@@ -1025,6 +1049,7 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E
g_free (label_text);
gtk_container_add (GTK_CONTAINER (button), label);
child->label = label;
+ child->button = button;
gtk_container_add(GTK_CONTAINER(alignment), button);
gtk_widget_show_all(alignment);
@@ -1037,6 +1062,9 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E
GTK_FILL, GTK_FILL,
0, 0);
+ etable = e_table_scrolled_get_table (e_select_names->table);
+ gtk_widget_set_sensitive (button, e_table_selected_count (etable) > 0);
+
sw = gtk_scrolled_window_new (NULL, NULL);
recipient_table = e_entry_new ();