--- gdm-2.19.3/gui/gdmlanguages.c.orig	2007-07-18 09:49:18.605828000 +0900
+++ gdm-2.19.3/gui/gdmlanguages.c	2007-07-18 15:53:01.463961000 +0900
@@ -669,7 +669,8 @@ gdm_lang_initialize_model (gchar * local
 
   list = gdm_lang_read_locale_file (locale_file);
 
-  lang_model = gtk_list_store_new (NUM_COLUMNS,
+  // -2 means to remove left and right arrow columns
+  lang_model = gtk_list_store_new (NUM_COLUMNS - 2,
 				   G_TYPE_STRING,
 				   G_TYPE_STRING,
 				   G_TYPE_STRING);
@@ -795,6 +796,154 @@ gdm_lang_check_language (const char *old
 }
 
 static void
+text_column_clicked (GtkTreeViewColumn *column, gpointer data)
+{
+  gint clicked_column_id = GPOINTER_TO_INT (data);
+  gint sorted_column_id;
+  GtkSortType order;
+
+  if (gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (lang_model),
+                                            &sorted_column_id,
+                                            &order) == TRUE &&
+      sorted_column_id == clicked_column_id)
+    {
+      order = (order == GTK_SORT_ASCENDING) ? GTK_SORT_DESCENDING : GTK_SORT_ASCENDING;
+      gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (lang_model),
+                                            clicked_column_id,
+                                            order);
+    }
+  else
+    {
+      gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (lang_model),
+                                            clicked_column_id,
+                                            GTK_SORT_ASCENDING);
+    }
+}
+
+static void
+arrow_column_clicked (GtkTreeViewColumn *column, gpointer data)
+{
+  int arrow_id = GPOINTER_TO_INT (data);
+  GtkTreeViewColumn *arrow_reverse_column;
+  GtkTreeViewColumn *enable_text_column;
+  GtkTreeViewColumn *disable_text_column;
+
+  switch (arrow_id)
+    {
+    case 1:
+      arrow_reverse_column = gtk_tree_view_get_column (GTK_TREE_VIEW(tv), 0);
+      disable_text_column = gtk_tree_view_get_column (GTK_TREE_VIEW(tv), 1);
+      enable_text_column = gtk_tree_view_get_column (GTK_TREE_VIEW(tv), NUM_COLUMNS - 2);
+      break;
+    case -1:
+      arrow_reverse_column = gtk_tree_view_get_column (GTK_TREE_VIEW(tv), NUM_COLUMNS - 1);
+      disable_text_column = gtk_tree_view_get_column (GTK_TREE_VIEW(tv), NUM_COLUMNS - 2);
+      enable_text_column = gtk_tree_view_get_column (GTK_TREE_VIEW(tv), 1);
+      break;
+    default:
+      return;
+    }
+
+  gtk_tree_view_column_set_visible (column, FALSE);
+  gtk_tree_view_column_set_visible (arrow_reverse_column, TRUE);
+  gtk_tree_view_column_set_visible (disable_text_column, FALSE);
+  gtk_tree_view_column_set_visible (enable_text_column, TRUE);
+}
+
+static void
+columns_new (GtkWidget *tv)
+{
+  GtkTreeViewColumn *column;
+  GtkWidget *button;
+  GtkWidget *arrow;
+  int n_column = 0;
+
+  // Left Arrow column
+  column = gtk_tree_view_column_new_with_attributes ("",
+                                                     gtk_cell_renderer_text_new (),
+                                                     "active", ARROW_LEFT_COLUMN,
+                                                     NULL);
+  gtk_tree_view_column_set_clickable (column, TRUE);
+  gtk_tree_view_insert_column (GTK_TREE_VIEW (tv),
+                               column,
+                               n_column++);
+  button = gtk_button_new ();
+  arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_OUT);
+  gtk_tree_view_column_set_widget (column, arrow);
+  gtk_widget_show (arrow);
+  // FALSE by default
+  gtk_tree_view_column_set_visible (column, FALSE);
+  g_signal_connect (column,
+                    "clicked",
+                    G_CALLBACK (arrow_column_clicked),
+                    GINT_TO_POINTER (-1));
+
+  // Text column
+  column = gtk_tree_view_column_new_with_attributes ("Current _encoding",
+                                                     gtk_cell_renderer_text_new (),
+                                                     "text", TRANSLATED_NAME_COLUMN,
+                                                     NULL);
+  gtk_tree_view_column_set_clickable (column, TRUE);
+  gtk_tree_view_insert_column (GTK_TREE_VIEW (tv),
+                               column,
+                               n_column++);
+  g_signal_connect (column,
+                    "clicked",
+                    G_CALLBACK (text_column_clicked),
+                    GINT_TO_POINTER (TRANSLATED_NAME_COLUMN));
+
+  // Text column
+  column = gtk_tree_view_column_new_with_attributes ("_Multi-lingual",
+                                                     gtk_cell_renderer_text_new (),
+                                                     "markup",
+                                                     UNTRANSLATED_NAME_COLUMN,
+                                                     NULL);
+  gtk_tree_view_column_set_clickable (column, TRUE);
+  gtk_tree_view_insert_column (GTK_TREE_VIEW (tv),
+                               column,
+                               n_column++);
+  g_signal_connect (column,
+                    "clicked",
+                    G_CALLBACK (text_column_clicked),
+                    GINT_TO_POINTER (UNTRANSLATED_NAME_COLUMN));
+
+  // Text column
+  column = gtk_tree_view_column_new_with_attributes ("L_ocale",
+                                                     gtk_cell_renderer_text_new (),
+                                                     "text",
+                                                     LOCALE_COLUMN,
+                                                     NULL);
+  gtk_tree_view_column_set_clickable (column, TRUE);
+  gtk_tree_view_insert_column (GTK_TREE_VIEW (tv),
+                               column,
+                               n_column++);
+  // FALSE by default
+  gtk_tree_view_column_set_visible (column, FALSE);
+  g_signal_connect (column,
+                    "clicked",
+                    G_CALLBACK (text_column_clicked),
+                    GINT_TO_POINTER (LOCALE_COLUMN));
+
+  // Right arrow column
+  column = gtk_tree_view_column_new_with_attributes ("",
+                                                     gtk_cell_renderer_text_new (),
+                                                     "active", ARROW_RIGHT_COLUMN,
+                                                     NULL);
+  gtk_tree_view_column_set_clickable (column, TRUE);
+  gtk_tree_view_insert_column (GTK_TREE_VIEW (tv),
+                               column,
+                               n_column++);
+  button = gtk_button_new ();
+  arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_OUT);
+  gtk_tree_view_column_set_widget (column, arrow);
+  gtk_widget_show (arrow);
+  g_signal_connect (column,
+                    "clicked",
+                    G_CALLBACK (arrow_column_clicked),
+                    GINT_TO_POINTER (1));
+}
+
+static void
 selection_changed (GtkTreeSelection *selection,
 		   gpointer          data)
 {
@@ -879,20 +1028,11 @@ gdm_lang_setup_treeview (void)
       /* FIXME: we should handle this better, but things really look
        * bad if we aren't always LTR */
       gtk_widget_set_direction (tv, GTK_TEXT_DIR_LTR);
-      gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), FALSE);
-      gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tv),
-					       GTK_DIALOG_MODAL,
-					       NULL,
-					       gtk_cell_renderer_text_new (),
-					       "text", TRANSLATED_NAME_COLUMN,
-					       NULL);
-      gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tv),
-					       GTK_DIALOG_MODAL,
-					       NULL,
-					       gtk_cell_renderer_text_new (),
-					       "markup",
-					       UNTRANSLATED_NAME_COLUMN,
-					       NULL);
+      gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), TRUE);
+      gtk_tree_view_set_reorderable (GTK_TREE_VIEW (tv), TRUE);
+
+      columns_new (tv);
+
       swindow = gtk_scrolled_window_new (NULL, NULL);
       gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swindow), GTK_SHADOW_IN);
       gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow),
