6fcf5196cd2577b23022f9d5e88b69ff65c7efd5
[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        "bool vexpand" : false,
33        "items" : [
34         {
35          "listeners" : {
36           "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}"
37          },
38          "label" : "Stash Changes",
39          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-undo\", Gtk.IconSize.SMALL_TOOLBAR), null);",
40          "xtype" : "ToolButton",
41          "* pack" : "add",
42          "$ xns" : "Gtk",
43          "bool is_important" : true
44         },
45         {
46          "listeners" : {
47           "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}"
48          },
49          "label" : "Commit Changes",
50          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-save\", Gtk.IconSize.SMALL_TOOLBAR), null);",
51          "* pack" : "add",
52          "xtype" : "ToolButton",
53          "$ xns" : "Gtk",
54          "bool is_important" : true
55         },
56         {
57          "listeners" : {
58           "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}"
59          },
60          "label" : "Create Branch / Start ticket",
61          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-add\", Gtk.IconSize.SMALL_TOOLBAR), null);",
62          "xtype" : "ToolButton",
63          "* pack" : "add",
64          "$ xns" : "Gtk",
65          "bool is_important" : true
66         },
67         {
68          "listeners" : {
69           "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}"
70          },
71          "label" : "Reset / clear changes",
72          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-revert-to-saved\", Gtk.IconSize.SMALL_TOOLBAR), null);",
73          "* pack" : "add",
74          "xtype" : "ToolButton",
75          "$ xns" : "Gtk",
76          "bool is_important" : true
77         },
78         {
79          "listeners" : {
80           "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}"
81          },
82          "label" : "Pull updates",
83          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-goto-bottom\", Gtk.IconSize.SMALL_TOOLBAR), null);",
84          "xtype" : "ToolButton",
85          "* pack" : "add",
86          "$ xns" : "Gtk",
87          "bool is_important" : true
88         },
89         {
90          "listeners" : {
91           "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}"
92          },
93          "label" : "Merge branch/  ticket",
94          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-goto-top\", Gtk.IconSize.SMALL_TOOLBAR), null);",
95          "xtype" : "ToolButton",
96          "* pack" : "add",
97          "$ xns" : "Gtk",
98          "bool is_important" : true
99         },
100         {
101          "listeners" : {
102           "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}"
103          },
104          "label" : "Create Ticket",
105          "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-new\", Gtk.IconSize.SMALL_TOOLBAR), null);",
106          "* pack" : "add",
107          "xtype" : "ToolButton",
108          "$ xns" : "Gtk",
109          "bool is_important" : true
110         }
111        ]
112       },
113       {
114        "* pack" : "pack_start,true,true,0",
115        "xtype" : "Notebook",
116        "$ xns" : "Gtk",
117        "items" : [
118         {
119          "id" : "label_status",
120          "xtype" : "Label",
121          "* pack" : false,
122          "$ xns" : "Gtk",
123          "utf8 label" : "Status"
124         },
125         {
126          "id" : "label_diff",
127          "* pack" : false,
128          "xtype" : "Label",
129          "$ xns" : "Gtk",
130          "utf8 label" : "Diff"
131         },
132         {
133          "* pack" : "append_page,_this.label_status.el",
134          "xtype" : "Box",
135          "gboolean homogeneous" : false,
136          "$ xns" : "Gtk",
137          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
138          "items" : [
139           {
140            "* pack" : "pack_start,true,true,0",
141            "xtype" : "ScrolledWindow",
142            "$ xns" : "Gtk",
143            "items" : [
144             {
145              "id" : "status_view",
146              "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(9000);\n    this.el.override_font(description);",
147              "xtype" : "View",
148              "* pack" : "add",
149              "$ xns" : "GtkSource"
150             }
151            ]
152           }
153          ]
154         },
155         {
156          "* pack" : "append_page,_this.label_diff.el",
157          "xtype" : "Box",
158          "gboolean homogeneous" : false,
159          "$ xns" : "Gtk",
160          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
161          "items" : [
162           {
163            "int height_request" : 400,
164            "xtype" : "ScrolledWindow",
165            "* pack" : "pack_start,true,true,0",
166            "$ xns" : "Gtk",
167            "items" : [
168             {
169              "id" : "diff_view",
170              "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(9000);\n    this.el.override_font(description);",
171              "xtype" : "View",
172              "* pack" : "add",
173              "$ xns" : "GtkSource"
174             }
175            ]
176           }
177          ]
178         }
179        ]
180       },
181       {
182        "* pack" : "pack_end,false,false,0",
183        "xtype" : "Box",
184        "gboolean expand" : false,
185        "$ xns" : "Gtk",
186        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
187        "$ homogeneous" : true,
188        "gboolean vexpand" : false,
189        "items" : [
190         {
191          "Gtk.ToolbarStyle toolbar_style" : "Gtk.ToolbarStyle.BOTH_HORIZ",
192          "* pack" : "add",
193          "xtype" : "Toolbar",
194          "$ xns" : "Gtk",
195          "items" : [
196           {
197            "listeners" : {
198             "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}"
199            },
200            "label" : "Stash Changes",
201            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-undo\", Gtk.IconSize.SMALL_TOOLBAR), null);",
202            "xtype" : "ToolButton",
203            "* pack" : "add",
204            "$ xns" : "Gtk",
205            "bool is_important" : true
206           },
207           {
208            "listeners" : {
209             "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}"
210            },
211            "label" : "Commit Changes",
212            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-save\", Gtk.IconSize.SMALL_TOOLBAR), null);",
213            "* pack" : "add",
214            "xtype" : "ToolButton",
215            "$ xns" : "Gtk",
216            "bool is_important" : true
217           },
218           {
219            "listeners" : {
220             "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}"
221            },
222            "label" : "Create Branch / Start ticket",
223            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-add\", Gtk.IconSize.SMALL_TOOLBAR), null);",
224            "xtype" : "ToolButton",
225            "* pack" : "add",
226            "$ xns" : "Gtk",
227            "bool is_important" : true
228           },
229           {
230            "listeners" : {
231             "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}"
232            },
233            "label" : "Reset / clear changes",
234            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-revert-to-saved\", Gtk.IconSize.SMALL_TOOLBAR), null);",
235            "* pack" : "add",
236            "xtype" : "ToolButton",
237            "$ xns" : "Gtk",
238            "bool is_important" : true
239           },
240           {
241            "listeners" : {
242             "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}"
243            },
244            "label" : "Pull updates",
245            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-goto-bottom\", Gtk.IconSize.SMALL_TOOLBAR), null);",
246            "xtype" : "ToolButton",
247            "* pack" : "add",
248            "$ xns" : "Gtk",
249            "bool is_important" : true
250           },
251           {
252            "listeners" : {
253             "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}"
254            },
255            "label" : "Merge branch/  ticket",
256            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-goto-top\", Gtk.IconSize.SMALL_TOOLBAR), null);",
257            "xtype" : "ToolButton",
258            "* pack" : "add",
259            "$ xns" : "Gtk",
260            "bool is_important" : true
261           },
262           {
263            "listeners" : {
264             "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}"
265            },
266            "label" : "Create Ticket",
267            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-new\", Gtk.IconSize.SMALL_TOOLBAR), null);",
268            "* pack" : "add",
269            "xtype" : "ToolButton",
270            "$ xns" : "Gtk",
271            "bool is_important" : true
272           }
273          ]
274         }
275        ]
276       }
277      ]
278     }
279    ]
280   }
281  ]
282 }