1 static RepoStatusPopover _RepoStatusPopover;
3 public class RepoStatusPopover : Object
6 private RepoStatusPopover _this;
8 public static RepoStatusPopover singleton()
10 if (_RepoStatusPopover == null) {
11 _RepoStatusPopover= new RepoStatusPopover();
13 return _RepoStatusPopover;
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;
24 public RepoStatusPopover()
27 this.el = new Gtk.Popover( null );
32 this.el.border_width = 0;
34 this.el.position = Gtk.PositionType.RIGHT;
35 var child_0 = new Xcls_Box2( _this );
37 this.el.add ( child_0.el );
40 // user defined functions
41 public void show (Gtk.Widget btn, Gdk.Rectangle rect, GitRepo repo) {
43 // get the active project.
44 var lm = Gtk.SourceLanguageManager.get_default();
46 // ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
47 // lm.get_language("html")
51 //project.runhtml = project.runhtml || '';
52 _this.diff_view.el.get_buffer().set_text(repo.git_diff);
53 _this.status_view.el.get_buffer().set_text(repo.git_status);
55 //console.log('show all');
56 this.el.set_modal(true);
57 this.el.set_relative_to(btn);
58 this.el.set_pointing_to(rect);
60 //this.el.set_position(Gtk.PositionType.RIGHT);
63 GLib.debug("SHOWALL - POPIP\n");
65 //this.el.set_size_request(800,500);
66 // this.diff_view.el.grab_focus();
70 public class Xcls_Box2 : Object
73 private RepoStatusPopover _this;
79 public Xcls_Box2(RepoStatusPopover _owner )
82 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
87 this.el.homogeneous = false;
88 this.el.border_width = 5;
89 var child_0 = new Xcls_Notebook3( _this );
91 this.el.pack_start ( child_0.el , true,true,0 );
92 var child_1 = new Xcls_Box12( _this );
94 this.el.pack_end ( child_1.el , false,false,0 );
95 var child_2 = new Xcls_Button18( _this );
97 this.el.add ( child_2.el );
98 var child_3 = new Xcls_Button19( _this );
100 this.el.add ( child_3.el );
103 // user defined functions
105 public class Xcls_Notebook3 : Object
107 public Gtk.Notebook el;
108 private RepoStatusPopover _this;
114 public Xcls_Notebook3(RepoStatusPopover _owner )
117 this.el = new Gtk.Notebook();
121 // set gobject values
122 var child_0 = new Xcls_label_status( _this );
124 var child_1 = new Xcls_label_diff( _this );
126 var child_2 = new Xcls_Box6( _this );
128 this.el.append_page ( child_2.el , _this.label_status.el );
129 var child_3 = new Xcls_Box9( _this );
131 this.el.append_page ( child_3.el , _this.label_diff.el );
134 // user defined functions
136 public class Xcls_label_status : Object
139 private RepoStatusPopover _this;
145 public Xcls_label_status(RepoStatusPopover _owner )
148 _this.label_status = this;
149 this.el = new Gtk.Label( "Status" );
153 // set gobject values
156 // user defined functions
159 public class Xcls_label_diff : Object
162 private RepoStatusPopover _this;
168 public Xcls_label_diff(RepoStatusPopover _owner )
171 _this.label_diff = this;
172 this.el = new Gtk.Label( "Diff" );
176 // set gobject values
179 // user defined functions
182 public class Xcls_Box6 : Object
185 private RepoStatusPopover _this;
191 public Xcls_Box6(RepoStatusPopover _owner )
194 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
198 // set gobject values
199 this.el.homogeneous = false;
200 var child_0 = new Xcls_ScrolledWindow7( _this );
202 this.el.pack_start ( child_0.el , true,true,0 );
205 // user defined functions
207 public class Xcls_ScrolledWindow7 : Object
209 public Gtk.ScrolledWindow el;
210 private RepoStatusPopover _this;
216 public Xcls_ScrolledWindow7(RepoStatusPopover _owner )
219 this.el = new Gtk.ScrolledWindow( null, null );
223 // set gobject values
224 var child_0 = new Xcls_status_view( _this );
226 this.el.add ( child_0.el );
229 // user defined functions
231 public class Xcls_status_view : Object
233 public Gtk.SourceView el;
234 private RepoStatusPopover _this;
240 public Xcls_status_view(RepoStatusPopover _owner )
243 _this.status_view = this;
244 this.el = new Gtk.SourceView();
250 var description = Pango.FontDescription.from_string("monospace");
251 description.set_size(9000);
252 this.el.override_font(description);
255 // user defined functions
260 public class Xcls_Box9 : Object
263 private RepoStatusPopover _this;
269 public Xcls_Box9(RepoStatusPopover _owner )
272 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
276 // set gobject values
277 this.el.homogeneous = false;
278 var child_0 = new Xcls_ScrolledWindow10( _this );
280 this.el.pack_start ( child_0.el , true,true,0 );
283 // user defined functions
285 public class Xcls_ScrolledWindow10 : Object
287 public Gtk.ScrolledWindow el;
288 private RepoStatusPopover _this;
294 public Xcls_ScrolledWindow10(RepoStatusPopover _owner )
297 this.el = new Gtk.ScrolledWindow( null, null );
301 // set gobject values
302 this.el.height_request = 400;
303 var child_0 = new Xcls_diff_view( _this );
305 this.el.add ( child_0.el );
308 // user defined functions
310 public class Xcls_diff_view : Object
312 public Gtk.SourceView el;
313 private RepoStatusPopover _this;
319 public Xcls_diff_view(RepoStatusPopover _owner )
322 _this.diff_view = this;
323 this.el = new Gtk.SourceView();
329 var description = Pango.FontDescription.from_string("monospace");
330 description.set_size(9000);
331 this.el.override_font(description);
334 // user defined functions
340 public class Xcls_Box12 : Object
343 private RepoStatusPopover _this;
349 public Xcls_Box12(RepoStatusPopover _owner )
352 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
356 // set gobject values
357 this.el.homogeneous = true;
358 this.el.expand = false;
359 this.el.vexpand = false;
360 var child_0 = new Xcls_Button13( _this );
362 this.el.add ( child_0.el );
363 var child_1 = new Xcls_Button14( _this );
365 this.el.add ( child_1.el );
366 var child_2 = new Xcls_Button15( _this );
368 this.el.add ( child_2.el );
369 var child_3 = new Xcls_Button16( _this );
371 this.el.add ( child_3.el );
372 var child_4 = new Xcls_Button17( _this );
374 this.el.add ( child_4.el );
377 // user defined functions
379 public class Xcls_Button13 : Object
381 public Gtk.Button el;
382 private RepoStatusPopover _this;
388 public Xcls_Button13(RepoStatusPopover _owner )
391 this.el = new Gtk.Button();
395 // set gobject values
396 this.el.label = "Stash Changes";
399 this.el.button_press_event.connect( () => {
402 GitMonitor.gitmonitor.stop();
403 _this.repo.git({ "stash" , "--all" });
404 _this.repo.loadStatus();
405 GitMonitor.gitmonitor.start();
406 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
407 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
408 Clones.singleton().reposStore.load();
415 // user defined functions
418 public class Xcls_Button14 : Object
420 public Gtk.Button el;
421 private RepoStatusPopover _this;
427 public Xcls_Button14(RepoStatusPopover _owner )
430 this.el = new Gtk.Button();
434 // set gobject values
435 this.el.label = "Commit Changes";
438 this.el.button_press_event.connect( () => {
439 _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
441 _this.repo.loadStatus();
443 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
444 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
447 Clones.singleton().reposStore.load();
453 // user defined functions
456 public class Xcls_Button15 : Object
458 public Gtk.Button el;
459 private RepoStatusPopover _this;
465 public Xcls_Button15(RepoStatusPopover _owner )
468 this.el = new Gtk.Button();
472 // set gobject values
473 this.el.label = "Create Branch";
476 this.el.button_press_event.connect( () => {
477 var oldq = new Gee.ArrayList<GitMonitorQueue>();
479 Clones.singleton().el.response(-1);
480 NewBranch.singleton().show(_this.repo, oldq);
486 // user defined functions
489 public class Xcls_Button16 : Object
491 public Gtk.Button el;
492 private RepoStatusPopover _this;
498 public Xcls_Button16(RepoStatusPopover _owner )
501 this.el = new Gtk.Button();
505 // set gobject values
506 this.el.label = "Ignore for now";
509 this.el.button_press_event.connect( () => {
515 // user defined functions
518 public class Xcls_Button17 : Object
520 public Gtk.Button el;
521 private RepoStatusPopover _this;
527 public Xcls_Button17(RepoStatusPopover _owner )
530 this.el = new Gtk.Button();
534 // set gobject values
535 this.el.label = "Stash Changes";
538 this.el.button_press_event.connect( () => {
541 GitMonitor.gitmonitor.stop();
542 _this.repo.git({ "stash" , "--all" });
543 _this.repo.loadStatus();
544 GitMonitor.gitmonitor.start();
545 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
546 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
547 Clones.singleton().reposStore.load();
554 // user defined functions
558 public class Xcls_Button18 : Object
560 public Gtk.Button el;
561 private RepoStatusPopover _this;
567 public Xcls_Button18(RepoStatusPopover _owner )
570 this.el = new Gtk.Button();
574 // set gobject values
575 this.el.label = "Stash Changes";
578 this.el.button_press_event.connect( () => {
581 GitMonitor.gitmonitor.stop();
582 _this.repo.git({ "stash" , "--all" });
583 _this.repo.loadStatus();
584 GitMonitor.gitmonitor.start();
585 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
586 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
587 Clones.singleton().reposStore.load();
594 // user defined functions
597 public class Xcls_Button19 : Object
599 public Gtk.Button el;
600 private RepoStatusPopover _this;
606 public Xcls_Button19(RepoStatusPopover _owner )
609 this.el = new Gtk.Button();
613 // set gobject values
614 this.el.label = "Stash Changes";
617 this.el.button_press_event.connect( () => {
620 GitMonitor.gitmonitor.stop();
621 _this.repo.git({ "stash" , "--all" });
622 _this.repo.loadStatus();
623 GitMonitor.gitmonitor.start();
624 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
625 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
626 Clones.singleton().reposStore.load();
633 // user defined functions