Fix #8045 - roo base template not getting set correctly, clear warnings in roo settin...
authorAlan <alan@roojs.com>
Thu, 22 Feb 2024 08:18:46 +0000 (16:18 +0800)
committerAlan <alan@roojs.com>
Thu, 22 Feb 2024 08:18:46 +0000 (16:18 +0800)
resources/css/roobuilder.css
src/Builder4/RooProjectSettings.bjs
src/Builder4/RooProjectSettings.vala
src/Builder4/WindowRooView.bjs
src/Builder4/WindowRooView.vala

index efc3dee..3060b80 100644 (file)
@@ -89,4 +89,6 @@
 }
 #roo-search-entry { 
     background-color: #ccc; 
-}
\ No newline at end of file
+}
+
\ No newline at end of file
index adff8c9..1c0647f 100644 (file)
@@ -3,12 +3,10 @@
  "gen_extended" : false,
  "items" : [
   {
+   "# Project.Roo project" : "",
+   "# bool done" : false,
    "$ xns" : "Gtk",
    "@ void buttonPressed" : "(string btn)",
-   "Gtk.PositionType position" : "Gtk.PositionType.RIGHT",
-   "Project.Roo project" : "",
-   "bool autohide" : false,
-   "bool done" : false,
    "bool modal" : true,
    "id" : "RooProjectSettings",
    "items" : [
              "xtype" : "Label"
             },
             {
+             "# bool loading" : false,
              "$ xns" : "Gtk",
-             "* init" : "this.el.add_attribute(_this.base_template_cellrenderer.el , \"markup\", 0 );",
              "* pack" : "attach,1,1,1,1",
-             "bool loading" : false,
              "id" : "base_template",
              "items" : [
               {
                "$ xns" : "Gtk",
-               "* pack" : "pack_start,true",
-               "id" : "base_template_cellrenderer",
-               "xtype" : "CellRendererText"
-              },
-              {
-               "$ columns" : "typeof(string)",
-               "$ xns" : "Gtk",
-               "* pack" : "set_model",
-               "id" : "base_template_model",
-               "n_columns" : 1,
-               "xtype" : "ListStore",
-               "| void loadData" : [
-                "  () {",
-                "\t_this.base_template.loading = true;",
-                "  ",
-                "    this.el.clear();                                    ",
-                "    Gtk.TreeIter iter;",
-                "    var el = this.el;",
-                "    ",
-                "   /// el.append(out iter);",
-                "    ",
-                "   ",
-                "    el.append(out iter);",
-                "    el.set_value(iter, 0, \"roo.builder.html\");",
-                "    _this.base_template.el.set_active_iter(iter);",
-                "\tif (_this.project.base_template == \"roo.builder.html\") {",
-                "\t   _this.base_template.el.set_active_iter(iter);",
-                "    }",
-                "",
-                "    el.append(out iter);",
-                "    el.set_value(iter, 0, \"bootstrap.builder.html\");",
-                "  ",
-                "\tprint(\"\\ncur template = %s\\n\", _this.project.base_template);",
-                " ",
-                "    if (_this.project.base_template == \"bootstrap.builder.html\") {",
-                "\t   _this.base_template.el.set_active_iter(iter);",
-                "    }",
-                "\t  el.append(out iter);",
-                "    el.set_value(iter, 0, \"bootstrap4.builder.html\");",
-                "     if (_this.project.base_template == \"bootstrap4.builder.html\") {",
-                "\t   _this.base_template.el.set_active_iter(iter);",
-                "    }",
-                "    ",
-                "",
-                "\tel.append(out iter);",
-                "    el.set_value(iter, 0, \"mailer.builder.html\");",
-                "",
-                "\tif (_this.project.base_template == \"mailer.builder.html\") {",
-                "\t    _this.base_template.el.set_active_iter(iter);",
-                "    }",
-                "\t_this.base_template.loading = false;",
-                "                                     ",
-                "}",
-                ""
-               ]
+               "* prop" : "model",
+               "strings" : [
+                "{ ",
+                "\t\"roo.builder.html\",",
+                "\t\"bootstrap.builder.html\",",
+                "\t\"bootstrap4.builder.html\",",
+                "\t\"mailer.builder.html\"",
+                "}"
+               ],
+               "xtype" : "StringList"
               }
              ],
              "listeners" : {
-              "changed" : [
+              "notify[\"selected\"]" : [
                "() => {",
-               "\tGtk.TreeIter iter;",
+               "",
                " ",
                "\t// this get's called when we are filling in the data... ???",
                "\tif (this.loading) {",
                "\t\treturn;",
                "\t}",
-               "\t",
-               " ",
-               "\tif (this.el.get_active_iter(out iter)) {",
-               "\t\tValue vfname;",
-               "\t\t_this.base_template_model.el.get_value (iter, 0, out vfname);",
-               "\t\t_this.project.base_template = ((string)vfname) ;",
+               "\tvar sm = (Gtk.StringList) this.el.model;",
+               "\t_this.project.base_template = sm.get_string(this.el.selected);",
                "\t\t",
                "\t\t print(\"\\nSET base template to %s\\n\", _this.project.base_template );",
                "\t\t// is_bjs = ((string)vfname) == \"bjs\";",
-               "\t}",
-               "    ",
-               "  ",
-               "    // directory is only available for non-bjs ",
-               " ",
                "",
                "",
-               "}",
-               ""
+               " }"
               ]
              },
-             "xtype" : "ComboBox"
+             "xtype" : "DropDown"
             },
             {
              "$ xns" : "Gtk",
              "xtype" : "Label"
             },
             {
+             "# bool loading" : false,
              "$ xns" : "Gtk",
-             "* init" : "this.el.add_attribute(_this.html_gen_cellrenderer.el , \"markup\", 1 );",
              "* pack" : "attach,1,3,1,1",
              "id" : "html_gen",
              "items" : [
               {
                "$ xns" : "Gtk",
-               "* pack" : "pack_start,true",
-               "id" : "html_gen_cellrenderer",
-               "xtype" : "CellRendererText"
-              },
-              {
-               "$ columns" : "typeof(string),typeof(string)",
-               "$ xns" : "Gtk",
-               "* pack" : "set_model",
-               "id" : "html_gen_model",
-               "n_columns" : 2,
-               "xtype" : "ListStore",
-               "| void loadData" : [
-                "  (string cur) {",
-                "    this.el.clear();                                    ",
-                "    Gtk.TreeIter iter;",
-                "    var el = this.el;",
-                "    ",
+               "* prop" : "model",
+               "strings" : [
+                "{ ",
+                "\t\"Do not Generate\", // \"\"",
+                "\t\"same directory as BJS file\", // bjs",
+                "\t\"in templates subdirectory\"  // tmeplate",
                 " ",
-                "    el.append(out iter);",
-                "",
-                "    ",
-                "    el.set_value(iter, 0, \"\");",
-                "    el.set_value(iter, 1, \"Do not Generate\");",
-                "    _this.html_gen.el.set_active_iter(iter);",
-                "",
-                "    el.append(out iter);",
-                "    ",
-                "    el.set_value(iter, 0, \"bjs\");",
-                "    el.set_value(iter, 1, \"same directory as BJS file\");",
-                "\tif (cur == \"bjs\") {",
-                "\t    _this.html_gen.el.set_active_iter(iter);",
-                "    }",
-                "",
-                "",
-                "",
-                "    el.append(out iter);",
-                "    ",
-                "    el.set_value(iter, 0, \"templates\");",
-                "    el.set_value(iter, 1, \"in templates subdirectory\");",
-                "",
-                "\tif (cur == \"template\") {",
-                "\t    _this.html_gen.el.set_active_iter(iter);",
-                "    }",
-                "",
-                "                                     ",
-                "}",
-                ""
-               ]
+                "}  "
+               ],
+               "xtype" : "StringList"
               }
              ],
-             "xtype" : "ComboBox"
+             "listeners" : {
+              "notify[\"selected\"]" : [
+               "() => {",
+               "",
+               " ",
+               "\t// this get's called when we are filling in the data... ???",
+               "\tif (this.loading) {",
+               "\t\treturn;",
+               "\t}",
+               "\tvar sm = (Gtk.StringList) this.el.model;",
+               "\t_this.project.base_template = sm.get_string(this.el.selected);",
+               "\t\t",
+               "\t\t print(\"\\nSET base template to %s\\n\", _this.project.base_template );",
+               "\t\t// is_bjs = ((string)vfname) == \"bjs\";",
+               "",
+               "",
+               " }"
+              ]
+             },
+             "xtype" : "DropDown"
             }
            ],
            "n_columns" : 2,
            "items" : [
             {
              "$ xns" : "GtkSource",
-             "* init" : [
-              " ",
-              "    ",
-              "this.css = new Gtk.CssProvider();",
-              " ",
-              "\tthis.css.load_from_string(",
-              "\t\"#roo-project-settings-view{ font:  10px monospace;}\"",
-              ");",
-              " ",
-              "//this.el.get_style_context().add_provider(this.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);",
-              "        ",
-              "       Gtk.StyleContext.add_provider_for_display(",
-              "\t       Gdk.Display.get_default(), ",
-              "\t       this.css,",
-              "\t       Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION",
-              "       );"
-             ],
              "* pack" : "set_child",
-             "Gtk.CssProvider css" : "",
+             "css_classes" : "{ \"code-editor\" }",
              "id" : "view",
              "items" : [
               {
                "xtype" : "EventControllerKey"
               }
              ],
-             "string name" : "roo-project-settings-view",
              "xtype" : "View"
             }
            ],
            ],
            "xtype" : "Entry"
           },
