3 Pango = imports.gi.Pango;
4 GLib = imports.gi.GLib;
6 GObject = imports.gi.GObject;
7 GtkSource = imports.gi.GtkSource;
8 WebKit = imports.gi.WebKit;
10 GtkClutter = imports.gi.GtkClutter;
12 console = imports.console;
13 XObject = imports.XObject.XObject;
17 destroy_event : function (self, event) {
21 response : function (self, id) {
27 if (typeof(this.get('bug').getValue()) != 'object') {
34 //var val = this.get('bug').getValue();
41 title : "Select Active Bug",
50 /*[ 'xtype' ].forEach(function(k) {
51 _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);
57 // block until we return.
60 print(JSON.serialize(this.get('bug').getValue()));
62 //this.success = c.success;
67 pack : function(p,e) {
68 p.el.get_content_area().add(e.el)
73 pack : "pack_start,false,true,3",
77 label : "Select Active Bug:",
78 pack : "pack_start,false,true,3"
83 changed : function (self) {
84 var d = this.getValue();
85 this.get('/view').load(d.description);
89 pack : "pack_end,true,true,3",
90 getValue : function() {
91 var ix = this.el.get_active();
95 return this.get('model').data[ix];
98 XObject.prototype.init.call(this);
99 this.el.add_attribute(this.items[0].el , 'markup', 1 );
101 setValue : function(v)
105 this.get('model').data.forEach(function(n, ix) {
114 xtype: Gtk.CellRendererText,
118 xtype: Gtk.ListStore,
122 XObject.prototype.init.call(this);
124 this.el.set_column_types ( 2, [
125 GObject.TYPE_STRING, // real key
126 GObject.TYPE_STRING // real type
130 var Tickets = imports.Tickets.Tickets;
132 this.data = Tickets.fetchBugs("http://www.roojs.com/mtrack/index.php/Gitlive/web.hex");
134 { xtype: 'Roo', desc : "Roo Project" },
135 { xtype: 'Gtk', desc : "Gtk Project" },
136 //{ xtype: 'JS', desc : "Javascript Class" }
139 this.loadData(this.data);
142 loadData : function (data) {
144 var iter = new Gtk.TreeIter();
146 data.forEach(function(p) {
151 el.set_value(iter, 0, p.id);
152 el.set_value(iter, 1, '#' + p.id + ' - ' + p.summary );
164 xtype: Gtk.ScrolledWindow,
176 XObject.prototype.init.call(this);
177 var description = Pango.Font.description_from_string("monospace")
178 description.set_size(8000);
179 this.el.modify_font(description);
182 load : function(str) {
184 // show the help page for the active node..
189 this.el.get_buffer().set_text(str, str.length);
192 var buf = this.el.get_buffer();
197 show_line_numbers : true,
200 xtype: GtkSource.Buffer,
202 changed : function (self) {
204 var s = new Gtk.TextIter();
205 var e = new Gtk.TextIter();
206 this.el.get_start_iter(s);
207 this.el.get_end_iter(e);
208 var str = this.el.get_text(s,e,true);
210 Seed.check_syntax('var e = ' + str);
212 this.get('/RightEditor.view').el.modify_base(Gtk.StateType.NORMAL, new Gdk.Color({
213 red: 0xFFFF, green: 0xCCCC , blue : 0xCCCC
215 //print("SYNTAX ERROR IN EDITOR");
220 this.get('/RightEditor.view').el.modify_base(Gtk.StateType.NORMAL, new Gdk.Color({
221 red: 0xFFFF, green: 0xFFFF , blue : 0xFFFF
224 this.get('/LeftPanel.model').changed( str , false);
238 pack : "add_action_widget,1",
243 pack : "add_action_widget,0",
249 XObject.cache['/FixBug'] = FixBug;