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);
96 pack : "pack_end,true,true,3",
97 getValue : function() {
98 var ix = this.el.get_active();
102 return this.get('model').data[ix];
105 XObject.prototype.init.call(this);
106 this.el.add_attribute(this.items[0].el , 'markup', 1 );
108 setValue : function(v)
112 this.get('model').data.forEach(function(n, ix) {
121 xtype: Gtk.CellRendererText,
125 xtype: Gtk.ListStore,
129 XObject.prototype.init.call(this);
131 this.el.set_column_types ( 2, [
132 GObject.TYPE_STRING, // real key
133 GObject.TYPE_STRING // real type
137 var Tickets = imports.Tickets.Tickets;
139 this.data = Tickets.fetchBugs("http://www.roojs.com/mtrack/index.php/Gitlive/web.hex");
141 { xtype: 'Roo', desc : "Roo Project" },
142 { xtype: 'Gtk', desc : "Gtk Project" },
143 //{ xtype: 'JS', desc : "Javascript Class" }
146 this.loadData(this.data);
149 loadData : function (data) {
151 var iter = new Gtk.TreeIter();
153 data.forEach(function(p) {
158 el.set_value(iter, 0, p.id);
159 el.set_value(iter, 1, '#' + p.id + ' - ' + p.summary );
171 xtype: Gtk.ScrolledWindow,
183 XObject.prototype.init.call(this);
184 var description = Pango.Font.description_from_string("monospace")
185 description.set_size(8000);
186 this.el.modify_font(description);
189 load : function(str) {
191 // show the help page for the active node..
196 this.el.get_buffer().set_text(str, str.length);
199 var buf = this.el.get_buffer();
204 show_line_numbers : true,
207 xtype: GtkSource.Buffer,
209 changed : function (self) {
211 var s = new Gtk.TextIter();
212 var e = new Gtk.TextIter();
213 this.el.get_start_iter(s);
214 this.el.get_end_iter(e);
215 var str = this.el.get_text(s,e,true);
217 Seed.check_syntax('var e = ' + str);
219 this.get('/RightEditor.view').el.modify_base(Gtk.StateType.NORMAL, new Gdk.Color({
220 red: 0xFFFF, green: 0xCCCC , blue : 0xCCCC
222 //print("SYNTAX ERROR IN EDITOR");
227 this.get('/RightEditor.view').el.modify_base(Gtk.StateType.NORMAL, new Gdk.Color({
228 red: 0xFFFF, green: 0xFFFF , blue : 0xFFFF
231 this.get('/LeftPanel.model').changed( str , false);
246 pack : "add_action_widget,0"
252 pack : "add_action_widget,1"
257 XObject.cache['/FixBug'] = FixBug;