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_Toolbar3( _this );
91 this.el.add ( child_0.el );
92 var child_1 = new Xcls_Notebook11( _this );
94 this.el.pack_start ( child_1.el , true,true,0 );
95 var child_2 = new Xcls_Box20( _this );
97 this.el.pack_end ( child_2.el , false,false,0 );
100 // user defined functions
102 public class Xcls_Toolbar3 : Object
104 public Gtk.Toolbar el;
105 private RepoStatusPopover _this;
111 public Xcls_Toolbar3(RepoStatusPopover _owner )
114 this.el = new Gtk.Toolbar();
118 // set gobject values
119 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
120 var child_0 = new Xcls_ToolButton4( _this );
122 this.el.add ( child_0.el );
123 var child_1 = new Xcls_ToolButton5( _this );
125 this.el.add ( child_1.el );
126 var child_2 = new Xcls_ToolButton6( _this );
128 this.el.add ( child_2.el );
129 var child_3 = new Xcls_ToolButton7( _this );
131 this.el.add ( child_3.el );
132 var child_4 = new Xcls_ToolButton8( _this );
134 this.el.add ( child_4.el );
135 var child_5 = new Xcls_ToolButton9( _this );
137 this.el.add ( child_5.el );
138 var child_6 = new Xcls_ToolButton10( _this );
140 this.el.add ( child_6.el );
143 // user defined functions
145 public class Xcls_ToolButton4 : Object
147 public Gtk.ToolButton el;
148 private RepoStatusPopover _this;
154 public Xcls_ToolButton4(RepoStatusPopover _owner )
157 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-undo", Gtk.IconSize.SMALL_TOOLBAR), null);;
161 // set gobject values
162 this.el.label = "Stash Changes";
163 this.el.is_important = true;
166 this.el.button_press_event.connect( () => {
169 GitMonitor.gitmonitor.stop();
170 _this.repo.git({ "stash" , "--all" });
171 _this.repo.loadStatus();
172 GitMonitor.gitmonitor.start();
173 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
174 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
175 Clones.singleton().reposStore.load();
182 // user defined functions
185 public class Xcls_ToolButton5 : Object
187 public Gtk.ToolButton el;
188 private RepoStatusPopover _this;
194 public Xcls_ToolButton5(RepoStatusPopover _owner )
197 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-save", Gtk.IconSize.SMALL_TOOLBAR), null);;
201 // set gobject values
202 this.el.label = "Commit Changes";
203 this.el.is_important = true;
206 this.el.button_press_event.connect( () => {
207 _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
209 _this.repo.loadStatus();
211 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
212 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
215 Clones.singleton().reposStore.load();
221 // user defined functions
224 public class Xcls_ToolButton6 : Object
226 public Gtk.ToolButton el;
227 private RepoStatusPopover _this;
233 public Xcls_ToolButton6(RepoStatusPopover _owner )
236 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-add", Gtk.IconSize.SMALL_TOOLBAR), null);;
240 // set gobject values
241 this.el.label = "Create Branch / Start ticket";
242 this.el.is_important = true;
245 this.el.button_press_event.connect( () => {
246 var oldq = new Gee.ArrayList<GitMonitorQueue>();
248 Clones.singleton().el.response(-1);
249 NewBranch.singleton().show(_this.repo, oldq);
255 // user defined functions
258 public class Xcls_ToolButton7 : Object
260 public Gtk.ToolButton el;
261 private RepoStatusPopover _this;
267 public Xcls_ToolButton7(RepoStatusPopover _owner )
270 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-revert-to-saved", Gtk.IconSize.SMALL_TOOLBAR), null);;
274 // set gobject values
275 this.el.label = "Reset / clear changes";
276 this.el.is_important = true;
279 this.el.button_press_event.connect( () => {
282 GitMonitor.gitmonitor.stop();
283 _this.repo.git({ "reset" , "--hard" });
284 _this.repo.loadStatus();
285 GitMonitor.gitmonitor.start();
286 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
287 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
288 Clones.singleton().reposStore.load();
295 // user defined functions
298 public class Xcls_ToolButton8 : Object
300 public Gtk.ToolButton el;
301 private RepoStatusPopover _this;
307 public Xcls_ToolButton8(RepoStatusPopover _owner )
310 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-bottom", Gtk.IconSize.SMALL_TOOLBAR), null);;
314 // set gobject values
315 this.el.label = "Pull updates";
316 this.el.is_important = true;
319 this.el.button_press_event.connect( () => {
322 GitMonitor.gitmonitor.stop();
323 _this.repo.git({ "pull" , "--all" });
324 _this.repo.loadStatus();
325 GitMonitor.gitmonitor.start();
326 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
327 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
328 Clones.singleton().reposStore.load();
335 // user defined functions
338 public class Xcls_ToolButton9 : Object
340 public Gtk.ToolButton el;
341 private RepoStatusPopover _this;
347 public Xcls_ToolButton9(RepoStatusPopover _owner )
350 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
354 // set gobject values
355 this.el.label = "Merge branch/ ticket";
356 this.el.is_important = true;
359 this.el.button_press_event.connect( () => {
362 Clones.singleton().el.response(-1);
363 if (_this.repo.activeTicket != null) {
364 MergeBranch.singleton().show(_this.repo.activeTicket, null);
370 // user defined functions
373 public class Xcls_ToolButton10 : Object
375 public Gtk.ToolButton el;
376 private RepoStatusPopover _this;
382 public Xcls_ToolButton10(RepoStatusPopover _owner )
385 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-new", Gtk.IconSize.SMALL_TOOLBAR), null);;
389 // set gobject values
390 this.el.label = "Create Ticket";
391 this.el.is_important = true;
394 this.el.button_press_event.connect( () => {
398 Clones.singleton().el.response(-1);
401 Ticket.singleton().show( _this.repo);
407 // user defined functions
411 public class Xcls_Notebook11 : Object
413 public Gtk.Notebook el;
414 private RepoStatusPopover _this;
420 public Xcls_Notebook11(RepoStatusPopover _owner )
423 this.el = new Gtk.Notebook();
427 // set gobject values
428 var child_0 = new Xcls_label_status( _this );
430 var child_1 = new Xcls_label_diff( _this );
432 var child_2 = new Xcls_Box14( _this );
434 this.el.append_page ( child_2.el , _this.label_status.el );
435 var child_3 = new Xcls_Box17( _this );
437 this.el.append_page ( child_3.el , _this.label_diff.el );
440 // user defined functions
442 public class Xcls_label_status : Object
445 private RepoStatusPopover _this;
451 public Xcls_label_status(RepoStatusPopover _owner )
454 _this.label_status = this;
455 this.el = new Gtk.Label( "Status" );
459 // set gobject values
462 // user defined functions
465 public class Xcls_label_diff : Object
468 private RepoStatusPopover _this;
474 public Xcls_label_diff(RepoStatusPopover _owner )
477 _this.label_diff = this;
478 this.el = new Gtk.Label( "Diff" );
482 // set gobject values
485 // user defined functions
488 public class Xcls_Box14 : Object
491 private RepoStatusPopover _this;
497 public Xcls_Box14(RepoStatusPopover _owner )
500 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
504 // set gobject values
505 this.el.homogeneous = false;
506 var child_0 = new Xcls_ScrolledWindow15( _this );
508 this.el.pack_start ( child_0.el , true,true,0 );
511 // user defined functions
513 public class Xcls_ScrolledWindow15 : Object
515 public Gtk.ScrolledWindow el;
516 private RepoStatusPopover _this;
522 public Xcls_ScrolledWindow15(RepoStatusPopover _owner )
525 this.el = new Gtk.ScrolledWindow( null, null );
529 // set gobject values
530 var child_0 = new Xcls_status_view( _this );
532 this.el.add ( child_0.el );
535 // user defined functions
537 public class Xcls_status_view : Object
539 public Gtk.SourceView el;
540 private RepoStatusPopover _this;
546 public Xcls_status_view(RepoStatusPopover _owner )
549 _this.status_view = this;
550 this.el = new Gtk.SourceView();
556 var description = Pango.FontDescription.from_string("monospace");
557 description.set_size(9000);
558 this.el.override_font(description);
561 // user defined functions
566 public class Xcls_Box17 : Object
569 private RepoStatusPopover _this;
575 public Xcls_Box17(RepoStatusPopover _owner )
578 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
582 // set gobject values
583 this.el.homogeneous = false;
584 var child_0 = new Xcls_ScrolledWindow18( _this );
586 this.el.pack_start ( child_0.el , true,true,0 );
589 // user defined functions
591 public class Xcls_ScrolledWindow18 : Object
593 public Gtk.ScrolledWindow el;
594 private RepoStatusPopover _this;
600 public Xcls_ScrolledWindow18(RepoStatusPopover _owner )
603 this.el = new Gtk.ScrolledWindow( null, null );
607 // set gobject values
608 this.el.height_request = 400;
609 var child_0 = new Xcls_diff_view( _this );
611 this.el.add ( child_0.el );
614 // user defined functions
616 public class Xcls_diff_view : Object
618 public Gtk.SourceView el;
619 private RepoStatusPopover _this;
625 public Xcls_diff_view(RepoStatusPopover _owner )
628 _this.diff_view = this;
629 this.el = new Gtk.SourceView();
635 var description = Pango.FontDescription.from_string("monospace");
636 description.set_size(9000);
637 this.el.override_font(description);
640 // user defined functions
646 public class Xcls_Box20 : Object
649 private RepoStatusPopover _this;
655 public Xcls_Box20(RepoStatusPopover _owner )
658 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
662 // set gobject values
663 this.el.homogeneous = true;
664 this.el.expand = false;
665 this.el.vexpand = false;
666 var child_0 = new Xcls_Toolbar21( _this );
668 this.el.add ( child_0.el );
671 // user defined functions
673 public class Xcls_Toolbar21 : Object
675 public Gtk.Toolbar el;
676 private RepoStatusPopover _this;
682 public Xcls_Toolbar21(RepoStatusPopover _owner )
685 this.el = new Gtk.Toolbar();
689 // set gobject values
690 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
691 var child_0 = new Xcls_ToolButton22( _this );
693 this.el.add ( child_0.el );
694 var child_1 = new Xcls_ToolButton23( _this );
696 this.el.add ( child_1.el );
697 var child_2 = new Xcls_ToolButton24( _this );
699 this.el.add ( child_2.el );
700 var child_3 = new Xcls_ToolButton25( _this );
702 this.el.add ( child_3.el );
703 var child_4 = new Xcls_ToolButton26( _this );
705 this.el.add ( child_4.el );
706 var child_5 = new Xcls_ToolButton27( _this );
708 this.el.add ( child_5.el );
709 var child_6 = new Xcls_ToolButton28( _this );
711 this.el.add ( child_6.el );
714 // user defined functions
716 public class Xcls_ToolButton22 : Object
718 public Gtk.ToolButton el;
719 private RepoStatusPopover _this;
725 public Xcls_ToolButton22(RepoStatusPopover _owner )
728 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-undo", Gtk.IconSize.SMALL_TOOLBAR), null);;
732 // set gobject values
733 this.el.label = "Stash Changes";
734 this.el.is_important = true;
737 this.el.button_press_event.connect( () => {
740 GitMonitor.gitmonitor.stop();
741 _this.repo.git({ "stash" , "--all" });
742 _this.repo.loadStatus();
743 GitMonitor.gitmonitor.start();
744 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
745 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
746 Clones.singleton().reposStore.load();
753 // user defined functions
756 public class Xcls_ToolButton23 : Object
758 public Gtk.ToolButton el;
759 private RepoStatusPopover _this;
765 public Xcls_ToolButton23(RepoStatusPopover _owner )
768 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-save", Gtk.IconSize.SMALL_TOOLBAR), null);;
772 // set gobject values
773 this.el.label = "Commit Changes";
774 this.el.is_important = true;
777 this.el.button_press_event.connect( () => {
778 _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
780 _this.repo.loadStatus();
782 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
783 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
786 Clones.singleton().reposStore.load();
792 // user defined functions
795 public class Xcls_ToolButton24 : Object
797 public Gtk.ToolButton el;
798 private RepoStatusPopover _this;
804 public Xcls_ToolButton24(RepoStatusPopover _owner )
807 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-add", Gtk.IconSize.SMALL_TOOLBAR), null);;
811 // set gobject values
812 this.el.label = "Create Branch / Start ticket";
813 this.el.is_important = true;
816 this.el.button_press_event.connect( () => {
817 var oldq = new Gee.ArrayList<GitMonitorQueue>();
819 Clones.singleton().el.response(-1);
820 NewBranch.singleton().show(_this.repo, oldq);
826 // user defined functions
829 public class Xcls_ToolButton25 : Object
831 public Gtk.ToolButton el;
832 private RepoStatusPopover _this;
838 public Xcls_ToolButton25(RepoStatusPopover _owner )
841 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-revert-to-saved", Gtk.IconSize.SMALL_TOOLBAR), null);;
845 // set gobject values
846 this.el.label = "Reset / clear changes";
847 this.el.is_important = true;
850 this.el.button_press_event.connect( () => {
853 GitMonitor.gitmonitor.stop();
854 _this.repo.git({ "reset" , "--hard" });
855 _this.repo.loadStatus();
856 GitMonitor.gitmonitor.start();
857 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
858 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
859 Clones.singleton().reposStore.load();
866 // user defined functions
869 public class Xcls_ToolButton26 : Object
871 public Gtk.ToolButton el;
872 private RepoStatusPopover _this;
878 public Xcls_ToolButton26(RepoStatusPopover _owner )
881 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-bottom", Gtk.IconSize.SMALL_TOOLBAR), null);;
885 // set gobject values
886 this.el.label = "Pull updates";
887 this.el.is_important = true;
890 this.el.button_press_event.connect( () => {
893 GitMonitor.gitmonitor.stop();
894 _this.repo.git({ "pull" , "--all" });
895 _this.repo.loadStatus();
896 GitMonitor.gitmonitor.start();
897 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
898 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
899 Clones.singleton().reposStore.load();
906 // user defined functions
909 public class Xcls_ToolButton27 : Object
911 public Gtk.ToolButton el;
912 private RepoStatusPopover _this;
918 public Xcls_ToolButton27(RepoStatusPopover _owner )
921 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
925 // set gobject values
926 this.el.label = "Merge branch/ ticket";
927 this.el.is_important = true;
930 this.el.button_press_event.connect( () => {
933 Clones.singleton().el.response(-1);
934 if (_this.repo.activeTicket != null) {
935 MergeBranch.singleton().show(_this.repo.activeTicket, null);
941 // user defined functions
944 public class Xcls_ToolButton28 : Object
946 public Gtk.ToolButton el;
947 private RepoStatusPopover _this;
953 public Xcls_ToolButton28(RepoStatusPopover _owner )
956 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-new", Gtk.IconSize.SMALL_TOOLBAR), null);;
960 // set gobject values
961 this.el.label = "Create Ticket";
962 this.el.is_important = true;
965 this.el.button_press_event.connect( () => {
969 Clones.singleton().el.response(-1);
972 Ticket.singleton().show( _this.repo);
978 // user defined functions