Completed single image export function

From "Open" dialog, select an image (single click, or use
arrow keys / etc., to highlight the image), then select the
"Export" button at the lower right.

The image will be saved in the export directory.  By default
this will be based on the config found via the XDG_CONFIG_HOME
environment variable, which is scanned for a "XDG_PICTURES_DIR"
setting.  If none is found, "Pictures" in the directory specified
by the HOME env. var. will be used.  In both cases, a new
"TuxPaint" subdirectory will be created, and exports will be placed
there.

The export location may be overridden using the "--exportdir"
command-line option or "exportdir" config file option
(e.g., "--exportdir /path/to/dir" or "exportdir=/path/to/dir",
respectively).  In this case, the directory is assumed to preexist,
and no "TuxPaint" subdirectory will be made.

There's currently no way to disable the export feature altogether.
If there's demand, we can add it as a simplification option.

Finally, this feature simply copies the PNG file (but no extra
data files) from Tux Paint's "saved" directory to the export dir.

Closes https://sourceforge.net/p/tuxpaint/feature-requests/192/
This commit is contained in:
Bill Kendrick 2020-07-26 14:10:03 -07:00
parent 28b28d583e
commit b0a2b4dacc
5 changed files with 205 additions and 50 deletions

View file

@ -19,7 +19,7 @@ version
<p>Copyright (c) 2002-2020 by various contributors; see AUTHORS.txt<br/>
<a href="http://www.tuxpaint.org/">http://www.tuxpaint.org/</a></p>
<p>July 25, 2020</p>
<p>July 26, 2020</p>
</center>
@ -715,7 +715,8 @@ version
<p>Use this option to change where Tux&nbsp;Paint exports files &mdash; single
images, or animated GIF slideshows &mdash; for external use.
<p>If you do not override it, the <b><i>default</i></b> location is:
<p>If you do not override it, the <b><i>default</i></b> location is
determined as follows:
<ul>
<li>Linux &amp; Unix &mdash; If available, wherever your desktop environment
is configured for pictures to be stored, based on your XDG
@ -737,6 +738,14 @@ version
</ul>
</p>
<p><b>Note:</b> When the defaults are used, a new "<code>TuxPaint</code>"
subdirectory will be created and used. (e.g., "<code>~/Pictures/TuxPaint</code>")
When the "<code>--exportdir</code>" option is used, the exact path specified
will be used (no "<code>TuxPaint</code>" subdirectory is created).
It is expected that the parent directory exists. (The directory itself
will be created, if it doesn't.)
</p>
<p><b>Example:</b> <code>exportdir=/home/penguin/TuxPaintExports</code></p>
</dd>
@ -1606,6 +1615,7 @@ version
--keyboard<br>
--savedir&nbsp;<i>DIRECTORY</i><br>
--datadir&nbsp;<i>DIRECTORY</i><br>
--exportdir&nbsp;<i>DIRECTORY</i><br>
--saveover<br>
--saveovernew<br>
--nosave<br>