3 Pango = imports.gi.Pango;
4 GLib = imports.gi.GLib;
6 GObject = imports.gi.GObject;
7 GtkSource = imports.gi.GtkSource;
8 WebKit = imports.gi.WebKit;
10 console = imports.console;
11 XObject = imports.XObject.XObject;
12 DialogSaveTemplate=new XObject({
15 delete_event : function (self, event) {
19 response : function (self, response_id) {
24 var name = this.get('name').el.get_text();
26 this.get('/StandardErrorDialog').show(
27 "You must give the template a name. "
31 if (!name.match(/^[A-Z ]$/i) || name.match(/^[A-Z]/i)) {
32 this.get('/StandardErrorDialog').show(
33 "Template Nane must contain only letters and spaces. "
37 this.get('/LeftTree').getPaletteProvider().saveTemplate(name, this.data);
46 show : function(data) {
48 this.get('name').el.set_text('');
54 pack : function(p,e) {
55 p.el.get_content_area().add(e.el)
76 pack : "add_action_widget,0"
81 pack : "add_action_widget,0"
85 DialogSaveTemplate.init();
86 XObject.cache['/DialogSaveTemplate'] = DialogSaveTemplate;