Skip to content

Commit

Permalink
Replace Gtk.show_uri with Gtk.UriLauncher (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryonakano authored May 11, 2024
1 parent 51ba9cf commit 0d6a3ac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ GitHub Issue Reporter
## Building, Testing, and Installation

You'll need the following dependencies:
* libappstream-dev
* libgranite-7-dev
* libgtk-4-dev
* libadwaita-1-dev
* libappstream-dev (>=0.12.10)
* libgranite-7-dev (>=7.0.0)
* libgtk-4-dev (>=4.10)
* libadwaita-1-dev (>=1.0.0)
* meson
* valac

Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ executable(
dependency('glib-2.0'),
dependency('gobject-2.0'),
dependency('granite-7', version: '>=7.0.0'),
dependency('gtk4'),
dependency('gtk4', version: '>= 4.10'),
dependency('libadwaita-1', version: '>=1.0.0')
],
install : true
Expand Down
12 changes: 10 additions & 2 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,16 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow {
}

private void launch_from_row (RepoRow row) {
Gtk.show_uri (null, row.url, Gdk.CURRENT_TIME);
close ();
var uri_launcher = new Gtk.UriLauncher (row.url);
uri_launcher.launch.begin (null, null, (obj, res) => {
try {
uri_launcher.launch.end (res);
} catch (Error err) {
warning ("Failed to launch \"%s\": %s", row.url, err.message);
}

close ();
});
}

private async GenericArray<AppStream.Component> get_compulsory_for_desktop (AppStream.Pool appstream_pool) {
Expand Down

0 comments on commit 0d6a3ac

Please sign in to comment.