Fix #5560 - Gitlive - branching wip
[gitlive] / old_seed_version / Branches.bjs
1 {
2     "id": "file-gtk-1",
3     "name": "Branches",
4     "parent": "",
5     "title": false,
6     "path": "/home/alan/gitlive/gitlive/Branches.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "destroy_event": "function (self, event) {\n     this.el.hide();\n                return false;\n}",
11                 "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}"
12             },
13             " modal": true,
14             "border_width": 3,
15             "default_height": 300,
16             "default_width": 500,
17             "title": "Branches",
18             "xtype": "Dialog",
19             "|deletable": "true",
20             "|modal": "true",
21             "|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",
22             "|xns": "Gtk",
23             "items": [
24                 {
25                     "xtype": "VBox",
26                     "|pack": " function(p,e) {\n        p.el.get_content_area().pack_start(e.el,true,true,0)\n    }\n",
27                     "|xns": "Gtk",
28                     "items": [
29                         {
30                             "pack": "pack_start,false,true",
31                             "xtype": "HBox",
32                             "|xns": "Gtk",
33                             "items": [
34                                 {
35                                     "listeners": {
36                                         "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}"
37                                     },
38                                     "label": "Pull",
39                                     "pack": "add",
40                                     "xtype": "Button",
41                                     "|xns": "Gtk"
42                                 }
43                             ]
44                         },
45                         {
46                             "xtype": "ScrolledWindow",
47                             "|init": "function() {\n    XObject.prototype.init.call(this);\n      this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)\n}\n",
48                             "|xns": "Gtk",
49                             "items": [
50                                 {
51                                     "listeners": {
52                                         "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}"
53                                     },
54                                     "id": "branchView",
55                                     "pack": "add",
56                                     "xtype": "TreeView",
57                                     "|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",
58                                     "|xns": "Gtk",
59                                     "items": [
60                                         {
61                                             "id": "branchStore",
62                                             "pack": "set_model",
63                                             "xtype": "ListStore",
64                                             "|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",
65                                             "|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}",
66                                             "|xns": "Gtk"
67                                         },
68                                         {
69                                             "min_width": 70,
70                                             "pack": "append_column",
71                                             "resizable": true,
72                                             "title": "Local",
73                                             "xtype": "TreeViewColumn",
74                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 0 );\n\n}\n",
75                                             "|xns": "Gtk",
76                                             "items": [
77                                                 {
78                                                     "pack": "pack_start",
79                                                     "xtype": "CellRendererText",
80                                                     "|xns": "Gtk"
81                                                 }
82                                             ]
83                                         },
84                                         {
85                                             "min_width": 70,
86                                             "pack": "append_column",
87                                             "resizable": true,
88                                             "title": "Remote",
89                                             "xtype": "TreeViewColumn",
90                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 1 );\n\n}\n",
91                                             "|xns": "Gtk",
92                                             "items": [
93                                                 {
94                                                     "pack": "pack_start",
95                                                     "xtype": "CellRendererText",
96                                                     "|xns": "Gtk"
97                                                 }
98                                             ]
99                                         },
100                                         {
101                                             "min_width": 200,
102                                             "pack": "append_column",
103                                             "title": "Status",
104                                             "xtype": "TreeViewColumn",
105                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 2 );\n\n}\n",
106                                             "|xns": "Gtk",
107                                             "items": [
108                                                 {
109                                                     "pack": "pack_start",
110                                                     "xtype": "CellRendererText",
111                                                     "|xns": "Gtk"
112                                                 }
113                                             ]
114                                         }
115                                     ]
116                                 },
117                                 {
118                                     "|xns": "Gtk",
119                                     "xtype": "TreeView",
120                                     "pack": false,
121                                     "items": [
122                                         {
123                                             "|xns": "Gtk",
124                                             "xtype": "ListStore",
125                                             "pack": false
126                                         }
127                                     ]
128                                 }
129                             ]
130                         }
131                     ]
132                 },
133                 {
134                     "label": "Cancel",
135                     "pack": "add_action_widget,0",
136                     "xtype": "Button",
137                     "|xns": "Gtk",
138                     "listeners": {}
139                 },
140                 {
141                     "id": "ok_button",
142                     "label": "OK",
143                     "pack": "add_action_widget,1",
144                     "xtype": "Button",
145                     "|xns": "Gtk"
146                 }
147             ]
148         }
149     ],
150     "permname": "",
151     "modOrder": ""
152 }