2 valac --pkg gio-2.0 --pkg posix --pkg gtk+-3.0 --pkg libnotify --pkg gtksourceview-3.0 --pkg libwnck-3.0 \
3 /tmp/DialogSaveTemplate.vala -o /tmp/DialogSaveTemplate
8 static int main (string[] args) {
10 new Xcls_DialogSaveTemplate();
11 DialogSaveTemplate.show_all();
18 public static Xcls_DialogSaveTemplate DialogSaveTemplate;
20 public class Xcls_DialogSaveTemplate
23 private static Xcls_DialogSaveTemplate _this;
25 public Xcls_name name;
28 public JsRender.Node data;
29 public Palete.Palete palete;
32 public Xcls_DialogSaveTemplate()
34 this.el = new Gtk.Dialog();
36 DialogSaveTemplate = this;
41 this.el.default_height = 200;
42 this.el.default_width = 400;
44 var child_0 = new Xcls_HBox2();
45 this.el.add ( child_0.el );
46 var child_1 = new Xcls_Button5();
47 this.el.add_action_widget ( child_1.el , 0 );
48 var child_2 = new Xcls_Button6();
49 this.el.add_action_widget ( child_2.el , 1 );
52 this.el.delete_event.connect( (self, event) => {
56 this.el.response.connect( (self, response_id) => {
58 if (response_id < 1) {
62 var name = _this.name.el.get_text();
63 if (name.length < 1) {
64 StandardErrorDialog.show(
65 "You must give the template a name. "
69 if (!Regex.match_simple ("^[A-Za-z]+$", name) ||
70 !Regex.match_simple ("^[A-Za-z ]+$", name) )
72 StandardErrorDialog.show(
73 "Template Nane must contain only letters and spaces. "
77 _this.palete.saveTemplate(name, _this.data);
84 // userdefined functions
86 // skip listeners - not pipe
88 // skip .JsRender.Node:data - already used
90 // skip .Palete.Palete:palete - already used
92 // skip default_height - already used
94 // skip default_width - already used
96 // skip xtype - not pipe
98 // skip |modal - already used
99 public void show (Palete.Palete palete, JsRender.Node data) {
101 _this.palete = palete;
102 _this.name.el.set_text("");
106 // skip |xns - no return type
108 // skip items - not pipe
110 // skip id - not pipe
112 // skip xvala_cls - not pipe
114 // skip xvala_xcls - not pipe
116 // skip xvala_id - not pipe
117 public class Xcls_HBox2
126 this.el = new Gtk.HBox( true, 0 );
130 // set gobject values
131 var child_0 = new Xcls_Label3();
132 this.el.add ( child_0.el );
133 var child_1 = new Xcls_name();
134 this.el.add ( child_1.el );
137 // userdefined functions
139 // skip xtype - not pipe
141 // skip |pack - already used
143 // skip |xns - no return type
145 // skip items - not pipe
147 // skip xvala_cls - not pipe
149 // skip xvala_xcls - not pipe
151 // skip xvala_id - not pipe
153 public class Xcls_Label3
162 this.el = new Gtk.Label( "Name" );
166 // set gobject values
171 // userdefined functions
173 // skip label - already used
175 // skip pack - not pipe
177 // skip xtype - not pipe
179 // skip |xns - no return type
181 // skip listeners - not pipe
183 // skip xvala_cls - not pipe
185 // skip xvala_xcls - not pipe
187 // skip xvala_id - not pipe
189 public class Xcls_name
198 this.el = new Gtk.Entry();
203 // set gobject values
206 // userdefined functions
208 // skip id - not pipe
210 // skip pack - not pipe
212 // skip xtype - not pipe
214 // skip |xns - no return type
216 // skip xvala_cls - not pipe
218 // skip xvala_xcls - not pipe
220 // skip xvala_id - not pipe
222 public class Xcls_Button5
224 public Gtk.Button el;
229 public Xcls_Button5()
231 this.el = new Gtk.Button();
235 // set gobject values
236 this.el.label = "Cancel";
239 // userdefined functions
241 // skip label - already used
243 // skip pack - not pipe
245 // skip xtype - not pipe
247 // skip |xns - no return type
249 // skip xvala_cls - not pipe
251 // skip xvala_xcls - not pipe
253 // skip xvala_id - not pipe
255 public class Xcls_Button6
257 public Gtk.Button el;
262 public Xcls_Button6()
264 this.el = new Gtk.Button();
268 // set gobject values
269 this.el.label = "OK";
272 // userdefined functions
274 // skip label - already used
276 // skip pack - not pipe
278 // skip xtype - not pipe
280 // skip |xns - no return type
282 // skip xvala_cls - not pipe
284 // skip xvala_xcls - not pipe
286 // skip xvala_id - not pipe