Commit graph

1188 commits

Author SHA1 Message Date
Bill Kendrick
4ba4c11911 Properly handling getenv() returning "" not NULL
i18n code was checking for local-related environment variables
(e.g., "getenv("LANGUAGE")") coming back as a NULL if unset.

However, on my laptop, under Kubuntu 20.04 with GLIBC 2.31, a
"LANGUAGE" env. var. is set, but it's blank.

Tux Paint failed to attempt any fallback (e.g., checking "LANG")
in that situation, which was causing the description text corruption
that was corrected in a previous commit.

That commit also mistakenly suggested that the issue might've been a
difference with GCC versions, but the problem was deeper in Tux Paint's
code (in i18n.c), and was triggered by an unexpected environment.
2020-07-26 17:17:14 -07:00
Bill Kendrick
42512a67b0 Don't use extern for num_wished_langs
WORK IN PROGRESS -- Attempting to mend an issue where stamp descriptions
are not loading.

Also, making things safer when a problem occurs.

Using gcc 9.3.0 compiler, this was happening in 0.9.25 during
development, but also affected 0.9.24 and 0.9.23, which worked
fine under earlier versions of gcc.
2020-07-26 16:42:12 -07:00
Bill Kendrick
e50a0ef84c Improved safety when copying things into strings
Created "safe_" variations of 'strncpy()', 'strncat()',
and 'snprintf()', to ensure a truncated source string doesn't
leave the destination buffer without a NUL termination character.

Replaced all calls (in "tuxpaint.c" only, so far) to the standard
functions with calls to the new safer versions.

Replaced most calls to plain 'strcpy()', 'strcat()' and
'sprintf()' (which can cause buffer overruns) with the new functions.
2020-07-26 16:13:53 -07:00
Bill Kendrick
b0a2b4dacc 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/
2020-07-26 14:10:03 -07:00
Bill Kendrick
f8cce36435 Further work on animated GIF export: XDG Pictures
Using XDG's user dir settings to determine where pictures are
stored for a user (e.g., "~/Pictures" -- used as a fallback).
May be overridden using "--exportdir".

Also, while I was updating some docs, replace references to
"Mac OS X" with "macOS", the new name of that OS these days.
2020-07-25 16:45:17 -07:00
Bill Kendrick
8c3a07294b Beginning GIF export
Beginning addition of an option to export animated GIFs
from the Open -> Slideshow dialog, after choosing the images.

Non-operable at this time, but a button has been added (and will
provide a hint to select 2 or more images, when clicked).
2020-07-25 00:18:46 -07:00
Bill Kendrick
af039e6f7b Rebuilt TXT versions of HTML docs
After 0.9.24->0.9.25 bump.
2020-06-22 23:06:16 -07:00
Bill Kendrick
e87f36d9a7 Fix Haiku "unable to open saved files" bug
Appling patch from a92961004d
that fixes https://github.com/haikuports/haikuports/issues/3045
2020-06-22 23:04:13 -07:00
Bill Kendrick
b65d7f9da4 Bumping version to 0.9.25 2020-06-22 22:58:12 -07:00
Bill Kendrick
90871308ef Bump release date to today (2020-05-29) 2020-05-29 20:15:45 -07:00
Bill Kendrick
10c833e565 Bump version date -> 2020-05-23 2020-05-23 23:32:49 -07:00
Bill Kendrick
b0dda9ac26 Updates to RPM .spec file
Disable target "install-xdg". Add ImageMagick for BuildReq.
(From Shin-Ichi)
2020-04-26 21:19:33 -07:00
Bill Kendrick
d172f38d4d Win32 build (& doc) tweaks
TOYAMA Shin-ichi noticed that when building for Win32 under mingw/msys,
an #include of "librsvg-cairo.h" was also necessary.

He also bumped the version # in win32/resources.rc
(and I put his credit in there).

I updated docs/RELEASE.txt to mention that .rc file also needing
updated when preparing a new release.
2020-04-10 19:05:52 -07:00
Bill Kendrick
91505fae8e Debug output clean-up
Wrapped some debug output in "#ifdef DEBUG" tests,
and made sure some warnings and errors were going to
STDERR, rather than STDOUT.

