diff options
author | William Hua <william.hua@canonical.com> | 2013-04-02 17:33:46 -0400 |
---|---|---|
committer | William Hua <william.hua@canonical.com> | 2013-04-02 17:33:46 -0400 |
commit | 0817b1fad80603879e7a25981fe87ce162eaaa7d (patch) | |
tree | eadc884838ab0f60beefa1a36189ea29cbaedeaa | |
parent | 9d04807fffd9ed6eda2cbbb0d65eeb64a209c3bd (diff) | |
download | ayatana-indicator-keyboard-0817b1fad80603879e7a25981fe87ce162eaaa7d.tar.gz ayatana-indicator-keyboard-0817b1fad80603879e7a25981fe87ce162eaaa7d.tar.bz2 ayatana-indicator-keyboard-0817b1fad80603879e7a25981fe87ce162eaaa7d.zip |
Fix display name of IBus engines.
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | lib/main.vala | 21 |
2 files changed, 17 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index a5f077d0..ecd5a7b9 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ AC_PROG_INSTALL PKG_PROG_PKG_CONFIG([0.26]) AC_ARG_WITH([dbus-service-dir], [AS_HELP_STRING([--with-dbus-service-dir=DIR], [D-Bus service directory [default=`pkg-config --variable=session_bus_services_dir dbus-1`]])], [], [with_dbus_service_dir=`pkg-config --variable=session_bus_services_dir dbus-1`]) -AC_ARG_WITH([indicator-dir], [AS_HELP_STRING([--with-indicator-dir=DIR], [Indicator directory [default=$sysconfdir/indicators]])], [], [with_indicator_dir=$sysconfdir/indicators]) +AC_ARG_WITH([indicator-dir], [AS_HELP_STRING([--with-indicator-dir=DIR], [Indicator directory [default=$prefix/share/unity/indicators]])], [], [with_indicator_dir=$prefix/share/unity/indicators]) AC_SUBST([DBUS_SERVICE_DIR], [$with_dbus_service_dir]) AC_SUBST([INDICATOR_DIR], [$with_indicator_dir]) diff --git a/lib/main.vala b/lib/main.vala index 97315f96..b5b735b5 100644 --- a/lib/main.vala +++ b/lib/main.vala @@ -123,19 +123,30 @@ public class Indicator.Keyboard.Service : Object { var language = Xkl.get_language_name (name); var country = Xkl.get_country_name (name); - if (language != null && country != null) + if (language != null && country != null) { name = @"$language ($country)"; - else if (language != null) + } else if (language != null) { name = language; - else if (country != null) + } else if (country != null) { name = country; + } } else if (type == "ibus") { var ibus = get_ibus (); string[] names = { name, null }; var engines = ibus.get_engines_by_names (names); - - name = engines[0].longname; + var engine = engines[0]; + var longname = engine.longname; + var language = Xkl.get_language_name (engine.language); + var country = Xkl.get_country_name (engine.language); + + if (language != null) { + name = @"$language ($longname)"; + } else if (country != null) { + name = @"$country ($longname)"; + } else { + name = longname; + } } var menu_item = new MenuItem (name, "indicator.current"); |