-          {
-           "$ xns" : "Gtk",
-           "label" : "Username",
-           "xalign" : 0,
-           "xtype" : "Label"
-          },
-          {
-           "$ xns" : "Gtk",
-           "id" : "database_DBUSERNAME",
-           "items" : [
-            {
-             "$ xns" : "Gtk",
-             "listeners" : {
-              "key_pressed" : [
-               "(keyval, keycode, state) => {",
-               "    if (keyval == Gdk.Key.Tab) {",
-               "        _this.database_DBPASSWORD.el.grab_focus();",
-               "        return true;",
-               "    }",
-               "",
-               "",
-               "\treturn false;",
-               "\t ",
-               "",
-               "}",
-               ""
-              ]
-             },
-             "xtype" : "EventControllerKey"
-            }
-           ],
-           "xtype" : "Entry"
-          },
-          {
-           "$ xns" : "Gtk",
-           "label" : "Password",
-           "xalign" : 0,
-           "xtype" : "Label"
-          },
-          {
-           "$ xns" : "Gtk",
-           "id" : "database_DBPASSWORD",
-           "xtype" : "Entry"
-          },
           {
            "$ xns" : "Gtk",
            "listeners" : {
     }
    ],
    "string title" : "Edit Project settings",
-   "uint border_width" : 0,
    "xtype" : "Window",
    "| void save" : [
     "() {",
     "      ",
     "    _this.project.rootURL = _this.rootURL.el.get_text();",
     "    ",
+    "     ",
     "    ",
-    "    Gtk.TreeIter iter;",
-    "    Value html_gen_val;",
-    "    _this.html_gen.el.get_active_iter(out iter);",
-    "    _this.html_gen_model.el.get_value (iter, 0, out html_gen_val);",
+    "      ",
+    "\tvar val  = \"\";",
+    "\tswitch (this.html_gen.el.selected) {",
+    "\t\tcase 1: val = \"bjs\"; break;",
+    "\t\tcase 2: val = \"template\"; break;",
+    "\t}",
     "    ",
-    "    _this.project.html_gen = (string)html_gen_val;",
+    "    _this.project.html_gen = val;",
     "    ",
     "    // set by event changed...",
     "    //_this.project.base_template = _this.base_template.el.get_text();    ",
     "    var js = _this.project;",
     "    js.DBTYPE = _this.database_DBTYPE.el.get_text();",
     "   js.DBNAME= _this.database_DBNAME.el.get_text();",
-    "    js.DBUSERNAME= _this.database_DBUSERNAME.el.get_text();",
-    "    js.DBPASSWORD= _this.database_DBPASSWORD.el.get_text();",
+    "   // js.DBUSERNAME= _this.database_DBUSERNAME.el.get_text();",
+    "   // js.DBPASSWORD= _this.database_DBPASSWORD.el.get_text();",
     "//    _this.project.set_string_member(\"DBHOST\", _this.DBTYPE.el.get_text());    ",
     "    ",
     "    // need to re-init the database ",
     "      ",
     "    _this.rootURL.el.set_text( _this.project.rootURL );",
     "    ",
-    "    _this.html_gen_model.loadData(_this.project.html_gen);",
-    "",
-    "    _this.base_template_model.loadData();",
+    " ",
+    "    var tv = 0;",
+    "    switch (this.project.html_gen) {",
+    "    \tcase \"bjs\": tv = 1; break;",
+    "    \tcase \"template\": tv = 2; break;",
+    "    }",
+    "    this.html_gen.el.selected = tv;",
+    "   ",
     "    ",
+    "",
+    "\tvar sm = (Gtk.StringList)     _this.base_template.el.model;",
+    "\tthis.base_template.loading = true;",
+    "\tthis.base_template.el.selected = Gtk.INVALID_LIST_POSITION;",
+    "\tfor(var i=0;i< sm.get_n_items(); i++) {",
+    "\t\tif (sm.get_string( i ) ==  this.project.base_template) {",
+    "\t\t\tthis.base_template.el.selected = i;",
+    "\t\t\tbreak;",
+    "\t\t}",
+    "\t}",
+    "    this.base_template.loading = false;",
     "     //var js = _this.project;",
     "    _this.database_DBTYPE.el.set_text(    _this.project.DBTYPE );",
     "    _this.database_DBNAME.el.set_text(    _this.project.DBNAME );",
-    "    _this.database_DBUSERNAME.el.set_text(  _this.project.DBUSERNAME );",
-    "    _this.database_DBPASSWORD.el.set_text(  _this.project.DBPASSWORD );",
+    "    //_this.database_DBUSERNAME.el.set_text(  _this.project.DBUSERNAME );",
+    "    //_this.database_DBPASSWORD.el.set_text(  _this.project.DBPASSWORD );",
     "    ",
     "    \t//console.log('show all');",
     "",
index 7516636..081f2fb 100644 (file)
@@ -17,26 +17,17 @@ public class Xcls_RooProjectSettings : Object
        public Xcls_grid grid;
        public Xcls_path path;
        public Xcls_base_template base_template;
-       public Xcls_base_template_cellrenderer base_template_cellrenderer;
-       public Xcls_base_template_model base_template_model;
        public Xcls_rootURL rootURL;
        public Xcls_html_gen html_gen;
-       public Xcls_html_gen_cellrenderer html_gen_cellrenderer;
-       public Xcls_html_gen_model html_gen_model;
        public Xcls_view view;
        public Xcls_database_DBTYPE database_DBTYPE;
        public Xcls_database_DBNAME database_DBNAME;
-       public Xcls_database_DBUSERNAME database_DBUSERNAME;
-       public Xcls_database_DBPASSWORD database_DBPASSWORD;
        public Xcls_database_ERROR database_ERROR;
 
                // my vars (def)
        public signal void buttonPressed (string btn);
-       public Gtk.PositionType position;
-       public uint border_width;
        public bool done;
        public Project.Roo project;
-       public bool autohide;
 
        // ctor
        public Xcls_RooProjectSettings()
@@ -45,10 +36,7 @@ public class Xcls_RooProjectSettings : Object
                this.el = new Gtk.Window();
 
                // my vars (dec)
-               this.position = Gtk.PositionType.RIGHT;
-               this.border_width = 0;
                this.done = false;
-               this.autohide = false;
 
                // set gobject values
                this.el.title = "Edit Project settings";
@@ -57,6 +45,7 @@ public class Xcls_RooProjectSettings : Object
                child_1.ref();
                this.el.set_child ( child_1.el  );
                var child_2 = new Xcls_HeaderBar37( _this );
+               child_2.ref();
                this.el.titlebar = child_2.el;
        }
 
