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.
58 var run_ret = this.el.run();
59 print("RUN RETURN : " + run_ret);
61 //print(JSON.stringify(this.get('bug').getValue()));
62 return this.get('bug').getValue();
63 //this.success = c.success;
68 pack : function(p,e) {
69 p.el.get_content_area().add(e.el)
74 pack : "pack_start,false,true,3",
78 label : "Select Active Bug:",
79 pack : "pack_start,false,true,3"
84 changed : function (self) {
85 var d = this.getValue();
86 this.get('/view').load(d.description);
90 pack : "pack_end,true,true,3",
91 getValue : function() {
92 var ix = this.el.get_active();
96 return this.get('model').data[ix];
99 XObject.prototype.init.call(this);
100 this.el.add_attribute(this.items[0].el , 'markup', 1 );
102 setValue : function(v)
106 this.get('model').data.forEach(function(n, ix) {
115 xtype: Gtk.CellRendererText,
119 xtype: Gtk.ListStore,
123 XObject.prototype.init.call(this);
125 this.el.set_column_types ( 2, [
126 GObject.TYPE_STRING, // real key
127 GObject.TYPE_STRING // real type
131 var Tickets = imports.Tickets.Tickets;
133 this.data = Tickets.fetchBugs("http://www.roojs.com/mtrack/index.php/Gitlive/web.hex");
135 { xtype: 'Roo', desc : "Roo Project" },
136 { xtype: 'Gtk', desc : "Gtk Project" },
137 //{ xtype: 'JS', desc : "Javascript Class" }
140 this.loadData(this.data);
143 loadData : function (data) {
145 var iter = new Gtk.TreeIter();
147 data.forEach(function(p) {
152 el.set_value(iter, 0, p.id);
153 el.set_value(iter, 1, '#' + p.id + ' - ' + p.summary );
165 xtype: Gtk.ScrolledWindow,
177 XObject.prototype.init.call(this);
178 var description = Pango.Font.description_from_string("monospace")
179 description.set_size(8000);
180 this.el.modify_font(description);
183 load : function(str) {
185 // show the help page for the active node..
190 this.el.get_buffer().set_text(str, str.length);
193 var buf = this.el.get_buffer();
198 show_line_numbers : true,
201 xtype: GtkSource.Buffer,
203 changed : function (self) {
205 var s = new Gtk.TextIter();
206 var e = new Gtk.TextIter();
207 this.el.get_start_iter(s);
208 this.el.get_end_iter(e);
209 var str = this.el.get_text(s,e,true);
211 Seed.check_syntax('var e = ' + str);
213 this.get('/RightEditor.view').el.modify_base(Gtk.StateType.NORMAL, new Gdk.Color({
214 red: 0xFFFF, green: 0xCCCC , blue : 0xCCCC
216 //print("SYNTAX ERROR IN EDITOR");
221 this.get('/RightEditor.view').el.modify_base(Gtk.StateType.NORMAL, new Gdk.Color({
222 red: 0xFFFF, green: 0xFFFF , blue : 0xFFFF
225 this.get('/LeftPanel.model').changed( str , false);
239 pack : "add_action_widget,0",
244 pack : "add_action_widget,1",
250 XObject.cache['/FixBug'] = FixBug;