X-Git-Url: http://git.roojs.org/?p=app.Builder.js;a=blobdiff_plain;f=Builder4%2FRooProjectProperties.js;h=c70e8954d69f918177c16db1fa4808b0546c6078;hp=3f907689c39e261a93b52bd4562b0a8499ce660f;hb=2357117f2dbfda5d1282c5cc730534781e244d7e;hpb=a8abe74a436a317a7574a85149f17ecf9f72daa1 diff --git a/Builder4/RooProjectProperties.js b/Builder4/RooProjectProperties.js index 3f907689c..c70e8954d 100644 --- a/Builder4/RooProjectProperties.js +++ b/Builder4/RooProjectProperties.js @@ -11,116 +11,76 @@ console = imports.console; XObject = imports.XObject.XObject; RooProjectProperties=new XObject({ xtype: Gtk.Dialog, - modal : true, - show : function() { - // get the active project. - var file = this.get('/Window.LeftTree').getActiveFile(); - if (!file) { - this.get('/StandardErrorDialog').show("No file is currently active"); - return; - } - var project = this.get('/Window.LeftTree').getActiveFile().project; - //print (project.fn); - project.runhtml = project.runhtml || ''; - this.get('view').el.get_buffer().set_text(project.runhtml, project.runhtml.length); - this.get('dbcon').el.set_text(project.dbcon || ''); - print("project db: " + project.dbcon); - this.el.show_all(); - }, - default_width : 500, listeners : { - delete_event : function (self, event) { - this.el.hide() - return true; + delete_event : (self, event) => { + this.el.hide(); + return true; }, - response : function (self, response_id) { - print(response_id); - if (!response_id) { + response : (self, response_id) => { + //print(response_id); + if (response_id< 1 ) { this.el.hide(); return; } - var buf = this.get('view').el.get_buffer() - var e = {}; - var s = {}; - buf.get_start_iter(s); - buf.get_end_iter(e); - - var str = buf.get_text(s.iter,e.iter,false); - //print(str); + var buf = view.el.get_buffer(); + Gtk.TextIter s; + Gtk.TextIter e; + buf.get_start_iter(out s); + buf.get_end_iter(out e); + var str = buf.get_text(s,e,true); // ideally we should syntax check it.. but it's html!? - var project = this.get('/Window.LeftTree').getActiveFile().project; - - - project.runhtml = str; + //var project = this.get('/Window.LeftTree').getActiveFile().project; - project.dbcon = this.get('dbcon').el.get_text(); + _this.project.runhtml = str; + _this.project.save(); - imports.ProjectManager.ProjectManager.saveConfig(); + // imports.Builder.Provider.ProjectManager.ProjectManager.saveConfig(); // print (str); // this.get('view').el.get_buffer().get_text(project.runjs, project.runjs.length); // ok pressed.. this.el.hide(); } }, + default_width : 500, + modal : true, + 'void:show' : (Project.Project project) { + _this.project = project; + // get the active project. + + //print (project.fn); + //project.runhtml = project.runhtml || ''; + _this.view.el.get_buffer().set_text(project.runhtml); + + this.el.show_all(); + }, items : [ { xtype: Gtk.VBox, - pack : function(p,e) { - p.el.get_content_area().add(e.el); - e.border_width =5; - }, + border_width : 5, + pack : get_content_area().add, items : [ { - xtype: Gtk.HBox, - pack : "pack_start,false,true,3", + xtype: Gtk.Label, + pack : "pack_start,false,false,0", + label : "HTML To insert at end of " + }, + { + xtype: Gtk.ScrolledWindow, + pack : "pack_end,true,true,0", items : [ - - - { - xtype: Gtk.Label, - pack : "pack_start,false,false,0", - label : "Database Name" - }, - { - xtype: Gtk.Entry, - id : "dbcon", + { + xtype: GtkSource.View, pack : "add", - visible : true - }, + id : "view" + } ] - }, - - { - xtype: Gtk.Label, - pack : "pack_start,false,false,0", - label : "HTML To insert at end of " - }, - { - xtype: Gtk.ScrolledWindow, - pack : "pack_end,true,true,0", - items : [ - { - xtype: GtkSource.View, - pack : "add", - id : "view" - } - ] - } - - - - - + } ] }, - - - - { xtype: Gtk.Button, pack : "add_action_widget,1",