[gedit/wip/merge-encoding-settings: 23/23] EncodingsDialog: add "(Current Locale)" for... the current locale



commit 5a39d8186f3f036393f7f62ca9e48d296cc1b2b3
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Mar 29 13:25:03 2015 +0200

    EncodingsDialog: add "(Current Locale)" for... the current locale

 gedit/gedit-encodings-dialog.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/gedit/gedit-encodings-dialog.c b/gedit/gedit-encodings-dialog.c
index e121aae..27c112a 100644
--- a/gedit/gedit-encodings-dialog.c
+++ b/gedit/gedit-encodings-dialog.c
@@ -300,9 +300,26 @@ append_encoding (GtkListStore            *liststore,
        gtk_list_store_append (liststore, &iter);
        gtk_list_store_set (liststore, &iter,
                            COLUMN_NAME, gtk_source_encoding_get_name (encoding),
-                           COLUMN_CHARSET, gtk_source_encoding_get_charset (encoding),
                            COLUMN_ENCODING, encoding,
                            -1);
+
+       if (encoding == gtk_source_encoding_get_current ())
+       {
+               gchar *charset = g_strdup_printf (_("%s (Current Locale)"),
+                                                 gtk_source_encoding_get_charset (encoding));
+
+               gtk_list_store_set (liststore, &iter,
+                                   COLUMN_CHARSET, charset,
+                                   -1);
+
+               g_free (charset);
+       }
+       else
+       {
+               gtk_list_store_set (liststore, &iter,
+                                   COLUMN_CHARSET, gtk_source_encoding_get_charset (encoding),
+                                   -1);
+       }
 }
 
 /* Removes all @paths from @orig, and append them at the end of @dest in the


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