Sample/RooProjectProperties.js
[app.Builder.js] / Sample / RooProjectProperties.js
1 Gtk = imports.gi.Gtk;
2 Gdk = imports.gi.Gdk;
3 Pango = imports.gi.Pango;
4 GLib = imports.gi.GLib;
5 Gio = imports.gi.Gio;
6 GObject = imports.gi.GObject;
7 GtkSource = imports.gi.GtkSource;
8 WebKit = imports.gi.WebKit;
9 Vte = imports.gi.Vte;
10 console = imports.console;
11 XObject = imports.XObject.XObject;
12 RooProjectProperties=new XObject({
13     xtype: Gtk.Dialog,
14     modal : true,
15     show : function() {
16         // get the active project.
17         
18         var project = this.get('/Window.LeftTree').getActiveFile().project;
19         print (project.fn);
20     
21         this.el.show_all();
22     },
23     default_width : 500,
24     listeners : {
25         "delete_event":function (self, event) {
26             this.el.hide()
27             return true;
28         },
29         "response":function (self, response_id) {
30            print(response_id);
31            if (!response_id) {
32               this.el.hide();
33               return;
34            }
35            // ok pressed..
36            this.el.hide();
37         }
38     },
39     items : [
40         {
41             xtype: Gtk.VBox,
42             pack : function(p,e) {
43                         p.el.get_content_area().add(e.el);
44                         e.border_width  =5;
45                     },
46             items : [
47                 {
48                     xtype: Gtk.Table,
49                     pack : "pack_start,true,true,3",
50                     init : function() {
51                         this.el = new Gtk.Table.c_new(1,2, true);
52                         XObject.prototype.init.call(this);
53                     
54                     },
55                     items : [
56                         {
57                             xtype: Gtk.Label,
58                             pack : "attach,0,1,0,1,0,0,0,0",
59                             label : "baseURL "
60                         },
61                         {
62                             xtype: Gtk.Entry,
63                             pack : "attach,1,2,0,1,5"
64                         },
65                         {
66                             xtype: Gtk.Label,
67                             pack : "attach,0,1,1,2,0,0,1,0",
68                             label : "login:"
69                         },
70                         {
71                             xtype: Gtk.Entry,
72                             pack : "attach,1,2,1,2,5"
73                         },
74                         {
75                             xtype: Gtk.Label,
76                             pack : "attach,0,1,2,3,0,0,1,0",
77                             label : "password"
78                         },
79                         {
80                             xtype: Gtk.Entry,
81                             pack : "attach,1,2,2,3,5",
82                             visibility : false
83                         }
84                     ]
85                 }
86             ]
87         },
88         {
89             xtype: Gtk.Button,
90             pack : "add_action_widget,1",
91             label : "OK"
92         },
93         {
94             xtype: Gtk.Button,
95             pack : "add_action_widget,0",
96             label : "Cancel"
97         }
98     ]
99 });
100 RooProjectProperties.init();
101 XObject.cache['/RooProjectProperties'] = RooProjectProperties;