Joined: 08 Feb 2005
Location: Almeria, Spain
|Posted: Wed Feb 28, 2018 6:53 pm Post subject: Launching a custom Windows app when double-clicking a file
|Since the demise of qtiplot as a free project for versions >0.9.8.9, and since good old v0.9.8.9 depends on qt4 and other deprecated packages, it occurred to me to replace my portage-installed instance with the same Windows version (0.9.8.9), and then run it through wine (crossover). So, I downloaded the latest Windows free version and installed in ~/Programas/qtiplot-0.9.8.9/. The installation is just a matter of uncompressing a folder (I had previously installed the required python-2.7.x for Windows in the desired bottle). Then, you launch qtiplot.exe in KDE by right-clicking it and selecting "open with wine".
However, my goal was to be able to simply double-click a .qti file (the file type this program creates) in KDE so that qtiplot.exe launched automatically and loaded the file.
I'd like to share with you how I got it to work:
1) I re-created the qti mime type:
|user@box ~/.local/share/applications $ cat x-qtiplot.xml
<?xml version="1.0" encoding="utf-8"?>
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-qtiplot">
<!--Created automatically by update-mime-database. DO NOT EDIT!-->
<comment xml:lang="es">documento de QtiPlot</comment>
2) I created a working launch-script for qtiplot.exe in its same folder (chmod it with a+x):
|user@box ~/Programas/qtiplot-0.9.8.9 $ cat qtiplot.script
exec "/opt/cxoffice/bin/wine" --bottle "Microsoft Office 2007" --check --wait-children --start "Y:\Programas\qtiplot-0.9.8.9\qtiplot.exe" "$@"
3) I re-created a .desktop file for the Windows program:
|user@box ~/.local/share/applications $ cat qtiplot-qtiplot.desktop
Name=QtiPlot Scientific Plotting
Comment=Qt based clone of the Origin plotting package
The Windows version works like a charm so far and is a perfect replacement for me: I have tried non-linear fitting, exporting a plot as SVG or PNG with transparent backgrounds, selecting gentoo-installed fonts for plots...
Hope this info helps.