RepoStatusPopover.bjs
[gitlive] / RepoStatusPopover.bjs
1 {
2  "name" : "RepoStatusPopover",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/gitlive/RepoStatusPopover.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "build_module" : "gitlive",
9  "items" : [
10   {
11    "GitRepo repo" : "",
12    "| void show" : " (Gtk.Widget btn, Gdk.Rectangle rect, GitRepo repo) {\n    _this.repo = repo;\n    // get the active project.\n     var lm = Gtk.SourceLanguageManager.get_default();\n                \n//    ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(\n  //      lm.get_language(\"html\")\n //   );\n  \n    //print (project.fn);\n    //project.runhtml = project.runhtml || '';\n    _this.diff_view.el.get_buffer().set_text(repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(repo.git_status);\n       \n    \t//console.log('show all');\n\tthis.el.set_modal(true);\n\tthis.el.set_relative_to(btn);\n    this.el.set_pointing_to(rect);\n  \n\t//this.el.set_position(Gtk.PositionType.RIGHT);\n\n\t// window + header?\n\t GLib.debug(\"SHOWALL - POPIP\\n\");\n\tthis.el.show_all();\n\t//this.el.set_size_request(800,500);\n//\tthis.diff_view.el.grab_focus();\n\t\n    //this.el.show_all();\n}\n",
13    "xtype" : "Popover",
14    "Gtk.PositionType position" : "Gtk.PositionType.RIGHT",
15    "$ xns" : "Gtk",
16    "bool modal" : true,
17    "uint border_width" : 0,
18    "items" : [
19     {
20      "xtype" : "Box",
21      "* pack" : "add",
22      "$ xns" : "Gtk",
23      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
24      "border_width" : 5,
25      "$ homogeneous" : false,
26      "items" : [
27       {
28        "Gtk.ToolbarStyle toolbar_style" : "Gtk.ToolbarStyle.BOTH_HORIZ",
29        "xtype" : "Toolbar",
30        "* pack" : "add",
31        "$ xns" : "Gtk",
32        "items" : [
33         {
34          "listeners" : {
35           "button_press_event" : "() => {\n  \n   \n   GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"stash\" , \"--all\" });\n   _this.repo.loadStatus();\n   GitMonitor.gitmonitor.start();\n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    Clones.singleton().reposStore.load();\n  \n   _this.el.hide();\n    return false;\n}"
36          },
37          "label" : "Stash Changes",
38          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-undo\", Gtk.IconSize.SMALL_TOOLBAR), null);",
39          "xtype" : "ToolButton",
40          "* pack" : "add",
41          "$ xns" : "Gtk",
42          "bool is_important" : true
43         },
44         {
45          "listeners" : {
46           "button_press_event" : "() => {\n   _this.repo.git({ \"commit\" , \"-a\" ,\"-m\", \"Uncommited changes synced\" });\n   _this.repo.push();\n   _this.repo.loadStatus();\n   \n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    \n   _this.el.hide();\n   Clones.singleton().reposStore.load();\n   \n    return false;\n}"
47          },
48          "label" : "Commit Changes",
49          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-save\", Gtk.IconSize.SMALL_TOOLBAR), null);",
50          "* pack" : "add",
51          "xtype" : "ToolButton",
52          "$ xns" : "Gtk",
53          "bool is_important" : true
54         },
55         {
56          "listeners" : {
57           "button_press_event" : "() => {\n   var oldq = new Gee.ArrayList<GitMonitorQueue>();  \n\n\tClones.singleton().el.response(-1);\n\tNewBranch.singleton().show(_this.repo, oldq);\n\n    return false;\n}"
58          },
59          "label" : "Create Branch / Start ticket",
60          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-add\", Gtk.IconSize.SMALL_TOOLBAR), null);",
61          "xtype" : "ToolButton",
62          "* pack" : "add",
63          "$ xns" : "Gtk",
64          "bool is_important" : true
65         },
66         {
67          "listeners" : {
68           "button_press_event" : "() => {\n  \n   \n   GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"reset\" , \"--hard\" });\n   _this.repo.loadStatus();\n   GitMonitor.gitmonitor.start();\n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    Clones.singleton().reposStore.load();\n  \n   _this.el.hide();\n    return false;\n}"
69          },
70          "label" : "Reset / clear changes",
71          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-revert-to-saved\", Gtk.IconSize.SMALL_TOOLBAR), null);",
72          "* pack" : "add",
73          "xtype" : "ToolButton",
74          "$ xns" : "Gtk",
75          "bool is_important" : true
76         },
77         {
78          "listeners" : {
79           "button_press_event" : "() => {\n  \n   \n   GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"pull\" , \"--all\" });\n   _this.repo.loadStatus();\n   GitMonitor.gitmonitor.start();\n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    Clones.singleton().reposStore.load();\n  \n   _this.el.hide();\n    return false;\n}"
80          },
81          "label" : "Pull updates",
82          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-goto-bottom\", Gtk.IconSize.SMALL_TOOLBAR), null);",
83          "xtype" : "ToolButton",
84          "* pack" : "add",
85          "$ xns" : "Gtk",
86          "bool is_important" : true
87         },
88         {
89          "listeners" : {
90           "button_press_event" : "() => {\n\n   _this.el.hide();\n   Clones.singleton().el.response(-1);\n   if (_this.repo.activeTicket != null) {\n\t   MergeBranch.singleton().show(_this.repo.activeTicket, null);   \n   }\n    return false;\n}"
91          },
92          "label" : "Merge branch/  ticket",
93          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-goto-top\", Gtk.IconSize.SMALL_TOOLBAR), null);",
94          "xtype" : "ToolButton",
95          "* pack" : "add",
96          "$ xns" : "Gtk",
97          "bool is_important" : true
98         },
99         {
100          "listeners" : {
101           "button_press_event" : "() => {\n  \n\n\n      Clones.singleton().el.response(-1);\n  \n   _this.el.hide();\n   Ticket.singleton().show( _this.repo);\n   \n    return false;\n}"
102          },
103          "label" : "Create Ticket",
104          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-new\", Gtk.IconSize.SMALL_TOOLBAR), null);",
105          "* pack" : "add",
106          "xtype" : "ToolButton",
107          "$ xns" : "Gtk",
108          "bool is_important" : true
109         }
110        ]
111       },
112       {
113        "* pack" : "pack_start,true,true,0",
114        "xtype" : "Notebook",
115        "$ xns" : "Gtk",
116        "items" : [
117         {
118          "id" : "label_status",
119          "xtype" : "Label",
120          "* pack" : false,
121          "$ xns" : "Gtk",
122          "utf8 label" : "Status"
123         },
124         {
125          "id" : "label_diff",
126          "* pack" : false,
127          "xtype" : "Label",
128          "$ xns" : "Gtk",
129          "utf8 label" : "Diff"
130         },
131         {
132          "* pack" : "append_page,_this.label_status.el",
133          "xtype" : "Box",
134          "gboolean homogeneous" : false,
135          "$ xns" : "Gtk",
136          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
137          "items" : [
138           {
139            "* pack" : "pack_start,true,true,0",
140            "xtype" : "ScrolledWindow",
141            "$ xns" : "Gtk",
142            "items" : [
143             {
144              "id" : "status_view",
145              "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(9000);\n    this.el.override_font(description);",
146              "xtype" : "View",
147              "* pack" : "add",
148              "$ xns" : "GtkSource"
149             }
150            ]
151           }
152          ]
153         },
154         {
155          "* pack" : "append_page,_this.label_diff.el",
156          "xtype" : "Box",
157          "gboolean homogeneous" : false,
158          "$ xns" : "Gtk",
159          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
160          "items" : [
161           {
162            "int height_request" : 400,
163            "xtype" : "ScrolledWindow",
164            "* pack" : "pack_start,true,true,0",
165            "$ xns" : "Gtk",
166            "items" : [
167             {
168              "id" : "diff_view",
169              "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(9000);\n    this.el.override_font(description);",
170              "xtype" : "View",
171              "* pack" : "add",
172              "$ xns" : "GtkSource"
173             }
174            ]
175           }
176          ]
177         }
178        ]
179       },
180       {
181        "* pack" : "pack_end,false,false,0",
182        "xtype" : "Box",
183        "gboolean expand" : false,
184        "$ xns" : "Gtk",
185        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
186        "$ homogeneous" : true,
187        "gboolean vexpand" : false,
188        "items" : [
189         {
190          "Gtk.ToolbarStyle toolbar_style" : "Gtk.ToolbarStyle.BOTH_HORIZ",
191          "* pack" : "add",
192          "xtype" : "Toolbar",
193          "$ xns" : "Gtk",
194          "items" : [
195           {
196            "listeners" : {
197             "button_press_event" : "() => {\n  \n   \n   GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"stash\" , \"--all\" });\n   _this.repo.loadStatus();\n   GitMonitor.gitmonitor.start();\n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    Clones.singleton().reposStore.load();\n  \n   _this.el.hide();\n    return false;\n}"
198            },
199            "label" : "Stash Changes",
200            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-undo\", Gtk.IconSize.SMALL_TOOLBAR), null);",
201            "xtype" : "ToolButton",
202            "* pack" : "add",
203            "$ xns" : "Gtk",
204            "bool is_important" : true
205           },
206           {
207            "listeners" : {
208             "button_press_event" : "() => {\n   _this.repo.git({ \"commit\" , \"-a\" ,\"-m\", \"Uncommited changes synced\" });\n   _this.repo.push();\n   _this.repo.loadStatus();\n   \n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    \n   _this.el.hide();\n   Clones.singleton().reposStore.load();\n   \n    return false;\n}"
209            },
210            "label" : "Commit Changes",
211            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-save\", Gtk.IconSize.SMALL_TOOLBAR), null);",
212            "* pack" : "add",
213            "xtype" : "ToolButton",
214            "$ xns" : "Gtk",
215            "bool is_important" : true
216           },
217           {
218            "listeners" : {
219             "button_press_event" : "() => {\n   var oldq = new Gee.ArrayList<GitMonitorQueue>();  \n\n\tClones.singleton().el.response(-1);\n\tNewBranch.singleton().show(_this.repo, oldq);\n\n    return false;\n}"
220            },
221            "label" : "Create Branch / Start ticket",
222            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-add\", Gtk.IconSize.SMALL_TOOLBAR), null);",
223            "xtype" : "ToolButton",
224            "* pack" : "add",
225            "$ xns" : "Gtk",
226            "bool is_important" : true
227           },
228           {
229            "listeners" : {
230             "button_press_event" : "() => {\n  \n   \n   GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"reset\" , \"--hard\" });\n   _this.repo.loadStatus();\n   GitMonitor.gitmonitor.start();\n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    Clones.singleton().reposStore.load();\n  \n   _this.el.hide();\n    return false;\n}"
231            },
232            "label" : "Reset / clear changes",
233            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-revert-to-saved\", Gtk.IconSize.SMALL_TOOLBAR), null);",
234            "* pack" : "add",
235            "xtype" : "ToolButton",
236            "$ xns" : "Gtk",
237            "bool is_important" : true
238           },
239           {
240            "listeners" : {
241             "button_press_event" : "() => {\n  \n   \n   GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"pull\" , \"--all\" });\n   _this.repo.loadStatus();\n   GitMonitor.gitmonitor.start();\n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    Clones.singleton().reposStore.load();\n  \n   _this.el.hide();\n    return false;\n}"
242            },
243            "label" : "Pull updates",
244            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-goto-bottom\", Gtk.IconSize.SMALL_TOOLBAR), null);",
245            "xtype" : "ToolButton",
246            "* pack" : "add",
247            "$ xns" : "Gtk",
248            "bool is_important" : true
249           },
250           {
251            "listeners" : {
252             "button_press_event" : "() => {\n\n   _this.el.hide();\n   Clones.singleton().el.response(-1);\n   if (_this.repo.activeTicket != null) {\n\t   MergeBranch.singleton().show(_this.repo.activeTicket, null);   \n   }\n    return false;\n}"
253            },
254            "label" : "Merge branch/  ticket",
255            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-goto-top\", Gtk.IconSize.SMALL_TOOLBAR), null);",
256            "xtype" : "ToolButton",
257            "* pack" : "add",
258            "$ xns" : "Gtk",
259            "bool is_important" : true
260           },
261           {
262            "listeners" : {
263             "button_press_event" : "() => {\n  \n\n\n      Clones.singleton().el.response(-1);\n  \n   _this.el.hide();\n   Ticket.singleton().show( _this.repo);\n   \n    return false;\n}"
264            },
265            "label" : "Create Ticket",
266            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-new\", Gtk.IconSize.SMALL_TOOLBAR), null);",
267            "* pack" : "add",
268            "xtype" : "ToolButton",
269            "$ xns" : "Gtk",
270            "bool is_important" : true
271           }
272          ]
273         }
274        ]
275       }
276      ]
277     }
278    ]
279   }
280  ]
281 }