eclipse-ecal / ecal

📦 eCAL - enhanced Communication Abstraction Layer. A high performance publish-subscribe, client-server cross-plattform middleware.
https://ecal.io
Apache License 2.0
823 stars 174 forks source link

Mon: Hyperlink to ecal.ini #563

Closed FlorianReimold closed 2 years ago

FlorianReimold commented 2 years ago

People sometimes struggle to find and edit the ecal.ini. As the monitor shows the path to the file anyways, we could easily transfor it into a hyperlink the user can click on.

grafik

FlorianReimold commented 2 years ago

Current solution already works fine. It however cannot open the ecal.ini on Linux as root. I want to do a workaround at some point:

  1. Check the permissions

  2. Query mime type:

    Shell: xdg-mime query filetype /usr/local/etc/ecal/ecal.ini
    C++: auto mime_type = QMimeDatabase().mimeTypeForFile(path);
    
    text/plain
  3. Get Default application

    Shell: xdg-mime query default text/plain
    
    org.gnome.gedit.desktop
  4. Unfortunatelly it stops here. But we can launch gedit with a magic parameter manually whenever we detect org.gnome.gedit.desktop:

    gedit admin:///usr/local/etc/ecal/ecal.ini

For all other cases we just let Qt open the file (it will use xdg-open). This would give us a generic solution:

FlorianReimold commented 2 years ago

Fixed by #569