From 82660f5739c7f78e33f9c25ab00780eb777f0703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 16 Feb 2024 18:58:00 -0800 Subject: [PATCH] =?UTF-8?q?show=5Furi=20=E2=86=92=20UriLauncher=20(#2123)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * show_uri → UriLauncher * Add minimum GTK version * Update gettext.yml --- .github/workflows/gettext.yml | 2 +- README.md | 2 +- meson.build | 2 +- src/MainWindow.vala | 6 +----- src/Views/AppInfoView.vala | 5 ++++- src/Widgets/SharePopover.vala | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/gettext.yml b/.github/workflows/gettext.yml index 839f84b27..371eee764 100644 --- a/.github/workflows/gettext.yml +++ b/.github/workflows/gettext.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-22.04 container: - image: ghcr.io/elementary/docker:next-unstable + image: ghcr.io/elementary/docker:development-target steps: - name: Install git diff --git a/README.md b/README.md index 75a5f73fc..8830dec6c 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ You'll need the following dependencies: * libflatpak-dev (>= 1.0.7) * libgee-0.8-dev * libgranite-7-dev (>=7.1.0) -* libgtk-4-dev +* libgtk-4-dev (>=4.10) * libjson-glib-dev * libpackagekit-glib2-dev * libpolkit-gobject-1-dev diff --git a/meson.build b/meson.build index 0c198602c..31a176029 100644 --- a/meson.build +++ b/meson.build @@ -22,7 +22,7 @@ glib = dependency ('glib-2.0') gobject = dependency ('gobject-2.0') gio = dependency ('gio-2.0') gee = dependency ('gee-0.8') -gtk = dependency ('gtk4') +gtk = dependency ('gtk4', version: '>=4.10') granite = dependency ('granite-7', version: '>=7.3.0') adwaita = dependency('libadwaita-1') appstream = dependency ('appstream', version: '>=0.15.2') diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 9aa814cc2..d3aa35df2 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -276,11 +276,7 @@ public class AppCenter.MainWindow : Gtk.ApplicationWindow { network_monitor.bind_property ("network-available", network_info_bar, "revealed", BindingFlags.INVERT_BOOLEAN | BindingFlags.SYNC_CREATE); network_info_bar.response.connect (() => { - try { - Gtk.show_uri (this, "settings://network", Gdk.CURRENT_TIME); - } catch (GLib.Error e) { - critical (e.message); - } + new Gtk.UriLauncher ("settings://network").launch.begin (this, null); }); updates_button.clicked.connect (() => { diff --git a/src/Views/AppInfoView.vala b/src/Views/AppInfoView.vala index 514eb3da0..c535d00db 100644 --- a/src/Views/AppInfoView.vala +++ b/src/Views/AppInfoView.vala @@ -1275,7 +1275,10 @@ public class AppCenter.Views.AppInfoView : AppCenter.AbstractAppContainer { append (button); button.clicked.connect (() => { - Gtk.show_uri ((Gtk.Window) get_root (), uri, Gdk.CURRENT_TIME); + new Gtk.UriLauncher (uri).launch.begin ( + (Gtk.Window) get_root (), + null + ); }); } else { append (box); diff --git a/src/Widgets/SharePopover.vala b/src/Widgets/SharePopover.vala index 5a5b67c3d..6c04c83d2 100644 --- a/src/Widgets/SharePopover.vala +++ b/src/Widgets/SharePopover.vala @@ -133,7 +133,7 @@ public class SharePopover : Gtk.Popover { private void show_uri (string uri) { var main_window = ((Gtk.Application) Application.get_default ()).active_window; - Gtk.show_uri (main_window, uri, Gdk.CURRENT_TIME); + new Gtk.UriLauncher (uri).launch.begin (main_window, null); popdown (); } }