Include file associations settings in the GIMP's Preferences
Submitted by Jernej Simončič
Link to original bug (#382683)
Description
Currently, the only way to create file associations with the GIMP on Windows is through the installer. While it's not so unusual to create file associations there, users sometimes want to manipulate them after the program is installed, and for this, most Windows programs offer file associations settings somwhere in their preferences.
The user interface for this should be pretty straightforward - checkboxed list of file extensions and their descriptions that GIMP's plug-ins support, along with a button to automatically select file extensions not claimed by other applications. I propose that these settings wouldn't be saved in gimprc at all (or at least not used if they were saved there), but that the checkboxes would always be filled straight from the Windows registry, since that's where the file associations are stored.
The file associations in Windows registry consist of 2 parts:
- application identifier, stored in HKEY_CLASSES_ROOT``,
which has the following subkeys:
- (default value): text seen in file managers as file type description
- DefaultIcon(default value): path to an icon used to represent the file
- shell\open\command(default value): program to run when user double-clicks a file
- file extension association itself, stored in HKEY_CLASSES_ROOT.
<extension>
, where the default value is set to<identification string>
from the application
Typically, <identification string>
contains the program name and version, and usually a file extension (you can have a single identifier for multipe file types, although more commonly, each extension [or group of extensions] gets it's own idenfitier; this also allows different file types to have different icons). For example, to associate PNG files with the GIMP, at minimum, the following registry entries would have to be created:
HKEY_LOCAL_MACHINE.png
(default) = gimp-2.3.png
HKEY_LOCAL_MACHINE\gimp-2.3.png
(default) = Portable Network Graphic
HKEY_LOCAL_MACHINE\gimp-2.3.png\DefaultIcon
(default) = c:\path\to\gimp-2.3.exe,1
HKEY_LOCAL_MACHINE\gimp-2.3.png\shell\open\command
(deafult) = "c:\path\to\gimp-2.3.exe" "%Future"
(default) refers to the default value for the key, not string "(default)". ",1" in the DefaultIcon refers to the 2nd icon in gimp-2.3.exe.
Version: git master