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_end ( child_0.el , false,false,0 );
92 var child_1 = new Xcls_Notebook12( _this );
94 this.el.pack_start ( child_1.el , true,true,0 );
95 var child_2 = new Xcls_Box21( _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 );
159 var child_4 = new Xcls_ToolButton9( _this );
161 this.el.add ( child_4.el );
162 var child_5 = new Xcls_ToolButton10( _this );
164 this.el.add ( child_5.el );
165 var child_6 = new Xcls_ToolButton11( _this );
167 this.el.add ( child_6.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-add", Gtk.IconSize.SMALL_TOOLBAR), null);;
267 // set gobject values
268 this.el.label = "Create Branch / Start ticket";
269 this.el.is_important = true;
272 this.el.button_press_event.connect( () => {
273 var oldq = new Gee.ArrayList<GitMonitorQueue>();
275 Clones.singleton().el.response(-1);
276 NewBranch.singleton().show(_this.repo, oldq);
282 // user defined functions
285 public class Xcls_ToolButton8 : Object
287 public Gtk.ToolButton el;
288 private RepoStatusPopover _this;
294 public Xcls_ToolButton8(RepoStatusPopover _owner )
297 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-revert-to-saved", Gtk.IconSize.SMALL_TOOLBAR), null);;
301 // set gobject values
302 this.el.label = "Reset / clear changes";
303 this.el.is_important = true;
306 this.el.button_press_event.connect( () => {
309 GitMonitor.gitmonitor.stop();
310 _this.repo.git({ "reset" , "--hard" });
311 _this.repo.loadStatus();
312 GitMonitor.gitmonitor.start();
313 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
314 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
315 Clones.singleton().reposStore.load();
322 // user defined functions
325 public class Xcls_ToolButton9 : Object
327 public Gtk.ToolButton el;
328 private RepoStatusPopover _this;
334 public Xcls_ToolButton9(RepoStatusPopover _owner )
337 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-bottom", Gtk.IconSize.SMALL_TOOLBAR), null);;
341 // set gobject values
342 this.el.label = "Pull updates";
343 this.el.is_important = true;
346 this.el.button_press_event.connect( () => {
349 GitMonitor.gitmonitor.stop();
350 _this.repo.git({ "pull" , "--all" });
351 _this.repo.loadStatus();
352 GitMonitor.gitmonitor.start();
353 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
354 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
355 Clones.singleton().reposStore.load();
362 // user defined functions
365 public class Xcls_ToolButton10 : Object
367 public Gtk.ToolButton el;
368 private RepoStatusPopover _this;
374 public Xcls_ToolButton10(RepoStatusPopover _owner )
377 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
381 // set gobject values
382 this.el.label = "Merge branch/ ticket";
383 this.el.is_important = true;
386 this.el.button_press_event.connect( () => {
389 Clones.singleton().el.response(-1);
390 if (_this.repo.activeTicket != null) {
391 MergeBranch.singleton().show(_this.repo.activeTicket, null);
397 // user defined functions
400 public class Xcls_ToolButton11 : Object
402 public Gtk.ToolButton el;
403 private RepoStatusPopover _this;
409 public Xcls_ToolButton11(RepoStatusPopover _owner )
412 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-new", Gtk.IconSize.SMALL_TOOLBAR), null);;
416 // set gobject values
417 this.el.label = "Create Ticket";
418 this.el.is_important = true;
421 this.el.button_press_event.connect( () => {
425 Clones.singleton().el.response(-1);
428 Ticket.singleton().show( _this.repo);
434 // user defined functions
439 public class Xcls_Notebook12 : Object
441 public Gtk.Notebook el;
442 private RepoStatusPopover _this;
448 public Xcls_Notebook12(RepoStatusPopover _owner )
451 this.el = new Gtk.Notebook();
455 // set gobject values
456 var child_0 = new Xcls_label_status( _this );
458 var child_1 = new Xcls_label_diff( _this );
460 var child_2 = new Xcls_Box15( _this );
462 this.el.append_page ( child_2.el , _this.label_status.el );
463 var child_3 = new Xcls_Box18( _this );
465 this.el.append_page ( child_3.el , _this.label_diff.el );
468 // user defined functions
470 public class Xcls_label_status : Object
473 private RepoStatusPopover _this;
479 public Xcls_label_status(RepoStatusPopover _owner )
482 _this.label_status = this;
483 this.el = new Gtk.Label( "Status" );
487 // set gobject values
490 // user defined functions
493 public class Xcls_label_diff : Object
496 private RepoStatusPopover _this;
502 public Xcls_label_diff(RepoStatusPopover _owner )
505 _this.label_diff = this;
506 this.el = new Gtk.Label( "Diff" );
510 // set gobject values
513 // user defined functions
516 public class Xcls_Box15 : Object
519 private RepoStatusPopover _this;
525 public Xcls_Box15(RepoStatusPopover _owner )
528 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
532 // set gobject values
533 this.el.homogeneous = false;
534 var child_0 = new Xcls_ScrolledWindow16( _this );
536 this.el.pack_start ( child_0.el , true,true,0 );
539 // user defined functions
541 public class Xcls_ScrolledWindow16 : Object
543 public Gtk.ScrolledWindow el;
544 private RepoStatusPopover _this;
550 public Xcls_ScrolledWindow16(RepoStatusPopover _owner )
553 this.el = new Gtk.ScrolledWindow( null, null );
557 // set gobject values
558 var child_0 = new Xcls_status_view( _this );
560 this.el.add ( child_0.el );
563 // user defined functions
565 public class Xcls_status_view : Object
567 public Gtk.SourceView el;
568 private RepoStatusPopover _this;
574 public Xcls_status_view(RepoStatusPopover _owner )
577 _this.status_view = this;
578 this.el = new Gtk.SourceView();
584 var description = Pango.FontDescription.from_string("monospace");
585 description.set_size(9000);
586 this.el.override_font(description);
589 // user defined functions
594 public class Xcls_Box18 : Object
597 private RepoStatusPopover _this;
603 public Xcls_Box18(RepoStatusPopover _owner )
606 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
610 // set gobject values
611 this.el.homogeneous = false;
612 var child_0 = new Xcls_ScrolledWindow19( _this );
614 this.el.pack_start ( child_0.el , true,true,0 );
617 // user defined functions
619 public class Xcls_ScrolledWindow19 : Object
621 public Gtk.ScrolledWindow el;
622 private RepoStatusPopover _this;
628 public Xcls_ScrolledWindow19(RepoStatusPopover _owner )
631 this.el = new Gtk.ScrolledWindow( null, null );
635 // set gobject values
636 this.el.height_request = 400;
637 var child_0 = new Xcls_diff_view( _this );
639 this.el.add ( child_0.el );
642 // user defined functions
644 public class Xcls_diff_view : Object
646 public Gtk.SourceView el;
647 private RepoStatusPopover _this;
653 public Xcls_diff_view(RepoStatusPopover _owner )
656 _this.diff_view = this;
657 this.el = new Gtk.SourceView();
663 var description = Pango.FontDescription.from_string("monospace");
664 description.set_size(9000);
665 this.el.override_font(description);
668 // user defined functions
674 public class Xcls_Box21 : Object
677 private RepoStatusPopover _this;
683 public Xcls_Box21(RepoStatusPopover _owner )
686 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
690 // set gobject values
691 this.el.homogeneous = true;
692 this.el.expand = false;
693 this.el.vexpand = false;
694 var child_0 = new Xcls_Toolbar22( _this );
696 this.el.add ( child_0.el );
699 // user defined functions
701 public class Xcls_Toolbar22 : Object
703 public Gtk.Toolbar el;
704 private RepoStatusPopover _this;
710 public Xcls_Toolbar22(RepoStatusPopover _owner )
713 this.el = new Gtk.Toolbar();
717 // set gobject values
718 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
719 var child_0 = new Xcls_ToolButton23( _this );
721 this.el.add ( child_0.el );
722 var child_1 = new Xcls_ToolButton24( _this );
724 this.el.add ( child_1.el );
725 var child_2 = new Xcls_ToolButton25( _this );
727 this.el.add ( child_2.el );
728 var child_3 = new Xcls_ToolButton26( _this );
730 this.el.add ( child_3.el );
731 var child_4 = new Xcls_ToolButton27( _this );
733 this.el.add ( child_4.el );
734 var child_5 = new Xcls_ToolButton28( _this );
736 this.el.add ( child_5.el );
737 var child_6 = new Xcls_ToolButton29( _this );
739 this.el.add ( child_6.el );
742 // user defined functions
744 public class Xcls_ToolButton23 : Object
746 public Gtk.ToolButton el;
747 private RepoStatusPopover _this;
753 public Xcls_ToolButton23(RepoStatusPopover _owner )
756 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-undo", Gtk.IconSize.SMALL_TOOLBAR), null);;
760 // set gobject values
761 this.el.label = "Stash Changes";
762 this.el.is_important = true;
765 this.el.button_press_event.connect( () => {
768 GitMonitor.gitmonitor.stop();
769 _this.repo.git({ "stash" , "--all" });
770 _this.repo.loadStatus();
771 GitMonitor.gitmonitor.start();
772 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
773 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
774 Clones.singleton().reposStore.load();
781 // user defined functions
784 public class Xcls_ToolButton24 : Object
786 public Gtk.ToolButton el;
787 private RepoStatusPopover _this;
793 public Xcls_ToolButton24(RepoStatusPopover _owner )
796 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-save", Gtk.IconSize.SMALL_TOOLBAR), null);;
800 // set gobject values
801 this.el.label = "Commit Changes";
802 this.el.is_important = true;
805 this.el.button_press_event.connect( () => {
806 _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
808 _this.repo.loadStatus();
810 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
811 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
814 Clones.singleton().reposStore.load();
820 // user defined functions
823 public class Xcls_ToolButton25 : Object
825 public Gtk.ToolButton el;
826 private RepoStatusPopover _this;
832 public Xcls_ToolButton25(RepoStatusPopover _owner )
835 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-revert-to-saved", Gtk.IconSize.SMALL_TOOLBAR), null);;
839 // set gobject values
840 this.el.label = "Reset / clear changes";
841 this.el.is_important = true;
844 this.el.button_press_event.connect( () => {
847 GitMonitor.gitmonitor.stop();
848 _this.repo.git({ "reset" , "--hard" });
849 _this.repo.loadStatus();
850 GitMonitor.gitmonitor.start();
851 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
852 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
853 Clones.singleton().reposStore.load();
860 // user defined functions
863 public class Xcls_ToolButton26 : Object
865 public Gtk.ToolButton el;
866 private RepoStatusPopover _this;
872 public Xcls_ToolButton26(RepoStatusPopover _owner )
875 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-bottom", Gtk.IconSize.SMALL_TOOLBAR), null);;
879 // set gobject values
880 this.el.label = "Pull updates";
881 this.el.is_important = true;
884 this.el.button_press_event.connect( () => {
887 GitMonitor.gitmonitor.stop();
888 _this.repo.git({ "pull" , "--all" });
889 _this.repo.loadStatus();
890 GitMonitor.gitmonitor.start();
891 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
892 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
893 Clones.singleton().reposStore.load();
900 // user defined functions
903 public class Xcls_ToolButton27 : Object
905 public Gtk.ToolButton el;
906 private RepoStatusPopover _this;
912 public Xcls_ToolButton27(RepoStatusPopover _owner )
915 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-add", Gtk.IconSize.SMALL_TOOLBAR), null);;
919 // set gobject values
920 this.el.label = "Create Branch / Start ticket";
921 this.el.is_important = true;
924 this.el.button_press_event.connect( () => {
925 var oldq = new Gee.ArrayList<GitMonitorQueue>();
927 Clones.singleton().el.response(-1);
928 NewBranch.singleton().show(_this.repo, oldq);
934 // user defined functions
937 public class Xcls_ToolButton28 : Object
939 public Gtk.ToolButton el;
940 private RepoStatusPopover _this;
946 public Xcls_ToolButton28(RepoStatusPopover _owner )
949 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
953 // set gobject values
954 this.el.label = "Merge branch/ ticket";
955 this.el.is_important = true;
958 this.el.button_press_event.connect( () => {
961 Clones.singleton().el.response(-1);
962 if (_this.repo.activeTicket != null) {
963 MergeBranch.singleton().show(_this.repo.activeTicket, null);
969 // user defined functions
972 public class Xcls_ToolButton29 : Object
974 public Gtk.ToolButton el;
975 private RepoStatusPopover _this;
981 public Xcls_ToolButton29(RepoStatusPopover _owner )
984 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-new", Gtk.IconSize.SMALL_TOOLBAR), null);;
988 // set gobject values
989 this.el.label = "Create Ticket";
990 this.el.is_important = true;
993 this.el.button_press_event.connect( () => {
997 Clones.singleton().el.response(-1);
1000 Ticket.singleton().show( _this.repo);
1006 // user defined functions