Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahil-Shadwal committed Jan 17, 2024
1 parent 5675d13 commit 643417b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion demos/Open File/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Adw.StatusPage {
]
}

Button button_images {
Button button_image {
halign: center;
label: _("Open Image");

Expand Down
13 changes: 6 additions & 7 deletions demos/Open File/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ Gio._promisify(
);

const button_single = workbench.builder.get_object("button_single");
const button_image = workbench.builder.get_object("button_image");
const button_multiple = workbench.builder.get_object("button_multiple");
const button_images = workbench.builder.get_object(
"button_images",
);

async function openFile() {
const dialog_for_file = new Gtk.FileDialog();
Expand All @@ -25,11 +23,11 @@ async function openFile() {
console.log(`Selected File: ${info.get_name()}`);
}

async function openImageFiles() {
async function openImageFile() {
const filters = new Gio.ListStore();

const imageFilter = Gtk.FileFilter.new();
imageFilter.set_name("Image Files");
imageFilter.set_name("Image File");
imageFilter.add_mime_type("image/*");
filters.append(imageFilter);

Expand Down Expand Up @@ -58,10 +56,11 @@ button_single.connect("clicked", () => {
openFile().catch(console.error);
});

button_images.connect("clicked", () => {
openImageFiles().catch(console.error);
button_image.connect("clicked", () => {
openImageFile().catch(console.error);
});

button_multiple.connect("clicked", () => {
openMultipleFiles().catch(console.error);
});

0 comments on commit 643417b

Please sign in to comment.