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_Notebook3( _this );
91 this.el.pack_start ( child_0.el , true,true,0 );
92 var child_1 = new Xcls_Box12( _this );
94 this.el.pack_end ( child_1.el , false,false,0 );
97 // user defined functions
99 public class Xcls_Notebook3 : Object
101 public Gtk.Notebook el;
102 private RepoStatusPopover _this;
108 public Xcls_Notebook3(RepoStatusPopover _owner )
111 this.el = new Gtk.Notebook();
115 // set gobject values
116 var child_0 = new Xcls_label_status( _this );
118 var child_1 = new Xcls_label_diff( _this );
120 var child_2 = new Xcls_Box6( _this );
122 this.el.append_page ( child_2.el , _this.label_status.el );
123 var child_3 = new Xcls_Box9( _this );
125 this.el.append_page ( child_3.el , _this.label_diff.el );
128 // user defined functions
130 public class Xcls_label_status : Object
133 private RepoStatusPopover _this;
139 public Xcls_label_status(RepoStatusPopover _owner )
142 _this.label_status = this;
143 this.el = new Gtk.Label( "Status" );
147 // set gobject values
150 // user defined functions
153 public class Xcls_label_diff : Object
156 private RepoStatusPopover _this;
162 public Xcls_label_diff(RepoStatusPopover _owner )
165 _this.label_diff = this;
166 this.el = new Gtk.Label( "Diff" );
170 // set gobject values
173 // user defined functions
176 public class Xcls_Box6 : Object
179 private RepoStatusPopover _this;
185 public Xcls_Box6(RepoStatusPopover _owner )
188 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
192 // set gobject values
193 this.el.homogeneous = false;
194 var child_0 = new Xcls_ScrolledWindow7( _this );
196 this.el.pack_start ( child_0.el , true,true,0 );
199 // user defined functions
201 public class Xcls_ScrolledWindow7 : Object
203 public Gtk.ScrolledWindow el;
204 private RepoStatusPopover _this;
210 public Xcls_ScrolledWindow7(RepoStatusPopover _owner )
213 this.el = new Gtk.ScrolledWindow( null, null );
217 // set gobject values
218 var child_0 = new Xcls_status_view( _this );
220 this.el.add ( child_0.el );
223 // user defined functions
225 public class Xcls_status_view : Object
227 public Gtk.SourceView el;
228 private RepoStatusPopover _this;
234 public Xcls_status_view(RepoStatusPopover _owner )
237 _this.status_view = this;
238 this.el = new Gtk.SourceView();
244 var description = Pango.FontDescription.from_string("monospace");
245 description.set_size(9000);
246 this.el.override_font(description);
249 // user defined functions
254 public class Xcls_Box9 : Object
257 private RepoStatusPopover _this;
263 public Xcls_Box9(RepoStatusPopover _owner )
266 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
270 // set gobject values
271 this.el.homogeneous = false;
272 var child_0 = new Xcls_ScrolledWindow10( _this );
274 this.el.pack_start ( child_0.el , true,true,0 );
277 // user defined functions
279 public class Xcls_ScrolledWindow10 : Object
281 public Gtk.ScrolledWindow el;
282 private RepoStatusPopover _this;
288 public Xcls_ScrolledWindow10(RepoStatusPopover _owner )
291 this.el = new Gtk.ScrolledWindow( null, null );
295 // set gobject values
296 this.el.height_request = 400;
297 var child_0 = new Xcls_diff_view( _this );
299 this.el.add ( child_0.el );
302 // user defined functions
304 public class Xcls_diff_view : Object
306 public Gtk.SourceView el;
307 private RepoStatusPopover _this;
313 public Xcls_diff_view(RepoStatusPopover _owner )
316 _this.diff_view = this;
317 this.el = new Gtk.SourceView();
323 var description = Pango.FontDescription.from_string("monospace");
324 description.set_size(9000);
325 this.el.override_font(description);
328 // user defined functions
334 public class Xcls_Box12 : Object
337 private RepoStatusPopover _this;
343 public Xcls_Box12(RepoStatusPopover _owner )
346 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
350 // set gobject values
351 this.el.homogeneous = true;
352 this.el.expand = false;
353 this.el.vexpand = false;
354 var child_0 = new Xcls_Toolbar13( _this );
356 this.el.add ( child_0.el );
359 // user defined functions
361 public class Xcls_Toolbar13 : Object
363 public Gtk.Toolbar el;
364 private RepoStatusPopover _this;
370 public Xcls_Toolbar13(RepoStatusPopover _owner )
373 this.el = new Gtk.Toolbar();
377 // set gobject values
378 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
379 var child_0 = new Xcls_ToolButton14( _this );
381 this.el.add ( child_0.el );
382 var child_1 = new Xcls_ToolButton15( _this );
384 this.el.add ( child_1.el );
385 var child_2 = new Xcls_ToolButton16( _this );
387 this.el.add ( child_2.el );
388 var child_3 = new Xcls_ToolButton17( _this );
390 this.el.add ( child_3.el );
391 var child_4 = new Xcls_ToolButton18( _this );
393 this.el.add ( child_4.el );
394 var child_5 = new Xcls_ToolButton19( _this );
396 this.el.add ( child_5.el );
397 var child_6 = new Xcls_ToolButton20( _this );
399 this.el.add ( child_6.el );
402 // user defined functions
404 public class Xcls_ToolButton14 : Object
406 public Gtk.ToolButton el;
407 private RepoStatusPopover _this;
413 public Xcls_ToolButton14(RepoStatusPopover _owner )
416 this.el = new Gtk.ToolButton( null, "Stash Changes" );
420 // set gobject values
423 this.el.button_press_event.connect( () => {
426 GitMonitor.gitmonitor.stop();
427 _this.repo.git({ "stash" , "--all" });
428 _this.repo.loadStatus();
429 GitMonitor.gitmonitor.start();
430 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
431 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
432 Clones.singleton().reposStore.load();
439 // user defined functions
442 public class Xcls_ToolButton15 : Object
444 public Gtk.ToolButton el;
445 private RepoStatusPopover _this;
451 public Xcls_ToolButton15(RepoStatusPopover _owner )
454 this.el = new Gtk.ToolButton( null, "Commit Changes" );
458 // set gobject values
461 this.el.button_press_event.connect( () => {
462 _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
464 _this.repo.loadStatus();
466 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
467 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
470 Clones.singleton().reposStore.load();
476 // user defined functions
479 public class Xcls_ToolButton16 : Object
481 public Gtk.ToolButton el;
482 private RepoStatusPopover _this;
488 public Xcls_ToolButton16(RepoStatusPopover _owner )
491 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
495 // set gobject values
496 this.el.label = "Create Branch / Start ticket";
499 this.el.button_press_event.connect( () => {
500 var oldq = new Gee.ArrayList<GitMonitorQueue>();
502 Clones.singleton().el.response(-1);
503 NewBranch.singleton().show(_this.repo, oldq);
509 // user defined functions
512 public class Xcls_ToolButton17 : Object
514 public Gtk.ToolButton el;
515 private RepoStatusPopover _this;
521 public Xcls_ToolButton17(RepoStatusPopover _owner )
524 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-revert-to-saved", Gtk.IconSize.SMALL_TOOLBAR), null);;
528 // set gobject values
529 this.el.label = "Reset / clear changes";
532 this.el.button_press_event.connect( () => {
535 GitMonitor.gitmonitor.stop();
536 _this.repo.git({ "reset" , "--hard" });
537 _this.repo.loadStatus();
538 GitMonitor.gitmonitor.start();
539 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
540 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
541 Clones.singleton().reposStore.load();
548 // user defined functions
551 public class Xcls_ToolButton18 : Object
553 public Gtk.ToolButton el;
554 private RepoStatusPopover _this;
560 public Xcls_ToolButton18(RepoStatusPopover _owner )
563 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-bottom", Gtk.IconSize.SMALL_TOOLBAR), null);;
567 // set gobject values
568 this.el.label = "Pull updates";
571 this.el.button_press_event.connect( () => {
574 GitMonitor.gitmonitor.stop();
575 _this.repo.git({ "pull" , "--all" });
576 _this.repo.loadStatus();
577 GitMonitor.gitmonitor.start();
578 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
579 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
580 Clones.singleton().reposStore.load();
587 // user defined functions
590 public class Xcls_ToolButton19 : Object
592 public Gtk.ToolButton el;
593 private RepoStatusPopover _this;
599 public Xcls_ToolButton19(RepoStatusPopover _owner )
602 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
606 // set gobject values
607 this.el.label = "Merge branch/ ticket";
610 this.el.button_press_event.connect( () => {
613 Clones.singleton().el.response(-1);
614 if (_this.repo.activeTicket != null) {
615 MergeBranch.singleton().show(_this.repo.activeTicket, null);
621 // user defined functions
624 public class Xcls_ToolButton20 : Object
626 public Gtk.ToolButton el;
627 private RepoStatusPopover _this;
633 public Xcls_ToolButton20(RepoStatusPopover _owner )
636 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-new", Gtk.IconSize.SMALL_TOOLBAR), null);;
640 // set gobject values
641 this.el.label = "Create Ticket";
644 this.el.button_press_event.connect( () => {
648 Clones.singleton().el.response(-1);
651 Ticket.singleton().show( _this.repo);
657 // user defined functions