Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Adw.MessageDialog.choose() #512

Merged
merged 7 commits into from Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/Library/demos/Dialogs/main.js
@@ -1,5 +1,8 @@
import Adw from "gi://Adw";
import Gtk from "gi://Gtk";
import Gio from "gi://Gio";

Gio._promisify(Adw.MessageDialog.prototype, "choose", "choose_finish");

const button_confirmation = workbench.builder.get_object("button_confirmation");
const button_error = workbench.builder.get_object("button_error");
Expand All @@ -25,7 +28,7 @@ function createConfirmationDialog() {
console.log(`Selected "${response}" response.`);
});

dialog.present();
dialog.choose(null);
SoNiC-HeRE marked this conversation as resolved.
Show resolved Hide resolved
}

function createErrorDialog() {
Expand All @@ -43,7 +46,7 @@ function createErrorDialog() {
console.log(`Selected "${response}" response.`);
});

dialog.present();
dialog.choose(null);
}

//Creates a message dialog with an extra child
Expand Down Expand Up @@ -78,7 +81,7 @@ function createAdvancedDialog() {
}
});

dialog.present();
dialog.choose(null);
}

button_confirmation.connect("clicked", createConfirmationDialog);
Expand Down
5 changes: 4 additions & 1 deletion src/Library/demos/Welcome/main.js
@@ -1,5 +1,8 @@
import Gtk from "gi://Gtk";
import Adw from "gi://Adw";
import Gio from "gi://Gio";

Gio._promisify(Adw.MessageDialog.prototype, "choose", "choose_finish");

const box = workbench.builder.get_object("subtitle");

Expand All @@ -26,5 +29,5 @@ function greet() {
console.log(response);
});

dialog.present();
dialog.choose(null);
}