From 7e9fd7e25164e3a1bc5706c6c25feca5cdafba25 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Sat, 24 Jan 2004 05:36:53 +0000 Subject: if the source is primary, don't allow it to be un-selected 2004-01-24 JP Rosevear * e-source-selector.c (cell_toggled_callback): if the source is primary, don't allow it to be un-selected svn path=/trunk/; revision=24397 --- widgets/misc/ChangeLog | 5 +++++ widgets/misc/e-source-selector.c | 25 ++++++++++++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'widgets/misc') diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 8db55ee74c..f8fc8bbef3 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,8 @@ +2004-01-24 JP Rosevear + + * e-source-selector.c (cell_toggled_callback): if the source is + primary, don't allow it to be un-selected + 2004-01-20 Rodney Dawes * e-combo-button.c (paint): Be even more exactly like the GtkButton diff --git a/widgets/misc/e-source-selector.c b/widgets/misc/e-source-selector.c index f64c192bd4..f26ce4030b 100644 --- a/widgets/misc/e-source-selector.c +++ b/widgets/misc/e-source-selector.c @@ -475,17 +475,20 @@ cell_toggled_callback (GtkCellRendererToggle *renderer, gtk_tree_path_free (path); } else { source = E_SOURCE (data); - if (source_is_selected (selector, source)) - unselect_source (selector, source); - else - select_source (selector, source); - - selector->priv->toggled_last = TRUE; - - gtk_tree_model_row_changed (model, path, &iter); - g_signal_emit (selector, signals[SELECTION_CHANGED], 0); - - gtk_tree_path_free (path); + + if (e_source_selector_peek_primary_selection (selector) != source) { + if (source_is_selected (selector, source)) + unselect_source (selector, source); + else + select_source (selector, source); + + selector->priv->toggled_last = TRUE; + + gtk_tree_model_row_changed (model, path, &iter); + g_signal_emit (selector, signals[SELECTION_CHANGED], 0); + + gtk_tree_path_free (path); + } } g_object_unref (data); -- cgit v1.2.3