Builder/StandardErrorDialog.js
[app.Builder.js] / Builder / StandardErrorDialog.js
1 //<Script type="text/javascript">
2
3 Gtk = imports.gi.Gtk;
4 GObject = imports.gi.GObject;
5 Gio = imports.gi.Gio;
6 GLib = imports.gi.GLib;
7
8 XObject = imports.XObject.XObject;
9 console = imports.console;
10
11
12
13 /**
14  * add a component
15  * 
16  * basically uses a standard template ? pulled from the web?
17  * 
18  * you have to pick which template, and give it a name..
19  * 
20  * and pick which directory to put it in?
21  * 
22  */
23
24
25 StandardErrorDialog = new XObject({
26     
27     
28     
29     xtype : Gtk.MessageDialog,
30     modal : true,
31     buttons : Gtk.ButtonsType.OK,
32     'message-type' : Gtk.MessageType.ERROR,
33     //"secondary-text"           gchar*                : Read / Write
34     //"secondary-use-markup"     gboolean              : Read / Write
35     text   : "FIXME",
36     "use-markup"     : true,
37     
38     show : function(msg)
39     {
40         if (!this.el) {
41             this.init();
42         }
43         this.el.text =  msg;
44         this.el.show_all();
45     },
46     
47     listeners :  {
48         'delete-event' : function (widget, event) {
49             this.el.hide();
50             return true;
51         },
52         
53         response : function () {
54             this.el.hide();
55         }
56     }
57 });