gnome-terminal r2630 - trunk/src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-terminal r2630 - trunk/src
- Date: Thu, 29 May 2008 19:40:10 +0000 (UTC)
Author: chpe
Date: Thu May 29 19:40:09 2008
New Revision: 2630
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2630&view=rev
Log:
Port the encodings dialogue to gtkbuilder.
Code cleanup & modernisations.
Added:
trunk/src/encodings-dialog.ui
Modified:
trunk/src/Makefile.am
trunk/src/encoding.c
trunk/src/encoding.h
trunk/src/gnome-terminal.glade2
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Thu May 29 19:40:09 2008
@@ -91,6 +91,7 @@
uidir = $(pkgdatadir)
ui_DATA = \
terminal.ui \
+ encodings-dialog.ui \
profile-manager.ui \
$(NULL)
Modified: trunk/src/encoding.c
==============================================================================
--- trunk/src/encoding.c (original)
+++ trunk/src/encoding.c Thu May 29 19:40:09 2008
@@ -1,9 +1,6 @@
-/* Encoding stuff */
-
/*
* Copyright  2002 Red Hat, Inc.
- *
- * This file is part of gnome-terminal.
+ * Copyright  2008 Christian Persch
*
* Gnome-terminal is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,22 +17,17 @@
*/
#include <config.h>
-#include "terminal-intl.h"
-#include "terminal.h"
+#include <string.h>
-#include "encoding.h"
+#include <gtk/gtk.h>
+#include "encoding.h"
+#include "terminal.h"
+#include "terminal-intl.h"
#include "terminal-profile.h"
#include "terminal-util.h"
-#include <glade/glade.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtktreestore.h>
-
-#include <string.h>
-
/* Overview
*
* There's a list of character sets stored in gconf, indicating
@@ -51,312 +43,122 @@
* labeled "user defined" but still appears in the menu.
*/
-enum {
- TERMINAL_ENCODING_CURRENT_LOCALE,
-
- TERMINAL_ENCODING_ISO_8859_1,
- TERMINAL_ENCODING_ISO_8859_2,
- TERMINAL_ENCODING_ISO_8859_3,
- TERMINAL_ENCODING_ISO_8859_4,
- TERMINAL_ENCODING_ISO_8859_5,
- TERMINAL_ENCODING_ISO_8859_6,
- TERMINAL_ENCODING_ISO_8859_7,
- TERMINAL_ENCODING_ISO_8859_8,
- TERMINAL_ENCODING_ISO_8859_8_I,
- TERMINAL_ENCODING_ISO_8859_9,
- TERMINAL_ENCODING_ISO_8859_10,
- TERMINAL_ENCODING_ISO_8859_13,
- TERMINAL_ENCODING_ISO_8859_14,
- TERMINAL_ENCODING_ISO_8859_15,
- TERMINAL_ENCODING_ISO_8859_16,
-
- TERMINAL_ENCODING_UTF_7,
- TERMINAL_ENCODING_UTF_8,
- TERMINAL_ENCODING_UTF_16,
- TERMINAL_ENCODING_UCS_2,
- TERMINAL_ENCODING_UCS_4,
-
- TERMINAL_ENCODING_ARMSCII_8,
- TERMINAL_ENCODING_BIG5,
- TERMINAL_ENCODING_BIG5_HKSCS,
- TERMINAL_ENCODING_CP_866,
-
- TERMINAL_ENCODING_EUC_JP,
- TERMINAL_ENCODING_EUC_KR,
- TERMINAL_ENCODING_EUC_TW,
-
- TERMINAL_ENCODING_GB18030,
- TERMINAL_ENCODING_GB2312,
- TERMINAL_ENCODING_GBK,
- TERMINAL_ENCODING_GEOSTD8,
- TERMINAL_ENCODING_HZ,
-
- TERMINAL_ENCODING_IBM_850,
- TERMINAL_ENCODING_IBM_852,
- TERMINAL_ENCODING_IBM_855,
- TERMINAL_ENCODING_IBM_857,
- TERMINAL_ENCODING_IBM_862,
- TERMINAL_ENCODING_IBM_864,
-
- TERMINAL_ENCODING_ISO_2022_JP,
- TERMINAL_ENCODING_ISO_2022_KR,
- TERMINAL_ENCODING_ISO_IR_111,
- TERMINAL_ENCODING_JOHAB,
- TERMINAL_ENCODING_KOI8_R,
- TERMINAL_ENCODING_KOI8_U,
-
- TERMINAL_ENCODING_MAC_ARABIC,
- TERMINAL_ENCODING_MAC_CE,
- TERMINAL_ENCODING_MAC_CROATIAN,
- TERMINAL_ENCODING_MAC_CYRILLIC,
- TERMINAL_ENCODING_MAC_DEVANAGARI,
- TERMINAL_ENCODING_MAC_FARSI,
- TERMINAL_ENCODING_MAC_GREEK,
- TERMINAL_ENCODING_MAC_GUJARATI,
- TERMINAL_ENCODING_MAC_GURMUKHI,
- TERMINAL_ENCODING_MAC_HEBREW,
- TERMINAL_ENCODING_MAC_ICELANDIC,
- TERMINAL_ENCODING_MAC_ROMAN,
- TERMINAL_ENCODING_MAC_ROMANIAN,
- TERMINAL_ENCODING_MAC_TURKISH,
- TERMINAL_ENCODING_MAC_UKRAINIAN,
-
- TERMINAL_ENCODING_SHIFT_JIS,
- TERMINAL_ENCODING_TCVN,
- TERMINAL_ENCODING_TIS_620,
- TERMINAL_ENCODING_UHC,
- TERMINAL_ENCODING_VISCII,
-
- TERMINAL_ENCODING_WINDOWS_1250,
- TERMINAL_ENCODING_WINDOWS_1251,
- TERMINAL_ENCODING_WINDOWS_1252,
- TERMINAL_ENCODING_WINDOWS_1253,
- TERMINAL_ENCODING_WINDOWS_1254,
- TERMINAL_ENCODING_WINDOWS_1255,
- TERMINAL_ENCODING_WINDOWS_1256,
- TERMINAL_ENCODING_WINDOWS_1257,
- TERMINAL_ENCODING_WINDOWS_1258,
-
- TERMINAL_ENCODING_LAST
-
-};
-
-static TerminalEncoding encodings[] = {
-
- { TERMINAL_ENCODING_CURRENT_LOCALE, TRUE,
- NULL, N_("Current Locale") , 1 },
-
- { TERMINAL_ENCODING_ISO_8859_1, FALSE,
- "ISO-8859-1", N_("Western") , 1 },
- { TERMINAL_ENCODING_ISO_8859_2, FALSE,
- "ISO-8859-2", N_("Central European") , 1 },
- { TERMINAL_ENCODING_ISO_8859_3, FALSE,
- "ISO-8859-3", N_("South European") , 1 },
- { TERMINAL_ENCODING_ISO_8859_4, FALSE,
- "ISO-8859-4", N_("Baltic") , 1 },
- { TERMINAL_ENCODING_ISO_8859_5, FALSE,
- "ISO-8859-5", N_("Cyrillic") , 1 },
- { TERMINAL_ENCODING_ISO_8859_6, FALSE,
- "ISO-8859-6", N_("Arabic") , 1 },
- { TERMINAL_ENCODING_ISO_8859_7, FALSE,
- "ISO-8859-7", N_("Greek") , 1 },
- { TERMINAL_ENCODING_ISO_8859_8, FALSE,
- "ISO-8859-8", N_("Hebrew Visual") , 1 },
- { TERMINAL_ENCODING_ISO_8859_8_I, FALSE,
- "ISO-8859-8-I", N_("Hebrew") , 1 },
- { TERMINAL_ENCODING_ISO_8859_9, FALSE,
- "ISO-8859-9", N_("Turkish") , 1 },
- { TERMINAL_ENCODING_ISO_8859_10, FALSE,
- "ISO-8859-10", N_("Nordic") , 1 },
- { TERMINAL_ENCODING_ISO_8859_13, FALSE,
- "ISO-8859-13", N_("Baltic") , 1 },
- { TERMINAL_ENCODING_ISO_8859_14, FALSE,
- "ISO-8859-14", N_("Celtic") , 1 },
- { TERMINAL_ENCODING_ISO_8859_15, FALSE,
- "ISO-8859-15", N_("Western") , 1 },
- { TERMINAL_ENCODING_ISO_8859_16, FALSE,
- "ISO-8859-16", N_("Romanian") , 1 },
-
- { TERMINAL_ENCODING_UTF_7, FALSE,
- "UTF-7", N_("Unicode") , 1 },
- { TERMINAL_ENCODING_UTF_8, FALSE,
- "UTF-8", N_("Unicode") , 1 },
- { TERMINAL_ENCODING_UTF_16, FALSE,
- "UTF-16", N_("Unicode") , 1 },
- { TERMINAL_ENCODING_UCS_2, FALSE,
- "UCS-2", N_("Unicode") , 1 },
- { TERMINAL_ENCODING_UCS_4, FALSE,
- "UCS-4", N_("Unicode") , 1 },
-
- { TERMINAL_ENCODING_ARMSCII_8, FALSE,
- "ARMSCII-8", N_("Armenian") , 1 },
- { TERMINAL_ENCODING_BIG5, FALSE,
- "BIG5", N_("Chinese Traditional") , 1 },
- { TERMINAL_ENCODING_BIG5_HKSCS, FALSE,
- "BIG5-HKSCS", N_("Chinese Traditional") , 1 },
- { TERMINAL_ENCODING_CP_866, FALSE,
- "CP866", N_("Cyrillic/Russian") , 1 },
-
- { TERMINAL_ENCODING_EUC_JP, FALSE,
- "EUC-JP", N_("Japanese") , 1 },
- { TERMINAL_ENCODING_EUC_KR, FALSE,
- "EUC-KR", N_("Korean") , 1 },
- { TERMINAL_ENCODING_EUC_TW, FALSE,
- "EUC-TW", N_("Chinese Traditional") , 1 },
-
- { TERMINAL_ENCODING_GB18030, FALSE,
- "GB18030", N_("Chinese Simplified") , 1 },
- { TERMINAL_ENCODING_GB2312, FALSE,
- "GB2312", N_("Chinese Simplified") , 1 },
- { TERMINAL_ENCODING_GBK, FALSE,
- "GBK", N_("Chinese Simplified") , 1 },
- { TERMINAL_ENCODING_GEOSTD8, FALSE,
- "GEORGIAN-PS", N_("Georgian") , 1 },
- { TERMINAL_ENCODING_HZ, FALSE,
- "HZ", N_("Chinese Simplified") , 1 },
-
- { TERMINAL_ENCODING_IBM_850, FALSE,
- "IBM850", N_("Western") , 1 },
- { TERMINAL_ENCODING_IBM_852, FALSE,
- "IBM852", N_("Central European") , 1 },
- { TERMINAL_ENCODING_IBM_855, FALSE,
- "IBM855", N_("Cyrillic") , 1 },
- { TERMINAL_ENCODING_IBM_857, FALSE,
- "IBM857", N_("Turkish") , 1 },
- { TERMINAL_ENCODING_IBM_862, FALSE,
- "IBM862", N_("Hebrew") , 1 },
- { TERMINAL_ENCODING_IBM_864, FALSE,
- "IBM864", N_("Arabic") , 1 },
-
- { TERMINAL_ENCODING_ISO_2022_JP, FALSE,
- "ISO-2022-JP", N_("Japanese") , 1 },
- { TERMINAL_ENCODING_ISO_2022_KR, FALSE,
- "ISO-2022-KR", N_("Korean") , 1 },
- { TERMINAL_ENCODING_ISO_IR_111, FALSE,
- "ISO-IR-111", N_("Cyrillic") , 1 },
- { TERMINAL_ENCODING_JOHAB, FALSE,
- "JOHAB", N_("Korean") , 1 },
- { TERMINAL_ENCODING_KOI8_R, FALSE,
- "KOI8-R", N_("Cyrillic") , 1 },
- { TERMINAL_ENCODING_KOI8_U, FALSE,
- "KOI8-U", N_("Cyrillic/Ukrainian") , 1 },
-
- { TERMINAL_ENCODING_MAC_ARABIC, FALSE,
- "MAC_ARABIC", N_("Arabic") , 1 },
- { TERMINAL_ENCODING_MAC_CE, FALSE,
- "MAC_CE", N_("Central European") , 1 },
- { TERMINAL_ENCODING_MAC_CROATIAN, FALSE,
- "MAC_CROATIAN", N_("Croatian") , 1 },
- { TERMINAL_ENCODING_MAC_CYRILLIC, FALSE,
- "MAC-CYRILLIC", N_("Cyrillic") , 1 },
- { TERMINAL_ENCODING_MAC_DEVANAGARI, FALSE,
- "MAC_DEVANAGARI", N_("Hindi") , 1 },
- { TERMINAL_ENCODING_MAC_FARSI, FALSE,
- "MAC_FARSI", N_("Persian") , 1 },
- { TERMINAL_ENCODING_MAC_GREEK, FALSE,
- "MAC_GREEK", N_("Greek") , 1 },
- { TERMINAL_ENCODING_MAC_GUJARATI, FALSE,
- "MAC_GUJARATI", N_("Gujarati") , 1 },
- { TERMINAL_ENCODING_MAC_GURMUKHI, FALSE,
- "MAC_GURMUKHI", N_("Gurmukhi") , 1 },
- { TERMINAL_ENCODING_MAC_HEBREW, FALSE,
- "MAC_HEBREW", N_("Hebrew") , 1 },
- { TERMINAL_ENCODING_MAC_ICELANDIC, FALSE,
- "MAC_ICELANDIC", N_("Icelandic") , 1 },
- { TERMINAL_ENCODING_MAC_ROMAN, FALSE,
- "MAC_ROMAN", N_("Western") , 1 },
- { TERMINAL_ENCODING_MAC_ROMANIAN, FALSE,
- "MAC_ROMANIAN", N_("Romanian") , 1 },
- { TERMINAL_ENCODING_MAC_TURKISH, FALSE,
- "MAC_TURKISH", N_("Turkish") , 1 },
- { TERMINAL_ENCODING_MAC_UKRAINIAN, FALSE,
- "MAC_UKRAINIAN", N_("Cyrillic/Ukrainian") , 1 },
-
- { TERMINAL_ENCODING_SHIFT_JIS, FALSE,
- "SHIFT_JIS", N_("Japanese") , 1 },
- { TERMINAL_ENCODING_TCVN, FALSE,
- "TCVN", N_("Vietnamese") , 1 },
- { TERMINAL_ENCODING_TIS_620, FALSE,
- "TIS-620", N_("Thai") , 1 },
- { TERMINAL_ENCODING_UHC, FALSE,
- "UHC", N_("Korean") , 1 },
- { TERMINAL_ENCODING_VISCII, FALSE,
- "VISCII", N_("Vietnamese") , 1 },
-
- { TERMINAL_ENCODING_WINDOWS_1250, FALSE,
- "WINDOWS-1250", N_("Central European") , 1 },
- { TERMINAL_ENCODING_WINDOWS_1251, FALSE,
- "WINDOWS-1251", N_("Cyrillic") , 1 },
- { TERMINAL_ENCODING_WINDOWS_1252, FALSE,
- "WINDOWS-1252", N_("Western") , 1 },
- { TERMINAL_ENCODING_WINDOWS_1253, FALSE,
- "WINDOWS-1253", N_("Greek") , 1 },
- { TERMINAL_ENCODING_WINDOWS_1254, FALSE,
- "WINDOWS-1254", N_("Turkish") , 1 },
- { TERMINAL_ENCODING_WINDOWS_1255, FALSE,
- "WINDOWS-1255", N_("Hebrew") , 1 },
- { TERMINAL_ENCODING_WINDOWS_1256, FALSE,
- "WINDOWS-1256", N_("Arabic") , 1 },
- { TERMINAL_ENCODING_WINDOWS_1257, FALSE,
- "WINDOWS-1257", N_("Baltic") , 1 },
- { TERMINAL_ENCODING_WINDOWS_1258, FALSE,
- "WINDOWS-1258", N_("Vietnamese") , 1 }
+static const struct {
+ const char *charset;
+ const char *name;
+} encodings[] = {
+// { "UTF-8", N_("Current Locale") },
+ { "ISO-8859-1", N_("Western") },
+ { "ISO-8859-2", N_("Central European") },
+ { "ISO-8859-3", N_("South European") },
+ { "ISO-8859-4", N_("Baltic") },
+ { "ISO-8859-5", N_("Cyrillic") },
+ { "ISO-8859-6", N_("Arabic") },
+ { "ISO-8859-7", N_("Greek") },
+ { "ISO-8859-8", N_("Hebrew Visual") },
+ { "ISO-8859-8-I", N_("Hebrew") },
+ { "ISO-8859-9", N_("Turkish") },
+ { "ISO-8859-10", N_("Nordic") },
+ { "ISO-8859-13", N_("Baltic") },
+ { "ISO-8859-14", N_("Celtic") },
+ { "ISO-8859-15", N_("Western") },
+ { "ISO-8859-16", N_("Romanian") },
+ { "UTF-7", N_("Unicode") },
+ { "UTF-8", N_("Unicode") },
+ { "UTF-16", N_("Unicode") },
+ { "UCS-2", N_("Unicode") },
+ { "UCS-4", N_("Unicode") },
+ { "ARMSCII-8", N_("Armenian") },
+ { "BIG5", N_("Chinese Traditional") },
+ { "BIG5-HKSCS", N_("Chinese Traditional") },
+ { "CP866", N_("Cyrillic/Russian") },
+ { "EUC-JP", N_("Japanese") },
+ { "EUC-KR", N_("Korean") },
+ { "EUC-TW", N_("Chinese Traditional") },
+ { "GB18030", N_("Chinese Simplified") },
+ { "GB2312", N_("Chinese Simplified") },
+ { "GBK", N_("Chinese Simplified") },
+ { "GEORGIAN-PS", N_("Georgian") },
+ { "HZ", N_("Chinese Simplified") },
+ { "IBM850", N_("Western") },
+ { "IBM852", N_("Central European") },
+ { "IBM855", N_("Cyrillic") },
+ { "IBM857", N_("Turkish") },
+ { "IBM862", N_("Hebrew") },
+ { "IBM864", N_("Arabic") },
+ { "ISO-2022-JP", N_("Japanese") },
+ { "ISO-2022-KR", N_("Korean") },
+ { "ISO-IR-111", N_("Cyrillic") },
+ { "JOHAB", N_("Korean") },
+ { "KOI8-R", N_("Cyrillic") },
+ { "KOI8-U", N_("Cyrillic/Ukrainian") },
+ { "MAC_ARABIC", N_("Arabic") },
+ { "MAC_CE", N_("Central European") },
+ { "MAC_CROATIAN", N_("Croatian") },
+ { "MAC-CYRILLIC", N_("Cyrillic") },
+ { "MAC_DEVANAGARI", N_("Hindi") },
+ { "MAC_FARSI", N_("Persian") },
+ { "MAC_GREEK", N_("Greek") },
+ { "MAC_GUJARATI", N_("Gujarati") },
+ { "MAC_GURMUKHI", N_("Gurmukhi") },
+ { "MAC_HEBREW", N_("Hebrew") },
+ { "MAC_ICELANDIC", N_("Icelandic") },
+ { "MAC_ROMAN", N_("Western") },
+ { "MAC_ROMANIAN", N_("Romanian") },
+ { "MAC_TURKISH", N_("Turkish") },
+ { "MAC_UKRAINIAN", N_("Cyrillic/Ukrainian") },
+ { "SHIFT_JIS", N_("Japanese") },
+ { "TCVN", N_("Vietnamese") },
+ { "TIS-620", N_("Thai") },
+ { "UHC", N_("Korean") },
+ { "VISCII", N_("Vietnamese") },
+ { "WINDOWS-1250", N_("Central European") },
+ { "WINDOWS-1251", N_("Cyrillic") },
+ { "WINDOWS-1252", N_("Western") },
+ { "WINDOWS-1253", N_("Greek") },
+ { "WINDOWS-1254", N_("Turkish") },
+ { "WINDOWS-1255", N_("Hebrew") },
+ { "WINDOWS-1256", N_("Arabic") },
+ { "WINDOWS-1257", N_("Baltic") },
+ { "WINDOWS-1258", N_("Vietnamese") },
};
+
+static GHashTable *encodings_hashtable;
-static GSList *active_encodings = NULL;
+typedef struct {
+ GtkWidget *dialog;
+ GtkListStore *base_store;
+ GtkTreeView *available_tree_view;
+ GtkTreeSelection *available_selection;
+ GtkTreeModel *available_model;
+ GtkTreeView *active_tree_view;
+ GtkTreeSelection *active_selection;
+ GtkTreeModel *active_model;
+ GtkWidget *add_button;
+ GtkWidget *remove_button;
+} EncodingDialogData;
static void update_active_encoding_tree_models (void);
-static void register_active_encoding_treeview (GtkTreeView *tree_view);
static void encodings_notify_cb (GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
gpointer user_data);
-static TerminalEncoding*
-find_encoding_by_charset (const char *charset)
-{
- int i;
-
- i = 1; /* skip current locale */
- while (i < TERMINAL_ENCODING_LAST)
- {
- /* Note that the "current locale" encoding entry
- * may have the same charset as other entries
- */
-
- if (strcmp (charset, encodings[i].charset) == 0)
- return &encodings[i];
-
- ++i;
- }
-
- /* Fall back to current locale if the current locale charset
- * wasn't known.
- */
- if (strcmp (charset, encodings[TERMINAL_ENCODING_CURRENT_LOCALE].charset) == 0)
- return &encodings[TERMINAL_ENCODING_CURRENT_LOCALE];
-
- return NULL;
-}
-
-
static TerminalEncoding *
-terminal_encoding_new (int index_,
- const char *charset,
+terminal_encoding_new (const char *charset,
const char *name,
- gboolean valid)
+ gboolean is_custom,
+ gboolean force_valid)
{
TerminalEncoding *encoding;
-
encoding = g_slice_new (TerminalEncoding);
encoding->refcount = 1;
- encoding->index_ = index_;
- encoding->name = g_strdup (name);
encoding->charset = g_strdup (charset);
- encoding->valid = valid;
- encoding->validity_checked = TRUE;
+ encoding->name = g_strdup (name);
+ encoding->valid = encoding->validity_checked = force_valid;
+ encoding->is_custom = is_custom;
return encoding;
}
@@ -411,21 +213,54 @@
#ifdef DEBUG_ENCODINGS
if (!encoding->valid)
{
- g_print("Rejecting encoding %s as invalid: %s\n", encoding->charset, error ? error->message : "");
+ g_print("Rejecting encoding %s as invalid:\n", encoding->charset);
g_print(" input \"%s\"\n", ascii_sample);
- g_print(" output \"%s\"\n\n", converted ? converted : "(null)");
- g_clear_error (&error);
+ g_print(" output \"%s\" bytes read %u written %u\n",
+ converted ? converted : "(null)", bytes_read, bytes_written);
+ if (error)
+ g_print (" Error: %s\n", error->message);
+ g_print ("\n");
}
else
g_print ("Encoding %s is valid\n\n", encoding->charset);
#endif
+ g_clear_error (&error);
g_free (converted);
encoding->validity_checked = TRUE;
return encoding->valid;
}
+#define TERMINAL_TYPE_ENCODING (terminal_encoding_get_type ())
+
+static GType
+terminal_encoding_get_type (void)
+{
+ static GType type = 0;
+
+ if (G_UNLIKELY (type == 0)) {
+ type = g_boxed_type_register_static (I_("TerminalEncoding"),
+ (GBoxedCopyFunc) terminal_encoding_ref,
+ (GBoxedFreeFunc) terminal_encoding_unref);
+ }
+
+ return type;
+}
+
+static void
+encoding_mark_active (gpointer key,
+ gpointer value,
+ gpointer data)
+{
+ TerminalEncoding *encoding = (TerminalEncoding *) value;
+ guint active = GPOINTER_TO_UINT (data);
+
+ g_assert (key == encoding->charset);
+
+ encoding->is_active = active;
+}
+
static void
encodings_notify_cb (GConfClient *client,
guint cnxn_id,
@@ -434,39 +269,24 @@
{
GConfValue *val;
GSList *strings, *tmp;
- GHashTable *table;
+ TerminalEncoding *encoding;
const char *charset;
-#if 1
- g_slist_foreach (active_encodings, (GFunc) terminal_encoding_unref,
- NULL);
- g_slist_free (active_encodings);
-#endif
- active_encodings = NULL;
+ /* Mark all as non-active, then re-enable the active ones */
+ g_hash_table_foreach (encodings_hashtable, (GHFunc) encoding_mark_active, GUINT_TO_POINTER (FALSE));
- table = g_hash_table_new (g_direct_hash, g_direct_equal);
-
/* First add the local encoding. */
- charset = encodings[TERMINAL_ENCODING_CURRENT_LOCALE].charset;
- if (g_hash_table_lookup (table, GINT_TO_POINTER (g_quark_from_string (charset))) == NULL)
+ if (!g_get_charset (&charset))
{
- active_encodings = g_slist_prepend (active_encodings,
- terminal_encoding_ref (&encodings[TERMINAL_ENCODING_CURRENT_LOCALE]));
- g_hash_table_insert (table,
- GINT_TO_POINTER (g_quark_from_string (charset)),
- GINT_TO_POINTER (g_quark_from_string (charset)));
+ encoding = g_hash_table_lookup (encodings_hashtable, charset);
+ if (encoding)
+ encoding->is_active = TRUE;
}
/* Always ensure that UTF-8 is available. */
- charset = encodings[TERMINAL_ENCODING_UTF_8].charset;
- if (g_hash_table_lookup (table, GINT_TO_POINTER (g_quark_from_string (charset))) == NULL)
- {
- active_encodings = g_slist_prepend (active_encodings,
- terminal_encoding_ref (&encodings[TERMINAL_ENCODING_UTF_8]));
- g_hash_table_insert (table,
- GINT_TO_POINTER (g_quark_from_string (charset)),
- GINT_TO_POINTER (g_quark_from_string (charset)));
- }
+ encoding = g_hash_table_lookup (encodings_hashtable, "UTF-8");
+ g_assert (encoding);
+ encoding->is_active = TRUE;
val = gconf_entry_get_value (entry);
if (val != NULL &&
@@ -479,54 +299,77 @@
for (tmp = strings; tmp != NULL; tmp = tmp->next)
{
GConfValue *v = (GConfValue *) tmp->data;
- TerminalEncoding *e;
- TerminalEncoding *encoding;
- charset = tmp->data;
charset = gconf_value_get_string (v);
if (!charset)
continue;
+ /* We already handled the locale charset above */
if (strcmp (charset, "current") == 0)
- g_get_charset (&charset);
-
- e = find_encoding_by_charset (charset);
-
- if (g_hash_table_lookup (table, GINT_TO_POINTER (g_quark_from_string (charset))) != NULL)
- {
- continue;
- }
+ continue;
- g_hash_table_insert (table,
- GINT_TO_POINTER (g_quark_from_string (charset)),
- GINT_TO_POINTER (g_quark_from_string (charset)));
-
- if (e == NULL)
+ encoding = g_hash_table_lookup (encodings_hashtable, charset);
+ if (!encoding)
{
- encoding = terminal_encoding_new (-1,
- charset,
+ encoding = terminal_encoding_new (charset,
_("User Defined"),
+ TRUE,
TRUE /* scary! */);
- }
- else
- {
- encoding = terminal_encoding_is_valid (e) ? terminal_encoding_ref (e) : NULL;
+ g_hash_table_insert (encodings_hashtable, encoding->charset, encoding);
}
- if (encoding != NULL)
- {
- active_encodings = g_slist_prepend (active_encodings, encoding);
- }
+ if (!terminal_encoding_is_valid (encoding))
+ continue;
+
+ encoding->is_active = TRUE;
}
- /* Put it back in order, order is significant */
- active_encodings = g_slist_reverse (active_encodings);
-
- g_hash_table_destroy (table);
-
update_active_encoding_tree_models ();
}
+
+static void
+update_active_encodings_gconf (void)
+{
+ GSList *list, *l;
+ GSList *strings = NULL;
+ GConfClient *conf;
+
+ list = terminal_get_active_encodings ();
+ for (l = list; l != NULL; l = l->next)
+ {
+ TerminalEncoding *encoding = (TerminalEncoding *) l->data;
+
+ strings = g_slist_prepend (strings, encoding->charset);
+ }
+
+ conf = gconf_client_get_default ();
+ gconf_client_set_list (conf,
+ CONF_GLOBAL_PREFIX"/active_encodings",
+ GCONF_VALUE_STRING,
+ strings,
+ NULL);
+ g_object_unref (conf);
+
+ g_slist_free (strings);
+ g_slist_foreach (list, (GFunc) terminal_encoding_unref, NULL);
+ g_slist_free (list);
+}
+
+static void
+add_active_encoding_to_list (gpointer key,
+ gpointer value,
+ gpointer data)
+{
+ TerminalEncoding *encoding = (TerminalEncoding *) value;
+ GSList **list = (GSList **) data;
+
+ if (!encoding->is_active)
+ return;
+
+ *list = g_slist_prepend (*list, terminal_encoding_ref (encoding));
+}
+
/**
* terminal_get_active_encodings:
*
@@ -535,17 +378,16 @@
GSList*
terminal_get_active_encodings (void)
{
- GSList *copy;
+ GSList *list = NULL;
- copy = g_slist_copy (active_encodings);
- g_slist_foreach (copy, (GFunc) terminal_encoding_ref, NULL);
- return copy;
+ g_hash_table_foreach (encodings_hashtable, (GHFunc) add_active_encoding_to_list, &list);
+ return g_slist_reverse (list); /* FIXME sort ! */
}
static void
response_callback (GtkWidget *window,
int id,
- void *data)
+ EncodingDialogData *data)
{
if (id == GTK_RESPONSE_HELP)
terminal_util_show_help ("gnome-terminal-encoding-add", GTK_WINDOW (window));
@@ -557,314 +399,195 @@
{
COLUMN_NAME,
COLUMN_CHARSET,
+ COLUMN_DATA,
N_COLUMNS
};
static void
-count_selected_items_func (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data)
+selection_changed_cb (GtkTreeSelection *selection,
+ EncodingDialogData *data)
{
- int *count = data;
+ GtkWidget *button;
+ gboolean have_selection;
+
+ if (selection == data->available_selection)
+ button = data->add_button;
+ else if (selection == data->active_selection)
+ button = data->remove_button;
+ else
+ g_assert_not_reached ();
- *count += 1;
+ have_selection = gtk_tree_selection_get_selected (selection, NULL, NULL);
+ gtk_widget_set_sensitive (button, have_selection);
}
static void
-available_selection_changed_callback (GtkTreeSelection *selection,
- void *data)
+button_clicked_cb (GtkWidget *button,
+ EncodingDialogData *data)
{
- int count;
- GtkWidget *add_button;
- GtkWidget *dialog;
+ GtkTreeSelection *selection;
+ GtkTreeModel *model;
+ GtkTreeIter filter_iter, iter;
+ TerminalEncoding *encoding;
- dialog = data;
-
- count = 0;
- gtk_tree_selection_selected_foreach (selection,
- count_selected_items_func,
- &count);
+ if (button == data->add_button)
+ selection = data->available_selection;
+ else if (button == data->remove_button)
+ selection = data->active_selection;
+ else
+ g_assert_not_reached ();
- add_button = g_object_get_data (G_OBJECT (dialog), "encoding-dialog-add");
-
- gtk_widget_set_sensitive (add_button, count > 0);
-}
+ if (!gtk_tree_selection_get_selected (selection, &model, &filter_iter))
+ return;
-static void
-displayed_selection_changed_callback (GtkTreeSelection *selection,
- void *data)
-{
- int count;
- GtkWidget *remove_button;
- GtkWidget *dialog;
+ gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model),
+ &iter,
+ &filter_iter);
+
+ model = GTK_TREE_MODEL (data->base_store);
+ gtk_tree_model_get (model, &iter, COLUMN_DATA, &encoding, -1);
+ g_assert (encoding != NULL);
+
+ if (button == data->add_button)
+ encoding->is_active = TRUE;
+ else if (button == data->remove_button)
+ encoding->is_active = FALSE;
+ else
+ g_assert_not_reached ();
- dialog = data;
-
- count = 0;
- gtk_tree_selection_selected_foreach (selection,
- count_selected_items_func,
- &count);
+ terminal_encoding_unref (encoding);
- remove_button = g_object_get_data (G_OBJECT (dialog), "encoding-dialog-remove");
+ /* We don't need to emit row-changed here, since updating the gconf pref
+ * will update the models.
+ */
- gtk_widget_set_sensitive (remove_button, count > 0);
+ update_active_encodings_gconf ();
}
static void
-get_selected_encodings_func (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data)
-{
- GSList **list = data;
- char *charset;
-
- charset = NULL;
- gtk_tree_model_get (model,
- iter,
- COLUMN_CHARSET,
- &charset,
- -1);
+liststore_insert_encoding (gpointer key,
+ TerminalEncoding *encoding,
+ GtkListStore *store)
+{
+ GtkTreeIter iter;
- *list = g_slist_prepend (*list, charset);
+ if (!terminal_encoding_is_valid (encoding))
+ return;
+
+ gtk_list_store_insert_with_values (store, &iter, -1,
+ COLUMN_CHARSET,
+ encoding->charset,
+ COLUMN_NAME,
+ encoding->name,
+ COLUMN_DATA,
+ encoding,
+ -1);
}
static gboolean
-charset_in_encoding_list (GSList *list,
- const char *str)
+filter_active_encodings (GtkTreeModel *child_model,
+ GtkTreeIter *child_iter,
+ gpointer data)
{
- GSList *tmp;
-
- tmp = list;
- while (tmp != NULL)
- {
- const TerminalEncoding *enc = tmp->data;
-
- if (strcmp (enc->charset, str) == 0)
- return TRUE;
+ TerminalEncoding *encoding;
+ gboolean active = GPOINTER_TO_UINT (data);
+ gboolean visible;
- tmp = tmp->next;
- }
+ gtk_tree_model_get (child_model, child_iter, COLUMN_DATA, &encoding, -1);
+ visible = active ? encoding->is_active : !encoding->is_active;
+ terminal_encoding_unref (encoding);
- return FALSE;
+ return visible;
}
-static GSList*
-remove_string_from_list (GSList *list,
- const char *str)
+static GtkTreeModel *
+encodings_create_treemodel (GtkListStore *base_store,
+ gboolean active)
{
- GSList *tmp;
+ GtkTreeModel *model;
- tmp = list;
- while (tmp != NULL)
- {
- if (strcmp (tmp->data, str) == 0)
- break;
+ model = gtk_tree_model_filter_new (GTK_TREE_MODEL (base_store), NULL);
+ gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (model),
+ filter_active_encodings,
+ GUINT_TO_POINTER (active), NULL);
- tmp = tmp->next;
- }
-
- if (tmp != NULL)
- {
- g_free (tmp->data);
- list = g_slist_remove (list, tmp->data);
- }
-
- return list;
+ return model;
}
-static GSList*
-encoding_list_to_charset_list (GSList *src)
+static void
+update_single_liststore (EncodingDialogData *data)
{
- GSList *list;
- GSList *tmp;
-
- list = NULL;
- tmp = src;
- while (tmp != NULL)
- {
- const TerminalEncoding *enc = tmp->data;
-
- list = g_slist_prepend (list, g_strdup (enc->charset));
- tmp = tmp->next;
- }
- list = g_slist_reverse (list);
-
- return list;
+ gtk_list_store_clear (data->base_store);
+ g_hash_table_foreach (encodings_hashtable, (GHFunc) liststore_insert_encoding, data->base_store);
}
+static GSList *encoding_dialogs_data = NULL;
static void
-add_button_clicked_callback (GtkWidget *button,
- void *data)
+unregister_liststore (void *data,
+ GObject *where_object_was)
{
- GtkWidget *dialog;
- GtkWidget *treeview;
- GtkTreeSelection *selection;
- GSList *encodings;
- GSList *tmp;
- GSList *new_active_list;
- GConfClient *conf;
-
- dialog = data;
-
- treeview = g_object_get_data (G_OBJECT (dialog),
- "encoding-dialog-available-treeview");
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
-
- encodings = NULL;
- gtk_tree_selection_selected_foreach (selection,
- get_selected_encodings_func,
- &encodings);
-
- new_active_list = encoding_list_to_charset_list (active_encodings);
- tmp = encodings;
- while (tmp != NULL)
- {
- /* appending is less efficient but produces user-expected
- * result
- */
- if (!charset_in_encoding_list (active_encodings, tmp->data))
- new_active_list = g_slist_append (new_active_list,
- g_strdup (tmp->data));
-
- tmp = tmp->next;
- }
-
- /* this is reentrant, but only after it's done using the list
- * values, so should be safe
- */
- conf = gconf_client_get_default ();
- gconf_client_set_list (conf,
- CONF_GLOBAL_PREFIX"/active_encodings",
- GCONF_VALUE_STRING,
- new_active_list,
- NULL);
- g_object_unref (conf);
-
- g_slist_foreach (new_active_list, (GFunc) g_free, NULL);
- g_slist_free (new_active_list);
-
- g_slist_foreach (encodings, (GFunc) g_free, NULL);
- g_slist_free (encodings);
+ encoding_dialogs_data = g_slist_remove (encoding_dialogs_data, data);
}
static void
-remove_button_clicked_callback (GtkWidget *button,
- void *data)
+update_active_encoding_tree_models (void)
{
- GtkWidget *dialog;
- GtkWidget *treeview;
- GtkTreeSelection *selection;
- GSList *encodings;
- GSList *tmp;
- GSList *new_active_list;
- GConfClient *conf;
-
- dialog = data;
-
- treeview = g_object_get_data (G_OBJECT (dialog),
- "encoding-dialog-displayed-treeview");
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
-
- encodings = NULL;
- gtk_tree_selection_selected_foreach (selection,
- get_selected_encodings_func,
- &encodings);
-
- new_active_list = encoding_list_to_charset_list (active_encodings);
- tmp = encodings;
- while (tmp != NULL)
- {
- /* appending is less efficient but produces user-expected
- * result
- */
- new_active_list =
- remove_string_from_list (new_active_list, tmp->data);
-
- tmp = tmp->next;
- }
-
- /* this is reentrant, but only after it's done using the list
- * values, so should be safe
- */
- conf = gconf_client_get_default ();
- gconf_client_set_list (conf,
- CONF_GLOBAL_PREFIX"/active_encodings",
- GCONF_VALUE_STRING,
- new_active_list,
- NULL);
- g_object_unref (conf);
+ g_slist_foreach (encoding_dialogs_data, (GFunc) update_single_liststore, NULL);
+}
- g_slist_foreach (new_active_list, (GFunc) g_free, NULL);
- g_slist_free (new_active_list);
-
- g_slist_foreach (encodings, (GFunc) g_free, NULL);
- g_slist_free (encodings);
+static void
+register_liststore (EncodingDialogData *data)
+{
+ update_single_liststore (data);
+ encoding_dialogs_data = g_slist_prepend (encoding_dialogs_data, data);
+ g_object_weak_ref (G_OBJECT (data->dialog), unregister_liststore, data);
}
GtkWidget*
terminal_encoding_dialog_new (GtkWindow *transient_parent)
{
- GladeXML *xml;
- GtkWidget *w;
GtkCellRenderer *cell_renderer;
- int i;
- GtkListStore *store;
GtkTreeViewColumn *column;
- GtkTreeIter iter;
- GtkTreeSelection *selection;
- GtkWidget *dialog;
+ GtkTreeModel *model;
+ EncodingDialogData *data;
+
+ data = g_new (EncodingDialogData, 1);
+
+ if (!terminal_util_load_builder_file ("encodings-dialog.ui",
+ "encodings-dialog", &data->dialog,
+ "add-button", &data->add_button,
+ "remove-button", &data->remove_button,
+ "available-treeview", &data->available_tree_view,
+ "displayed-treeview", &data->active_tree_view,
+ NULL))
+ {
+ g_free (data);
+ return NULL;
+ }
+
+ g_object_set_data_full (G_OBJECT (data->dialog), "GT::Data", data, (GDestroyNotify) g_free);
- xml = terminal_util_load_glade_file (TERM_GLADE_FILE,
- "encodings-dialog",
- transient_parent);
- if (xml == NULL)
- return NULL;
-
- /* The dialog itself */
- dialog = glade_xml_get_widget (xml, "encodings-dialog");
-
- terminal_util_set_unique_role (GTK_WINDOW (dialog), "gnome-terminal-encodings");
-
- g_signal_connect (G_OBJECT (dialog), "response",
- G_CALLBACK (response_callback),
- NULL);
+ gtk_window_set_transient_for (GTK_WINDOW (data->dialog), transient_parent);
+ terminal_util_set_unique_role (GTK_WINDOW (data->dialog), "gnome-terminal-encodings");
+ g_signal_connect (data->dialog, "response",
+ G_CALLBACK (response_callback), data);
/* buttons */
- w = glade_xml_get_widget (xml, "add-button");
- g_object_set_data (G_OBJECT (dialog),
- "encoding-dialog-add",
- w);
-
- g_signal_connect (G_OBJECT (w), "clicked",
- G_CALLBACK (add_button_clicked_callback),
- dialog);
-
- w = glade_xml_get_widget (xml, "remove-button");
- g_object_set_data (G_OBJECT (dialog),
- "encoding-dialog-remove",
- w);
-
- g_signal_connect (G_OBJECT (w), "clicked",
- G_CALLBACK (remove_button_clicked_callback),
- dialog);
+ g_signal_connect (data->add_button, "clicked",
+ G_CALLBACK (button_clicked_cb), data);
+
+ g_signal_connect (data->remove_button, "clicked",
+ G_CALLBACK (button_clicked_cb), data);
/* Tree view of available encodings */
-
- w = glade_xml_get_widget (xml, "available-treeview");
- g_object_set_data (G_OBJECT (dialog),
- "encoding-dialog-available-treeview",
- w);
-
/* Column 1 */
cell_renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("_Description"),
cell_renderer,
"text", COLUMN_NAME,
NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (w), column);
+ gtk_tree_view_append_column (data->available_tree_view, column);
gtk_tree_view_column_set_sort_column_id (column, COLUMN_NAME);
/* Column 2 */
@@ -873,55 +596,23 @@
cell_renderer,
"text", COLUMN_CHARSET,
NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (w), column);
+ gtk_tree_view_append_column (data->available_tree_view, column);
gtk_tree_view_column_set_sort_column_id (column, COLUMN_CHARSET);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (w));
- gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection),
- GTK_SELECTION_MULTIPLE);
+ data->available_selection = gtk_tree_view_get_selection (data->available_tree_view);
+ gtk_tree_selection_set_mode (data->available_selection, GTK_SELECTION_BROWSE);
- store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
-
- for (i = 0; i < (int) G_N_ELEMENTS (encodings); ++i)
- {
- if (!terminal_encoding_is_valid (&encodings[i]))
- continue;
-
- gtk_list_store_insert_with_values (store, &iter, -1,
- COLUMN_CHARSET,
- encodings[i].charset,
- COLUMN_NAME,
- encodings[i].name,
- -1);
- }
-
- /* Now turn on sorting */
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
- COLUMN_NAME,
- GTK_SORT_ASCENDING);
-
- gtk_tree_view_set_model (GTK_TREE_VIEW (w), GTK_TREE_MODEL (store));
- g_object_unref (store);
-
- available_selection_changed_callback (selection, dialog);
- g_signal_connect (G_OBJECT (selection), "changed",
- G_CALLBACK (available_selection_changed_callback),
- dialog);
+ g_signal_connect (data->available_selection, "changed",
+ G_CALLBACK (selection_changed_cb), data);
/* Tree view of selected encodings */
-
- w = glade_xml_get_widget (xml, "displayed-treeview");
- g_object_set_data (G_OBJECT (dialog),
- "encoding-dialog-displayed-treeview",
- w);
-
/* Column 1 */
cell_renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("_Description"),
cell_renderer,
"text", COLUMN_NAME,
NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (w), column);
+ gtk_tree_view_append_column (data->active_tree_view, column);
gtk_tree_view_column_set_sort_column_id (column, COLUMN_NAME);
/* Column 2 */
@@ -930,90 +621,35 @@
cell_renderer,
"text", COLUMN_CHARSET,
NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (w), column);
+ gtk_tree_view_append_column (data->active_tree_view, column);
gtk_tree_view_column_set_sort_column_id (column, COLUMN_CHARSET);
/* Add the data */
- store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
- COLUMN_NAME,
- GTK_SORT_ASCENDING);
- gtk_tree_view_set_model (GTK_TREE_VIEW (w), GTK_TREE_MODEL (store));
- g_object_unref (store);
-
- register_active_encoding_treeview (GTK_TREE_VIEW (w));
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (w));
- gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection),
- GTK_SELECTION_MULTIPLE);
-
- displayed_selection_changed_callback (selection, dialog);
- g_signal_connect (G_OBJECT (selection), "changed",
- G_CALLBACK (displayed_selection_changed_callback),
- dialog);
- g_object_unref (G_OBJECT (xml));
-
- return dialog;
-}
-
-static void
-update_single_treeview (GtkTreeView *tree_view)
-{
- GtkListStore *store;
- GSList *tmp;
- GtkTreeIter iter;
+ data->active_selection = gtk_tree_view_get_selection (data->active_tree_view);
+ gtk_tree_selection_set_mode (data->active_selection, GTK_SELECTION_BROWSE);
- store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
-
- for (tmp = active_encodings; tmp != NULL; tmp = tmp->next)
- {
- TerminalEncoding *e = tmp->data;
-
- gtk_list_store_insert_with_values (store, &iter, -1,
- COLUMN_CHARSET,
- e->charset,
- COLUMN_NAME,
- e->name,
- -1);
- }
+ g_signal_connect (data->active_selection, "changed",
+ G_CALLBACK (selection_changed_cb), data);
+ data->base_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, TERMINAL_TYPE_ENCODING);
+ register_liststore (data);
/* Now turn on sorting */
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (data->base_store),
COLUMN_NAME,
GTK_SORT_ASCENDING);
- gtk_tree_view_set_model (tree_view, GTK_TREE_MODEL (store));
- g_object_unref (store);
-}
+ model = encodings_create_treemodel (data->base_store, FALSE);
+ gtk_tree_view_set_model (data->available_tree_view, model);
+ g_object_unref (model);
-static GSList *treeviews = NULL;
+ model = encodings_create_treemodel (data->base_store, TRUE);
+ gtk_tree_view_set_model (data->active_tree_view, model);
+ g_object_unref (model);
-static void
-unregister_treeview (void *data,
- GObject *where_object_was)
-{
- treeviews = g_slist_remove (treeviews, where_object_was);
-}
+ g_object_unref (data->base_store);
-static void
-update_active_encoding_tree_models (void)
-{
- GSList *tmp;
- tmp = treeviews;
- while (tmp != NULL)
- {
- update_single_treeview (tmp->data);
- tmp = tmp->next;
- }
-}
-
-static void
-register_active_encoding_treeview (GtkTreeView *tree_view)
-{
- update_single_treeview (tree_view);
- treeviews = g_slist_prepend (treeviews, tree_view);
- g_object_weak_ref (G_OBJECT (tree_view), unregister_treeview, NULL);
+ return data->dialog;
}
void
@@ -1021,23 +657,34 @@
{
GConfClient *conf;
guint i;
+ const char *locale_charset = NULL;
conf = gconf_client_get_default ();
- g_get_charset ((const char**)
- &encodings[TERMINAL_ENCODING_CURRENT_LOCALE].charset);
-
- g_assert (G_N_ELEMENTS (encodings) == TERMINAL_ENCODING_LAST);
+ encodings_hashtable = g_hash_table_new_full (g_str_hash, g_str_equal,
+ NULL,
+ (GDestroyNotify) terminal_encoding_unref);
- for (i = 0; i < TERMINAL_ENCODING_LAST; ++i)
+ if (!g_get_charset (&locale_charset))
{
- g_assert (encodings[i].index_ == i);
+ TerminalEncoding *encoding;
- /* Translate the names */
- encodings[i].name = _(encodings[i].name);
+ encoding = terminal_encoding_new (locale_charset,
+ _("Current Locale"),
+ FALSE,
+ TRUE);
+ g_hash_table_insert (encodings_hashtable, encoding->charset, encoding);
+ }
+
+ for (i = 0; i < G_N_ELEMENTS (encodings); ++i)
+ {
+ TerminalEncoding *encoding;
- if (i == TERMINAL_ENCODING_CURRENT_LOCALE)
- encodings[i].valid = encodings[i].validity_checked = TRUE;
+ encoding = terminal_encoding_new (encodings[i].charset,
+ _(encodings[i].name),
+ FALSE,
+ FALSE);
+ g_hash_table_insert (encodings_hashtable, encoding->charset, encoding);
}
gconf_client_notify_add (conf,
Modified: trunk/src/encoding.h
==============================================================================
--- trunk/src/encoding.h (original)
+++ trunk/src/encoding.h Thu May 29 19:40:09 2008
@@ -22,17 +22,17 @@
#ifndef TERMINAL_ENCODING_H
#define TERMINAL_ENCODING_H
-#include <gconf/gconf-client.h>
#include <gtk/gtkwindow.h>
typedef struct
{
- int index_;
- gboolean valid;
- char *charset;
- char *name;
- int refcount;
- gboolean validity_checked;
+ int refcount;
+ char *charset;
+ char *name;
+ guint valid : 1;
+ guint validity_checked : 1;
+ guint is_custom : 1;
+ guint is_active : 1;
} TerminalEncoding;
void terminal_encoding_init (void);
Added: trunk/src/encodings-dialog.ui
==============================================================================
--- (empty file)
+++ trunk/src/encodings-dialog.ui Thu May 29 19:40:09 2008
@@ -0,0 +1,282 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+ <object class="GtkDialog" id="encodings-dialog">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Add or Remove Terminal Encodings</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="default_height">325</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox3">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area3">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <object class="GtkButton" id="helpbutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-help</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton" id="closebutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTable" id="table33">
+ <property name="border_width">5</property>
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">3</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="available-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">A_vailable encodings:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">available-treeview</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ <accessibility>
+ <relation target="available-treeview" type="label-for"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+ <child>
+ <object class="GtkTreeView" id="available-treeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">True</property>
+ <property name="rules_hint">False</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">True</property>
+ <property name="fixed_height_mode">False</property>
+ <property name="hover_selection">False</property>
+ <property name="hover_expand">False</property>
+ <accessibility>
+ <relation target="available-label" type="labelled-by"/>
+ </accessibility>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="displayed-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">E_ncodings shown in menu:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">displayed-treeview</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+ <child>
+ <object class="GtkTreeView" id="displayed-treeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">True</property>
+ <property name="rules_hint">False</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">True</property>
+ <property name="fixed_height_mode">False</property>
+ <property name="hover_selection">False</property>
+ <property name="hover_expand">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox27">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+ <child>
+ <object class="GtkVBox" id="vbox87">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkButton" id="add-button">
+ <property name="visible">True</property>
+ <property name="tooltip-text" translatable="yes">Add encoding to menu.</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <child>
+ <object class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="stock">gtk-go-forward</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="remove-button">
+ <property name="visible">True</property>
+ <property name="tooltip-text" translatable="yes">Remove encoding from menu.</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <child>
+ <object class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="stock">gtk-go-back</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-11">helpbutton1</action-widget>
+ <action-widget response="-5">closebutton1</action-widget>
+ </action-widgets>
+ </object>
+</interface>
Modified: trunk/src/gnome-terminal.glade2
==============================================================================
--- trunk/src/gnome-terminal.glade2 (original)
+++ trunk/src/gnome-terminal.glade2 Thu May 29 19:40:09 2008
@@ -178,300 +178,6 @@
</child>
</widget>
-<widget class="GtkDialog" id="encodings-dialog">
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Add or Remove Terminal Encodings</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_height">325</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area3">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="helpbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-help</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-11</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="closebutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table33">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="available-label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">A_vailable encodings:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">available-treeview</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- <accessibility>
- <atkrelation target="available-treeview" type="label-for"/>
- </accessibility>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="available-treeview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</property>
- <accessibility>
- <atkrelation target="available-label" type="labelled-by"/>
- </accessibility>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="displayed-label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">E_ncodings shown in menu:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">displayed-treeview</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="displayed-treeview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox27">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkVBox" id="vbox87">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="add-button">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Add encoding to menu.</property>
- <property name="can_focus">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
-
- <child>
- <widget class="GtkImage" id="image3">
- <property name="visible">True</property>
- <property name="stock">gtk-go-forward</property>
- <property name="icon_size">4</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="remove-button">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Remove encoding from menu.</property>
- <property name="can_focus">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
-
- <child>
- <widget class="GtkImage" id="image4">
- <property name="visible">True</property>
- <property name="stock">gtk-go-back</property>
- <property name="icon_size">4</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
<widget class="GtkDialog" id="skey-dialog">
<property name="border_width">5</property>
<property name="title" translatable="yes"></property>
@@ -643,6 +349,7 @@
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
+ <property name="invisible_char">*</property>
<property name="activates_default">True</property>
</widget>
<packing>
@@ -873,6 +580,7 @@
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
+ <property name="invisible_char">*</property>
<property name="activates_default">False</property>
<property name="width_chars">14</property>
</widget>
@@ -1029,6 +737,7 @@
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
+ <property name="invisible_char">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
@@ -1264,6 +973,7 @@
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
+ <property name="invisible_char">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
@@ -1547,6 +1257,7 @@
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
+ <property name="invisible_char">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
@@ -1789,6 +1500,7 @@
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
+ <property name="invisible_char">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]