Git Product home page Git Product logo

Comments (22)

joshua-stone avatar joshua-stone commented on May 27, 2024 1

I believe this should be possible to fix, given that there are numerous apps that include their own filetype associations:

https://github.com/search?q=org%3Aflathub%20%3Cmime-info%20xmlns%3D%22http%3A%2F%2Fwww.freedesktop.org%2Fstandards%2Fshared-mime-info%22%3E&type=code

from starc.

dimkanovikov avatar dimkanovikov commented on May 27, 2024 1

My bad... Now mime types equal in both files.

from starc.

joshua-stone avatar joshua-stone commented on May 27, 2024 1

Looks good to me. I'll update the flatpak build manifest once the mimetype file is included in a new release.

from starc.

dimkanovikov avatar dimkanovikov commented on May 27, 2024

Since the app sandboxed in Flatpak it can't register itself as a default app for any kind of files. But we should provide instruction about how to do it manually (something like jgraph/drawio-desktop#363). Plus we can add instruction about how to add AppImage file to the Applications menu (for Linux and ChromeOS), something like this.

from starc.

hyuri avatar hyuri commented on May 27, 2024

Kdenlive Flatpak seems to be able to do it. Maybe they know a trick?

from starc.

dimkanovikov avatar dimkanovikov commented on May 27, 2024

Will check it, thanks!

from starc.

hyuri avatar hyuri commented on May 27, 2024

Thinking here... worst case scenario, if you make the file type unique so it doesn't advertise itself as an SQLite3 file, I think we will probably be able to select Story Architect to open it and the system will remember that association from there on, no?

Is there an easy way you can make the file header say "This is a Starc file" instead of "This is a SQLite3 file" while still keeping Story Architect's ability to open it as SQLite3?

from starc.

dimkanovikov avatar dimkanovikov commented on May 27, 2024

I believe this should be possible to fix, given that there are numerous apps that include their own filetype associations:

https://github.com/search?q=org%3Aflathub%20%3Cmime-info%20xmlns%3D%22http%3A%2F%2Fwww.freedesktop.org%2Fstandards%2Fshared-mime-info%22%3E&type=code

Okay, I added the file with mime info to the repo. Now we should install it somehow?

from starc.

joshua-stone avatar joshua-stone commented on May 27, 2024

I believe the mimetype file should reside in share/mime/packages/dev.storyapps.starc.mime.xml inside the AppImage, that way it can be easily copied along the other files during the flatpak build process:

diff --git a/dev.storyapps.starc.yml b/dev.storyapps.starc.yml
index 7251cf4..e651b3f 100644
--- a/dev.storyapps.starc.yml
+++ b/dev.storyapps.starc.yml
@@ -24,11 +24,13 @@ modules:
       - cp squashfs-root/starc.desktop                                      ${FLATPAK_ID}.desktop
       - cp squashfs-root/share/icons/hicolor/512x512/apps/${FLATPAK_ID}.png ${FLATPAK_ID}.png
       - cp squashfs-root/share/metainfo/${FLATPAK_ID}.metainfo.xml          ${FLATPAK_ID}.metainfo.xml
+      - cp squashfs-root/share/mime/packages/${FLATPAK_ID}.mime.xml         ${FLATPAK_ID}.mime.xml
       - desktop-file-edit --set-icon ${FLATPAK_ID} --set-key Exec --set-value 'starc-run
         %u' ${FLATPAK_ID}.desktop
       - install -Dm644 ${FLATPAK_ID}.desktop      -t ${FLATPAK_DEST}/share/applications
       - install -Dm644 ${FLATPAK_ID}.png          -t ${FLATPAK_DEST}/share/icons/hicolor/512x512/apps
       - install -Dm644 ${FLATPAK_ID}.metainfo.xml -t ${FLATPAK_DEST}/share/metainfo
+      - install -Dm644 ${FLATPAK_ID}.mime.xml     -t ${FLATPAK_DEST}/share/mime/packages
       - install -Dm755 starc-run                  -t ${FLATPAK_DEST}/bin
       - mv squashfs-root ${FLATPAK_DEST}/bin/starc
     sources:

from starc.

dimkanovikov avatar dimkanovikov commented on May 27, 2024

Done

from starc.

hyuri avatar hyuri commented on May 27, 2024

It does open the .starc file with Starc when I click on it, but it immediately crashes.

I noticed the following log when running through the terminal (xdg-open file.starc):

2023.06.09 13:26:18.068 [D] Failed to write minidump, dump path: ~/.var/app/dev.storyapps.starc/data/Story Apps/Story Architect/crashreports/c4ad6038-a08d-4545-da9066b1-554ca98f.dmp

/app/bin/starc-run: line 2:     3 Segmentation fault      (core dumped) /app/bin/starc/starc $@

I guess I should report it as a separate issue?

from starc.

joshua-stone avatar joshua-stone commented on May 27, 2024

Where are you opening that file? AFAIK it only has access to files within ~/Documents:

https://github.com/flathub/dev.storyapps.starc/blob/2b4f258bd11224e55245e64a1fdd9d7d001b5400/dev.storyapps.starc.yml#L7

from starc.

hyuri avatar hyuri commented on May 27, 2024

On the Desktop. I added permission to 'xdg-desktop` using Flatseal.

from starc.

joshua-stone avatar joshua-stone commented on May 27, 2024

Where on the desktop?

Can you make sure the file is moved into the documents folder and have it be opened here?

