X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Sample%2FRooProjectProperties.js;h=24d90b33f9867f9d4834da2ebf39f6fc47e88b06;hb=048b010aaf3960fd73352f23d6884b2dad08e9e2;hp=24e6700fa312914644ea85296aa7a86282f30aed;hpb=8abfeb44dcde40bc203d1bf0336b3f046245d8ae;p=app.Builder.js diff --git a/Sample/RooProjectProperties.js b/Sample/RooProjectProperties.js index 24e6700fa..24d90b33f 100644 --- a/Sample/RooProjectProperties.js +++ b/Sample/RooProjectProperties.js @@ -13,64 +13,87 @@ 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.el.show_all(); }, + default_width : 500, listeners : { - "delete_event":function (self, event) { + delete_event : function (self, event) { this.el.hide() return true; + }, + response : function (self, response_id) { + print(response_id); + if (!response_id) { + this.el.hide(); + + return; + } + var buf = this.get('view').el.get_buffer() + var s = new Gtk.TextIter(); + var e = new Gtk.TextIter(); + buf.get_start_iter(s); + buf.get_end_iter(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; + + 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(); } }, items : [ { xtype: Gtk.VBox, pack : function(p,e) { - p.el.get_content_area().add(e.el) + p.el.get_content_area().add(e.el); + e.border_width =5; }, items : [ { - xtype: Gtk.Table, - pack : "add", - init : function() { - this.el = new Gtk.Table.c_new(2,2, false); - XObject.prototype.init.call(this); - - }, - listeners : { - - }, + 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 : "add", - label : "baseURL", - 'eft-attac' : 0, - 'op-attac' : 0, - 'ight-attac' : 1 - }, - { - xtype: Gtk.Entry, + xtype: GtkSource.View, pack : "add", - 'eft-attac' : 1, - 'op-attac' : 0, - 'ight-attac' : 2 - }, - { - xtype: Gtk.Label, - pack : "add", - label : "baseURL", - left_attach : 0, - 'op-attac' : 1 - }, - { - xtype: Gtk.Entry, - pack : "add", - left_attach : 1, - 'op-attac' : 1 + id : "view" } ] } ] + }, + { + xtype: Gtk.Button, + pack : "add_action_widget,1", + label : "OK" + }, + { + xtype: Gtk.Button, + pack : "add_action_widget,0", + label : "Cancel" } ] });