RepoStatusPopover.bjs
[gitlive] / RepoStatusPopover.vala
1 static RepoStatusPopover  _RepoStatusPopover;
2
3 public class RepoStatusPopover : Object
4 {
5     public Gtk.Popover el;
6     private RepoStatusPopover  _this;
7
8     public static RepoStatusPopover singleton()
9     {
10         if (_RepoStatusPopover == null) {
11             _RepoStatusPopover= new RepoStatusPopover();
12         }
13         return _RepoStatusPopover;
14     }
15     public Xcls_label_status label_status;
16     public Xcls_label_diff label_diff;
17     public Xcls_status_view status_view;
18     public Xcls_diff_view diff_view;
19
20         // my vars (def)
21     public GitRepo repo;
22
23     // ctor
24     public RepoStatusPopover()
25     {
26         _this = this;
27         this.el = new Gtk.Popover( null );
28
29         // my vars (dec)
30
31         // set gobject values
32         this.el.border_width = 0;
33         this.el.modal = true;
34         this.el.position = Gtk.PositionType.RIGHT;
35         var child_0 = new Xcls_Box2( _this );
36         child_0.ref();
37         this.el.add (  child_0.el  );
38     }
39
40     // user defined functions
41     public void show (Gtk.Widget btn, Gdk.Rectangle rect, GitRepo repo) {
42         _this.repo = repo;
43         // get the active project.
44          var lm = Gtk.SourceLanguageManager.get_default();
45                     
46     //    ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
47       //      lm.get_language("html")
48      //   );
49       
50         //print (project.fn);
51         //project.runhtml = project.runhtml || '';
52         _this.diff_view.el.get_buffer().set_text("diff goes here");
53         _this.status_view.el.get_buffer().set_text("status goes here");
54            
55                 //console.log('show all');
56         this.el.set_modal(true);
57         this.el.set_pointing_to(rect);
58     
59         //this.el.set_relative_to(btn);
60      
61         //this.el.set_position(Gtk.PositionType.RIGHT);
62     
63         // window + header?
64          print("SHOWALL - POPIP\n");
65         this.el.show_all();
66         this.el.set_size_request(800,500);
67     //  this.diff_view.el.grab_focus();
68         
69         //this.el.show_all();
70     }
71     public class Xcls_Box2 : Object
72     {
73         public Gtk.Box el;
74         private RepoStatusPopover  _this;
75
76
77             // my vars (def)
78
79         // ctor
80         public Xcls_Box2(RepoStatusPopover _owner )
81         {
82             _this = _owner;
83             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
84
85             // my vars (dec)
86
87             // set gobject values
88             this.el.homogeneous = false;
89             this.el.border_width = 5;
90             var child_0 = new Xcls_Notebook3( _this );
91             child_0.ref();
92             this.el.pack_start (  child_0.el , true,true,0 );
93             var child_1 = new Xcls_Box12( _this );
94             child_1.ref();
95             this.el.pack_end (  child_1.el , false,false,0 );
96         }
97
98         // user defined functions
99     }
100     public class Xcls_Notebook3 : Object
101     {
102         public Gtk.Notebook el;
103         private RepoStatusPopover  _this;
104
105
106             // my vars (def)
107
108         // ctor
109         public Xcls_Notebook3(RepoStatusPopover _owner )
110         {
111             _this = _owner;
112             this.el = new Gtk.Notebook();
113
114             // my vars (dec)
115
116             // set gobject values
117             var child_0 = new Xcls_label_status( _this );
118             child_0.ref();
119             var child_1 = new Xcls_label_diff( _this );
120             child_1.ref();
121             var child_2 = new Xcls_Box6( _this );
122             child_2.ref();
123             this.el.append_page (  child_2.el , _this.label_status.el );
124             var child_3 = new Xcls_Box9( _this );
125             child_3.ref();
126             this.el.append_page (  child_3.el , _this.label_diff.el );
127         }
128
129         // user defined functions
130     }
131     public class Xcls_label_status : Object
132     {
133         public Gtk.Label el;
134         private RepoStatusPopover  _this;
135
136
137             // my vars (def)
138
139         // ctor
140         public Xcls_label_status(RepoStatusPopover _owner )
141         {
142             _this = _owner;
143             _this.label_status = this;
144             this.el = new Gtk.Label( "Status" );
145
146             // my vars (dec)
147
148             // set gobject values
149         }
150
151         // user defined functions
152     }
153
154     public class Xcls_label_diff : Object
155     {
156         public Gtk.Label el;
157         private RepoStatusPopover  _this;
158
159
160             // my vars (def)
161
162         // ctor
163         public Xcls_label_diff(RepoStatusPopover _owner )
164         {
165             _this = _owner;
166             _this.label_diff = this;
167             this.el = new Gtk.Label( "Diff" );
168
169             // my vars (dec)
170
171             // set gobject values
172         }
173
174         // user defined functions
175     }
176
177     public class Xcls_Box6 : Object
178     {
179         public Gtk.Box el;
180         private RepoStatusPopover  _this;
181
182
183             // my vars (def)
184
185         // ctor
186         public Xcls_Box6(RepoStatusPopover _owner )
187         {
188             _this = _owner;
189             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
190
191             // my vars (dec)
192
193             // set gobject values
194             this.el.homogeneous = false;
195             var child_0 = new Xcls_ScrolledWindow7( _this );
196             child_0.ref();
197             this.el.pack_start (  child_0.el , true,true,0 );
198         }
199
200         // user defined functions
201     }
202     public class Xcls_ScrolledWindow7 : Object
203     {
204         public Gtk.ScrolledWindow el;
205         private RepoStatusPopover  _this;
206
207
208             // my vars (def)
209
210         // ctor
211         public Xcls_ScrolledWindow7(RepoStatusPopover _owner )
212         {
213             _this = _owner;
214             this.el = new Gtk.ScrolledWindow( null, null );
215
216             // my vars (dec)
217
218             // set gobject values
219             var child_0 = new Xcls_status_view( _this );
220             child_0.ref();
221             this.el.add (  child_0.el  );
222         }
223
224         // user defined functions
225     }
226     public class Xcls_status_view : Object
227     {
228         public Gtk.SourceView el;
229         private RepoStatusPopover  _this;
230
231
232             // my vars (def)
233
234         // ctor
235         public Xcls_status_view(RepoStatusPopover _owner )
236         {
237             _this = _owner;
238             _this.status_view = this;
239             this.el = new Gtk.SourceView();
240
241             // my vars (dec)
242
243             // init method
244
245             var description =   Pango.FontDescription.from_string("monospace");
246                 description.set_size(9000);
247                 this.el.override_font(description);
248         }
249
250         // user defined functions
251     }
252
253
254
255     public class Xcls_Box9 : Object
256     {
257         public Gtk.Box el;
258         private RepoStatusPopover  _this;
259
260
261             // my vars (def)
262
263         // ctor
264         public Xcls_Box9(RepoStatusPopover _owner )
265         {
266             _this = _owner;
267             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
268
269             // my vars (dec)
270
271             // set gobject values
272             this.el.homogeneous = false;
273             var child_0 = new Xcls_ScrolledWindow10( _this );
274             child_0.ref();
275             this.el.pack_start (  child_0.el , true,true,0 );
276         }
277
278         // user defined functions
279     }
280     public class Xcls_ScrolledWindow10 : Object
281     {
282         public Gtk.ScrolledWindow el;
283         private RepoStatusPopover  _this;
284
285
286             // my vars (def)
287
288         // ctor
289         public Xcls_ScrolledWindow10(RepoStatusPopover _owner )
290         {
291             _this = _owner;
292             this.el = new Gtk.ScrolledWindow( null, null );
293
294             // my vars (dec)
295
296             // set gobject values
297             var child_0 = new Xcls_diff_view( _this );
298             child_0.ref();
299             this.el.add (  child_0.el  );
300         }
301
302         // user defined functions
303     }
304     public class Xcls_diff_view : Object
305     {
306         public Gtk.SourceView el;
307         private RepoStatusPopover  _this;
308
309
310             // my vars (def)
311
312         // ctor
313         public Xcls_diff_view(RepoStatusPopover _owner )
314         {
315             _this = _owner;
316             _this.diff_view = this;
317             this.el = new Gtk.SourceView();
318
319             // my vars (dec)
320
321             // init method
322
323             var description =   Pango.FontDescription.from_string("monospace");
324                 description.set_size(9000);
325                 this.el.override_font(description);
326         }
327
328         // user defined functions
329     }
330
331
332
333
334     public class Xcls_Box12 : Object
335     {
336         public Gtk.Box el;
337         private RepoStatusPopover  _this;
338
339
340             // my vars (def)
341
342         // ctor
343         public Xcls_Box12(RepoStatusPopover _owner )
344         {
345             _this = _owner;
346             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
347
348             // my vars (dec)
349
350             // set gobject values
351             this.el.homogeneous = true;
352             this.el.expand = false;
353             this.el.vexpand = false;
354             var child_0 = new Xcls_Button13( _this );
355             child_0.ref();
356             this.el.add (  child_0.el  );
357             var child_1 = new Xcls_Button14( _this );
358             child_1.ref();
359             this.el.add (  child_1.el  );
360             var child_2 = new Xcls_Button15( _this );
361             child_2.ref();
362             this.el.add (  child_2.el  );
363         }
364
365         // user defined functions
366     }
367     public class Xcls_Button13 : Object
368     {
369         public Gtk.Button el;
370         private RepoStatusPopover  _this;
371
372
373             // my vars (def)
374
375         // ctor
376         public Xcls_Button13(RepoStatusPopover _owner )
377         {
378             _this = _owner;
379             this.el = new Gtk.Button();
380
381             // my vars (dec)
382
383             // set gobject values
384             this.el.label = "Stash Changes";
385
386             //listeners
387             this.el.button_press_event.connect( () => {
388                     _this.el.hide();
389                     return false;
390             });
391         }
392
393         // user defined functions
394     }
395
396     public class Xcls_Button14 : Object
397     {
398         public Gtk.Button el;
399         private RepoStatusPopover  _this;
400
401
402             // my vars (def)
403
404         // ctor
405         public Xcls_Button14(RepoStatusPopover _owner )
406         {
407             _this = _owner;
408             this.el = new Gtk.Button();
409
410             // my vars (dec)
411
412             // set gobject values
413             this.el.label = "Commit Changes";
414
415             //listeners
416             this.el.button_press_event.connect( () => {
417                      _this.el.hide();
418                     return false;
419             });
420         }
421
422         // user defined functions
423     }
424
425     public class Xcls_Button15 : Object
426     {
427         public Gtk.Button el;
428         private RepoStatusPopover  _this;
429
430
431             // my vars (def)
432
433         // ctor
434         public Xcls_Button15(RepoStatusPopover _owner )
435         {
436             _this = _owner;
437             this.el = new Gtk.Button();
438
439             // my vars (dec)
440
441             // set gobject values
442             this.el.label = "Ignore or now";
443
444             //listeners
445             this.el.button_press_event.connect( () => {
446                    _this.el.hide();
447                     return false;
448             });
449         }
450
451         // user defined functions
452     }
453
454
455
456 }