mailnag icon indicating copy to clipboard operation
mailnag copied to clipboard

mailnag.appdata.xml is not installed and screenshot are to small

Open knurd opened this issue 10 years ago • 23 comments

Just noticed that mailnag.appdata.xml afaics is not installed by default and hence not used by tools like Gnome Software. Ohh, and the images the file points to are to small according to appstream-util:

[thl@thl mailnag]$ appstream-util validate ./mailnag-1.2.0/data/appdata/mailnag.appdata.xml 
./mailnag-1.2.0/data/appdata/mailnag.appdata.xml: FEHLGESCHLAGEN:
• tag-missing           : <translation> not specified
• attribute-invalid     : <screenshot> width too small [https://raw.githubusercontent.com/pulb/mailnag-design/master/Screenshots/mailnag-config.png]
• attribute-invalid     : <screenshot> width too small [https://raw.githubusercontent.com/pulb/mailnag-design/master/Screenshots/mailnag-gnome-shell2.png]
• attribute-invalid     : <screenshot> width too small [https://raw.githubusercontent.com/pulb/mailnag-design/master/Screenshots/mailnag-gnome-shell.png]
Validierung der Dateien ist fehlgeschlagen
[thl@thl mailnag]$

knurd avatar Apr 15 '16 09:04 knurd

I'm not a setup.py expert, but afaics the installation of the file can be fixed with this patch

diff -Naur mailnag-1.2.0.org/setup.py mailnag-1.2.0/setup.py
--- mailnag-1.2.0.org/setup.py  2016-04-15 16:55:29.732297614 +0200
+++ mailnag-1.2.0/setup.py      2016-04-15 17:01:27.489221678 +0200
@@ -119,6 +119,7 @@
                ('share/mailnag', ['data/config_window.css']),
                ('share/mailnag', ['data/mailnag.ogg']),
                ('share/mailnag', ['data/mailnag.png']),
+               ('share/appdata', ['data/appdata/mailnag.appdata.xml']),
                ('share/applications', [os.path.join(BUILD_PATCH_DIR, 'mailnag.desktop'), os.path.join(BUILD_PATCH_DIR, 'mailnag-config.desktop')])],
        cmdclass={'build': BuildData, 
                        'install_data': InstallData,

knurd avatar Apr 15 '16 15:04 knurd

While at it: This patch might make sense, as it gets rid of the warning "• tag-missing: not specified" mentioned in the first comment of this bug.

--- mailnag-1.2.0.org/data/appdata/mailnag.appdata.xml  2016-03-23 20:17:35.000000000 +0100
+++ mailnag-1.2.0/data/appdata/mailnag.appdata.xml  2016-04-15 19:20:20.132476304 +0200
@@ -4,6 +4,7 @@
   <id type="desktop">mailnag-config.desktop</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-2.0+</project_license>
+  <translation type="gettext">mailnag</translation>
   <name>Mailnag</name>
   <summary>An extensible mail notification daemon</summary>
   <description>

This seems to be correct according to https://blogs.gnome.org/hughsie/2016/01/25/appdata-and-the-gettext-domain/, but I could see any difference due to that. And gnome-software still shows mailnag as "Mailnag-Konfiguration" when running in de_DE.utf8 (it seems it gets that german text from the mailnag-config.desktop file)

knurd avatar Apr 16 '16 10:04 knurd

Hey knurd, many thanks for your patches - I'll apply them asap. Regarding the wrong app title ("Mailnag-Konfiguration"), do you know if there is a way to make a .desktop file the primary one? It's also possible gnome-software ignores mailnag.desktop because it has the NoDisplay=true key set...

pulb avatar Apr 18 '16 17:04 pulb

@hughsie: Any ideas?

pulb avatar Apr 18 '16 17:04 pulb

Regarding the wrong app title ("Mailnag-Konfiguration"), do you know if there is a way to make a .desktop file the primary one?

No idea – but wonder if the proper way to handle this would be to add translation data to the appstream file directly – like for example found is vinagre.appdata.xml

<name xml:lang="de">Betrachter für entfernte Bildschirme</name>
<summary xml:lang="de">Auf entfernte Bildschirme zugreifen</summary>
<description>
        <p xml:lang="de">Vinagre zeigt entfernte Arbeitsflächen von Windows, Mac OS X und Linux an.</p>
</description>

knurd avatar Apr 18 '16 18:04 knurd

Yes, the translation for the software center should be in the AppData file too ideally.

hughsie avatar Apr 19 '16 10:04 hughsie

@hughsie The problem is that Mailnag has two .desktop files. Gnome-Software seems to show the name specified in mailnag-config.desktop (Mailnag Configuration) instead of the name specified in mailnag.desktop (Mailnag). mailnag-config is just a setup tool so showing its name is clearly not desirable :)

pulb avatar Apr 19 '16 17:04 pulb

Gnome-Software seems to show the name specified in mailnag-config.desktop (Mailnag Configuration)

FWIW, that afaics is only the case when there is no translation available for the current locale - at least if you run "LC_ALL=C gnome-software" I'll show "Mailnag" and not "Mailnag Configuration"

knurd avatar Apr 19 '16 17:04 knurd

Could you add X-AppStream-Ignore=true in the config desktop file? It probably ought not to be show in the software center as a separate app in any case.

hughsie avatar Apr 19 '16 21:04 hughsie

@hughsie: thanks for the pointers!

@knurd: can you confirm that it's fixed now?

pulb avatar Apr 20 '16 17:04 pulb

@pulb commit 25d3c01fcd7 afaics didn't change anything: Gnome Software still showed "Mailnag-Konfiguration" from mailnag-config.desktop as the apps name. You can make it go away by adding

<name xml:lang="de">Mailnag</name>

to mailnag.appdata.xml, but that obviously won't help for non-translated languages :-/

knurd avatar Apr 20 '16 18:04 knurd

sigh

@hughsie: Other advices welcome :)

pulb avatar Apr 21 '16 15:04 pulb

I think X-AppStream-Ignore=true is only respected by very new versions of libappstream-glib. Going back a bit; do you really need a desktop file for the configuration? Can't it just be launched from the main application?

hughsie avatar Apr 26 '16 11:04 hughsie

Unfortunately it's not possible to launch the config tool from the main application as it is a daemon that has no GUI. In fact users should just see the config tool in GNOME-Shell's (or Unitys') dash. The daemon has a .desktop file just because it's required for notification settings integration in gnome-control-center.

So I guess there's nothing we can do right now?

pulb avatar Apr 26 '16 17:04 pulb

Doesn't NoDisplay=true in the main .desktop file work?

hughsie avatar Apr 26 '16 18:04 hughsie

NoDisplay=true prevents the daemon's .desktop file from being shown in GNOME-Shells dash. I don't know if it also hints appstream/GNOME-Software to ignore it though.

pulb avatar Apr 28 '16 16:04 pulb

Hmmm, slightly annoying there still is no solution in sight, so trying to get things rolling again:

Unfortunately it's not possible to launch the config tool from the main application as it is a daemon that has no GUI. […] The daemon has a .desktop file just because it's required for notification settings integration in gnome-control-center.

Just wondering: Why not rename the executable "mailnag" to something like "mailnag-daemon" or "mailnagd" and after that rename and "mailnag-config" to "mailnag". Would that solve everything or am I confused now?

knurd avatar Jun 19 '16 19:06 knurd

I don't know by what criteria GNOME-Software currently chooses the .desktop file. Maybe renaming the files will make it choose the right file, maybe not. Maybe it will break again in the next GNOME-Software release, maybe not. It certainly feels like a pretty fragile workaround and I don't feel like changing program names (and breaking stuff like already installed autostart files) just because of a bug in a software-center. I'd rather prefer to wait until @hughsie releases libappstream-glib with support for the X-AppStream-Ignore=true key :)

pulb avatar Jun 21 '16 19:06 pulb

Is this really still an issue? According to the libappstream-glib changelog support for X-AppStream-Ignore was added back in 2016. Maybe adding X-AppStream-Ignore=true to a line other than the last one in mailnag-config.desktop will fix it? Maybe appstream metadata has to be regenerated after that change?

pulb avatar Nov 06 '19 17:11 pulb

Well, gnome-software still shows "Mailnag-Konfiguration" here. I tried to locally build a mailnag where I moved the X-AppStream-Ignore=true line, but I couldn't test it, as gnome-software still shows the info from /usr/share/app-info/xmls/fedora.xml.gz – and I don't know how to avoid that :-/

knurd avatar Nov 08 '19 19:11 knurd

@knurd Unfortunatelly I have no means to test gnome-software integration either. I also tried to rename mailnag into mailnagd and mailnag-config into mailnag on this branch, but TBH I don't like it. I'm afraid esp. the changes in documentation files will confuse users. Furthermore, it will also break existing intallations of mailnag-gnome-shell as this extension tries to launch mailnag-config.

@hughsie Do you have any idea what's wrong here? gnome-software shows information of the wrong .desktop file. There are two .desktop files in the package:

  • The first one, mailnag.desktop, is the one gnome-software should parse information from. It has a NoDisplay attribute to hide it in gnome-shell.
  • The second one, mailnag-config.desktop, is a setup program and must be ignored by gnome-software. But even though it has the X-AppStream-Ignore attribute set, gnome-software displays information of this one.

pulb avatar Nov 09 '19 11:11 pulb

@pulb Not sure and maybe a crazy idea: Can this maybe be fixed by renaming just the desktop files (mailnag.desktop -> mailnagd.desktop; mailnag-config.desktop -> mailnag.desktop) and a few adjustments (remove X-AppStream-Ignore from the later and also the "config" part in the descption)?

knurd avatar Nov 10 '19 07:11 knurd

@knurd: I already did that on this branch. The thing is that this change will break extensions like mailnag-gnomeshell and I'm not even able to verify if it will solve the problem. Furthermore I stil consider this issue a gnome-software bug, so I think I'll leave things as-is and rather file a bug in gnome-software.

pulb avatar Jan 05 '20 18:01 pulb