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]);
58 this.get('/ok_button').el.set_sensitive(false);
60 // block until we return.
61 var run_ret = this.el.run();
65 print("RUN RETURN : " + run_ret);
67 //print(JSON.stringify(this.get('bug').getValue()));
68 return this.get('bug').getValue();
69 //this.success = c.success;
74 pack : function(p,e) {
75 p.el.get_content_area().add(e.el)
80 pack : "pack_start,false,true,3",
84 label : "Select Active Bug:",
85 pack : "pack_start,false,true,3"
90 changed : function (self) {
91 var d = this.getValue();
92 this.get('/view').load(d.description);
93 this.get('/ok_button').el.set_sensitive(true);
97 pack : "pack_end,true,true,3",
98 getValue : function() {
99 var ix = this.el.get_active();
103 return this.get('model').data[ix];
106 XObject.prototype.init.call(this);
107 this.el.add_attribute(this.items[0].el , 'markup', 1 );
109 setValue : function(v)
113 this.get('model').data.forEach(function(n, ix) {
122 xtype: Gtk.CellRendererText,
126 xtype: Gtk.ListStore,
130 XObject.prototype.init.call(this);
132 this.el.set_column_types ( 2, [
133 GObject.TYPE_STRING, // real key
134 GObject.TYPE_STRING // real type
138 var Tickets = imports.Tickets.Tickets;
140 this.data = Tickets.fetchBugs("http://www.roojs.com/mtrack/index.php/Gitlive/web.hex");
142 { xtype: 'Roo', desc : "Roo Project" },
143 { xtype: 'Gtk', desc : "Gtk Project" },
144 //{ xtype: 'JS', desc : "Javascript Class" }
147 this.loadData(this.data);
150 loadData : function (data) {
152 var iter = new Gtk.TreeIter();
154 data.forEach(function(p) {
159 el.set_value(iter, 0, p.id);
160 el.set_value(iter, 1, '#' + p.id + ' - ' + p.summary );
172 xtype: Gtk.ScrolledWindow,
184 XObject.prototype.init.call(this);
185 var description = Pango.Font.description_from_string("monospace")
186 description.set_size(8000);
187 this.el.modify_font(description);
190 load : function(str) {
192 // show the help page for the active node..
197 this.el.get_buffer().set_text(str, str.length);
200 var buf = this.el.get_buffer();
205 show_line_numbers : true,
208 xtype: GtkSource.Buffer,
210 changed : function (self) {
212 var s = new Gtk.TextIter();
213 var e = new Gtk.TextIter();
214 this.el.get_start_iter(s);
215 this.el.get_end_iter(e);
216 var str = this.el.get_text(s,e,true);
218 Seed.check_syntax('var e = ' + str);
220 this.get('/RightEditor.view').el.modify_base(Gtk.StateType.NORMAL, new Gdk.Color({
221 red: 0xFFFF, green: 0xCCCC , blue : 0xCCCC
223 //print("SYNTAX ERROR IN EDITOR");
228 this.get('/RightEditor.view').el.modify_base(Gtk.StateType.NORMAL, new Gdk.Color({
229 red: 0xFFFF, green: 0xFFFF , blue : 0xFFFF
232 this.get('/LeftPanel.model').changed( str , false);
247 pack : "add_action_widget,0"
253 pack : "add_action_widget,1"
258 XObject.cache['/FixBug'] = FixBug;