$ xdg-open ~/Documents/file.starc

from starc.

hyuri avatar hyuri commented on May 27, 2024

~/Desktop/file.starc

Just move it to ~/Documents/file.starc and tried opening it there.

Same result: crash. Tried both clicking on the file, and the xdg-open command you shared above.

from starc.

joshua-stone avatar joshua-stone commented on May 27, 2024

@dimkanovikov It looks like the mimetype has to match the MimeType property in the .desktop file:

$ cp dev.storyapps.starc.mime.xml ~/.local/share/mime/packages/
$ update-mime-database ~/.local/share/mime -V
Updating MIME database in /var/home/jstone/.local/share/mime...

Parsing source file /var/home/jstone/.local/share/mime/packages/dev.storyapps.starc.mime.xml...
Wrote 3 strings at 2c - 6c
Wrote aliases at 6c - 70
Wrote parents at 70 - 84
Wrote literal globs at 84 - 88
Wrote suffix globs at 88 - e4
Wrote full globs at e4 - e8
Wrote magic at e8 - f4
Wrote namespace list at f4 - f8
Wrote icons list at f8 - 104
Wrote generic icons list at 104 - 110
Wrote types list at 110 - 118
$ xdg-open ~/Documents/starc/projects/Starc.starc 
gio: file:///var/home/jstone/Documents/starc/projects/Starc.starc: Failed to find default application for content type ‘application/x-starc’

from starc.

dimkanovikov avatar dimkanovikov commented on May 27, 2024

Nice, thanks!

from starc.

joshua-stone avatar joshua-stone commented on May 27, 2024

The latest update should have resolved this now.

from starc.

hyuri avatar hyuri commented on May 27, 2024

Nice! Thanks, @joshua-stone!

from starc.

hyuri avatar hyuri commented on May 27, 2024

Association confirmed:
image

But the crash still happens for me when I click on a .starc file or by running xdg-open path/to/file.starc via terminal. Is it working for you?

The terminal output is:

2023.07.06 13:08:57.861 [I] Story Architect version 0.5.4, Freedesktop.org SDK 22.08 (Flatpak runtime), x86_64
2023.07.06 13:08:57.861 [I] Loading fonts
2023.07.06 13:08:58.069 [W] QFont::setPixelSize: Pixel size <= 0 (0)
2023.07.06 13:08:58.074 [W] QFont::setPixelSize: Pixel size <= 0 (0)
2023.07.06 13:08:58.075 [W] QFont::setPixelSize: Pixel size <= 0 (0)
2023.07.06 13:08:58.078 [W] QFont::setPixelSize: Pixel size <= 0 (0)
2023.07.06 13:08:58.078 [W] QFont::setPixelSize: Pixel size <= 0 (0)
2023.07.06 13:08:58.110 [W] QFont::setPixelSize: Pixel size <= 0 (0)
2023.07.06 13:08:58.183 [I] Starting the application
2023.07.06 13:08:58.183 [I] Setup translation for en
2023.07.06 13:08:58.185 [I] Setup design system theme
2023.07.06 13:08:58.185 [I] Setup design system scale factor
2023.07.06 13:08:58.185 [I] Setup design system density
2023.07.06 13:08:58.234 [I] Show application window
2023.07.06 13:08:58.323 [I] Make startup checks
2023.07.06 13:08:58.324 [I] Starting cloud service connection
2023.07.06 13:08:58.324 [I] Configure autosaving
2023.07.06 13:08:58.332 [I] Show projects screen
2023.07.06 13:08:58.332 [D] Show content: Ui::ProjectsToolBar, Ui::ProjectsNavigator, Ui::ProjectsView
2023.07.06 13:08:58.349 [I] Closing current project
2023.07.06 13:08:58.350 [W] Current project is not valid. Skip closing.
2023.07.06 13:08:58.498 [I] Activate plugin "" (default "application/x-starc/editor/project/information")
2023.07.06 13:08:58.499 [D] Activate plugin view
2023.07.06 13:08:58.742 [D] Activate plugin view options
2023.07.06 13:08:58.742 [D] Activate plugin manager
2023.07.06 13:08:58.742 [I] Plugin activated
2023.07.06 13:08:58.753 [D] Failed to write minidump, dump path: ~/.var/app/dev.storyapps.starc/data/Story Apps/Story Architect/crashreports/aa427533-c8be-421f-06bf87a4-e75c3130.dmp

/app/bin/starc-run: line 2:     3 Segmentation fault      (core dumped) /app/bin/starc/starc $@

After it crashes and I click on the .starc file again, the app opens but displays this dialog:
image

Even though the project is not open and no other Starc instances are running (I checked running processes in the System Monitor).

Is this a different issue — should I file a new report?

from starc.

joshua-stone avatar joshua-stone commented on May 27, 2024

You may have to delete the lock file that's created by Starc:

image

Make sure you kill any old instances of Starc as well:

$ flatpak kill dev.storyapps.starc

And make sure you have granted filesystem access to the required directory with Flatseal, or run the following:

$ flatpak override --user --filesystem=home dev.storyapps.starc

from starc.

hyuri avatar hyuri commented on May 27, 2024

I just figured out what the issue is: spaces in the file name.

The moment I renamed Test Story.starc to Test_Story.starc, the file opened perfectly.

The lock file created for Test Story.starc is named .~lock.Test and not .~lock.Test Story.starc.
image

Note: I tried deleting the lock as you suggested, still crashed.

from starc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.