@@ -80,15 +69,31 @@ public class Xcls_RooProjectSettings : Object
              
            _this.rootURL.el.set_text( _this.project.rootURL );
            
-           _this.html_gen_model.loadData(_this.project.html_gen);
-       
-           _this.base_template_model.loadData();
+        
+           var tv = 0;
+           switch (this.project.html_gen) {
+               case "bjs": tv = 1; break;
+               case "template": tv = 2; break;
+           }
+           this.html_gen.el.selected = tv;
+          
            
+       
+               var sm = (Gtk.StringList)     _this.base_template.el.model;
+               this.base_template.loading = true;
+               this.base_template.el.selected = Gtk.INVALID_LIST_POSITION;
+               for(var i=0;i< sm.get_n_items(); i++) {
+                       if (sm.get_string( i ) ==  this.project.base_template) {
+                               this.base_template.el.selected = i;
+                               break;
+                       }
+               }
+           this.base_template.loading = false;
             //var js = _this.project;
            _this.database_DBTYPE.el.set_text(    _this.project.DBTYPE );
            _this.database_DBNAME.el.set_text(    _this.project.DBNAME );
-           _this.database_DBUSERNAME.el.set_text(  _this.project.DBUSERNAME );
-           _this.database_DBPASSWORD.el.set_text(  _this.project.DBPASSWORD );
+           //_this.database_DBUSERNAME.el.set_text(  _this.project.DBUSERNAME );
+           //_this.database_DBPASSWORD.el.set_text(  _this.project.DBPASSWORD );
            
                //console.log('show all');
        
