Register remote-viewer mime handling

Unfortunately, I don't see yet how we could avoid the browser dialog
asking which application to open. On Firefox, each user has a
mimeTypes.rdf, but we can't really modify it..
This commit is contained in:
Marc-André Lureau 2013-01-21 15:09:37 +01:00
parent d5229a71eb
commit da45d9fa1e
6 changed files with 42 additions and 14 deletions

View File

@ -1,9 +1,10 @@
NULL=
NULL =
CLEANFILES =
EXTRA_DIST = \
spice-xpi-client-remote-viewer \
virt-viewer.nsis.in \
virt-viewer-debug.nsis.in \
virt-viewer-debug.nsis.in \
$(NULL)
if OS_WIN32
@ -16,7 +17,23 @@ virt-viewer-$(VERSION).exe: virt-viewer.nsis deps.txt
makensis -NOCD -DDESTDIR=$$DESTDIR $< >/dev/null && \
rm -rf $$DESTDIR
CLEANFILES = deps.txt virt-viewer-$(VERSION).exe
CLEANFILES += deps.txt virt-viewer-$(VERSION).exe
else #!WIN32
desktopdir = $(datadir)/applications
DESKTOPFILES = remote-viewer.desktop.in
desktop_DATA = $(DESKTOPFILES:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
MIMEFILES = virt-viewer-mime.xml.in
mimedir = $(datadir)/mime/packages
mime_DATA = virt-viewer-mime.xml
@INTLTOOL_XML_RULE@
CLEANFILES += $(mime_DATA) $(desktop_DATA)
EXTRA_DIST += $(MIMEFILES) $(DESKTOPFILES)
endif
-include $(top_srcdir)/git.mk

View File

@ -0,0 +1,9 @@
[Desktop Entry]
_Name=Remote Viewer
_Comment=Access remote desktops
Exec=remote-viewer %u
Type=Application
Terminal=false
MimeType=x-scheme-handler/spice;application/x-virt-viewer
StartupNotify=true
Categories=GNOME;GTK;Network;RemoteAccess;

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-virt-viewer">
<sub-class-of type="text/plain"/>
<_comment>Virt-Viewer connection file</_comment>
<magic priority="50">
<match type="string" offset="0" value="[virt-viewer]"/>
</magic>
<glob pattern="*.vv"/>
</mime-type>
</mime-info>

View File

@ -1,3 +1,5 @@
data/remote-viewer.desktop.in
data/virt-viewer-mime.xml.in
src/gbinding.c
src/remote-viewer-main.c
src/remote-viewer.c

View File

@ -136,11 +136,6 @@ if OS_WIN32
remote_viewer_LDFLAGS += -Wl,--subsystem,windows
endif
desktopdir = $(datadir)/applications
desktop_DATA = remote-viewer.desktop
EXTRA_DIST += $(desktop_DATA)
VIRT_VIEWER_RES = virt-viewer.rc virt-viewer.manifest
ICONDIR = $(top_builddir)/icons
MANIFESTDIR = $(srcdir)

View File

@ -1,6 +0,0 @@
[Desktop Entry]
Name=Remote Viewer
Exec=remote-viewer %u
Type=Application
Terminal=false
MimeType=x-scheme-handler/spice;