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_create btn_create;
20 public Xcls_btn_merge btn_merge;
26 public RepoStatusPopover()
29 this.el = new Gtk.Popover( null );
34 this.el.border_width = 0;
36 this.el.position = Gtk.PositionType.RIGHT;
37 var child_0 = new Xcls_Box2( _this );
39 this.el.add ( child_0.el );
42 // user defined functions
43 public void show (Gtk.Widget btn, Gdk.Rectangle rect, GitRepo repo) {
45 // get the active project.
46 var lm = Gtk.SourceLanguageManager.get_default();
48 // ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
49 // lm.get_language("html")
53 //project.runhtml = project.runhtml || '';
54 _this.diff_view.el.get_buffer().set_text(repo.git_diff);
55 _this.status_view.el.get_buffer().set_text(repo.git_status);
57 //console.log('show all');
58 this.el.set_modal(true);
59 this.el.set_relative_to(btn);
60 this.el.set_pointing_to(rect);
62 //this.el.set_position(Gtk.PositionType.RIGHT);
64 if (repo.activeTicket == null) {
65 _this.btn_merge.el.set_sensitive(false);
67 _this.btn_merge.el.set_sensitive(true);
69 _this.btn_create.el.set_sensitive(repo.is_master());
72 GLib.debug("SHOWALL - POPIP\n");
74 //this.el.set_size_request(800,500);
75 // this.diff_view.el.grab_focus();
79 public class Xcls_Box2 : Object
82 private RepoStatusPopover _this;
88 public Xcls_Box2(RepoStatusPopover _owner )
91 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
96 this.el.homogeneous = false;
97 this.el.border_width = 5;
98 var child_0 = new Xcls_Box3( _this );
100 this.el.pack_start ( child_0.el , false,false,0 );
101 var child_1 = new Xcls_Notebook9( _this );
103 this.el.add ( child_1.el );
104 var child_2 = new Xcls_Box18( _this );
106 this.el.pack_end ( child_2.el , false,false,0 );
109 // user defined functions
111 public class Xcls_Box3 : Object
114 private RepoStatusPopover _this;
120 public Xcls_Box3(RepoStatusPopover _owner )
123 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
127 // set gobject values
128 this.el.homogeneous = true;
129 this.el.expand = false;
130 this.el.vexpand = false;
131 var child_0 = new Xcls_Toolbar4( _this );
133 this.el.add ( child_0.el );
136 // user defined functions
138 public class Xcls_Toolbar4 : Object
140 public Gtk.Toolbar el;
141 private RepoStatusPopover _this;
147 public Xcls_Toolbar4(RepoStatusPopover _owner )
150 this.el = new Gtk.Toolbar();
154 // set gobject values
155 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
156 var child_0 = new Xcls_ToolButton5( _this );
158 this.el.add ( child_0.el );
159 var child_1 = new Xcls_ToolButton6( _this );
161 this.el.add ( child_1.el );
162 var child_2 = new Xcls_ToolButton7( _this );
164 this.el.add ( child_2.el );
165 var child_3 = new Xcls_ToolButton8( _this );
167 this.el.add ( child_3.el );
170 // user defined functions
172 public class Xcls_ToolButton5 : Object
174 public Gtk.ToolButton el;
175 private RepoStatusPopover _this;
181 public Xcls_ToolButton5(RepoStatusPopover _owner )
184 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-undo", Gtk.IconSize.SMALL_TOOLBAR), null);;
188 // set gobject values
189 this.el.label = "Stash Changes";
190 this.el.is_important = true;
193 this.el.button_press_event.connect( () => {
196 GitMonitor.gitmonitor.stop();
197 _this.repo.git({ "stash" , "--all" });
198 _this.repo.loadStatus();
199 GitMonitor.gitmonitor.start();
200 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
201 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
202 Clones.singleton().reposStore.load();
209 // user defined functions
212 public class Xcls_ToolButton6 : Object
214 public Gtk.ToolButton el;
215 private RepoStatusPopover _this;
221 public Xcls_ToolButton6(RepoStatusPopover _owner )
224 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-save", Gtk.IconSize.SMALL_TOOLBAR), null);;
228 // set gobject values
229 this.el.label = "Commit Changes";
230 this.el.is_important = true;
233 this.el.button_press_event.connect( () => {
234 _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
236 _this.repo.loadStatus();
238 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
239 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
242 Clones.singleton().reposStore.load();
248 // user defined functions
251 public class Xcls_ToolButton7 : Object
253 public Gtk.ToolButton el;
254 private RepoStatusPopover _this;
260 public Xcls_ToolButton7(RepoStatusPopover _owner )
263 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-revert-to-saved", Gtk.IconSize.SMALL_TOOLBAR), null);;
267 // set gobject values
268 this.el.label = "Reset / clear changes";
269 this.el.is_important = true;
272 this.el.button_press_event.connect( () => {
275 GitMonitor.gitmonitor.stop();
276 _this.repo.git({ "reset" , "--hard" });
277 _this.repo.loadStatus();
278 GitMonitor.gitmonitor.start();
279 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
280 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
281 Clones.singleton().reposStore.load();
288 // user defined functions
291 public class Xcls_ToolButton8 : Object
293 public Gtk.ToolButton el;
294 private RepoStatusPopover _this;
300 public Xcls_ToolButton8(RepoStatusPopover _owner )
303 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-bottom", Gtk.IconSize.SMALL_TOOLBAR), null);;
307 // set gobject values
308 this.el.label = "Pull updates";
309 this.el.is_important = true;
312 this.el.button_press_event.connect( () => {
315 GitMonitor.gitmonitor.stop();
316 _this.repo.git({ "pull" , "--all" });
317 _this.repo.loadStatus();
318 GitMonitor.gitmonitor.start();
319 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
320 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
321 Clones.singleton().reposStore.load();
328 // user defined functions
333 public class Xcls_Notebook9 : Object
335 public Gtk.Notebook el;
336 private RepoStatusPopover _this;
342 public Xcls_Notebook9(RepoStatusPopover _owner )
345 this.el = new Gtk.Notebook();
349 // set gobject values
350 this.el.vexpand = true;
351 var child_0 = new Xcls_label_status( _this );
353 var child_1 = new Xcls_label_diff( _this );
355 var child_2 = new Xcls_Box12( _this );
357 this.el.append_page ( child_2.el , _this.label_status.el );
358 var child_3 = new Xcls_Box15( _this );
360 this.el.append_page ( child_3.el , _this.label_diff.el );
363 // user defined functions
365 public class Xcls_label_status : Object
368 private RepoStatusPopover _this;
374 public Xcls_label_status(RepoStatusPopover _owner )
377 _this.label_status = this;
378 this.el = new Gtk.Label( "Status" );
382 // set gobject values
385 // user defined functions
388 public class Xcls_label_diff : Object
391 private RepoStatusPopover _this;
397 public Xcls_label_diff(RepoStatusPopover _owner )
400 _this.label_diff = this;
401 this.el = new Gtk.Label( "Diff" );
405 // set gobject values
408 // user defined functions
411 public class Xcls_Box12 : Object
414 private RepoStatusPopover _this;
420 public Xcls_Box12(RepoStatusPopover _owner )
423 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
427 // set gobject values
428 this.el.homogeneous = false;
429 var child_0 = new Xcls_ScrolledWindow13( _this );
431 this.el.pack_start ( child_0.el , true,true,0 );
434 // user defined functions
436 public class Xcls_ScrolledWindow13 : Object
438 public Gtk.ScrolledWindow el;
439 private RepoStatusPopover _this;
445 public Xcls_ScrolledWindow13(RepoStatusPopover _owner )
448 this.el = new Gtk.ScrolledWindow( null, null );
452 // set gobject values
453 var child_0 = new Xcls_status_view( _this );
455 this.el.add ( child_0.el );
458 // user defined functions
460 public class Xcls_status_view : Object
462 public Gtk.SourceView el;
463 private RepoStatusPopover _this;
469 public Xcls_status_view(RepoStatusPopover _owner )
472 _this.status_view = this;
473 this.el = new Gtk.SourceView();
479 var description = Pango.FontDescription.from_string("monospace");
480 description.set_size(9000);
481 this.el.override_font(description);
484 // user defined functions
489 public class Xcls_Box15 : Object
492 private RepoStatusPopover _this;
498 public Xcls_Box15(RepoStatusPopover _owner )
501 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
505 // set gobject values
506 this.el.homogeneous = false;
507 var child_0 = new Xcls_ScrolledWindow16( _this );
509 this.el.pack_start ( child_0.el , true,true,0 );
512 // user defined functions
514 public class Xcls_ScrolledWindow16 : Object
516 public Gtk.ScrolledWindow el;
517 private RepoStatusPopover _this;
523 public Xcls_ScrolledWindow16(RepoStatusPopover _owner )
526 this.el = new Gtk.ScrolledWindow( null, null );
530 // set gobject values
531 this.el.height_request = 400;
532 var child_0 = new Xcls_diff_view( _this );
534 this.el.add ( child_0.el );
537 // user defined functions
539 public class Xcls_diff_view : Object
541 public Gtk.SourceView el;
542 private RepoStatusPopover _this;
548 public Xcls_diff_view(RepoStatusPopover _owner )
551 _this.diff_view = this;
552 this.el = new Gtk.SourceView();
558 var description = Pango.FontDescription.from_string("monospace");
559 description.set_size(9000);
560 this.el.override_font(description);
563 // user defined functions
569 public class Xcls_Box18 : Object
572 private RepoStatusPopover _this;
578 public Xcls_Box18(RepoStatusPopover _owner )
581 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
585 // set gobject values
586 this.el.homogeneous = true;
587 this.el.expand = false;
588 this.el.vexpand = false;
589 var child_0 = new Xcls_Toolbar19( _this );
591 this.el.add ( child_0.el );
594 // user defined functions
596 public class Xcls_Toolbar19 : Object
598 public Gtk.Toolbar el;
599 private RepoStatusPopover _this;
605 public Xcls_Toolbar19(RepoStatusPopover _owner )
608 this.el = new Gtk.Toolbar();
612 // set gobject values
613 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
614 var child_0 = new Xcls_btn_create( _this );
616 this.el.add ( child_0.el );
617 var child_1 = new Xcls_btn_merge( _this );
619 this.el.add ( child_1.el );
620 var child_2 = new Xcls_ToolButton22( _this );
622 this.el.add ( child_2.el );
625 // user defined functions
627 public class Xcls_btn_create : Object
629 public Gtk.ToolButton el;
630 private RepoStatusPopover _this;
636 public Xcls_btn_create(RepoStatusPopover _owner )
639 _this.btn_create = this;
640 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-add", Gtk.IconSize.SMALL_TOOLBAR), null);;
644 // set gobject values
645 this.el.label = "Create Branch / Start ticket";
646 this.el.is_important = true;
649 this.el.button_press_event.connect( () => {
650 var oldq = new Gee.ArrayList<GitMonitorQueue>();
652 Clones.singleton().el.response(-1);
653 NewBranch.singleton().show(_this.repo, oldq);
659 // user defined functions
662 public class Xcls_btn_merge : Object
664 public Gtk.ToolButton el;
665 private RepoStatusPopover _this;
671 public Xcls_btn_merge(RepoStatusPopover _owner )
674 _this.btn_merge = this;
675 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
679 // set gobject values
680 this.el.label = "Merge branch / Complete ticket";
681 this.el.is_important = true;
684 this.el.clicked.connect( () => {
687 Clones.singleton().el.response(-1);
688 if (_this.repo.activeTicket != null) {
689 MergeBranch.singleton().show(_this.repo.activeTicket, null);
695 // user defined functions
698 public class Xcls_ToolButton22 : Object
700 public Gtk.ToolButton el;
701 private RepoStatusPopover _this;
707 public Xcls_ToolButton22(RepoStatusPopover _owner )
710 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-new", Gtk.IconSize.SMALL_TOOLBAR), null);;
714 // set gobject values
715 this.el.label = "Create Ticket";
716 this.el.is_important = true;
719 this.el.button_press_event.connect( () => {
723 Clones.singleton().el.response(-1);
726 Ticket.singleton().show( _this.repo);
732 // user defined functions