diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/0001-Remove-Install-Unlisted-Engines-function.patch b/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/0001-Remove-Install-Unlisted-Engines-function.patch deleted file mode 100644 index ead8bafaa125..000000000000 --- a/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/0001-Remove-Install-Unlisted-Engines-function.patch +++ /dev/null @@ -1,700 +0,0 @@ -From f23363ad2fa402d59b41ffe2c13a46462c6d2194 Mon Sep 17 00:00:00 2001 -From: Bobby Rong -Date: Fri, 16 Jul 2021 23:28:56 +0800 -Subject: [PATCH] Remove Install Unlisted Engines function - -https://github.com/elementary/switchboard-plug-keyboard/issues/324 - -Co-Authored-By: WORLDofPEACE - ---- - src/Dialogs/InstallEngineDialog.vala | 140 ----------------- - src/Dialogs/ProgressDialog.vala | 82 ---------- - src/InputMethod/Installer/InstallList.vala | 73 --------- - .../Installer/UbuntuInstaller.vala | 142 ------------------ - src/InputMethod/Installer/aptd-client.vala | 93 ------------ - .../InputMethod/AddEnginesPopover.vala | 12 -- - src/Widgets/InputMethod/LanguagesRow.vala | 43 ------ - src/meson.build | 6 - - 8 files changed, 591 deletions(-) - delete mode 100644 src/Dialogs/InstallEngineDialog.vala - delete mode 100644 src/Dialogs/ProgressDialog.vala - delete mode 100644 src/InputMethod/Installer/InstallList.vala - delete mode 100644 src/InputMethod/Installer/UbuntuInstaller.vala - delete mode 100644 src/InputMethod/Installer/aptd-client.vala - delete mode 100644 src/Widgets/InputMethod/LanguagesRow.vala - -diff --git a/src/Dialogs/InstallEngineDialog.vala b/src/Dialogs/InstallEngineDialog.vala -deleted file mode 100644 -index ffba3a8..0000000 ---- a/src/Dialogs/InstallEngineDialog.vala -+++ /dev/null -@@ -1,140 +0,0 @@ --/* --* Copyright 2019-2020 elementary, Inc. (https://elementary.io) --* --* 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 3 of the License, 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, see . --*/ -- --public class Pantheon.Keyboard.InputMethodPage.InstallEngineDialog : Granite.MessageDialog { -- private InstallList? engines_filter; -- -- public InstallEngineDialog (Gtk.Window parent) { -- Object ( -- primary_text: _("Choose an engine to install"), -- secondary_text: _("Select an engine from the list to install and use."), -- image_icon: new ThemedIcon ("extension"), -- transient_for: parent, -- buttons: Gtk.ButtonsType.CANCEL -- ); -- } -- -- construct { -- var languages_list = new Gtk.ListBox () { -- activate_on_single_click = true, -- expand = true, -- selection_mode = Gtk.SelectionMode.NONE -- }; -- -- foreach (var language in InstallList.get_all ()) { -- var lang = new LanguagesRow (language); -- languages_list.add (lang); -- } -- -- var back_button = new Gtk.Button.with_label (_("Languages")) { -- halign = Gtk.Align.START, -- margin = 6 -- }; -- back_button.get_style_context ().add_class (Granite.STYLE_CLASS_BACK_BUTTON); -- -- var language_title = new Gtk.Label (""); -- -- var language_header = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6); -- language_header.pack_start (back_button); -- language_header.set_center_widget (language_title); -- -- var listbox = new Gtk.ListBox () { -- expand = true -- }; -- listbox.set_filter_func (filter_function); -- listbox.set_sort_func (sort_function); -- -- foreach (var language in InstallList.get_all ()) { -- foreach (var engine in language.get_components ()) { -- listbox.add (new EnginesRow (engine)); -- } -- } -- -- var scrolled = new Gtk.ScrolledWindow (null, null); -- scrolled.add (listbox); -- -- var engine_list_grid = new Gtk.Grid () { -- orientation = Gtk.Orientation.VERTICAL -- }; -- engine_list_grid.get_style_context ().add_class (Gtk.STYLE_CLASS_VIEW); -- engine_list_grid.add (language_header); -- engine_list_grid.add (new Gtk.Separator (Gtk.Orientation.HORIZONTAL)); -- engine_list_grid.add (scrolled); -- -- var stack = new Gtk.Stack () { -- height_request = 200, -- width_request = 300, -- transition_type = Gtk.StackTransitionType.SLIDE_LEFT_RIGHT -- }; -- stack.add (languages_list); -- stack.add (engine_list_grid); -- -- var frame = new Gtk.Frame (null); -- frame.add (stack); -- -- custom_bin.add (frame); -- custom_bin.show_all (); -- -- var install_button = add_button (_("Install"), Gtk.ResponseType.OK); -- install_button.sensitive = false; -- install_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); -- -- languages_list.row_activated.connect ((row) => { -- stack.visible_child = engine_list_grid; -- language_title.label = ((LanguagesRow) row).language.get_name (); -- engines_filter = ((LanguagesRow) row).language; -- listbox.invalidate_filter (); -- var adjustment = scrolled.get_vadjustment (); -- adjustment.set_value (adjustment.lower); -- }); -- -- back_button.clicked.connect (() => { -- stack.visible_child = languages_list; -- install_button.sensitive = false; -- }); -- -- listbox.selected_rows_changed.connect (() => { -- foreach (var engines_row in listbox.get_children ()) { -- ((EnginesRow) engines_row).selected = false; -- } -- -- ((EnginesRow) listbox.get_selected_row ()).selected = true; -- install_button.sensitive = true; -- }); -- -- response.connect ((response_id) => { -- if (response_id == Gtk.ResponseType.OK) { -- string engine_to_install = ((EnginesRow) listbox.get_selected_row ()).engine_name; -- UbuntuInstaller.get_default ().install (engine_to_install); -- } -- }); -- } -- -- [CCode (instance_pos = -1)] -- private bool filter_function (Gtk.ListBoxRow row) { -- if (InstallList.get_language_from_engine_name (((EnginesRow) row).engine_name) == engines_filter) { -- return true; -- } -- -- return false; -- } -- -- [CCode (instance_pos = -1)] -- private int sort_function (Gtk.ListBoxRow row1, Gtk.ListBoxRow row2) { -- return ((EnginesRow) row1).engine_name.collate (((EnginesRow) row1).engine_name); -- } --} -diff --git a/src/Dialogs/ProgressDialog.vala b/src/Dialogs/ProgressDialog.vala -deleted file mode 100644 -index 868f167..0000000 ---- a/src/Dialogs/ProgressDialog.vala -+++ /dev/null -@@ -1,82 +0,0 @@ --/* --* Copyright 2011-2020 elementary, Inc. (https://elementary.io) --* --* This program is free software: you can redistribute it --* and/or modify it under the terms of the GNU Lesser General Public License as --* published by the Free Software Foundation, either version 3 of the --* License, 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, see http://www.gnu.org/licenses/. --*/ -- --public class Pantheon.Keyboard.InputMethodPage.ProgressDialog : Granite.Dialog { -- public int progress { -- set { -- if (value >= 100) { -- destroy (); -- } -- -- progress_bar.fraction = value / 100.0; -- } -- } -- -- private Gtk.ProgressBar progress_bar; -- -- construct { -- var image = new Gtk.Image.from_icon_name ("preferences-desktop-locale", Gtk.IconSize.DIALOG) { -- valign = Gtk.Align.START -- }; -- -- var primary_label = new Gtk.Label (null) { -- max_width_chars = 50, -- wrap = true, -- xalign = 0 -- }; -- primary_label.get_style_context ().add_class (Granite.STYLE_CLASS_PRIMARY_LABEL); -- -- unowned UbuntuInstaller installer = UbuntuInstaller.get_default (); -- switch (installer.transaction_mode) { -- case UbuntuInstaller.TransactionMode.INSTALL: -- primary_label.label = _("Installing %s").printf (installer.engine_to_address); -- break; -- case UbuntuInstaller.TransactionMode.REMOVE: -- primary_label.label = _("Removing %s").printf (installer.engine_to_address); -- break; -- } -- -- progress_bar = new Gtk.ProgressBar () { -- hexpand = true, -- valign = Gtk.Align.START, -- width_request = 300 -- }; -- -- var cancel_button = (Gtk.Button) add_button (_("Cancel"), 0); -- -- installer.bind_property ("install-cancellable", cancel_button, "sensitive"); -- -- var grid = new Gtk.Grid () { -- column_spacing = 12, -- margin = 6, -- row_spacing = 6 -- }; -- grid.attach (image, 0, 0, 1, 2); -- grid.attach (primary_label, 1, 0); -- grid.attach (progress_bar, 1, 1); -- grid.show_all (); -- -- border_width = 6; -- deletable = false; -- get_content_area ().add (grid); -- -- cancel_button.clicked.connect (() => { -- installer.cancel_install (); -- destroy (); -- }); -- } --} -diff --git a/src/InputMethod/Installer/InstallList.vala b/src/InputMethod/Installer/InstallList.vala -deleted file mode 100644 -index 275c302..0000000 ---- a/src/InputMethod/Installer/InstallList.vala -+++ /dev/null -@@ -1,75 +0,0 @@ --/* --* 2019-2020 elementary, Inc. (https://elementary.io) --* --* 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 3 of the License, 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, see . --*/ -- --public enum Pantheon.Keyboard.InputMethodPage.InstallList { -- JA, -- KO, -- ZH; -- -- public string get_name () { -- switch (this) { -- case JA: -- return _("Japanese"); -- case KO: -- return _("Korean"); -- case ZH: -- return _("Chinese"); -- default: -- assert_not_reached (); -- } -- } -- -- public string[] get_components () { -- switch (this) { -- case JA: -- return { "ibus-anthy", "ibus-mozc", "ibus-skk" }; -- case KO: -- return { "ibus-hangul" }; -- case ZH: -- return { "ibus-cangjie", "ibus-chewing", "ibus-pinyin", "ibus-rime" }; -- default: -- assert_not_reached (); -- } -- } -- -- public static InstallList get_language_from_engine_name (string engine_name) { -- switch (engine_name) { -- case "ibus-anthy": -- return JA; -- case "ibus-mozc": -- return JA; -- case "ibus-skk": -- return JA; -- case "ibus-hangul": -- return KO; -- case "ibus-cangjie": -- return ZH; -- case "ibus-chewing": -- return ZH; -- case "ibus-pinyin": -- return ZH; -- case "ibus-rime": -- return ZH; -- default: -- assert_not_reached (); -- } -- } -- -- public static InstallList[] get_all () { -- return { JA, KO, ZH }; -- } --} -diff --git a/src/InputMethod/Installer/UbuntuInstaller.vala b/src/InputMethod/Installer/UbuntuInstaller.vala -deleted file mode 100644 -index b65aa1f..0000000 ---- a/src/InputMethod/Installer/UbuntuInstaller.vala -+++ /dev/null -@@ -1,142 +0,0 @@ --/* --* Copyright 2011-2020 elementary, Inc. (https://elementary.io) --* --* This program is free software: you can redistribute it --* and/or modify it under the terms of the GNU Lesser General Public License as --* published by the Free Software Foundation, either version 3 of the --* License, 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, see http://www.gnu.org/licenses/. --*/ -- --public class Pantheon.Keyboard.InputMethodPage.UbuntuInstaller : Object { -- private AptdProxy aptd; -- private AptdTransactionProxy proxy; -- -- public bool install_cancellable { get; private set; } -- public TransactionMode transaction_mode { get; private set; } -- public string engine_to_address { get; private set; } -- -- public signal void install_finished (string langcode); -- public signal void install_failed (); -- public signal void remove_finished (string langcode); -- public signal void progress_changed (int progress); -- -- public enum TransactionMode { -- INSTALL, -- REMOVE, -- INSTALL_MISSING, -- } -- -- Gee.HashMap transactions; -- -- private static GLib.Once instance; -- public static unowned UbuntuInstaller get_default () { -- return instance.once (() => { -- return new UbuntuInstaller (); -- }); -- } -- -- private UbuntuInstaller () {} -- -- construct { -- transactions = new Gee.HashMap (); -- aptd = new AptdProxy (); -- -- try { -- aptd.connect_to_aptd (); -- } catch (Error e) { -- warning ("Could not connect to APT daemon"); -- } -- } -- -- public void install (string engine_name) { -- transaction_mode = TransactionMode.INSTALL; -- engine_to_address = engine_name; -- string[] packages = {}; -- packages += engine_to_address; -- -- foreach (var packet in packages) { -- message ("Packet: %s", packet); -- } -- -- aptd.install_packages.begin (packages, (obj, res) => { -- try { -- var transaction_id = aptd.install_packages.end (res); -- transactions.@set (transaction_id, "i-" + engine_name); -- run_transaction (transaction_id); -- } catch (Error e) { -- warning ("Could not queue downloads: %s", e.message); -- } -- }); -- } -- -- public void cancel_install () { -- if (install_cancellable) { -- warning ("cancel_install"); -- try { -- proxy.cancel (); -- } catch (Error e) { -- warning ("cannot cancel installation:%s", e.message); -- } -- } -- } -- -- private void run_transaction (string transaction_id) { -- proxy = new AptdTransactionProxy (); -- proxy.finished.connect (() => { -- on_apt_finshed (transaction_id, true); -- }); -- -- proxy.property_changed.connect ((prop, val) => { -- if (prop == "Progress") { -- progress_changed ((int) val.get_int32 ()); -- } -- -- if (prop == "Cancellable") { -- install_cancellable = val.get_boolean (); -- } -- }); -- -- try { -- proxy.connect_to_aptd (transaction_id); -- proxy.simulate (); -- -- proxy.run (); -- } catch (Error e) { -- on_apt_finshed (transaction_id, false); -- warning ("Could no run transaction: %s", e.message); -- } -- } -- -- private void on_apt_finshed (string id, bool success) { -- if (!success) { -- install_failed (); -- transactions.unset (id); -- return; -- } -- -- if (!transactions.has_key (id)) { //transaction already removed -- return; -- } -- -- var action = transactions.get (id); -- var lang = action[2:action.length]; -- -- message ("ID %s -> %s", id, success ? "success" : "failed"); -- -- if (action[0:1] == "i") { // install -- install_finished (lang); -- } else { -- remove_finished (lang); -- } -- -- transactions.unset (id); -- } --} -diff --git a/src/InputMethod/Installer/aptd-client.vala b/src/InputMethod/Installer/aptd-client.vala -deleted file mode 100644 -index ee5c3f5..0000000 ---- a/src/InputMethod/Installer/aptd-client.vala -+++ /dev/null -@@ -1,93 +0,0 @@ --/* -- * Copyright (C) 2012 Canonical Ltd -- * -- * This program is free software: you can redistribute it and/or modify -- * it under the terms of the GNU General Public License version 3 as -- * published by the Free Software Foundation. -- * -- * 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, see . -- * -- * Authored by Pawel Stolowski -- */ -- --namespace Pantheon.Keyboard.InputMethodPage { -- private const string APTD_DBUS_NAME = "org.debian.apt"; -- private const string APTD_DBUS_PATH = "/org/debian/apt"; -- -- /** -- * Expose a subset of org.debian.apt interfaces -- only what's needed by applications lens. -- */ -- [DBus (name = "org.debian.apt")] -- public interface AptdService : GLib.Object { -- public abstract async string install_packages (string[] packages) throws GLib.Error; -- public abstract async string remove_packages (string[] packages) throws GLib.Error; -- public abstract async void quit () throws GLib.Error; -- } -- -- [DBus (name = "org.debian.apt.transaction")] -- public interface AptdTransactionService : GLib.Object { -- public abstract void run () throws GLib.Error; -- public abstract void simulate () throws GLib.Error; -- public abstract void cancel () throws GLib.Error; -- public signal void finished (string exit_state); -- public signal void property_changed (string property, Variant val); -- } -- -- public class AptdProxy : GLib.Object { -- private AptdService _aptd_service; -- -- public void connect_to_aptd () throws GLib.Error { -- _aptd_service = Bus.get_proxy_sync (BusType.SYSTEM, APTD_DBUS_NAME, APTD_DBUS_PATH); -- } -- -- public async string install_packages (string[] packages) throws GLib.Error { -- string res = yield _aptd_service.install_packages (packages); -- return res; -- } -- -- public async string remove_packages (string[] packages) throws GLib.Error { -- string res = yield _aptd_service.remove_packages (packages); -- return res; -- } -- -- public async void quit () throws GLib.Error { -- yield _aptd_service.quit (); -- } -- } -- -- public class AptdTransactionProxy : GLib.Object { -- public signal void finished (string transaction_id); -- public signal void property_changed (string property, Variant variant); -- -- private AptdTransactionService _aptd_service; -- -- public void connect_to_aptd (string transaction_id) throws GLib.Error { -- _aptd_service = Bus.get_proxy_sync (BusType.SYSTEM, APTD_DBUS_NAME, transaction_id); -- _aptd_service.finished.connect ((exit_state) => { -- debug ("aptd transaction finished: %s\n", exit_state); -- finished (transaction_id); -- }); -- _aptd_service.property_changed.connect ((prop, variant) => { -- property_changed (prop, variant); -- }); -- } -- -- public void simulate () throws GLib.Error { -- _aptd_service.simulate (); -- } -- -- public void run () throws GLib.Error { -- _aptd_service.run (); -- } -- -- public void cancel () throws GLib.Error { -- _aptd_service.cancel (); -- } -- } --} -diff --git a/src/Widgets/InputMethod/AddEnginesPopover.vala b/src/Widgets/InputMethod/AddEnginesPopover.vala -index 110bc1d..8a03ca8 100644 ---- a/src/Widgets/InputMethod/AddEnginesPopover.vala -+++ b/src/Widgets/InputMethod/AddEnginesPopover.vala -@@ -43,8 +43,6 @@ public class Pantheon.Keyboard.InputMethodPage.AddEnginesPopover : Gtk.Popover { - }; - scrolled.add (listbox); - -- var install_button = new Gtk.Button.with_label (_("Install Unlisted Engines…")); -- - var cancel_button = new Gtk.Button.with_label (_("Cancel")); - - var add_button = new Gtk.Button.with_label (_("Add Engine")); -@@ -55,10 +53,8 @@ public class Pantheon.Keyboard.InputMethodPage.AddEnginesPopover : Gtk.Popover { - margin = 12, - spacing = 6 - }; -- button_box.add (install_button); - button_box.add (cancel_button); - button_box.add (add_button); -- button_box.set_child_secondary (install_button, true); - - var grid = new Gtk.Grid (); - grid.attach (search_entry, 0, 0); -@@ -88,14 +84,6 @@ public class Pantheon.Keyboard.InputMethodPage.AddEnginesPopover : Gtk.Popover { - listbox.invalidate_filter (); - }); - -- install_button.clicked.connect (() => { -- popdown (); -- -- var install_dialog = new InstallEngineDialog ((Gtk.Window) get_toplevel ()); -- install_dialog.run (); -- install_dialog.destroy (); -- }); -- - cancel_button.clicked.connect (() => { - popdown (); - }); -diff --git a/src/Widgets/InputMethod/LanguagesRow.vala b/src/Widgets/InputMethod/LanguagesRow.vala -deleted file mode 100644 -index dc064ae..0000000 ---- a/src/Widgets/InputMethod/LanguagesRow.vala -+++ /dev/null -@@ -1,43 +0,0 @@ --/* --* 2019-2020 elementary, Inc. (https://elementary.io) --* --* 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 3 of the License, 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, see . --*/ -- --public class Pantheon.Keyboard.InputMethodPage.LanguagesRow : Gtk.ListBoxRow { -- public InstallList language { get; construct; } -- -- public LanguagesRow (InstallList language) { -- Object (language: language); -- } -- -- construct { -- var label = new Gtk.Label (language.get_name ()) { -- halign = Gtk.Align.START, -- hexpand = true -- }; -- -- var caret = new Gtk.Image.from_icon_name ("pan-end-symbolic", Gtk.IconSize.MENU); -- -- var grid = new Gtk.Grid () { -- margin = 3, -- margin_start = 6, -- margin_end = 6 -- }; -- grid.add (label); -- grid.add (caret); -- -- add (grid); -- } --} -diff --git a/src/meson.build b/src/meson.build -index 77a51d0..26711c5 100644 ---- a/src/meson.build -+++ b/src/meson.build -@@ -17,7 +17,6 @@ plug_files = files( - 'Widgets/Layout/Display.vala', - 'Widgets/Layout/AdvancedSettingsPanel.vala', - 'Widgets/Layout/AdvancedSettingsGrid.vala', -- 'Widgets/InputMethod/LanguagesRow.vala', - 'Widgets/InputMethod/EnginesRow.vala', - 'Widgets/InputMethod/AddEnginesPopover.vala', - 'Views/Shortcuts.vala', -@@ -33,11 +32,6 @@ plug_files = files( - 'InputSources/SourceSettings.vala', - 'InputSources/InputSource.vala', - 'InputMethod/AddEnginesList.vala', -- 'InputMethod/Installer/UbuntuInstaller.vala', -- 'InputMethod/Installer/InstallList.vala', -- 'InputMethod/Installer/aptd-client.vala', -- 'Dialogs/ProgressDialog.vala', -- 'Dialogs/InstallEngineDialog.vala', - 'Dialogs/ConflictDialog.vala', - 'Dialogs/AddLayoutDialog.vala' - ) diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/default.nix b/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/default.nix index 154a8b65a5cc..f6512a8a8d74 100644 --- a/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/default.nix +++ b/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/default.nix @@ -23,17 +23,20 @@ stdenv.mkDerivation rec { pname = "switchboard-plug-keyboard"; - version = "3.2.0"; + version = "3.2.1"; src = fetchFromGitHub { owner = "elementary"; repo = pname; rev = version; - sha256 = "sha256-X5EGDS8/EazIHiDBHCisd+XPE9dMx/0lQ8hrz9imUno="; + sha256 = "sha256-4LfS2F8pLbZw+HhnEVmZqbEaNCM96q+lqnf4sUBDVJI="; }; patches = [ - ./0001-Remove-Install-Unlisted-Engines-function.patch + # This will try to install packages with apt. + # https://github.com/elementary/switchboard-plug-keyboard/issues/324 + ./hide-install-unlisted-engines-button.patch + (substituteAll { src = ./fix-paths.patch; inherit ibus onboard libgnomekbd; diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/fix-paths.patch b/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/fix-paths.patch index bed4ca5573c8..37f202e98b2a 100644 --- a/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/fix-paths.patch +++ b/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/fix-paths.patch @@ -1,8 +1,8 @@ diff --git a/src/Views/InputMethod.vala b/src/Views/InputMethod.vala -index 7f73c1e1..1f0d6400 100644 +index ba12d6db..b9263c1d 100644 --- a/src/Views/InputMethod.vala +++ b/src/Views/InputMethod.vala -@@ -328,7 +328,7 @@ public class Pantheon.Keyboard.InputMethodPage.Page : Gtk.Grid { +@@ -338,7 +338,7 @@ public class Keyboard.InputMethodPage.Page : Gtk.Grid { private void spawn_ibus_daemon () { bool is_spawn_succeeded = false; try { @@ -11,24 +11,24 @@ index 7f73c1e1..1f0d6400 100644 } catch (GLib.SpawnError e) { warning (e.message); set_visible_view (e.message); -diff --git a/src/Views/Layout.vala b/src/Views/Layout.vala -index 75d2d805..b86252a4 100644 ---- a/src/Views/Layout.vala -+++ b/src/Views/Layout.vala -@@ -219,7 +219,7 @@ namespace Pantheon.Keyboard { +diff --git a/src/Views/Behavior.vala b/src/Views/Behavior.vala +index 8a89a0a4..a4f98668 100644 +--- a/src/Views/Behavior.vala ++++ b/src/Views/Behavior.vala +@@ -270,7 +270,7 @@ public class Keyboard.Behaviour.Page : Gtk.Box { - onscreen_keyboard_settings.clicked.connect (() => { - try { -- var appinfo = AppInfo.create_from_commandline ("onboard-settings", null, AppInfoCreateFlags.NONE); -+ var appinfo = AppInfo.create_from_commandline ("@onboard@/bin/onboard-settings", null, AppInfoCreateFlags.NONE); - appinfo.launch (null, null); - } catch (Error e) { - warning ("Unable to launch onboard-settings: %s", e.message); + onscreen_keyboard_settings.clicked.connect (() => { + try { +- var appinfo = AppInfo.create_from_commandline ("onboard-settings", null, NONE); ++ var appinfo = AppInfo.create_from_commandline ("@onboard@/bin/onboard-settings", null, NONE); + appinfo.launch (null, null); + } catch (Error e) { + critical ("Unable to launch onboard-settings: %s", e.message); diff --git a/src/Dialogs/AddLayoutDialog.vala b/src/Dialogs/AddLayoutDialog.vala -index 7c2efda3..de77094f 100644 +index aa084295..a486b52a 100644 --- a/src/Dialogs/AddLayoutDialog.vala +++ b/src/Dialogs/AddLayoutDialog.vala -@@ -197,7 +197,7 @@ public class Pantheon.Keyboard.LayoutPage.AddLayoutDialog : Granite.Dialog { +@@ -197,7 +197,7 @@ public class Keyboard.LayoutPage.AddLayoutDialog : Granite.Dialog { }); keyboard_map_button.clicked.connect (() => { diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/hide-install-unlisted-engines-button.patch b/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/hide-install-unlisted-engines-button.patch new file mode 100644 index 000000000000..6313dc30f6d0 --- /dev/null +++ b/pkgs/desktops/pantheon/apps/switchboard-plugs/keyboard/hide-install-unlisted-engines-button.patch @@ -0,0 +1,78 @@ +diff --git a/src/Widgets/InputMethod/AddEnginesPopover.vala b/src/Widgets/InputMethod/AddEnginesPopover.vala +index 478e6b02..5b25f2e9 100644 +--- a/src/Widgets/InputMethod/AddEnginesPopover.vala ++++ b/src/Widgets/InputMethod/AddEnginesPopover.vala +@@ -43,7 +43,6 @@ public class Keyboard.InputMethodPage.AddEnginesPopover : Gtk.Popover { + }; + scrolled.add (listbox); + +- var install_button = new Gtk.Button.with_label (_("Install Unlisted Engines…")); + + var cancel_button = new Gtk.Button.with_label (_("Cancel")); + +@@ -55,10 +54,8 @@ public class Keyboard.InputMethodPage.AddEnginesPopover : Gtk.Popover { + margin = 12, + spacing = 6 + }; +- button_box.add (install_button); + button_box.add (cancel_button); + button_box.add (add_button); +- button_box.set_child_secondary (install_button, true); + + var grid = new Gtk.Grid (); + grid.attach (search_entry, 0, 0); +@@ -88,30 +85,6 @@ public class Keyboard.InputMethodPage.AddEnginesPopover : Gtk.Popover { + listbox.invalidate_filter (); + }); + +- install_button.clicked.connect (() => { +- popdown (); +- +- var installer = UbuntuInstaller.get_default (); +- var install_dialog = new InstallEngineDialog ((Gtk.Window) get_toplevel ()); +- install_dialog.response.connect ((response_id) => { +- if (response_id == Gtk.ResponseType.OK) { +- string engine_to_install = install_dialog.get_selected_engine_name (); +- install_dialog.destroy (); +- installer.install (engine_to_install); +- +- var progress_dialog = new ProgressDialog () { +- transient_for = (Gtk.Window) get_toplevel () +- }; +- installer.progress_changed.connect ((p) => { +- progress_dialog.progress = p; +- }); +- progress_dialog.run (); +- } else { +- install_dialog.destroy (); +- } +- }); +- install_dialog.run (); +- }); + + cancel_button.clicked.connect (() => { + popdown (); +diff --git a/src/meson.build b/src/meson.build +index 83cde9f6..63d6a88a 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -19,7 +19,6 @@ plug_files = files( + 'Widgets/Layout/Display.vala', + 'Widgets/Layout/AdvancedSettingsPanel.vala', + 'Widgets/Layout/AdvancedSettingsGrid.vala', +- 'Widgets/InputMethod/LanguagesRow.vala', + 'Widgets/InputMethod/EnginesRow.vala', + 'Widgets/InputMethod/AddEnginesPopover.vala', + 'Views/Shortcuts.vala', +@@ -35,11 +34,6 @@ plug_files = files( + 'InputSources/SourceSettings.vala', + 'InputSources/InputSource.vala', + 'InputMethod/AddEnginesList.vala', +- 'InputMethod/Installer/UbuntuInstaller.vala', +- 'InputMethod/Installer/InstallList.vala', +- 'InputMethod/Installer/aptd-client.vala', +- 'Dialogs/ProgressDialog.vala', +- 'Dialogs/InstallEngineDialog.vala', + 'Dialogs/ConflictDialog.vala', + 'Dialogs/AddLayoutDialog.vala' + )