update setup dialog
authorPeng Wu <alexepico@gmail.com>
Mon, 26 Mar 2012 05:58:35 +0000 (13:58 +0800)
committerPeng Wu <alexepico@gmail.com>
Mon, 26 Mar 2012 05:58:35 +0000 (13:58 +0800)
configure.ac
setup/Makefile.am
setup/ibus-setup-libpinyin.in [new file with mode: 0644]
setup/main2.py
src/PYPBopomofoEngine.cc
src/PYPPinyinEngine.cc

index 02de9b7..3b63a2b 100644 (file)
@@ -220,6 +220,7 @@ src/Makefile
 src/pinyin.xml.in
 setup/Makefile
 setup/ibus-setup-pinyin
+setup/ibus-setup-libpinyin
 setup/version.py
 data/Makefile
 data/db/Makefile
index 565e5d4..b73f375 100644 (file)
 
 setup_pinyin_PYTHON = \
        main.py \
+       main2.py \
        version.py \
        ibus-pinyin-preferences.ui \
+       ibus-libpinyin-preferences.ui \
        $(NULL)
+
 setup_pinyindir = $(datadir)/ibus-pinyin/setup
 
-libexec_SCRIPTS = ibus-setup-pinyin
+libexec_SCRIPTS = \
+       ibus-setup-pinyin \
+       ibus-setup-libpinyin \
+       $(NULL)
 
 CLEANFILES = \
        *.pyc \
@@ -34,6 +40,7 @@ CLEANFILES = \
 EXTRA_DIST = \
        version.py.in \
        ibus-setup-pinyin.in \
+       ibus-setup-libpinyin.in \
        $(NULL)
 
 test-pinyin:
@@ -47,3 +54,15 @@ test-bopomofo:
                   IBUS_LOCALEDIR=@localedir@ \
                   PYTHONPATH=$(abs_top_srcdir):$(pyexecdir) \
                   $(PYTHON) $(srcdir)/main.py bopomofo
+
+test-libpinyin:
+       $(ENV) DBUS_DEBUG=true \
+                  IBUS_LOCALEDIR=@localedir@ \
+                  PYTHONPATH=$(abs_top_srcdir):$(pyexecdir) \
+                  $(PYTHON) $(srcdir)/main2.py pinyin
+
+test-libbopomofo:
+       $(ENV) DBUS_DEBUG=true \
+                  IBUS_LOCALEDIR=@localedir@ \
+                  PYTHONPATH=$(abs_top_srcdir):$(pyexecdir) \
+                  $(PYTHON) $(srcdir)/main2.py bopomofo
diff --git a/setup/ibus-setup-libpinyin.in b/setup/ibus-setup-libpinyin.in
new file mode 100644 (file)
index 0000000..036ab3e
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+# vim:set noet ts=4:
+#
+# ibus-tmpl - The Input Bus template project
+#
+# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datarootdir=@datarootdir@
+export IBUS_PREFIX=@prefix@
+export IBUS_DATAROOTDIR=@datarootdir@
+export IBUS_LOCALEDIR=@localedir@
+cd @prefix@/share/ibus-pinyin/setup/
+exec python main2.py $@
+
index a21acad..1280c2b 100644 (file)
@@ -41,7 +41,7 @@ class PreferencesDialog:
         self.__config = self.__bus.get_config()
         self.__builder = gtk.Builder()
         self.__builder.set_translation_domain("ibus-pinyin")
-        self.__builder.add_from_file("ibus-pinyin-preferences.ui")
+        self.__builder.add_from_file("ibus-libpinyin-preferences.ui")
         self.__dialog = self.__builder.get_object("dialog")
         self.__init_pages()
         
index 6e5df67..05c5931 100644 (file)
@@ -183,7 +183,7 @@ inline void
 LibPinyinBopomofoEngine::showSetupDialog (void)
 {
     g_spawn_command_line_async
-        (LIBEXECDIR"/ibus-setup-pinyin bopomofo --libpinyin", NULL);
+        (LIBEXECDIR"/ibus-setup-libpinyin bopomofo", NULL);
 }
 
 gboolean
index 30131c2..f8e721c 100644 (file)
@@ -249,7 +249,7 @@ inline void
 LibPinyinPinyinEngine::showSetupDialog (void)
 {
     g_spawn_command_line_async
-        (LIBEXECDIR"/ibus-setup-pinyin pinyin --libpinyin", NULL);
+        (LIBEXECDIR"/ibus-setup-libpinyin pinyin", NULL);
 }
 
 gboolean