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.vexpand = false;
120 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
121 var child_0 = new Xcls_ToolButton4( _this );
123 this.el.add ( child_0.el );
124 var child_1 = new Xcls_ToolButton5( _this );
126 this.el.add ( child_1.el );
127 var child_2 = new Xcls_ToolButton6( _this );
129 this.el.add ( child_2.el );
130 var child_3 = new Xcls_ToolButton7( _this );
132 this.el.add ( child_3.el );
133 var child_4 = new Xcls_ToolButton8( _this );
135 this.el.add ( child_4.el );
136 var child_5 = new Xcls_ToolButton9( _this );
138 this.el.add ( child_5.el );
139 var child_6 = new Xcls_ToolButton10( _this );
141 this.el.add ( child_6.el );
144 // user defined functions
146 public class Xcls_ToolButton4 : Object
148 public Gtk.ToolButton el;
149 private RepoStatusPopover _this;
155 public Xcls_ToolButton4(RepoStatusPopover _owner )
158 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-undo", Gtk.IconSize.SMALL_TOOLBAR), null);;
162 // set gobject values
163 this.el.label = "Stash Changes";
164 this.el.is_important = true;
167 this.el.button_press_event.connect( () => {
170 GitMonitor.gitmonitor.stop();
171 _this.repo.git({ "stash" , "--all" });
172 _this.repo.loadStatus();
173 GitMonitor.gitmonitor.start();
174 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
175 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
176 Clones.singleton().reposStore.load();
183 // user defined functions
186 public class Xcls_ToolButton5 : Object
188 public Gtk.ToolButton el;
189 private RepoStatusPopover _this;
195 public Xcls_ToolButton5(RepoStatusPopover _owner )
198 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-save", Gtk.IconSize.SMALL_TOOLBAR), null);;
202 // set gobject values
203 this.el.label = "Commit Changes";
204 this.el.is_important = true;
207 this.el.button_press_event.connect( () => {
208 _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
210 _this.repo.loadStatus();
212 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
213 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
216 Clones.singleton().reposStore.load();
222 // user defined functions
225 public class Xcls_ToolButton6 : Object
227 public Gtk.ToolButton el;
228 private RepoStatusPopover _this;
234 public Xcls_ToolButton6(RepoStatusPopover _owner )
237 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-add", Gtk.IconSize.SMALL_TOOLBAR), null);;
241 // set gobject values
242 this.el.label = "Create Branch / Start ticket";
243 this.el.is_important = true;
246 this.el.button_press_event.connect( () => {
247 var oldq = new Gee.ArrayList<GitMonitorQueue>();
249 Clones.singleton().el.response(-1);
250 NewBranch.singleton().show(_this.repo, oldq);
256 // user defined functions
259 public class Xcls_ToolButton7 : Object
261 public Gtk.ToolButton el;
262 private RepoStatusPopover _this;
268 public Xcls_ToolButton7(RepoStatusPopover _owner )
271 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-revert-to-saved", Gtk.IconSize.SMALL_TOOLBAR), null);;
275 // set gobject values
276 this.el.label = "Reset / clear changes";
277 this.el.is_important = true;
280 this.el.button_press_event.connect( () => {
283 GitMonitor.gitmonitor.stop();
284 _this.repo.git({ "reset" , "--hard" });
285 _this.repo.loadStatus();
286 GitMonitor.gitmonitor.start();
287 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
288 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
289 Clones.singleton().reposStore.load();
296 // user defined functions
299 public class Xcls_ToolButton8 : Object
301 public Gtk.ToolButton el;
302 private RepoStatusPopover _this;
308 public Xcls_ToolButton8(RepoStatusPopover _owner )
311 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-bottom", Gtk.IconSize.SMALL_TOOLBAR), null);;
315 // set gobject values
316 this.el.label = "Pull updates";
317 this.el.is_important = true;
320 this.el.button_press_event.connect( () => {
323 GitMonitor.gitmonitor.stop();
324 _this.repo.git({ "pull" , "--all" });
325 _this.repo.loadStatus();
326 GitMonitor.gitmonitor.start();
327 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
328 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
329 Clones.singleton().reposStore.load();
336 // user defined functions
339 public class Xcls_ToolButton9 : Object
341 public Gtk.ToolButton el;
342 private RepoStatusPopover _this;
348 public Xcls_ToolButton9(RepoStatusPopover _owner )
351 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
355 // set gobject values
356 this.el.label = "Merge branch/ ticket";
357 this.el.is_important = true;
360 this.el.button_press_event.connect( () => {
363 Clones.singleton().el.response(-1);
364 if (_this.repo.activeTicket != null) {
365 MergeBranch.singleton().show(_this.repo.activeTicket, null);
371 // user defined functions
374 public class Xcls_ToolButton10 : Object
376 public Gtk.ToolButton el;
377 private RepoStatusPopover _this;
383 public Xcls_ToolButton10(RepoStatusPopover _owner )
386 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-new", Gtk.IconSize.SMALL_TOOLBAR), null);;
390 // set gobject values
391 this.el.label = "Create Ticket";
392 this.el.is_important = true;
395 this.el.button_press_event.connect( () => {
399 Clones.singleton().el.response(-1);
402 Ticket.singleton().show( _this.repo);
408 // user defined functions
412 public class Xcls_Notebook11 : Object
414 public Gtk.Notebook el;
415 private RepoStatusPopover _this;
421 public Xcls_Notebook11(RepoStatusPopover _owner )
424 this.el = new Gtk.Notebook();
428 // set gobject values
429 var child_0 = new Xcls_label_status( _this );
431 var child_1 = new Xcls_label_diff( _this );
433 var child_2 = new Xcls_Box14( _this );
435 this.el.append_page ( child_2.el , _this.label_status.el );
436 var child_3 = new Xcls_Box17( _this );
438 this.el.append_page ( child_3.el , _this.label_diff.el );
441 // user defined functions
443 public class Xcls_label_status : Object
446 private RepoStatusPopover _this;
452 public Xcls_label_status(RepoStatusPopover _owner )
455 _this.label_status = this;
456 this.el = new Gtk.Label( "Status" );
460 // set gobject values
463 // user defined functions
466 public class Xcls_label_diff : Object
469 private RepoStatusPopover _this;
475 public Xcls_label_diff(RepoStatusPopover _owner )
478 _this.label_diff = this;
479 this.el = new Gtk.Label( "Diff" );
483 // set gobject values
486 // user defined functions
489 public class Xcls_Box14 : Object
492 private RepoStatusPopover _this;
498 public Xcls_Box14(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_ScrolledWindow15( _this );
509 this.el.pack_start ( child_0.el , true,true,0 );
512 // user defined functions
514 public class Xcls_ScrolledWindow15 : Object
516 public Gtk.ScrolledWindow el;
517 private RepoStatusPopover _this;
523 public Xcls_ScrolledWindow15(RepoStatusPopover _owner )
526 this.el = new Gtk.ScrolledWindow( null, null );
530 // set gobject values
531 var child_0 = new Xcls_status_view( _this );
533 this.el.add ( child_0.el );
536 // user defined functions
538 public class Xcls_status_view : Object
540 public Gtk.SourceView el;
541 private RepoStatusPopover _this;
547 public Xcls_status_view(RepoStatusPopover _owner )
550 _this.status_view = this;
551 this.el = new Gtk.SourceView();
557 var description = Pango.FontDescription.from_string("monospace");
558 description.set_size(9000);
559 this.el.override_font(description);
562 // user defined functions
567 public class Xcls_Box17 : Object
570 private RepoStatusPopover _this;
576 public Xcls_Box17(RepoStatusPopover _owner )
579 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
583 // set gobject values
584 this.el.homogeneous = false;
585 var child_0 = new Xcls_ScrolledWindow18( _this );
587 this.el.pack_start ( child_0.el , true,true,0 );
590 // user defined functions
592 public class Xcls_ScrolledWindow18 : Object
594 public Gtk.ScrolledWindow el;
595 private RepoStatusPopover _this;
601 public Xcls_ScrolledWindow18(RepoStatusPopover _owner )
604 this.el = new Gtk.ScrolledWindow( null, null );
608 // set gobject values
609 this.el.height_request = 400;
610 var child_0 = new Xcls_diff_view( _this );
612 this.el.add ( child_0.el );
615 // user defined functions
617 public class Xcls_diff_view : Object
619 public Gtk.SourceView el;
620 private RepoStatusPopover _this;
626 public Xcls_diff_view(RepoStatusPopover _owner )
629 _this.diff_view = this;
630 this.el = new Gtk.SourceView();
636 var description = Pango.FontDescription.from_string("monospace");
637 description.set_size(9000);
638 this.el.override_font(description);
641 // user defined functions
647 public class Xcls_Box20 : Object
650 private RepoStatusPopover _this;
656 public Xcls_Box20(RepoStatusPopover _owner )
659 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
663 // set gobject values
664 this.el.homogeneous = true;
665 this.el.expand = false;
666 this.el.vexpand = false;
667 var child_0 = new Xcls_Toolbar21( _this );
669 this.el.add ( child_0.el );
672 // user defined functions
674 public class Xcls_Toolbar21 : Object
676 public Gtk.Toolbar el;
677 private RepoStatusPopover _this;
683 public Xcls_Toolbar21(RepoStatusPopover _owner )
686 this.el = new Gtk.Toolbar();
690 // set gobject values
691 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
692 var child_0 = new Xcls_ToolButton22( _this );
694 this.el.add ( child_0.el );
695 var child_1 = new Xcls_ToolButton23( _this );
697 this.el.add ( child_1.el );
698 var child_2 = new Xcls_ToolButton24( _this );
700 this.el.add ( child_2.el );
701 var child_3 = new Xcls_ToolButton25( _this );
703 this.el.add ( child_3.el );
704 var child_4 = new Xcls_ToolButton26( _this );
706 this.el.add ( child_4.el );
707 var child_5 = new Xcls_ToolButton27( _this );
709 this.el.add ( child_5.el );
710 var child_6 = new Xcls_ToolButton28( _this );
712 this.el.add ( child_6.el );
715 // user defined functions
717 public class Xcls_ToolButton22 : Object
719 public Gtk.ToolButton el;
720 private RepoStatusPopover _this;
726 public Xcls_ToolButton22(RepoStatusPopover _owner )
729 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-undo", Gtk.IconSize.SMALL_TOOLBAR), null);;
733 // set gobject values
734 this.el.label = "Stash Changes";
735 this.el.is_important = true;
738 this.el.button_press_event.connect( () => {
741 GitMonitor.gitmonitor.stop();
742 _this.repo.git({ "stash" , "--all" });
743 _this.repo.loadStatus();
744 GitMonitor.gitmonitor.start();
745 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
746 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
747 Clones.singleton().reposStore.load();
754 // user defined functions
757 public class Xcls_ToolButton23 : Object
759 public Gtk.ToolButton el;
760 private RepoStatusPopover _this;
766 public Xcls_ToolButton23(RepoStatusPopover _owner )
769 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-save", Gtk.IconSize.SMALL_TOOLBAR), null);;
773 // set gobject values
774 this.el.label = "Commit Changes";
775 this.el.is_important = true;
778 this.el.button_press_event.connect( () => {
779 _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
781 _this.repo.loadStatus();
783 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
784 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
787 Clones.singleton().reposStore.load();
793 // user defined functions
796 public class Xcls_ToolButton24 : Object
798 public Gtk.ToolButton el;
799 private RepoStatusPopover _this;
805 public Xcls_ToolButton24(RepoStatusPopover _owner )
808 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-add", Gtk.IconSize.SMALL_TOOLBAR), null);;
812 // set gobject values
813 this.el.label = "Create Branch / Start ticket";
814 this.el.is_important = true;
817 this.el.button_press_event.connect( () => {
818 var oldq = new Gee.ArrayList<GitMonitorQueue>();
820 Clones.singleton().el.response(-1);
821 NewBranch.singleton().show(_this.repo, oldq);
827 // user defined functions
830 public class Xcls_ToolButton25 : Object
832 public Gtk.ToolButton el;
833 private RepoStatusPopover _this;
839 public Xcls_ToolButton25(RepoStatusPopover _owner )
842 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-revert-to-saved", Gtk.IconSize.SMALL_TOOLBAR), null);;
846 // set gobject values
847 this.el.label = "Reset / clear changes";
848 this.el.is_important = true;
851 this.el.button_press_event.connect( () => {
854 GitMonitor.gitmonitor.stop();
855 _this.repo.git({ "reset" , "--hard" });
856 _this.repo.loadStatus();
857 GitMonitor.gitmonitor.start();
858 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
859 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
860 Clones.singleton().reposStore.load();
867 // user defined functions
870 public class Xcls_ToolButton26 : Object
872 public Gtk.ToolButton el;
873 private RepoStatusPopover _this;
879 public Xcls_ToolButton26(RepoStatusPopover _owner )
882 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-bottom", Gtk.IconSize.SMALL_TOOLBAR), null);;
886 // set gobject values
887 this.el.label = "Pull updates";
888 this.el.is_important = true;
891 this.el.button_press_event.connect( () => {
894 GitMonitor.gitmonitor.stop();
895 _this.repo.git({ "pull" , "--all" });
896 _this.repo.loadStatus();
897 GitMonitor.gitmonitor.start();
898 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
899 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
900 Clones.singleton().reposStore.load();
907 // user defined functions
910 public class Xcls_ToolButton27 : Object
912 public Gtk.ToolButton el;
913 private RepoStatusPopover _this;
919 public Xcls_ToolButton27(RepoStatusPopover _owner )
922 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
926 // set gobject values
927 this.el.label = "Merge branch/ ticket";
928 this.el.is_important = true;
931 this.el.button_press_event.connect( () => {
934 Clones.singleton().el.response(-1);
935 if (_this.repo.activeTicket != null) {
936 MergeBranch.singleton().show(_this.repo.activeTicket, null);
942 // user defined functions
945 public class Xcls_ToolButton28 : Object
947 public Gtk.ToolButton el;
948 private RepoStatusPopover _this;
954 public Xcls_ToolButton28(RepoStatusPopover _owner )
957 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-new", Gtk.IconSize.SMALL_TOOLBAR), null);;
961 // set gobject values
962 this.el.label = "Create Ticket";
963 this.el.is_important = true;
966 this.el.button_press_event.connect( () => {
970 Clones.singleton().el.response(-1);
973 Ticket.singleton().show( _this.repo);
979 // user defined functions