@@ -113,13 +118,16 @@ public class Xcls_RooProjectSettings : Object
              
            _this.project.rootURL = _this.rootURL.el.get_text();
            
+            
            
-           Gtk.TreeIter iter;
-           Value html_gen_val;
-           _this.html_gen.el.get_active_iter(out iter);
-           _this.html_gen_model.el.get_value (iter, 0, out html_gen_val);
+             
+               var val  = "";
+               switch (this.html_gen.el.selected) {
+                       case 1: val = "bjs"; break;
+                       case 2: val = "template"; break;
+               }
            
-           _this.project.html_gen = (string)html_gen_val;
+           _this.project.html_gen = val;
            
            // set by event changed...
            //_this.project.base_template = _this.base_template.el.get_text();    
@@ -127,8 +135,8 @@ public class Xcls_RooProjectSettings : Object
            var js = _this.project;
            js.DBTYPE = _this.database_DBTYPE.el.get_text();
           js.DBNAME= _this.database_DBNAME.el.get_text();
-           js.DBUSERNAME= _this.database_DBUSERNAME.el.get_text();
-           js.DBPASSWORD= _this.database_DBPASSWORD.el.get_text();
+          // js.DBUSERNAME= _this.database_DBUSERNAME.el.get_text();
+          // js.DBPASSWORD= _this.database_DBPASSWORD.el.get_text();
        //    _this.project.set_string_member("DBHOST", _this.DBTYPE.el.get_text());    
            
            // need to re-init the database 
