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;
19 public Xcls_btn_merge btn_merge;
25 public RepoStatusPopover()
28 this.el = new Gtk.Popover( null );
33 this.el.border_width = 0;
35 this.el.position = Gtk.PositionType.RIGHT;
36 var child_0 = new Xcls_Box2( _this );
38 this.el.add ( child_0.el );
41 // user defined functions
42 public void show (Gtk.Widget btn, Gdk.Rectangle rect, GitRepo repo) {
44 // get the active project.
45 var lm = Gtk.SourceLanguageManager.get_default();
47 // ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
48 // lm.get_language("html")
52 //project.runhtml = project.runhtml || '';
53 _this.diff_view.el.get_buffer().set_text(repo.git_diff);
54 _this.status_view.el.get_buffer().set_text(repo.git_status);
56 //console.log('show all');
57 this.el.set_modal(true);
58 this.el.set_relative_to(btn);
59 this.el.set_pointing_to(rect);
61 //this.el.set_position(Gtk.PositionType.RIGHT);
64 GLib.debug("SHOWALL - POPIP\n");
66 //this.el.set_size_request(800,500);
67 // this.diff_view.el.grab_focus();
71 public class Xcls_Box2 : Object
74 private RepoStatusPopover _this;
80 public Xcls_Box2(RepoStatusPopover _owner )
83 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
88 this.el.homogeneous = false;
89 this.el.border_width = 5;
90 var child_0 = new Xcls_Box3( _this );
92 this.el.pack_start ( child_0.el , false,false,0 );
93 var child_1 = new Xcls_Notebook9( _this );
95 this.el.add ( child_1.el );
96 var child_2 = new Xcls_Box18( _this );
98 this.el.pack_end ( child_2.el , false,false,0 );
101 // user defined functions
103 public class Xcls_Box3 : Object
106 private RepoStatusPopover _this;
112 public Xcls_Box3(RepoStatusPopover _owner )
115 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
119 // set gobject values
120 this.el.homogeneous = true;
121 this.el.expand = false;
122 this.el.vexpand = false;
123 var child_0 = new Xcls_Toolbar4( _this );
125 this.el.add ( child_0.el );
128 // user defined functions
130 public class Xcls_Toolbar4 : Object
132 public Gtk.Toolbar el;
133 private RepoStatusPopover _this;
139 public Xcls_Toolbar4(RepoStatusPopover _owner )
142 this.el = new Gtk.Toolbar();
146 // set gobject values
147 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
148 var child_0 = new Xcls_ToolButton5( _this );
150 this.el.add ( child_0.el );
151 var child_1 = new Xcls_ToolButton6( _this );
153 this.el.add ( child_1.el );
154 var child_2 = new Xcls_ToolButton7( _this );
156 this.el.add ( child_2.el );
157 var child_3 = new Xcls_ToolButton8( _this );
159 this.el.add ( child_3.el );
162 // user defined functions
164 public class Xcls_ToolButton5 : Object
166 public Gtk.ToolButton el;
167 private RepoStatusPopover _this;
173 public Xcls_ToolButton5(RepoStatusPopover _owner )
176 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-undo", Gtk.IconSize.SMALL_TOOLBAR), null);;
180 // set gobject values
181 this.el.label = "Stash Changes";
182 this.el.is_important = true;
185 this.el.button_press_event.connect( () => {
188 GitMonitor.gitmonitor.stop();
189 _this.repo.git({ "stash" , "--all" });
190 _this.repo.loadStatus();
191 GitMonitor.gitmonitor.start();
192 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
193 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
194 Clones.singleton().reposStore.load();
201 // user defined functions
204 public class Xcls_ToolButton6 : Object
206 public Gtk.ToolButton el;
207 private RepoStatusPopover _this;
213 public Xcls_ToolButton6(RepoStatusPopover _owner )
216 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-save", Gtk.IconSize.SMALL_TOOLBAR), null);;
220 // set gobject values
221 this.el.label = "Commit Changes";
222 this.el.is_important = true;
225 this.el.button_press_event.connect( () => {
226 _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
228 _this.repo.loadStatus();
230 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
231 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
234 Clones.singleton().reposStore.load();
240 // user defined functions
243 public class Xcls_ToolButton7 : Object
245 public Gtk.ToolButton el;
246 private RepoStatusPopover _this;
252 public Xcls_ToolButton7(RepoStatusPopover _owner )
255 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-revert-to-saved", Gtk.IconSize.SMALL_TOOLBAR), null);;
259 // set gobject values
260 this.el.label = "Reset / clear changes";
261 this.el.is_important = true;
264 this.el.button_press_event.connect( () => {
267 GitMonitor.gitmonitor.stop();
268 _this.repo.git({ "reset" , "--hard" });
269 _this.repo.loadStatus();
270 GitMonitor.gitmonitor.start();
271 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
272 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
273 Clones.singleton().reposStore.load();
280 // user defined functions
283 public class Xcls_ToolButton8 : Object
285 public Gtk.ToolButton el;
286 private RepoStatusPopover _this;
292 public Xcls_ToolButton8(RepoStatusPopover _owner )
295 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-bottom", Gtk.IconSize.SMALL_TOOLBAR), null);;
299 // set gobject values
300 this.el.label = "Pull updates";
301 this.el.is_important = true;
304 this.el.button_press_event.connect( () => {
307 GitMonitor.gitmonitor.stop();
308 _this.repo.git({ "pull" , "--all" });
309 _this.repo.loadStatus();
310 GitMonitor.gitmonitor.start();
311 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
312 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
313 Clones.singleton().reposStore.load();
320 // user defined functions
325 public class Xcls_Notebook9 : Object
327 public Gtk.Notebook el;
328 private RepoStatusPopover _this;
334 public Xcls_Notebook9(RepoStatusPopover _owner )
337 this.el = new Gtk.Notebook();
341 // set gobject values
342 this.el.vexpand = true;
343 var child_0 = new Xcls_label_status( _this );
345 var child_1 = new Xcls_label_diff( _this );
347 var child_2 = new Xcls_Box12( _this );
349 this.el.append_page ( child_2.el , _this.label_status.el );
350 var child_3 = new Xcls_Box15( _this );
352 this.el.append_page ( child_3.el , _this.label_diff.el );
355 // user defined functions
357 public class Xcls_label_status : Object
360 private RepoStatusPopover _this;
366 public Xcls_label_status(RepoStatusPopover _owner )
369 _this.label_status = this;
370 this.el = new Gtk.Label( "Status" );
374 // set gobject values
377 // user defined functions
380 public class Xcls_label_diff : Object
383 private RepoStatusPopover _this;
389 public Xcls_label_diff(RepoStatusPopover _owner )
392 _this.label_diff = this;
393 this.el = new Gtk.Label( "Diff" );
397 // set gobject values
400 // user defined functions
403 public class Xcls_Box12 : Object
406 private RepoStatusPopover _this;
412 public Xcls_Box12(RepoStatusPopover _owner )
415 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
419 // set gobject values
420 this.el.homogeneous = false;
421 var child_0 = new Xcls_ScrolledWindow13( _this );
423 this.el.pack_start ( child_0.el , true,true,0 );
426 // user defined functions
428 public class Xcls_ScrolledWindow13 : Object
430 public Gtk.ScrolledWindow el;
431 private RepoStatusPopover _this;
437 public Xcls_ScrolledWindow13(RepoStatusPopover _owner )
440 this.el = new Gtk.ScrolledWindow( null, null );
444 // set gobject values
445 var child_0 = new Xcls_status_view( _this );
447 this.el.add ( child_0.el );
450 // user defined functions
452 public class Xcls_status_view : Object
454 public Gtk.SourceView el;
455 private RepoStatusPopover _this;
461 public Xcls_status_view(RepoStatusPopover _owner )
464 _this.status_view = this;
465 this.el = new Gtk.SourceView();
471 var description = Pango.FontDescription.from_string("monospace");
472 description.set_size(9000);
473 this.el.override_font(description);
476 // user defined functions
481 public class Xcls_Box15 : Object
484 private RepoStatusPopover _this;
490 public Xcls_Box15(RepoStatusPopover _owner )
493 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
497 // set gobject values
498 this.el.homogeneous = false;
499 var child_0 = new Xcls_ScrolledWindow16( _this );
501 this.el.pack_start ( child_0.el , true,true,0 );
504 // user defined functions
506 public class Xcls_ScrolledWindow16 : Object
508 public Gtk.ScrolledWindow el;
509 private RepoStatusPopover _this;
515 public Xcls_ScrolledWindow16(RepoStatusPopover _owner )
518 this.el = new Gtk.ScrolledWindow( null, null );
522 // set gobject values
523 this.el.height_request = 400;
524 var child_0 = new Xcls_diff_view( _this );
526 this.el.add ( child_0.el );
529 // user defined functions
531 public class Xcls_diff_view : Object
533 public Gtk.SourceView el;
534 private RepoStatusPopover _this;
540 public Xcls_diff_view(RepoStatusPopover _owner )
543 _this.diff_view = this;
544 this.el = new Gtk.SourceView();
550 var description = Pango.FontDescription.from_string("monospace");
551 description.set_size(9000);
552 this.el.override_font(description);
555 // user defined functions
561 public class Xcls_Box18 : Object
564 private RepoStatusPopover _this;
570 public Xcls_Box18(RepoStatusPopover _owner )
573 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
577 // set gobject values
578 this.el.homogeneous = true;
579 this.el.expand = false;
580 this.el.vexpand = false;
581 var child_0 = new Xcls_Toolbar19( _this );
583 this.el.add ( child_0.el );
586 // user defined functions
588 public class Xcls_Toolbar19 : Object
590 public Gtk.Toolbar el;
591 private RepoStatusPopover _this;
597 public Xcls_Toolbar19(RepoStatusPopover _owner )
600 this.el = new Gtk.Toolbar();
604 // set gobject values
605 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
606 var child_0 = new Xcls_ToolButton20( _this );
608 this.el.add ( child_0.el );
609 var child_1 = new Xcls_btn_merge( _this );
611 this.el.add ( child_1.el );
612 var child_2 = new Xcls_ToolButton22( _this );
614 this.el.add ( child_2.el );
617 // user defined functions
619 public class Xcls_ToolButton20 : Object
621 public Gtk.ToolButton el;
622 private RepoStatusPopover _this;
628 public Xcls_ToolButton20(RepoStatusPopover _owner )
631 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-add", Gtk.IconSize.SMALL_TOOLBAR), null);;
635 // set gobject values
636 this.el.label = "Create Branch / Start ticket";
637 this.el.is_important = true;
640 this.el.button_press_event.connect( () => {
641 var oldq = new Gee.ArrayList<GitMonitorQueue>();
643 Clones.singleton().el.response(-1);
644 NewBranch.singleton().show(_this.repo, oldq);
650 // user defined functions
653 public class Xcls_btn_merge : Object
655 public Gtk.ToolButton el;
656 private RepoStatusPopover _this;
662 public Xcls_btn_merge(RepoStatusPopover _owner )
665 _this.btn_merge = this;
666 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
670 // set gobject values
671 this.el.label = "Merge branch / Complete ticket";
672 this.el.is_important = true;
675 this.el.clicked.connect( () => {
678 Clones.singleton().el.response(-1);
679 if (_this.repo.activeTicket != null) {
680 MergeBranch.singleton().show(_this.repo.activeTicket, null);
686 // user defined functions
689 public class Xcls_ToolButton22 : Object
691 public Gtk.ToolButton el;
692 private RepoStatusPopover _this;
698 public Xcls_ToolButton22(RepoStatusPopover _owner )
701 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-new", Gtk.IconSize.SMALL_TOOLBAR), null);;
705 // set gobject values
706 this.el.label = "Create Ticket";
707 this.el.is_important = true;
710 this.el.button_press_event.connect( () => {
714 Clones.singleton().el.response(-1);
717 Ticket.singleton().show( _this.repo);
723 // user defined functions