[gnome-shell] shellDBus: Add new OpenExtensionPrefs method



commit fda938175e5d1adc8e81fe54e600f478cf9c3dfc
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Mar 5 02:00:57 2020 +0100

    shellDBus: Add new OpenExtensionPrefs method
    
    Unlike any other methods in the Extensions API, LaunchExtensionPrefs()
    opens what appears to be an application dialog, except that it is
    really a separate application that the caller has no control over.
    
    In order to address that, add a new OpenExtensionPrefs() method that
    takes additional parameters (modelled after the desktop portal APIs)
    that will make it possible to improve the behavior in the future.
    
    The new parameters are ignored for now, but pushing the API out now
    will allow us to fill in the functionality post the .0 release.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1074

 .../dbus-interfaces/org.gnome.Shell.Extensions.xml | 27 ++++++++++++++++++++--
 js/ui/shellDBus.js                                 |  4 ++++
 2 files changed, 29 insertions(+), 2 deletions(-)
---
diff --git a/data/dbus-interfaces/org.gnome.Shell.Extensions.xml 
b/data/dbus-interfaces/org.gnome.Shell.Extensions.xml
index eb7be8f1ac..ab80c10966 100644
--- a/data/dbus-interfaces/org.gnome.Shell.Extensions.xml
+++ b/data/dbus-interfaces/org.gnome.Shell.Extensions.xml
@@ -199,12 +199,35 @@
 
     <!--
         LaunchExtensionPrefs:
+        Deprecated for OpenExtensionPrefs
+    -->
+    <method name="LaunchExtensionPrefs">
+      <arg type="s" direction="in" name="uuid"/>
+    </method>
+
+    <!--
+        OpenExtensionPrefs:
         @uuid: The UUID of the extension
+        @parent_window: Identifier for the application window
+        @options: Vardict with further options
+
+        Opens the prefs dialog of extension @uuid.
 
-        Launch preferences of an extension.
+        The following @options are recognized:
+
+        <variablelist>
+          <varlistentry>
+            <term>modal b</term>
+            <listitem>
+              <para>Whether the prefs window should be modal, default: false</para>
+            </listitem>
+          </varlistentry>
+        </variablelist>
     -->
-    <method name="LaunchExtensionPrefs">
+    <method name="OpenExtensionPrefs">
       <arg type="s" direction="in" name="uuid"/>
+      <arg type="s" direction="in" name="parent_window"/>
+      <arg type="a{sv}" direction="in" name="options"/>
     </method>
 
     <!--
diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js
index 691019b42f..983a887123 100644
--- a/js/ui/shellDBus.js
+++ b/js/ui/shellDBus.js
@@ -312,6 +312,10 @@ var GnomeShellExtensions = class {
     }
 
     LaunchExtensionPrefs(uuid) {
+        this.OpenExtensionPrefs(uuid, '', {});
+    }
+
+    OpenExtensionPrefs(uuid, _parentWindow, _options) {
         let appSys = Shell.AppSystem.get_default();
         let app = appSys.lookup_app('org.gnome.Extensions.desktop');
         let info = app.get_app_info();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]