@@ -395,7 +403,7 @@ public class Xcls_RooProjectSettings : Object
 
        public class Xcls_base_template : Object
        {
-               public Gtk.ComboBox el;
+               public Gtk.DropDown el;
                private Xcls_RooProjectSettings  _this;
 
 
@@ -407,87 +415,53 @@ public class Xcls_RooProjectSettings : Object
                {
                        _this = _owner;
                        _this.base_template = this;
-                       this.el = new Gtk.ComboBox();
+                       var child_1 = new Xcls_StringList221( _this );
+                       child_1.ref();
+                       this.el = new Gtk.DropDown( child_1.el, null );
 
                        // my vars (dec)
                        this.loading = false;
 
                        // set gobject values
-                       new Xcls_base_template_cellrenderer( _this );
-                       this.el.pack_start ( _this.base_template_cellrenderer.el , true );
-                       new Xcls_base_template_model( _this );
-                       this.el.set_model ( _this.base_template_model.el  );
-
-                       // init method
-
-                       this.el.add_attribute(_this.base_template_cellrenderer.el , "markup", 0 );
 
                        //listeners
-                       this.el.changed.connect( () => {
-                               Gtk.TreeIter iter;
+                       this.el.notify["selected"].connect( () => {
+                       
                         
                                // this get's called when we are filling in the data... ???
                                if (this.loading) {
                                        return;
                                }
-                               
-                        
-                               if (this.el.get_active_iter(out iter)) {
-                                       Value vfname;
-                                       _this.base_template_model.el.get_value (iter, 0, out vfname);
-                                       _this.project.base_template = ((string)vfname) ;
+                               var sm = (Gtk.StringList) this.el.model;
+                               _this.project.base_template = sm.get_string(this.el.selected);
                                        
                                         print("\nSET base template to %s\n", _this.project.base_template );
                                        // is_bjs = ((string)vfname) == "bjs";
-                               }
-                           
-                         
-                           // directory is only available for non-bjs 
-                        
                        
                        
-                       });
-               }
-
-               // user defined functions
-       }
-       public class Xcls_base_template_cellrenderer : Object
-       {
-               public Gtk.CellRendererText el;
-               private Xcls_RooProjectSettings  _this;
-
-
-                       // my vars (def)
-
-               // ctor
-               public Xcls_base_template_cellrenderer(Xcls_RooProjectSettings _owner )
-               {
-                       _this = _owner;
-                       _this.base_template_cellrenderer = this;
-                       this.el = new Gtk.CellRendererText();
-
-                       // my vars (dec)
-
-                       // set gobject values
+                        });
                }
 
                // user defined functions
        }