@@ -922,23 +1062,34 @@ gdm_lang_ask_restart (gchar *language)
 {
 	gchar *firstmsg;
 	gchar *secondmsg;
+	gchar *name;
 	gchar *login;
 	gint response = GTK_RESPONSE_NO;
 
 	if (always_restart)
 		return GTK_RESPONSE_YES;
 
+	if (strcmp (language, DEFAULT_LANGUAGE) == 0)
+	  name = g_strdup (_("System Default"));
+	else
+	  name = gdm_lang_name (language,
+				FALSE /* never_encoding */,
+				TRUE /* no_group */,
+				TRUE /* untranslated */,
+				TRUE /* markup */);
+
 	login = _("the login screen");
 	firstmsg = g_strdup_printf (_("Do you wish to restart %s with the chosen language?"),
 	                            login);
 	secondmsg = g_strdup_printf (_("You will restart %s with the %s locale."),
 	                             login,
-	                             language);
+	                             name);
 
 	response = gdm_wm_query_dialog (firstmsg, secondmsg, _("_Yes"), _("_No"), FALSE);
 
 	g_free (firstmsg);
 	g_free (secondmsg);
+	g_free (name);
 
 	return response;
 }
--- gdm-2.19.3/gui/gdmlanguages.h.orig	2007-07-16 21:33:01.711532000 +0900
+++ gdm-2.19.3/gui/gdmlanguages.h	2007-07-17 03:53:20.558352000 +0900
@@ -27,6 +27,8 @@ enum {
   LOCALE_COLUMN,
   TRANSLATED_NAME_COLUMN,
   UNTRANSLATED_NAME_COLUMN,
+  ARROW_LEFT_COLUMN,
+  ARROW_RIGHT_COLUMN,
   NUM_COLUMNS
 };
 
