src/Builder4/DialogTemplateSelect.vala
"default_height" : 200,
"$ modal" : true,
"$ xns" : "Gtk",
- "| JsRender.Node? show" : " (Gtk.Window pwindow, Palete.Palete pal, JsRender.Node node) {\n \n this.el.show_all();\n var opts = pal.listTemplates(node);\n if (opts.length() < 1) {\n this.el.hide();\n return node;\n }\n this.el.set_attached_to( pwindow);\n this.el.set_transient_for( pwindow);\n \n //opts.unshift({ path: '' , name :'Just add Element' });\n _this.model.loadData(opts);\n _this.combo.el.set_active(0);\n \n \n this.el.run();\n this.el.hide(); \n //var ix = _this.combo.el.get_active();\n //if (ix < 1 ) {\n // return node;\n // }\n Gtk.TreeIter iter;\n _this.combo.el.get_active_iter (out iter);\n Value vfname;\n this.model.el.get_value (iter, 0, out vfname);\n \n if (((string)vfname).length < 1) {\n return node;\n }\n return pal.loadTemplate((string)vfname);\n\n}\n",
+ "| JsRender.Node? show" : " (Gtk.Window pwindow, Palete.Palete pal, JsRender.Node node) {\n \n this.el.show_all();\n var opts = pal.listTemplates(node);\n if (opts.length() < 1) {\n this.el.hide();\n return node;\n }\n this.el.set_attached_to( pwindow);\n this.el.set_transient_for( pwindow);\n \n //opts.unshift({ path: '' , name :'Just add Element' });\n _this.model.loadData(opts);\n _this.combo.el.set_active(0);\n \n \n var res = this.el.run();\n this.el.hide(); \n //var ix = _this.combo.el.get_active();\n if (res < 1 ) {\n return null;\n }\n if (res < 2 ) {\n return node;\n }\n \n Gtk.TreeIter iter;\n _this.combo.el.get_active_iter (out iter);\n Value vfname;\n this.model.el.get_value (iter, 0, out vfname);\n \n if (((string)vfname).length < 1) {\n return node;\n }\n return pal.loadTemplate((string)vfname);\n\n}\n",
"items" : [
{
"xtype" : "VBox",
_this.combo.el.set_active(0);
- this.el.run();
+ var res = this.el.run();
this.el.hide();
//var ix = _this.combo.el.get_active();
- //if (ix < 1 ) {
- // return node;
- // }
+ if (res < 1 ) {
+ return null;
+ }
+ if (res < 2 ) {
+ return node;
+ }
+
Gtk.TreeIter iter;
_this.combo.el.get_active_iter (out iter);
Value vfname;