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);
63 if (repo.activeTicket == null) {
64 _this.btn_merge.el.set_sensitive(false);
66 _this.btn_merge.el.set_sensitive(true);
71 GLib.debug("SHOWALL - POPIP\n");
73 //this.el.set_size_request(800,500);
74 // this.diff_view.el.grab_focus();
78 public class Xcls_Box2 : Object
81 private RepoStatusPopover _this;
87 public Xcls_Box2(RepoStatusPopover _owner )
90 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
95 this.el.homogeneous = false;
96 this.el.border_width = 5;
97 var child_0 = new Xcls_Box3( _this );
99 this.el.pack_start ( child_0.el , false,false,0 );
100 var child_1 = new Xcls_Notebook9( _this );
102 this.el.add ( child_1.el );
103 var child_2 = new Xcls_Box18( _this );
105 this.el.pack_end ( child_2.el , false,false,0 );
108 // user defined functions
110 public class Xcls_Box3 : Object
113 private RepoStatusPopover _this;
119 public Xcls_Box3(RepoStatusPopover _owner )
122 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
126 // set gobject values
127 this.el.homogeneous = true;
128 this.el.expand = false;
129 this.el.vexpand = false;
130 var child_0 = new Xcls_Toolbar4( _this );
132 this.el.add ( child_0.el );
135 // user defined functions
137 public class Xcls_Toolbar4 : Object
139 public Gtk.Toolbar el;
140 private RepoStatusPopover _this;
146 public Xcls_Toolbar4(RepoStatusPopover _owner )
149 this.el = new Gtk.Toolbar();
153 // set gobject values
154 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
155 var child_0 = new Xcls_ToolButton5( _this );
157 this.el.add ( child_0.el );
158 var child_1 = new Xcls_ToolButton6( _this );
160 this.el.add ( child_1.el );
161 var child_2 = new Xcls_ToolButton7( _this );
163 this.el.add ( child_2.el );
164 var child_3 = new Xcls_ToolButton8( _this );
166 this.el.add ( child_3.el );
169 // user defined functions
171 public class Xcls_ToolButton5 : Object
173 public Gtk.ToolButton el;
174 private RepoStatusPopover _this;
180 public Xcls_ToolButton5(RepoStatusPopover _owner )
183 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-undo", Gtk.IconSize.SMALL_TOOLBAR), null);;
187 // set gobject values
188 this.el.label = "Stash Changes";
189 this.el.is_important = true;
192 this.el.button_press_event.connect( () => {
195 GitMonitor.gitmonitor.stop();
196 _this.repo.git({ "stash" , "--all" });
197 _this.repo.loadStatus();
198 GitMonitor.gitmonitor.start();
199 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
200 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
201 Clones.singleton().reposStore.load();
208 // user defined functions
211 public class Xcls_ToolButton6 : Object
213 public Gtk.ToolButton el;
214 private RepoStatusPopover _this;
220 public Xcls_ToolButton6(RepoStatusPopover _owner )
223 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-save", Gtk.IconSize.SMALL_TOOLBAR), null);;
227 // set gobject values
228 this.el.label = "Commit Changes";
229 this.el.is_important = true;
232 this.el.button_press_event.connect( () => {
233 _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
235 _this.repo.loadStatus();
237 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
238 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
241 Clones.singleton().reposStore.load();
247 // user defined functions
250 public class Xcls_ToolButton7 : Object
252 public Gtk.ToolButton el;
253 private RepoStatusPopover _this;
259 public Xcls_ToolButton7(RepoStatusPopover _owner )
262 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-revert-to-saved", Gtk.IconSize.SMALL_TOOLBAR), null);;
266 // set gobject values
267 this.el.label = "Reset / clear changes";
268 this.el.is_important = true;
271 this.el.button_press_event.connect( () => {
274 GitMonitor.gitmonitor.stop();
275 _this.repo.git({ "reset" , "--hard" });
276 _this.repo.loadStatus();
277 GitMonitor.gitmonitor.start();
278 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
279 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
280 Clones.singleton().reposStore.load();
287 // user defined functions
290 public class Xcls_ToolButton8 : Object
292 public Gtk.ToolButton el;
293 private RepoStatusPopover _this;
299 public Xcls_ToolButton8(RepoStatusPopover _owner )
302 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-bottom", Gtk.IconSize.SMALL_TOOLBAR), null);;
306 // set gobject values
307 this.el.label = "Pull updates";
308 this.el.is_important = true;
311 this.el.button_press_event.connect( () => {
314 GitMonitor.gitmonitor.stop();
315 _this.repo.git({ "pull" , "--all" });
316 _this.repo.loadStatus();
317 GitMonitor.gitmonitor.start();
318 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
319 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
320 Clones.singleton().reposStore.load();
327 // user defined functions
332 public class Xcls_Notebook9 : Object
334 public Gtk.Notebook el;
335 private RepoStatusPopover _this;
341 public Xcls_Notebook9(RepoStatusPopover _owner )
344 this.el = new Gtk.Notebook();
348 // set gobject values
349 this.el.vexpand = true;
350 var child_0 = new Xcls_label_status( _this );
352 var child_1 = new Xcls_label_diff( _this );
354 var child_2 = new Xcls_Box12( _this );
356 this.el.append_page ( child_2.el , _this.label_status.el );
357 var child_3 = new Xcls_Box15( _this );
359 this.el.append_page ( child_3.el , _this.label_diff.el );
362 // user defined functions
364 public class Xcls_label_status : Object
367 private RepoStatusPopover _this;
373 public Xcls_label_status(RepoStatusPopover _owner )
376 _this.label_status = this;
377 this.el = new Gtk.Label( "Status" );
381 // set gobject values
384 // user defined functions
387 public class Xcls_label_diff : Object
390 private RepoStatusPopover _this;
396 public Xcls_label_diff(RepoStatusPopover _owner )
399 _this.label_diff = this;
400 this.el = new Gtk.Label( "Diff" );
404 // set gobject values
407 // user defined functions
410 public class Xcls_Box12 : Object
413 private RepoStatusPopover _this;
419 public Xcls_Box12(RepoStatusPopover _owner )
422 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
426 // set gobject values
427 this.el.homogeneous = false;
428 var child_0 = new Xcls_ScrolledWindow13( _this );
430 this.el.pack_start ( child_0.el , true,true,0 );
433 // user defined functions
435 public class Xcls_ScrolledWindow13 : Object
437 public Gtk.ScrolledWindow el;
438 private RepoStatusPopover _this;
444 public Xcls_ScrolledWindow13(RepoStatusPopover _owner )
447 this.el = new Gtk.ScrolledWindow( null, null );
451 // set gobject values
452 var child_0 = new Xcls_status_view( _this );
454 this.el.add ( child_0.el );
457 // user defined functions
459 public class Xcls_status_view : Object
461 public Gtk.SourceView el;
462 private RepoStatusPopover _this;
468 public Xcls_status_view(RepoStatusPopover _owner )
471 _this.status_view = this;
472 this.el = new Gtk.SourceView();
478 var description = Pango.FontDescription.from_string("monospace");
479 description.set_size(9000);
480 this.el.override_font(description);
483 // user defined functions
488 public class Xcls_Box15 : Object
491 private RepoStatusPopover _this;
497 public Xcls_Box15(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_ScrolledWindow16( _this );
508 this.el.pack_start ( child_0.el , true,true,0 );
511 // user defined functions
513 public class Xcls_ScrolledWindow16 : Object
515 public Gtk.ScrolledWindow el;
516 private RepoStatusPopover _this;
522 public Xcls_ScrolledWindow16(RepoStatusPopover _owner )
525 this.el = new Gtk.ScrolledWindow( null, null );
529 // set gobject values
530 this.el.height_request = 400;
531 var child_0 = new Xcls_diff_view( _this );
533 this.el.add ( child_0.el );
536 // user defined functions
538 public class Xcls_diff_view : Object
540 public Gtk.SourceView el;
541 private RepoStatusPopover _this;
547 public Xcls_diff_view(RepoStatusPopover _owner )
550 _this.diff_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
568 public class Xcls_Box18 : Object
571 private RepoStatusPopover _this;
577 public Xcls_Box18(RepoStatusPopover _owner )
580 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
584 // set gobject values
585 this.el.homogeneous = true;
586 this.el.expand = false;
587 this.el.vexpand = false;
588 var child_0 = new Xcls_Toolbar19( _this );
590 this.el.add ( child_0.el );
593 // user defined functions
595 public class Xcls_Toolbar19 : Object
597 public Gtk.Toolbar el;
598 private RepoStatusPopover _this;
604 public Xcls_Toolbar19(RepoStatusPopover _owner )
607 this.el = new Gtk.Toolbar();
611 // set gobject values
612 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
613 var child_0 = new Xcls_ToolButton20( _this );
615 this.el.add ( child_0.el );
616 var child_1 = new Xcls_btn_merge( _this );
618 this.el.add ( child_1.el );
619 var child_2 = new Xcls_ToolButton22( _this );
621 this.el.add ( child_2.el );
624 // user defined functions
626 public class Xcls_ToolButton20 : Object
628 public Gtk.ToolButton el;
629 private RepoStatusPopover _this;
635 public Xcls_ToolButton20(RepoStatusPopover _owner )
638 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-add", Gtk.IconSize.SMALL_TOOLBAR), null);;
642 // set gobject values
643 this.el.label = "Create Branch / Start ticket";
644 this.el.is_important = true;
647 this.el.button_press_event.connect( () => {
648 var oldq = new Gee.ArrayList<GitMonitorQueue>();
650 Clones.singleton().el.response(-1);
651 NewBranch.singleton().show(_this.repo, oldq);
657 // user defined functions
660 public class Xcls_btn_merge : Object
662 public Gtk.ToolButton el;
663 private RepoStatusPopover _this;
669 public Xcls_btn_merge(RepoStatusPopover _owner )
672 _this.btn_merge = this;
673 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
677 // set gobject values
678 this.el.label = "Merge branch / Complete ticket";
679 this.el.is_important = true;
682 this.el.clicked.connect( () => {
685 Clones.singleton().el.response(-1);
686 if (_this.repo.activeTicket != null) {
687 MergeBranch.singleton().show(_this.repo.activeTicket, null);
693 // user defined functions
696 public class Xcls_ToolButton22 : Object
698 public Gtk.ToolButton el;
699 private RepoStatusPopover _this;
705 public Xcls_ToolButton22(RepoStatusPopover _owner )
708 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-new", Gtk.IconSize.SMALL_TOOLBAR), null);;
712 // set gobject values
713 this.el.label = "Create Ticket";
714 this.el.is_important = true;
717 this.el.button_press_event.connect( () => {
721 Clones.singleton().el.response(-1);
724 Ticket.singleton().show( _this.repo);
730 // user defined functions