summaryrefslogtreecommitdiff
path: root/fluid/template_panel.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <git@matthiasm.com>2019-02-01 23:16:49 +0100
committerMatthias Melcher <git@matthiasm.com>2019-02-01 23:16:49 +0100
commitd6294ac2fccab7e7ffdfbf1ef63a059bba46c777 (patch)
tree1a95be5794379f1a560da1b90ae21d48b11293b6 /fluid/template_panel.cxx
parentaf8e406f883f5190cc48dde62fa42bbc54526f04 (diff)
Reorganized Fluid Template feature (STR #3336).
Diffstat (limited to 'fluid/template_panel.cxx')
-rw-r--r--fluid/template_panel.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/fluid/template_panel.cxx b/fluid/template_panel.cxx
index 5dbf9e18e..c40128300 100644
--- a/fluid/template_panel.cxx
+++ b/fluid/template_panel.cxx
@@ -220,6 +220,30 @@ void template_load() {
fluid_prefs.getUserdataPath(path, sizeof(path));
strlcat(path, "templates", sizeof(path));
+ int sample_templates_generated = 0;
+ fluid_prefs.get("sample_templates_generated", sample_templates_generated, 0);
+
+ if (!sample_templates_generated) {
+ strcpy(filename, path);
+ strcat(filename, "/FLTK_License.fl");
+ FILE *f = fopen(filename, "wb");
+ if (f) {
+ fputs(
+ "# data file for the Fltk User Interface Designer (fluid)\nversion 1.0400\nheader_name {.h}\n"
+ "code_name {.cxx}\ncomment {//\n// \"$Id$\"\n//\n// @INSTANCE@ for the Fast Light Tool Kit (FLT"
+ "K).\n//\n// Copyright 1998-2019 by Bill Spitzak and others.\n//\n// This library is free sof"
+ "tware. Distribution and use rights are outlined in\n// the file \"COPYING\" which should have "
+ "been included with this file. If this\n// file is missing or damaged, see the license at:\n"
+ "//\n// http://www.fltk.org/COPYING.php\n//\n// Please report all bugs and problems on th"
+ "e following page:\n//\n// http://www.fltk.org/str.php\n//\n} {selected in_source in_head"
+ "er\n}\n\ncomment {\n//\n// End of \"$Id$\".\n//} {in_source in_header\n}\n", f);
+ fclose(f);
+ }
+ sample_templates_generated = 1;
+ fluid_prefs.set("sample_templates_generated", sample_templates_generated);
+ fluid_prefs.flush();
+ }
+
num_files = fl_filename_list(path, &files);
for (i = 0; i < num_files; i ++) {