-
-       public class Xcls_base_template_model : Object
+       public class Xcls_StringList221 : Object
        {
-               public Gtk.ListStore el;
+               public Gtk.StringList el;
                private Xcls_RooProjectSettings  _this;
 
 
                        // my vars (def)
 
                // ctor
-               public Xcls_base_template_model(Xcls_RooProjectSettings _owner )
+               public Xcls_StringList221(Xcls_RooProjectSettings _owner )
                {
                        _this = _owner;
-                       _this.base_template_model = this;
-                       this.el = new Gtk.ListStore.newv(  { typeof(string) }  );
+                       this.el = new Gtk.StringList( { 
+       "roo.builder.html",
+       "bootstrap.builder.html",
+       "bootstrap4.builder.html",
+       "mailer.builder.html"
+} );
 
                        // my vars (dec)
 
@@ -495,47 +469,6 @@ public class Xcls_RooProjectSettings : Object
                }
 
                // user defined functions
-               public void loadData () {
-                       _this.base_template.loading = true;
-                 
-                   this.el.clear();                                    
-                   Gtk.TreeIter iter;
-                   var el = this.el;
-                   
-                  /// el.append(out iter);
-                   
-                  
-                   el.append(out iter);
-                   el.set_value(iter, 0, "roo.builder.html");
-                   _this.base_template.el.set_active_iter(iter);
-                       if (_this.project.base_template == "roo.builder.html") {
-                          _this.base_template.el.set_active_iter(iter);
-                   }
-               
-                   el.append(out iter);
-                   el.set_value(iter, 0, "bootstrap.builder.html");
-                 
-                       print("\ncur template = %s\n", _this.project.base_template);
-                
-                   if (_this.project.base_template == "bootstrap.builder.html") {
-                          _this.base_template.el.set_active_iter(iter);
-                   }
-                         el.append(out iter);
-                   el.set_value(iter, 0, "bootstrap4.builder.html");
-                    if (_this.project.base_template == "bootstrap4.builder.html") {
-                          _this.base_template.el.set_active_iter(iter);
-                   }
-                   
-               
-                       el.append(out iter);
-                   el.set_value(iter, 0, "mailer.builder.html");
-               
-                       if (_this.project.base_template == "mailer.builder.html") {
-                           _this.base_template.el.set_active_iter(iter);
-                   }
-                       _this.base_template.loading = false;
-                                                    
-               }
        }
 
 
@@ -612,71 +545,65 @@ public class Xcls_RooProjectSettings : Object
 
        public class Xcls_html_gen : Object
        {
-               public Gtk.ComboBox el;
+               public Gtk.DropDown el;
                private Xcls_RooProjectSettings  _this;
 
 
                        // my vars (def)
+               public bool loading;
 
                // ctor
                public Xcls_html_gen(Xcls_RooProjectSettings _owner )
                {
                        _this = _owner;
                        _this.html_gen = this;
-                       this.el = new Gtk.ComboBox();
+                       var child_1 = new Xcls_StringList322( _this );
+                       child_1.ref();
+                       this.el = new Gtk.DropDown( child_1.el, null );
 
                        // my vars (dec)
+                       this.loading = false;
 
                        // set gobject values
-                       new Xcls_html_gen_cellrenderer( _this );
-                       this.el.pack_start ( _this.html_gen_cellrenderer.el , true );
-                       new Xcls_html_gen_model( _this );
-                       this.el.set_model ( _this.html_gen_model.el  );
-
-                       // init method
-
-                       this.el.add_attribute(_this.html_gen_cellrenderer.el , "markup", 1 );
-               }
-
-               // user defined functions
-       }
-       public class Xcls_html_gen_cellrenderer : Object
-       {
-               public Gtk.CellRendererText el;
-               private Xcls_RooProjectSettings  _this;
-
 
-                       // my vars (def)
-
-               // ctor
-               public Xcls_html_gen_cellrenderer(Xcls_RooProjectSettings _owner )
-               {
-                       _this = _owner;
-                       _this.html_gen_cellrenderer = this;
-                       this.el = new Gtk.CellRendererText();
-
-                       // my vars (dec)
-
-                       // set gobject values
+                       //listeners
+                       this.el.notify["selected"].connect( () => {
+                       
+                        
+                               // this get's called when we are filling in the data... ???
+                               if (this.loading) {
+                                       return;
+                               }
+                               var sm = (Gtk.StringList) this.el.model;
+                               _this.project.base_template = sm.get_string(this.el.selected);
+                                       
+                                        print("\nSET base template to %s\n", _this.project.base_template );
+                                       // is_bjs = ((string)vfname) == "bjs";
+                       
+                       
+                        });
                }
 
                // user defined functions
        }
