"gen_extended" : false,
"items" : [
{
+ "# Project.Gtk project" : "null",
+ "# Project.GtkValaSettings? selected_target" : "null",
+ "# Xcls_MainWindow window" : "null",
+ "# bool cg_loading" : false,
+ "# bool done" : false,
"$ Project.Callback doneObj" : "null",
"$ xns" : "Gtk",
- "Project.Gtk project" : "null",
- "Project.GtkValaSettings? selected_target" : "null",
- "Xcls_MainWindow window" : "null",
- "bool cg_loading" : false,
- "bool done" : false,
"bool modal" : true,
"items" : [
{
"items" : [
{
"$ xns" : "Gtk",
- "Gtk.Align halign" : "Gtk.Align.START",
- "bool hexpand" : true,
- "utf8 label" : "compile flags",
- "xtype" : "Label"
+ "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+ "int spacing" : 10,
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "Gtk.Align halign" : "Gtk.Align.START",
+ "bool hexpand" : false,
+ "utf8 label" : "Compile flags:",
+ "xtype" : "Label"
+ },
+ {
+ "$ xns" : "Gtk",
+ "id" : "compile_flags",
+ "listeners" : {
+ "changed" : [
+ "() => {",
+ " ",
+ " _this.project.compile_flags = this.el.buffer.text;",
+ " _this.project.save();",
+ "// _this.project.save();",
+ "",
+ "}"
+ ]
+ },
+ "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR ",
+ "xtype" : "Entry"
+ },
+ {
+ "$ xns" : "Gtk",
+ "id" : "generate_meson",
+ "listeners" : {
+ "toggled" : [
+ "( ) => {",
+ "",
+ "\t_this.project.generate_meson = this.el.active;",
+ "}",
+ "\t"
+ ]
+ },
+ "string label" : "Generate Meson",
+ "xtype" : "CheckButton"
+ }
+ ],
+ "xtype" : "Box"
},
{
"$ xns" : "Gtk",
- "id" : "compile_flags",
- "listeners" : {
- "changed" : [
- "() => {",
- " ",
- " _this.project.compile_flags = this.el.buffer.text;",
- " _this.project.save();",
- "// _this.project.save();",
- "",
- "}"
- ]
- },
- "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR ",
- "xtype" : "Entry"
+ "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+ "int spacing" : 10,
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "Gtk.Align halign" : "Gtk.Align.START",
+ "bool hexpand" : false,
+ "utf8 label" : "Version:",
+ "xtype" : "Label"
+ },
+ {
+ "$ xns" : "Gtk",
+ "id" : "version",
+ "listeners" : {
+ "changed" : [
+ "() => {",
+ " ",
+ " _this.project.version = this.el.buffer.text;",
+ " _this.project.save();",
+ "// _this.project.save();",
+ "",
+ "}"
+ ]
+ },
+ "utf8 placeholder_text" : "eg. 1.5",
+ "xtype" : "Entry"
+ },
+ {
+ "$ xns" : "Gtk",
+ "Gtk.Align halign" : "Gtk.Align.START",
+ "bool hexpand" : false,
+ "utf8 label" : "Licence:",
+ "xtype" : "Label"
+ },
+ {
+ "$ xns" : "Gtk",
+ "id" : "licence",
+ "listeners" : {
+ "changed" : [
+ "() => {",
+ " ",
+ " _this.project.licence = this.el.buffer.text;",
+ " _this.project.save();",
+ "// _this.project.save();",
+ "",
+ "}"
+ ]
+ },
+ "utf8 placeholder_text" : "eg. LGPL",
+ "xtype" : "Entry"
+ }
+ ],
+ "xtype" : "Box"
},
{
"$ xns" : "Gtk",
"\t GLib.debug(\"Set name to %s\", cg.name);",
"\t ",
" \t_this.build_name.el.buffer.set_text(cg.name.data);",
- " ",
+ " \t_this.build_as_library.el.active = cg.is_library;",
" ",
"\t_this.build_execute_args.el.buffer.set_text( cg.execute_args.data );",
" ",
"xtype" : "Label"
},
{
+ "# bool in_insert" : false,
"$ xns" : "Gtk",
+ "* init" : [
+ "",
+ "var ed = (this.el.get_delegate() as Gtk.Editable);",
+ "if (ed != null) {",
+ "\ted.insert_text.connect((text, length, ref position) => {",
+ "\t\tif (this.in_insert) {",
+ "\t\t\treturn;",
+ "\t\t}",
+ "\t\tGLib.debug(\"got insert text %s\", text);",
+ "\t\t",
+ "\t\tvar nt = \"\";",
+ "\t\tfor(var i = 0;i < text.length; i++){ ",
+ "\t\t\tif (Posix.isupper(text[i]) ||Posix.islower(text[i]) ) {",
+ "\t\t\t\tnt += text[i].to_string();",
+ "\t\t\t}\t",
+ "\t\t}",
+ "\t\tif (nt.length < 1) {",
+ "\t\t\tGLib.Signal.stop_emission_by_name(ed, \"insert_text\");",
+ "\t\t\treturn;",
+ "\t\t}",
+ "",
+ "\t\tthis.in_insert = true;",
+ "\t ",
+ "\t\tthis.el.insert_text(nt,nt.length, ref position);",
+ "\t\tthis.in_insert = false;",
+ "\t\tGLib.Signal.stop_emission_by_name(ed, \"insert_text\");",
+ "\t});",
+ "",
+ "}"
+ ],
"id" : "build_name",
"listeners" : {
"changed" : [
"",
"\t_this.selected_target.name = this.el.buffer.text;",
"}"
+ ],
+ "insert_text" : [
+ "(text, length, ref position) => {",
+ "\tif (this.in_insert) {",
+ "\t\treturn;",
+ "\t}",
+ "\tGLib.debug(\"got insert text %s\", text);",
+ "\t",
+ "\tvar nt = \"\";",
+ "\tfor(var i = 0;i < text.length; i++){ ",
+ "\t\tif (Posix.isalpha(text[i])) {",
+ "\t\t\tnt += text[i].to_string();",
+ "\t\t}\t",
+ "\t}",
+ "\tif (nt.length < 1) {",
+ "\t\treturn;",
+ "\t}",
+ "",
+ "\tthis.in_insert = true;",
+ " ",
+ "\tthis.el.insert_text(text,length, ref position);",
+ "\tthis.in_insert = false;",
+ "}",
+ ""
]
},
"xtype" : "Entry"
},
"string placeholder_text" : "eg. -f somefile -g ",
"xtype" : "Entry"
+ },
+ {
+ "$ xns" : "Gtk",
+ "id" : "build_as_library",
+ "listeners" : {
+ "notify[\"active\"]" : [
+ "() => {",
+ " if (_this.selected_target == null) {",
+ " return;",
+ " }",
+ " _this.selected_target.is_library = this.el.active;",
+ " ",
+ "}",
+ ""
+ ]
+ },
+ "string label" : "build as library",
+ "xtype" : "CheckButton"
}
],
"xtype" : "Box"
" //print(\"ValaProjectSettings show\\n\");",
" this.doneObj = doneObj;",
" this.project= project;",
+ " ",
+ " this.project.loading = true;",
"\t ",
" this.compile_flags.el.buffer.set_text(",
" \tproject.compile_flags.data",
"\t);",
- "\t ",
- " project.loadVapiIntoStore(_this.vapimodel.el);",
- " GLib.Timeout.add(500, () => {",
- " \t\t this.vapi_scroll.el.vadjustment.value = 0;\t ",
- "\t return false;",
- " });",
- " ",
- " ",
+ " this.version.el.buffer.set_text(",
+ " \tproject.version.data",
+ "\t);",
+ "\t this.licence.el.buffer.set_text(",
+ " \tproject.licence.data",
+ "\t); ",
+ "\t",
+ "\t",
+ "\t",
+ "\tGLib.Idle.add(() => {",
+ "\t\tproject.loadVapiIntoStore(_this.vapimodel.el);",
+ "\t\t GLib.Timeout.add(500, () => {",
+ "\t \t\t this.vapi_scroll.el.vadjustment.value = 0;\t ",
+ "\t\t\t return false;",
+ "\t \t});",
+ " \t \tproject.loadTargetsIntoStore(this.target_model.el);",
+ " \t\t_this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;",
+ "\t\t_this.target_sel.selectTarget(null);",
+ "\t\t this.project.loading = false;",
+ "\t \treturn false;",
+ " \t});",
+ "\t\t",
+ " this.generate_meson.el.active = this.project.generate_meson;",
" \t",
- " \tproject.loadTargetsIntoStore(this.target_model.el);",
+ "",
"\t",
- " \t_this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;",
- "\t_this.target_sel.selectTarget(null);",
+ " ",
"//\tGtk.Allocation rect;",
"\t//btn.get_allocation(out rect);",
" // this.el.set_pointing_to(rect);",
- " this.el.application = pwin.application; // ??? make it modal?",
- "\t this.el.set_transient_for(pwin);",
+ " \tthis.el.application = pwin.application; // ??? make it modal?",
+ "\tthis.el.set_transient_for(pwin);",
"\t ",
"\t// window + header?",
"\t// print(\"SHOWALL - POPIP\\n\");",