[accounts-dialog] Fix selection when going back to the login options and back.



commit 0c193205cfb66a0ce4d01b586daa2633216d6060
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jan 21 09:05:14 2010 -0500

    Fix selection when going back to the login options and back.

 src/main.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index 4983f4c..eaeb5a1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -864,7 +864,17 @@ toggle_login_options (GtkButton *button, UserAccountDialog *d)
                 gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), 0);
                 if (!gtk_tree_selection_get_selected (selection, NULL, NULL)) {
                         gtk_tree_model_get_iter_first (model, &iter);
-                        gtk_tree_selection_select_iter (selection, &iter);
+                        do {
+                                gint sort_key;
+
+                                gtk_tree_model_get (model, &iter, SORT_KEY_COL, &sort_key, -1);
+
+                                if (sort_key == 1) {
+                                        /* select the current user */
+                                        gtk_tree_selection_select_iter (selection, &iter);
+                                        break;
+                                }
+                        } while (gtk_tree_model_iter_next (model, &iter));
                 }
         }
 }



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