Ability to disable Template creation from Open dialog

This commit is contained in:
Bill Kendrick 2023-05-29 10:50:55 -07:00
parent 36d7e0daf3
commit 65378f6fdd
30 changed files with 291 additions and 72 deletions

View file

@ -156,6 +156,7 @@ stampcontrols, NEGBOOL(disable_stamp_controls)
stamps, NEGBOOL(dont_load_stamps)
stampsize, MULTI(stamp_size_override)
stamprotation, NEGBOOL(no_stamp_rotation)
templateexport, NEGBOOL(disable_template_export)
startblank, POSBOOL(start_blank)
startlast, NEGBOOL(start_blank)
sysconfig, POSBOOL(parsertmp_sysconfig)

View file

@ -23,6 +23,7 @@ struct cfginfo
const char *disable_save;
const char *disable_screensaver;
const char *disable_stamp_controls;
const char *disable_template_export;
const char *dont_do_xor;
const char *dont_load_stamps;
const char *no_stamp_rotation;

View file

@ -3,7 +3,7 @@
# Bill Kendrick <bill@newbreedsoftware.com>; https://tuxpaint.org/
# Based on inkscape's completion file, by allali@univ-mlv.fr
#
# Last modified 2023-04-12
# Last modified 2023-05-29
#
# $Id$
@ -59,6 +59,7 @@ _tuxpaint()
--nomagiccontrols --magiccontrols \
--nomagicsizes --magicsizes \
--noshapecontrols --shapecontrols \
--notemplateexport --templateexport \
--mirrorstamps --dontmirrorstamps \
--stampsize=0 --stampsize=1 \
--stampsize=2 --stampsize=3 \

View file

@ -22,7 +22,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
June 14, 2002 - May 27, 2023
June 14, 2002 - May 29, 2023
*/
#include "platform.h"
@ -1416,6 +1416,8 @@ static int stamp_size_override = -1;
static int no_stamp_rotation = 0;
static int new_colors_last;
static int disable_template_export;
static Uint8 magic_disabled_features = 0x00000000;
#ifdef NOKIA_770
@ -17006,8 +17008,7 @@ static int do_open(void)
char *instructions;
int num_left_buttons;
/* FIXME: Support simplification to disable "Template" (make a template) option -bjk 2023.05.25 */
if (1) {
if (!disable_template_export) {
instructions = textdir(gettext_noop("Choose a picture and then click “Open”, “Export”, “Template“, or “Erase”. Click “Slides” to create a slideshow animation or “Back“ to return to your current picture."));
} else {
instructions = textdir(gettext_noop("Choose a picture and then click “Open”, “Export”, or “Erase”. Click “Slides” to create a slideshow animation or “Back“ to return to your current picture."));
@ -17125,8 +17126,7 @@ static int do_open(void)
SDL_BlitSurface(img_openlabels_slideshow, NULL, screen, &dest);
/* FIXME: Support simplification to disable "Template" option -bjk 2023.05.25 */
if (1) {
if (!disable_template_export) {
/* "Template" (make template) button: */
num_left_buttons = 3;
@ -17427,7 +17427,8 @@ static int do_open(void)
done = 1;
playsound(screen, 1, SND_CLICK, 1, SNDPOS_LEFT, SNDDIST_NEAR);
}
else if (event.button.x >= r_ttools.w + button_w * 2
else if (!disable_template_export &&
event.button.x >= r_ttools.w + button_w * 2
&& event.button.x < r_ttools.w + button_w * 3
&& event.button.y >=
(button_h * buttons_tall + r_ttools.h) - button_h
@ -27897,6 +27898,7 @@ static void setup_config(char *argv[])
SETBOOL(disable_save);
SETBOOL(disable_screensaver);
SETBOOL(disable_stamp_controls);
SETBOOL(disable_template_export);
SETBOOL(dont_do_xor);
SETBOOL(dont_load_stamps);
SETBOOL(fullscreen);