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_Box3( _this );
91 this.el.pack_start ( child_0.el , false,false,0 );
92 var child_1 = new Xcls_Notebook9( _this );
94 this.el.add ( child_1.el );
95 var child_2 = new Xcls_Box18( _this );
97 this.el.pack_end ( child_2.el , false,false,0 );
100 // user defined functions
102 public class Xcls_Box3 : Object
105 private RepoStatusPopover _this;
111 public Xcls_Box3(RepoStatusPopover _owner )
114 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
118 // set gobject values
119 this.el.homogeneous = true;
120 this.el.expand = false;
121 this.el.vexpand = false;
122 var child_0 = new Xcls_Toolbar4( _this );
124 this.el.add ( child_0.el );
127 // user defined functions
129 public class Xcls_Toolbar4 : Object
131 public Gtk.Toolbar el;
132 private RepoStatusPopover _this;
138 public Xcls_Toolbar4(RepoStatusPopover _owner )
141 this.el = new Gtk.Toolbar();
145 // set gobject values
146 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
147 var child_0 = new Xcls_ToolButton5( _this );
149 this.el.add ( child_0.el );
150 var child_1 = new Xcls_ToolButton6( _this );
152 this.el.add ( child_1.el );
153 var child_2 = new Xcls_ToolButton7( _this );
155 this.el.add ( child_2.el );
156 var child_3 = new Xcls_ToolButton8( _this );
158 this.el.add ( child_3.el );
161 // user defined functions
163 public class Xcls_ToolButton5 : Object
165 public Gtk.ToolButton el;
166 private RepoStatusPopover _this;
172 public Xcls_ToolButton5(RepoStatusPopover _owner )
175 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-undo", Gtk.IconSize.SMALL_TOOLBAR), null);;
179 // set gobject values
180 this.el.label = "Stash Changes";
181 this.el.is_important = true;
184 this.el.button_press_event.connect( () => {
187 GitMonitor.gitmonitor.stop();
188 _this.repo.git({ "stash" , "--all" });
189 _this.repo.loadStatus();
190 GitMonitor.gitmonitor.start();
191 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
192 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
193 Clones.singleton().reposStore.load();
200 // user defined functions
203 public class Xcls_ToolButton6 : Object
205 public Gtk.ToolButton el;
206 private RepoStatusPopover _this;
212 public Xcls_ToolButton6(RepoStatusPopover _owner )
215 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-save", Gtk.IconSize.SMALL_TOOLBAR), null);;
219 // set gobject values
220 this.el.label = "Commit Changes";
221 this.el.is_important = true;
224 this.el.button_press_event.connect( () => {
225 _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
227 _this.repo.loadStatus();
229 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
230 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
233 Clones.singleton().reposStore.load();
239 // user defined functions
242 public class Xcls_ToolButton7 : Object
244 public Gtk.ToolButton el;
245 private RepoStatusPopover _this;
251 public Xcls_ToolButton7(RepoStatusPopover _owner )
254 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-revert-to-saved", Gtk.IconSize.SMALL_TOOLBAR), null);;
258 // set gobject values
259 this.el.label = "Reset / clear changes";
260 this.el.is_important = true;
263 this.el.button_press_event.connect( () => {
266 GitMonitor.gitmonitor.stop();
267 _this.repo.git({ "reset" , "--hard" });
268 _this.repo.loadStatus();
269 GitMonitor.gitmonitor.start();
270 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
271 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
272 Clones.singleton().reposStore.load();
279 // user defined functions
282 public class Xcls_ToolButton8 : Object
284 public Gtk.ToolButton el;
285 private RepoStatusPopover _this;
291 public Xcls_ToolButton8(RepoStatusPopover _owner )
294 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-bottom", Gtk.IconSize.SMALL_TOOLBAR), null);;
298 // set gobject values
299 this.el.label = "Pull updates";
300 this.el.is_important = true;
303 this.el.button_press_event.connect( () => {
306 GitMonitor.gitmonitor.stop();
307 _this.repo.git({ "pull" , "--all" });
308 _this.repo.loadStatus();
309 GitMonitor.gitmonitor.start();
310 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
311 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
312 Clones.singleton().reposStore.load();
319 // user defined functions
324 public class Xcls_Notebook9 : Object
326 public Gtk.Notebook el;
327 private RepoStatusPopover _this;
333 public Xcls_Notebook9(RepoStatusPopover _owner )
336 this.el = new Gtk.Notebook();
340 // set gobject values
341 this.el.vexpand = true;
342 var child_0 = new Xcls_label_status( _this );
344 var child_1 = new Xcls_label_diff( _this );
346 var child_2 = new Xcls_Box12( _this );
348 this.el.append_page ( child_2.el , _this.label_status.el );
349 var child_3 = new Xcls_Box15( _this );
351 this.el.append_page ( child_3.el , _this.label_diff.el );
354 // user defined functions
356 public class Xcls_label_status : Object
359 private RepoStatusPopover _this;
365 public Xcls_label_status(RepoStatusPopover _owner )
368 _this.label_status = this;
369 this.el = new Gtk.Label( "Status" );
373 // set gobject values
376 // user defined functions
379 public class Xcls_label_diff : Object
382 private RepoStatusPopover _this;
388 public Xcls_label_diff(RepoStatusPopover _owner )
391 _this.label_diff = this;
392 this.el = new Gtk.Label( "Diff" );
396 // set gobject values
399 // user defined functions
402 public class Xcls_Box12 : Object
405 private RepoStatusPopover _this;
411 public Xcls_Box12(RepoStatusPopover _owner )
414 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
418 // set gobject values
419 this.el.homogeneous = false;
420 var child_0 = new Xcls_ScrolledWindow13( _this );
422 this.el.pack_start ( child_0.el , true,true,0 );
425 // user defined functions
427 public class Xcls_ScrolledWindow13 : Object
429 public Gtk.ScrolledWindow el;
430 private RepoStatusPopover _this;
436 public Xcls_ScrolledWindow13(RepoStatusPopover _owner )
439 this.el = new Gtk.ScrolledWindow( null, null );
443 // set gobject values
444 var child_0 = new Xcls_status_view( _this );
446 this.el.add ( child_0.el );
449 // user defined functions
451 public class Xcls_status_view : Object
453 public Gtk.SourceView el;
454 private RepoStatusPopover _this;
460 public Xcls_status_view(RepoStatusPopover _owner )
463 _this.status_view = this;
464 this.el = new Gtk.SourceView();
470 var description = Pango.FontDescription.from_string("monospace");
471 description.set_size(9000);
472 this.el.override_font(description);
475 // user defined functions
480 public class Xcls_Box15 : Object
483 private RepoStatusPopover _this;
489 public Xcls_Box15(RepoStatusPopover _owner )
492 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
496 // set gobject values
497 this.el.homogeneous = false;
498 var child_0 = new Xcls_ScrolledWindow16( _this );
500 this.el.pack_start ( child_0.el , true,true,0 );
503 // user defined functions
505 public class Xcls_ScrolledWindow16 : Object
507 public Gtk.ScrolledWindow el;
508 private RepoStatusPopover _this;
514 public Xcls_ScrolledWindow16(RepoStatusPopover _owner )
517 this.el = new Gtk.ScrolledWindow( null, null );
521 // set gobject values
522 this.el.height_request = 400;
523 var child_0 = new Xcls_diff_view( _this );
525 this.el.add ( child_0.el );
528 // user defined functions
530 public class Xcls_diff_view : Object
532 public Gtk.SourceView el;
533 private RepoStatusPopover _this;
539 public Xcls_diff_view(RepoStatusPopover _owner )
542 _this.diff_view = this;
543 this.el = new Gtk.SourceView();
549 var description = Pango.FontDescription.from_string("monospace");
550 description.set_size(9000);
551 this.el.override_font(description);
554 // user defined functions
560 public class Xcls_Box18 : Object
563 private RepoStatusPopover _this;
569 public Xcls_Box18(RepoStatusPopover _owner )
572 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
576 // set gobject values
577 this.el.homogeneous = true;
578 this.el.expand = false;
579 this.el.vexpand = false;
580 var child_0 = new Xcls_Toolbar19( _this );
582 this.el.add ( child_0.el );
585 // user defined functions
587 public class Xcls_Toolbar19 : Object
589 public Gtk.Toolbar el;
590 private RepoStatusPopover _this;
596 public Xcls_Toolbar19(RepoStatusPopover _owner )
599 this.el = new Gtk.Toolbar();
603 // set gobject values
604 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
605 var child_0 = new Xcls_ToolButton20( _this );
607 this.el.add ( child_0.el );
608 var child_1 = new Xcls_ToolButton21( _this );
610 this.el.add ( child_1.el );
611 var child_2 = new Xcls_ToolButton22( _this );
613 this.el.add ( child_2.el );
616 // user defined functions
618 public class Xcls_ToolButton20 : Object
620 public Gtk.ToolButton el;
621 private RepoStatusPopover _this;
627 public Xcls_ToolButton20(RepoStatusPopover _owner )
630 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-add", Gtk.IconSize.SMALL_TOOLBAR), null);;
634 // set gobject values
635 this.el.label = "Create Branch / Start ticket";
636 this.el.is_important = true;
639 this.el.button_press_event.connect( () => {
640 var oldq = new Gee.ArrayList<GitMonitorQueue>();
642 Clones.singleton().el.response(-1);
643 NewBranch.singleton().show(_this.repo, oldq);
649 // user defined functions
652 public class Xcls_ToolButton21 : Object
654 public Gtk.ToolButton el;
655 private RepoStatusPopover _this;
661 public Xcls_ToolButton21(RepoStatusPopover _owner )
664 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
668 // set gobject values
669 this.el.label = "Merge branch/ Completed ticket";
670 this.el.is_important = true;
673 this.el.clicked.connect( () => {
676 Clones.singleton().el.response(-1);
677 if (_this.repo.activeTicket != null) {
678 MergeBranch.singleton().show(_this.repo.activeTicket, null);
684 // user defined functions
687 public class Xcls_ToolButton22 : Object
689 public Gtk.ToolButton el;
690 private RepoStatusPopover _this;
696 public Xcls_ToolButton22(RepoStatusPopover _owner )
699 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-new", Gtk.IconSize.SMALL_TOOLBAR), null);;
703 // set gobject values
704 this.el.label = "Create Ticket";
705 this.el.is_important = true;
708 this.el.button_press_event.connect( () => {
712 Clones.singleton().el.response(-1);
715 Ticket.singleton().show( _this.repo);
721 // user defined functions