Skip to content

Commit f9bf57b

Browse files
committed
port: Launcher
1 parent 07ac8ad commit f9bf57b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Launcher/main.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ Gio._promisify(Gtk.FileDialog.prototype, "open", "open_finish");
1212
Gio._promisify(Gtk.UriLauncher.prototype, "launch", "launch_finish");
1313

1414
const launch_file = workbench.builder.get_object("launch_file");
15-
const file_name = workbench.builder.get_object("file_name");
15+
const file_name = workbench.builder.get_object<Gtk.Label>("file_name");
1616
const file_location = workbench.builder.get_object("file_location");
1717
const change_file = workbench.builder.get_object("change_file");
18-
const uri_launch = workbench.builder.get_object("uri_launch");
19-
const uri_details = workbench.builder.get_object("uri_details");
18+
const uri_launch = workbench.builder.get_object<Gtk.Button>("uri_launch");
19+
const uri_details = workbench.builder.get_object<Gtk.Entry>("uri_details");
2020

2121
//File Launcher
2222

@@ -27,6 +27,7 @@ const file_launcher = new Gtk.FileLauncher({
2727
});
2828

2929
launch_file.connect("clicked", () => {
30+
// @ts-expect-error undetected async function
3031
file_launcher.launch(workbench.window, null).catch(console.error);
3132
});
3233

@@ -42,12 +43,14 @@ file_launcher.connect("notify::file", () => {
4243
file_location.connect("clicked", () => {
4344
file_launcher
4445
.open_containing_folder(workbench.window, null)
46+
// @ts-expect-error undetected async function
4547
.catch(console.error);
4648
});
4749

4850
change_file.connect("clicked", () => {
4951
new Gtk.FileDialog()
5052
.open(workbench.window, null)
53+
// @ts-expect-error undetected async function
5154
.then((file) => {
5255
file_launcher.file = file;
5356
})
@@ -59,6 +62,7 @@ change_file.connect("clicked", () => {
5962
uri_launch.connect("clicked", () => {
6063
new Gtk.UriLauncher({ uri: uri_details.text })
6164
.launch(workbench.window, null)
65+
// @ts-expect-error undetected async function
6266
.catch(console.error);
6367
});
6468
uri_details.connect("changed", () => {

0 commit comments

Comments
 (0)