Package: ibus / 1.5.23-2

Warn-deprecated-IBus-XKB-engines-w-dialog.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Sat, 21 Nov 2020 07:41:23 +0900
Subject: [PATCH] ui/gtk3: Warn deprecated IBus XKB engines /w dialog
Origin: Concatenation of:
 * https://github.com/ibus/ibus/commit/5322c447
 * https://github.com/ibus/ibus/commit/aec2ac75
Bug-Ubuntu: https://launchpad.net/bugs/1901789

commit message 5322c447
simple.xml is updated by IBus release and some XKB engines
could be deprecated with xkeyboard-config updates.
Now a warning dialog is launched when the deprecated engines are
changed to xkb:us::eng engine.

commit message aec2ac75
This is a follow-up of commit 5322c447. That commit introduced
a warning dialog in case of an empty engines list.

This commit makes a differently worded warning dialog be shown
in cases where the engines list is not empty but preload-engines
includes at least one deprecated engine. It also fixes a variable
confusion so a deprecated engine is mentioned in the first kind
of warning dialog and not the US engine.

BUG=https://github.com/ibus/ibus/issues/2274
---
 po/ibus10.pot      | 37 ++++++++++++++++++++++++++++---------
 ui/gtk3/panel.vala | 31 +++++++++++++++++++++++++++----
 2 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/po/ibus10.pot b/po/ibus10.pot
index 55e8002..a1aecfc 100644
--- a/po/ibus10.pot
+++ b/po/ibus10.pot
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ibus 1.5.23\n"
 "Report-Msgid-Bugs-To: https://github.com/ibus/ibus/issues\n"
-"POT-Creation-Date: 2020-09-29 20:00+0900\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"POT-Creation-Date: 2020-12-11 16:21+0900\n"
+"PO-Revision-Date: 2020-12-11 16:21+0900\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "Language: \n"
@@ -403,7 +403,7 @@ msgstr ""
 msgid "Moreā€¦"
 msgstr ""
 
-#: setup/engineabout.py:37 setup/setup.ui:1368 ui/gtk3/panel.vala:1161
+#: setup/engineabout.py:37 setup/setup.ui:1368 ui/gtk3/panel.vala:1184
 msgid "About"
 msgstr ""
 
@@ -3173,7 +3173,7 @@ msgid "Alias: %s"
 msgstr ""
 
 #: ui/gtk3/emojier.vala:2140 ui/gtk3/ibus-extension-gtk3.desktop.in:3
-#: ui/gtk3/ibus-ui-emojier.desktop.in:3 ui/gtk3/panel.vala:1146
+#: ui/gtk3/ibus-ui-emojier.desktop.in:3 ui/gtk3/panel.vala:1169
 msgid "Emoji Choice"
 msgstr ""
 
@@ -3234,23 +3234,42 @@ msgstr ""
 msgid "IBus Panel"
 msgstr ""
 
-#: ui/gtk3/panel.vala:1118
+#: ui/gtk3/panel.vala:975
+#, c-format
+msgid ""
+"Your configured input method %s does not exist in IBus input methods so \"US"
+"\" layout was configured instead of your input method."
+msgstr ""
+
+#: ui/gtk3/panel.vala:980
+msgid ""
+"At least one of your configured input methods does not exist in IBus input "
+"methods."
+msgstr ""
+
+#: ui/gtk3/panel.vala:983
+msgid ""
+"Please run `ibus-setup` command, open \"Input Method\" tab, and configure "
+"your input methods again."
+msgstr ""
+
+#: ui/gtk3/panel.vala:1141
 msgid "IBus is an intelligent input bus for Linux/Unix."
 msgstr ""
 
-#: ui/gtk3/panel.vala:1122
+#: ui/gtk3/panel.vala:1145
 msgid "translator-credits"
 msgstr ""
 
-#: ui/gtk3/panel.vala:1141
+#: ui/gtk3/panel.vala:1164
 msgid "Preferences"
 msgstr ""
 
-#: ui/gtk3/panel.vala:1167
+#: ui/gtk3/panel.vala:1190
 msgid "Restart"
 msgstr ""
 
-#: ui/gtk3/panel.vala:1171
+#: ui/gtk3/panel.vala:1194
 msgid "Quit"
 msgstr ""
 
diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
index 627e26a..ab2005d 100644
--- a/ui/gtk3/panel.vala
+++ b/ui/gtk3/panel.vala
@@ -966,10 +966,33 @@ class Panel : IBus.PanelService {
         /* Fedora internal patch could save engines not in simple.xml
          * likes 'xkb:cn::chi'.
          */
-        if (engines.length == 0) {
-            names =  {"xkb:us::eng"};
-            m_settings_general.set_strv("preload-engines", names);
-            engines = m_bus.get_engines_by_names(names);
+        if (engines.length < names.length) {
+            string message1;
+            if (engines.length == 0) {
+                string[] fallback_names = {"xkb:us::eng"};
+                m_settings_general.set_strv("preload-engines", fallback_names);
+                engines = m_bus.get_engines_by_names(fallback_names);
+                message1 = _("Your configured input method %s does not exist " +
+                             "in IBus input methods so \"US\" layout was " +
+                             "configured instead of your input method."
+                            ).printf(names[0]);
+            } else {
+                message1 = _("At least one of your configured input methods " +
+                             "does not exist in IBus input methods.");
+            }
+            var message2 = _("Please run `ibus-setup` command, open \"Input " +
+                             "Method\" tab, and configure your input methods " +
+                             "again.");
+            var dialog = new Gtk.MessageDialog(
+                    null,
+                    Gtk.DialogFlags.DESTROY_WITH_PARENT,
+                    Gtk.MessageType.WARNING,
+                    Gtk.ButtonsType.CLOSE,
+                    "%s %s", message1, message2);
+            dialog.response.connect((id) => {
+                    dialog.destroy();
+            });
+            dialog.show_all();
 	}
 
         if (m_engines.length == 0) {