-
-       public class Xcls_html_gen_model : Object
+       public class Xcls_StringList322 : Object
        {
-               public Gtk.ListStore el;
+               public Gtk.StringList el;
                private Xcls_RooProjectSettings  _this;
 
 
                        // my vars (def)
 
                // ctor
-               public Xcls_html_gen_model(Xcls_RooProjectSettings _owner )
+               public Xcls_StringList322(Xcls_RooProjectSettings _owner )
                {
                        _this = _owner;
-                       _this.html_gen_model = this;
-                       this.el = new Gtk.ListStore.newv(  { typeof(string),typeof(string) }  );
+                       this.el = new Gtk.StringList( { 
+       "Do not Generate", // ""
+       "same directory as BJS file", // bjs
+       "in templates subdirectory"  // tmeplate
+}   );
 
                        // my vars (dec)
 
@@ -684,40 +611,6 @@ public class Xcls_RooProjectSettings : Object
                }
 
                // user defined functions
-               public void loadData (string cur) {
-                   this.el.clear();                                    
-                   Gtk.TreeIter iter;
-                   var el = this.el;
-                   
-                
-                   el.append(out iter);
-               
-                   
-                   el.set_value(iter, 0, "");
-                   el.set_value(iter, 1, "Do not Generate");
-                   _this.html_gen.el.set_active_iter(iter);
-               
-                   el.append(out iter);
-                   
-                   el.set_value(iter, 0, "bjs");
-                   el.set_value(iter, 1, "same directory as BJS file");
-                       if (cur == "bjs") {
-                           _this.html_gen.el.set_active_iter(iter);
-                   }
-               
-               
-               
-                   el.append(out iter);
-                   
-                   el.set_value(iter, 0, "templates");
-                   el.set_value(iter, 1, "in templates subdirectory");
-               
-                       if (cur == "template") {
-                           _this.html_gen.el.set_active_iter(iter);
-                   }
-               
-                                                    
-               }
        }
 
 
@@ -775,7 +668,6 @@ public class Xcls_RooProjectSettings : Object
 
 
                        // my vars (def)
-               public Gtk.CssProvider css;
 
                // ctor
                public Xcls_view(Xcls_RooProjectSettings _owner )
@@ -787,26 +679,10 @@ public class Xcls_RooProjectSettings : Object
                        // my vars (dec)
 
                        // set gobject values
-                       this.el.name = "roo-project-settings-view";
+                       this.el.css_classes = { "code-editor" };
                        var child_1 = new Xcls_EventControllerKey22( _this );
                        child_1.ref();
                        this.el.add_controller(  child_1.el );
-
-                       // init method
-
-                       this.css = new Gtk.CssProvider();
-                        
-                               this.css.load_from_string(
-                               "#roo-project-settings-view{ font:  10px monospace;}"
-                       );
-                        
-                       //this.el.get_style_context().add_provider(this.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
-                               
-                              Gtk.StyleContext.add_provider_for_display(
-                                      Gdk.Display.get_default(), 
-                                      this.css,
-                                      Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
-                              );
                }
 
                // user defined functions
@@ -889,19 +765,9 @@ public class Xcls_RooProjectSettings : Object
                        this.el.append( child_3.el );
                        new Xcls_database_DBNAME( _this );
                        this.el.append( _this.database_DBNAME.el );
-                       var child_5 = new Xcls_Label30( _this );
+                       var child_5 = new Xcls_Button35( _this );
                        child_5.ref();
                        this.el.append( child_5.el );
-                       new Xcls_database_DBUSERNAME( _this );
-                       this.el.append( _this.database_DBUSERNAME.el );
-                       var child_7 = new Xcls_Label33( _this );
-                       child_7.ref();
-                       this.el.append( child_7.el );
-                       new Xcls_database_DBPASSWORD( _this );
-                       this.el.append( _this.database_DBPASSWORD.el );
-                       var child_9 = new Xcls_Button35( _this );
-                       child_9.ref();
-                       this.el.append( child_9.el );
                        new Xcls_database_ERROR( _this );
                        this.el.append( _this.database_ERROR.el );
                }
@@ -1073,136 +939,6 @@ public class Xcls_RooProjectSettings : Object
        }
 
 
