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