dubstar-04 / Design

2D CAD For GNOME
GNU General Public License v3.0
127 stars 8 forks source link

Cannot open any file #232

Closed williamd1k0 closed 5 months ago

williamd1k0 commented 9 months ago

I cannot open any file.

Version: 44-alpha4 and main

Steps to reproduce the behaviour: Just try opening a file using Open Dialog or command-line argv.

If using Open Dialog

The dialog itself simply doesn't appear. After messing with the code, I managed to get it to work by setting the file filter after the dialog initialisation.

diff --git a/src/Design/fileIO.js b/src/Design/fileIO.js
index e3c7789..1964394 100644
--- a/src/Design/fileIO.js
+++ b/src/Design/fileIO.js
@@ -25,11 +25,11 @@ export class FileIO {

     const dialog = new Gtk.FileChooserNative({
       action: Gtk.FileChooserAction.OPEN,
-      filter: filter,
       select_multiple: false,
       transient_for: window,
       title: _('Open'),
     });
+    dialog.add_filter(filter);

     dialog.show();
     dialog.connect('response', (dialog, response) => {

If using command-line argv

The app crashes before opening. The log will warn you of this error:

JS ERROR: TypeError: activeWindow.load_file is not a function
DesignApplication/</<@resource:///io/github/dubstar_04/design/js/Design/main.js:73:26

I haven't found a way to fix it myself though.

dubstar-04 commented 9 months ago

Thanks for the report. This works for me on Debian and Fedora. File opening is done through the flatpak portal. What OS are you using?

williamd1k0 commented 9 months ago

I'm using Manjaro 23.0.2 Xfce4.

dubstar-04 commented 8 months ago

How are you launching the application?

dubstar-04 commented 5 months ago

No response. Closing issue.