-
Notifications
You must be signed in to change notification settings - Fork 0
/
Branches.bjs
152 lines (152 loc) · 10.3 KB
/
Branches.bjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
{
"id": "file-gtk-1",
"name": "Branches",
"parent": "",
"title": false,
"path": "/home/alan/gitlive/gitlive/Branches.bjs",
"items": [
{
"listeners": {
"destroy_event": "function (self, event) {\n this.el.hide();\n return false;\n}",
"response": "function (self, id) {\n // hide\n //if (id < 1) {\n this.el.hide();\n return;\n //}\n if (typeof(this.get('bug').getValue()) != 'object') {\n print(\"ERROR\");\n return;\n }\n \n this.el.hide();\n \n //var val = this.get('bug').getValue();\n // Seed.print(val);\n}"
},
" modal": true,
"border_width": 3,
"default_height": 300,
"default_width": 500,
"title": "Branches",
"xtype": "Dialog",
"|deletable": "true",
"|modal": "true",
"|show": "function(c) {\n \n if (!this.el) {\n this.init();\n }\n var _this = this;\n this.get('/branchStore').load();\n this.el.show_all();\n \n var run_ret = this.el.run();\n if (run_ret < 1 ) {\n return \"DONE\";\n }\n print(\"RUN RETURN : \" + run_ret);\n return \"DONE\";\n \n}\n",
"|xns": "Gtk",
"items": [
{
"xtype": "VBox",
"|pack": " function(p,e) {\n p.el.get_content_area().pack_start(e.el,true,true,0)\n }\n",
"|xns": "Gtk",
"items": [
{
"pack": "pack_start,false,true",
"xtype": "HBox",
"|xns": "Gtk",
"items": [
{
"listeners": {
"clicked": "function (self) {\n\n return;\n var RemoteEdit= imports.RemoteEdit.RemoteEdit\n RemoteEdit.repo = Remotes.repo;\n RemoteEdit.el.set_transient_for(Remotes.el);\n\n var res = RemoteEdit.show();\n \n if (res != false) {\n Remotes.repo.remotes(res);\n }\n \n this.get('/remotesStore').load();\n\n \n}"
},
"label": "Pull",
"pack": "add",
"xtype": "Button",
"|xns": "Gtk"
}
]
},
{
"xtype": "ScrolledWindow",
"|init": "function() {\n XObject.prototype.init.call(this);\n this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)\n}\n",
"|xns": "Gtk",
"items": [
{
"listeners": {
"cursor_changed": "function (self)\n{\n\n return;\n // SEE SELECTION.CHANGED\n if (this.el.get_selection().count_selected_rows() < 1) {\n //nothing? - clea it?\n return;\n }\n var ret = {}; \n var model = this.get('/changedFilesStore');\n\n var s = this.el.get_selection();\n var files = [];\n s.selected_foreach(function(model,p,iter) {\n \n files.push( model.get_value(iter, 0).value.get_string());\n \n });\n this.get('/patchview').showDiff(files); \n //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();\n //print(\"OUT?\" + value);// id..\n // load the list in the right grid..\n \n return true;\n\n}"
},
"id": "branchView",
"pack": "add",
"xtype": "TreeView",
"|init": "function() {\n XObject.prototype.init.call(this);\n var description = new Pango.FontDescription.c_new();\n description.set_size(8000);\n this.el.modify_font(description);\n\n this.selection = this.el.get_selection();\n this.selection.set_mode( Gtk.SelectionMode.MULTIPLE);\n var _this = this;\n this.selection.signal['changed'].connect(function() {\n _this.listeners.cursor_changed.apply(\n _this, [ _this, '']\n );\n });\n }\n",
"|xns": "Gtk",
"items": [
{
"id": "branchStore",
"pack": "set_model",
"xtype": "ListStore",
"|init": "function() {\n XObject.prototype.init.call(this);\n this.el.set_column_types ( 3, [\n GObject.TYPE_STRING, // file \n GObject.TYPE_STRING, // added\n GObject.TYPE_STRING, // removed\n ] );\n}\n",
"|load": "function(tr)\n{\n //this.insert(citer,iter,0);\n this.el.clear();\n \n var tr = Branches.repo.getBranches();\n \n \n for(var i =0 ; i < tr.length; i++) {\n var ret = { };\n \n this.el.append(ret);\n \n //print(JSON.stringify(ret,null,4));\n var lastrev = tr[i].lastrev;\n var remoterev = tr[i].remoterev;\n \n var lastrev = lastrev.length ? lastrev : remoterev;\n \n if (lastrev != remoterev) {\n lastrev = \"Out of sync: remote=\" + remoterev + \", local=\" + lastrev;\n }\n \n \n \n this.el.set_value(ret.iter, 0, '' + tr[i].name );\n this.el.set_value(ret.iter, 1, '' + tr[i].remote );\n this.el.set_value(ret.iter, 2, '' + lastrev );\n \n \n } \n}",
"|xns": "Gtk"
},
{
"min_width": 70,
"pack": "append_column",
"resizable": true,
"title": "Local",
"xtype": "TreeViewColumn",
"|init": "function() {\n XObject.prototype.init.call(this);\n this.el.add_attribute(this.items[0].el , 'markup', 0 );\n\n}\n",
"|xns": "Gtk",
"items": [
{
"pack": "pack_start",
"xtype": "CellRendererText",
"|xns": "Gtk"
}
]
},
{
"min_width": 70,
"pack": "append_column",
"resizable": true,
"title": "Remote",
"xtype": "TreeViewColumn",
"|init": "function() {\n XObject.prototype.init.call(this);\n this.el.add_attribute(this.items[0].el , 'markup', 1 );\n\n}\n",
"|xns": "Gtk",
"items": [
{
"pack": "pack_start",
"xtype": "CellRendererText",
"|xns": "Gtk"
}
]
},
{
"min_width": 200,
"pack": "append_column",
"title": "Status",
"xtype": "TreeViewColumn",
"|init": "function() {\n XObject.prototype.init.call(this);\n this.el.add_attribute(this.items[0].el , 'markup', 2 );\n\n}\n",
"|xns": "Gtk",
"items": [
{
"pack": "pack_start",
"xtype": "CellRendererText",
"|xns": "Gtk"
}
]
}
]
},
{
"|xns": "Gtk",
"xtype": "TreeView",
"pack": false,
"items": [
{
"|xns": "Gtk",
"xtype": "ListStore",
"pack": false
}
]
}
]
}
]
},
{
"label": "Cancel",
"pack": "add_action_widget,0",
"xtype": "Button",
"|xns": "Gtk",
"listeners": {}
},
{
"id": "ok_button",
"label": "OK",
"pack": "add_action_widget,1",
"xtype": "Button",
"|xns": "Gtk"
}
]
}
],
"permname": "",
"modOrder": ""
}