Motivation: Less noise while launching/using Tux Paint,
unless it matters.
2020-04-02 22:15:13 -07:00
Bill Kendrick
b9c929a0a1 Rework how progress bar shown with stamps
Was drawing progress bar while DRAWING stamps into the UI
(in https://sourceforge.net/p/tuxpaint/tuxpaint/ci/ad4bfde57c170082d93979a7073f7358872eca21/),
even if they were already loaded and thumbnailed.

Now only doing it when loading a new stamp.  Should hopefully
help with performance.  (h/t Pere for reporting slowness on Android)
2020-04-01 22:29:57 -07:00
Bill Kendrick
950ad369b9 Doc'ing Mark Kim's macOS build doc update 2020-04-01 22:10:37 -07:00
Bill Kendrick
50a570ef2b Doc'ing Norwegian Nynorsk translation update 2020-03-30 23:25:01 -07:00
Bill Kendrick
a404bfdba8 Doc'ing Valencian update 2020-03-29 17:11:29 -07:00
Bill Kendrick
d820fade47 Swahili translation update 2020-03-29 12:40:52 -07:00
Bill Kendrick
5ad2621abc Ensure all docs/etc. show 0.9.24 version # 2020-03-28 22:38:10 -07:00
Bill Kendrick
ad4bfde57c Show progress bar while loading (more) stamps 2020-03-15 13:06:13 -07:00
Bill Kendrick
2860da7668 Replace KDE icon install with Freedesktop.org
Replaced KDE (older, KDE4, in fact) specific icon and
launcher (.desktop file) installation & uninstallaton
invocations in Makefile with those that use Freedesktop.org
`xdg-...` tools.
2019-10-29 22:44:11 -07:00
Bill Kendrick
8667c29650 Doc'ing Pere's bugfix w/ SVG & PNG Starters
Mentioning Pere's bugfix for starters/templates PNG vs SVG
confusion, in changelog.
2019-09-25 22:50:22 -07:00
Bill Kendrick
f7d30d3222 Added --nostereo option
Ability to disable stereo panning effect (e.g., paint brush, UI
elements sound effect feedback, etc.), useful for users with
hearing impairment in one ear, or situations where one speaker or
headphone is being used.  Use "--nostereo" command-line option
or "nostereo=yes" config. file option.
2019-09-21 16:33:55 -07:00
Bill Kendrick
41847ae4af FIXME note in Makefile: starter/template thumbs...
The thumbnails for starters & templates are NOT being re-generated
when the source images are modified -- only when the thumbnail is
missing.  Needs an update to the target's prerequisites
(but I'm very rusty with this level of Makefile magic).

Also, update some Starter source images so they work better with
flood fill (Bald Eagle, World map, Gecko).
2019-09-14 12:07:29 -07:00
Bill Kendrick
a54dd570b4 Make sure Fill uses undo (but also intelligently)
"Fill", as a new main-toolbar tool, was not recording snapshots
of the image for the "Undo" tool.  Mended.

However, also updated the tool so that it doesn't _bother_ recording
into the undo buffer if the fill action is a no-op (e.g., clicking
the same spot a second time, or otherwise attempting to fill an
area with a color that's identical to what's already on the canvas).
2019-09-14 11:16:46 -07:00
Bill Kendrick
4c3ad460ee "New" dialog: fix bad dir: Starter/Template thumbs
Made sure "New" dialog created correct thumbnail subdirectories
for personal Starters & Templates (e.g., ~/.tuxpaint/starters/thumbs/)
2019-09-14 10:52:59 -07:00
Bill Kendrick
82910adafb Generating thumbnails for Template images
Also generating and installing thumbnails of Template images,
thus getting "New" dialog to open extremely quickly.
(Pretty much "instantaneously" on my 8 year old laptop with
Intel i3 @ ~2GHz and Intel 320-series SSD (214 MB/s).)
2019-09-14 10:36:36 -07:00
Bill Kendrick
73dc07b608 Way better scaling of Starter thumbnails
Providing better command-line args to ImageMagick `convert` to
produce nice-looking thumbnail PNGs of Starter images.
(N.B. - I'm using "ImageMagick" Version: 8:6.9.7.4+dfsg-16ubuntu6.7)
2019-09-14 10:11:05 -07:00
Bill Kendrick
2911b35a50 Elevate "Fill" from Magic Tool to real Tool
Replace the somewhat-recently-added "nothing" item in the tool bar
with the "Fill" tool, which has been converted back from a Magic tool
to a regular tool.

Also, change bash "==" to sh "=" in "if [ ... ]" tests in Makefile.

Also, link to math library (via "-lm") to make sure "max()" is available to
magic tools.

Also, add missing mention of "--newcolorslast" and "--newcolorsfirst" to manpage.
2019-09-12 23:04:13 -07:00
Bill Kendrick
d79173eae4 Doc'ing Luc's Haiku updates 2019-09-12 21:16:45 -07:00
Bill Kendrick
7938480174 Clean up GCC warnings (2019-08-29 edition)
Updated most parts of the code that were throwing warnings in GCC.
2019-08-30 00:01:00 -07:00
Bill Kendrick
99b566ae26 Support SIGUSR1/2 for immediate(ish) quit-and-save
Respond to a SIGUSR1 or SIGUSR2 signal by configuring itself
for autosave, saving a new file, or overwriting the current,
respectively, and sending itself a SIGTERM (which _generally_
causes Tux Paint to quit, depending on where you are in the UI).

Closes https://sourceforge.net/p/tuxpaint/feature-requests/188/
2019-04-03 22:49:04 -07:00
Bill Kendrick
5d9ceca076 "New colors last"; place colors at end of New
New option to place color palette items at the end of the "New"
dialog, rather than at the beginning.  Useful for when users
would want to pick from a set of Starters and/or Templates,
e.g., in a school or museum environment.

Available via command-line option "--newcolorslast", and
config file setting "newcolorslast=yes".  (And anti-option to
override config file settings, "--newcolorsfirst" and "...=no",
which represents the original behavior, which continues to be
the default).

Suggested by Bernard Verhaeghe.
2018-12-18 22:37:03 -08:00
Bill Kendrick
268e213e6d Bump to 0.9.24; improve usage output
Bumping to 0.9.24; going to add a new feature momentarily.

Improved usage output (e.g., that of "tuxpaint --help"); broke
the options into groups that match the tabs in Tux Paint Config.,
added some missing options.
2018-12-18 21:56:05 -08:00
Bill Kendrick
32cf7679a9 Updated link to MinGW/MSYS docs
They're in a new location over on John P.'s website
(should we purhapse integrate them into Tux Paint proper?)

(h/t sechidis & whoever on #tux4kids IRC channel who helped them)
2018-12-08 10:32:47 -08:00
Bill Kendrick
b18911ea4a Doc Mac OS X 10.7 fix; update docs to new vers. #
Document Mark Kim's Mac OS X 10.7 fix.
Update docs to new version number (0.9.23c).
2018-10-07 15:53:48 -07:00
Bill Kendrick
81ff7d3ae0 Doc'ing return of Mac print dialog
(See recent commit by Mark)
2018-09-30 19:55:43 -07:00
Bill Kendrick
33de9841c0 0.9.23a; doc: less hungry progress, verbose debug
Documenting Mark Kim's recent changes:

 * Less CPU-hungry progress bar (during Stamp loading)
 * Verbose debugging options
 * (Also, mentioned debugging _at all_, in INSTALL.txt)

Bumping version to 0.9.23a, to match the test build he's working
on for macOS.
2018-09-24 22:15:38 -07:00
Bill Kendrick
ce47eb4c28 Doc'ing everywhere to fiddle w/ version #
I forgot to make sure macos/Info.plist had the latest version # and
release date, before tagging and releasing source code.  Adding a checklist
of places to double-check for properly-updated version #s and/or release dates.
2018-09-02 10:29:33 -07:00
Bill Kendrick
0edf9cb4d9 Mend typo in README stub
local -> locale
2018-08-30 01:45:35 -07:00
Bill Kendrick
1ed04ed1a5 More Name Case! 2018-08-30 01:05:49 -07:00
Bill Kendrick
6cd47ea2dc Name Case for Chandrakant Dhutadmal 2018-08-30 00:55:16 -07:00
Bill Kendrick
8b84d51d00 Update & simplify credits
Update (c) date to 2018 on title screen.
Simplify and update (c) info in most documentation.
2018-08-28 09:36:38 -07:00
Bill Kendrick
edae5fc771 Installation tweaks to Makefile
* Install Tux Paint docs into a version-numbered directory
   (e.g., "/usr/local/share/doc/tuxpaint-0.9.23/")

 * Launcher icon installation location adjustments:
   * .../X11R6/include/X11/pixmaps/ -> .../share/pixmaps/
   * Using kde4config (vs kdeconfig); not putting things in "Graphics" subdir.
   * Removed gnome-config stuff
2018-08-19 21:31:09 -07:00
Bill Kendrick
11bcb019b8 Referring to AUTHORS/CHANGES for author list
No longer saying "By Bill Kendrick", since so many more people
have added so much to the project over the years.
(I'm basically website maintainer & project manager these days :) )
2018-08-18 00:17:11 -07:00
Bill Kendrick
dca0f8bb38 Doc'ing Hat starter fix
https://sourceforge.net/p/tuxpaint/bugs/202/
2018-08-09 21:51:30 -07:00
Bill Kendrick
6e55fd9cb8 Basque translation update
Updates to eu.po by Alexander Gabillondo.
2018-08-09 21:03:21 -07:00
Bill Kendrick
3e944e56a1 Doc build date override addition to Makefile 2018-08-08 23:51:46 -07:00
Mark K. Kim
9a186cb2d8 Minor documentation corrections 2018-05-25 07:57:56 -04:00