-       public class Xcls_Label30 : Object
-       {
-               public Gtk.Label el;
-               private Xcls_RooProjectSettings  _this;
-
-
-                       // my vars (def)
-
-               // ctor
-               public Xcls_Label30(Xcls_RooProjectSettings _owner )
-               {
-                       _this = _owner;
-                       this.el = new Gtk.Label( "Username" );
-
-                       // my vars (dec)
-
-                       // set gobject values
-                       this.el.xalign = 0f;
-               }
-
-               // user defined functions
-       }
-
-       public class Xcls_database_DBUSERNAME : Object
-       {
-               public Gtk.Entry el;
-               private Xcls_RooProjectSettings  _this;
-
-
-                       // my vars (def)
-
-               // ctor
-               public Xcls_database_DBUSERNAME(Xcls_RooProjectSettings _owner )
-               {
-                       _this = _owner;
-                       _this.database_DBUSERNAME = this;
-                       this.el = new Gtk.Entry();
-
-                       // my vars (dec)
-
-                       // set gobject values
-                       var child_1 = new Xcls_EventControllerKey32( _this );
-                       child_1.ref();
-                       this.el.add_controller(  child_1.el );
-               }
-
-               // user defined functions
-       }
-       public class Xcls_EventControllerKey32 : Object
-       {
-               public Gtk.EventControllerKey el;
-               private Xcls_RooProjectSettings  _this;
-
-
-                       // my vars (def)
-
-               // ctor
-               public Xcls_EventControllerKey32(Xcls_RooProjectSettings _owner )
-               {
-                       _this = _owner;
-                       this.el = new Gtk.EventControllerKey();
-
-                       // my vars (dec)
-
-                       // set gobject values
-
-                       //listeners
-                       this.el.key_pressed.connect( (keyval, keycode, state) => {
-                           if (keyval == Gdk.Key.Tab) {
-                               _this.database_DBPASSWORD.el.grab_focus();
-                               return true;
-                           }
-                       
-                       
-                               return false;
-                                
-                       
-                       });
-               }
-
-               // user defined functions
-       }
-
-
-       public class Xcls_Label33 : Object
-       {
-               public Gtk.Label el;
-               private Xcls_RooProjectSettings  _this;
-
-
-                       // my vars (def)
-
-               // ctor
-               public Xcls_Label33(Xcls_RooProjectSettings _owner )
-               {
-                       _this = _owner;
-                       this.el = new Gtk.Label( "Password" );
-
-                       // my vars (dec)
-
-                       // set gobject values
-                       this.el.xalign = 0f;
-               }
-
-               // user defined functions
-       }
-
-       public class Xcls_database_DBPASSWORD : Object
-       {
-               public Gtk.Entry el;
-               private Xcls_RooProjectSettings  _this;
-
-
-                       // my vars (def)
-
-               // ctor
-               public Xcls_database_DBPASSWORD(Xcls_RooProjectSettings _owner )
-               {
-                       _this = _owner;
-                       _this.database_DBPASSWORD = this;
-                       this.el = new Gtk.Entry();
-
-                       // my vars (dec)
-
-                       // set gobject values
-               }
-
-               // user defined functions
-       }
-
        public class Xcls_Button35 : Object
        {
                public Gtk.Button el;
index 497caf2..b515fd1 100644 (file)
             "    var base_template = project.base_template;",
             "    var f = GLib. File.new_for_uri(\"resource:///html/\" + base_template);",
             "    ",
-            "    if (base_template.length > 0 && !f.query_exists(null)) {",
+            "    if (base_template.length > 0 &&  f.query_exists(null)) {",
             "       ",
-            "           GLib.debug(\"invalid base_template name - using default:  %s\", base_template);",
+            "           GLib.debug(\"invalid base_template name ='%s' - using default\", base_template);",
             "           f = GLib. File.new_for_uri(\"resource:///html/roo.builder.html\");",
             "    ",
             "    }",
index 83c4804..aa92914 100644 (file)
@@ -911,9 +911,9 @@ public class Xcls_WindowRooView : Object
                    var base_template = project.base_template;
                    var f = GLib. File.new_for_uri("resource:///html/" + base_template);
                    
-                   if (base_template.length > 0 && !f.query_exists(null)) {
+                   if (base_template.length > 0 &&  f.query_exists(null)) {
                       
-                          GLib.debug("invalid base_template name - using default:  %s", base_template);
+                          GLib.debug("invalid base_template name ='%s' - using default", base_template);
                           f = GLib. File.new_for_uri("resource:///html/roo.builder.html");
                    
                    }