ig3tool 0.4.0 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
2
  <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
3
- <!--Generated with glade3 3.4.3 on Fri Mar 28 20:08:23 2008 -->
3
+ <!--Generated with glade3 3.4.3 on Tue Apr 8 21:39:48 2008 -->
4
4
  <glade-interface>
5
5
  <widget class="GtkWindow" id="window">
6
6
  <property name="visible">True</property>
@@ -909,6 +909,18 @@
909
909
  <property name="position">3</property>
910
910
  </packing>
911
911
  </child>
912
+ <child>
913
+ <widget class="GtkLabel" id="label29">
914
+ <property name="visible">True</property>
915
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
916
+ <property name="xalign">1</property>
917
+ <property name="xpad">5</property>
918
+ <property name="label" translatable="yes">last:</property>
919
+ </widget>
920
+ <packing>
921
+ <property name="position">4</property>
922
+ </packing>
923
+ </child>
912
924
  </widget>
913
925
  </child>
914
926
  </widget>
@@ -970,6 +982,17 @@
970
982
  <property name="position">3</property>
971
983
  </packing>
972
984
  </child>
985
+ <child>
986
+ <widget class="GtkEntry" id="purchase_last">
987
+ <property name="visible">True</property>
988
+ <property name="sensitive">False</property>
989
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
990
+ <property name="editable">False</property>
991
+ </widget>
992
+ <packing>
993
+ <property name="position">4</property>
994
+ </packing>
995
+ </child>
973
996
  </widget>
974
997
  </child>
975
998
  </widget>
@@ -1005,6 +1028,22 @@
1005
1028
  <property name="xalign">1</property>
1006
1029
  <property name="xpad">5</property>
1007
1030
  </widget>
1031
+ <packing>
1032
+ <property name="position">1</property>
1033
+ </packing>
1034
+ </child>
1035
+ <child>
1036
+ <widget class="GtkAlignment" id="alignment9">
1037
+ <property name="visible">True</property>
1038
+ <child>
1039
+ <widget class="GtkLabel" id="label36">
1040
+ <property name="visible">True</property>
1041
+ </widget>
1042
+ </child>
1043
+ </widget>
1044
+ <packing>
1045
+ <property name="position">1</property>
1046
+ </packing>
1008
1047
  </child>
1009
1048
  <child>
1010
1049
  <widget class="GtkLabel" id="label32">
@@ -1015,7 +1054,7 @@
1015
1054
  <property name="label" translatable="yes">plebs:</property>
1016
1055
  </widget>
1017
1056
  <packing>
1018
- <property name="position">1</property>
1057
+ <property name="position">3</property>
1019
1058
  </packing>
1020
1059
  </child>
1021
1060
  <child>
@@ -1027,7 +1066,7 @@
1027
1066
  <property name="label" translatable="yes">debuggers:</property>
1028
1067
  </widget>
1029
1068
  <packing>
1030
- <property name="position">2</property>
1069
+ <property name="position">4</property>
1031
1070
  </packing>
1032
1071
  </child>
1033
1072
  <child>
@@ -1039,7 +1078,7 @@
1039
1078
  <property name="label" translatable="yes">members:</property>
1040
1079
  </widget>
1041
1080
  <packing>
1042
- <property name="position">3</property>
1081
+ <property name="position">5</property>
1043
1082
  </packing>
1044
1083
  </child>
1045
1084
  </widget>
@@ -1049,12 +1088,20 @@
1049
1088
  <property name="visible">True</property>
1050
1089
  <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
1051
1090
  <property name="homogeneous">True</property>
1091
+ <child>
1092
+ <widget class="GtkLabel" id="label38">
1093
+ <property name="visible">True</property>
1094
+ </widget>
1095
+ </child>
1052
1096
  <child>
1053
1097
  <widget class="GtkLabel" id="label13">
1054
1098
  <property name="visible">True</property>
1055
1099
  <property name="xalign">1</property>
1056
1100
  <property name="label" translatable="yes">current prices</property>
1057
1101
  </widget>
1102
+ <packing>
1103
+ <property name="position">1</property>
1104
+ </packing>
1058
1105
  </child>
1059
1106
  <child>
1060
1107
  <widget class="GtkEntry" id="purchase_plebs_orig">
@@ -1065,7 +1112,7 @@
1065
1112
  <property name="editable">False</property>
1066
1113
  </widget>
1067
1114
  <packing>
1068
- <property name="position">1</property>
1115
+ <property name="position">3</property>
1069
1116
  </packing>
1070
1117
  </child>
1071
1118
  <child>
@@ -1077,7 +1124,7 @@
1077
1124
  <property name="editable">False</property>
1078
1125
  </widget>
1079
1126
  <packing>
1080
- <property name="position">2</property>
1127
+ <property name="position">4</property>
1081
1128
  </packing>
1082
1129
  </child>
1083
1130
  <child>
@@ -1088,7 +1135,7 @@
1088
1135
  <property name="editable">False</property>
1089
1136
  </widget>
1090
1137
  <packing>
1091
- <property name="position">3</property>
1138
+ <property name="position">5</property>
1092
1139
  </packing>
1093
1140
  </child>
1094
1141
  </widget>
@@ -24,46 +24,86 @@
24
24
  <placeholder/>
25
25
  </child>
26
26
  <child>
27
- <placeholder/>
27
+ <widget class="GtkAlignment" id="alignment2">
28
+ <property name="visible">True</property>
29
+ <child>
30
+ <widget class="GtkLabel" id="saldo_label">
31
+ <property name="visible">True</property>
32
+ <property name="xalign">0</property>
33
+ </widget>
34
+ </child>
35
+ </widget>
36
+ <packing>
37
+ <property name="left_attach">2</property>
38
+ <property name="right_attach">3</property>
39
+ <property name="top_attach">1</property>
40
+ <property name="bottom_attach">2</property>
41
+ </packing>
28
42
  </child>
29
43
  <child>
30
- <placeholder/>
44
+ <widget class="GtkAlignment" id="alignment1">
45
+ <property name="visible">True</property>
46
+ <child>
47
+ <widget class="GtkLabel" id="saldo">
48
+ <property name="visible">True</property>
49
+ <property name="xalign">0</property>
50
+ <property name="use_markup">True</property>
51
+ </widget>
52
+ </child>
53
+ </widget>
54
+ <packing>
55
+ <property name="left_attach">3</property>
56
+ <property name="right_attach">4</property>
57
+ <property name="top_attach">1</property>
58
+ <property name="bottom_attach">2</property>
59
+ </packing>
31
60
  </child>
32
61
  <child>
33
- <widget class="GtkLabel" id="label6">
62
+ <widget class="GtkComboBox" id="debugger">
34
63
  <property name="visible">True</property>
35
- <property name="xalign">0</property>
36
- <property name="label" translatable="yes">Debugger:</property>
64
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
65
+ <property name="active">0</property>
66
+ <signal name="changed" handler="debugger_changed"/>
37
67
  </widget>
38
68
  <packing>
69
+ <property name="left_attach">1</property>
70
+ <property name="right_attach">2</property>
39
71
  <property name="top_attach">1</property>
40
72
  <property name="bottom_attach">2</property>
41
- <property name="x_options">GTK_FILL</property>
42
- <property name="y_options"></property>
43
73
  </packing>
44
74
  </child>
45
75
  <child>
46
- <widget class="GtkEntry" id="count">
76
+ <widget class="GtkEntry" id="smartzap">
47
77
  <property name="visible">True</property>
48
78
  <property name="can_focus">True</property>
49
- <property name="text" translatable="yes">1</property>
50
- <signal name="activate" handler="count_activate"/>
79
+ <signal name="activate" handler="smartzap_activate"/>
51
80
  </widget>
52
81
  <packing>
53
82
  <property name="left_attach">1</property>
54
83
  <property name="right_attach">2</property>
55
- <property name="top_attach">2</property>
56
- <property name="bottom_attach">3</property>
57
84
  <property name="y_options"></property>
58
85
  </packing>
59
86
  </child>
60
87
  <child>
61
- <widget class="GtkLabel" id="label5">
88
+ <widget class="GtkLabel" id="label1">
62
89
  <property name="visible">True</property>
63
90
  <property name="xalign">0</property>
64
- <property name="label" translatable="yes">Aantal:</property>
91
+ <property name="label" translatable="yes">Smartzap:</property>
92
+ </widget>
93
+ <packing>
94
+ <property name="x_options">GTK_FILL</property>
95
+ <property name="y_options"></property>
96
+ </packing>
97
+ </child>
98
+ <child>
99
+ <widget class="GtkLabel" id="label7">
100
+ <property name="visible">True</property>
101
+ <property name="xalign">0</property>
102
+ <property name="label" translatable="yes">Lid:</property>
65
103
  </widget>
66
104
  <packing>
105
+ <property name="left_attach">2</property>
106
+ <property name="right_attach">3</property>
67
107
  <property name="top_attach">2</property>
68
108
  <property name="bottom_attach">3</property>
69
109
  <property name="x_options">GTK_FILL</property>
@@ -93,14 +133,12 @@ debugger</property>
93
133
  </packing>
94
134
  </child>
95
135
  <child>
96
- <widget class="GtkLabel" id="label7">
136
+ <widget class="GtkLabel" id="label5">
97
137
  <property name="visible">True</property>
98
138
  <property name="xalign">0</property>
99
- <property name="label" translatable="yes">Lid:</property>
139
+ <property name="label" translatable="yes">Aantal:</property>
100
140
  </widget>
101
141
  <packing>
102
- <property name="left_attach">2</property>
103
- <property name="right_attach">3</property>
104
142
  <property name="top_attach">2</property>
105
143
  <property name="bottom_attach">3</property>
106
144
  <property name="x_options">GTK_FILL</property>
@@ -108,40 +146,31 @@ debugger</property>
108
146
  </packing>
109
147
  </child>
110
148
  <child>
111
- <widget class="GtkLabel" id="label1">
112
- <property name="visible">True</property>
113
- <property name="xalign">0</property>
114
- <property name="label" translatable="yes">Smartzap:</property>
115
- </widget>
116
- <packing>
117
- <property name="x_options">GTK_FILL</property>
118
- <property name="y_options"></property>
119
- </packing>
120
- </child>
121
- <child>
122
- <widget class="GtkEntry" id="smartzap">
149
+ <widget class="GtkEntry" id="count">
123
150
  <property name="visible">True</property>
124
151
  <property name="can_focus">True</property>
125
- <signal name="activate" handler="smartzap_activate"/>
152
+ <property name="text" translatable="yes">1</property>
153
+ <signal name="activate" handler="count_activate"/>
126
154
  </widget>
127
155
  <packing>
128
156
  <property name="left_attach">1</property>
129
157
  <property name="right_attach">2</property>
158
+ <property name="top_attach">2</property>
159
+ <property name="bottom_attach">3</property>
130
160
  <property name="y_options"></property>
131
161
  </packing>
132
162
  </child>
133
163
  <child>
134
- <widget class="GtkComboBox" id="debugger">
164
+ <widget class="GtkLabel" id="label6">
135
165
  <property name="visible">True</property>
136
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
137
- <property name="active">0</property>
138
- <signal name="changed" handler="debugger_changed"/>
166
+ <property name="xalign">0</property>
167
+ <property name="label" translatable="yes">Debugger:</property>
139
168
  </widget>
140
169
  <packing>
141
- <property name="left_attach">1</property>
142
- <property name="right_attach">2</property>
143
170
  <property name="top_attach">1</property>
144
171
  <property name="bottom_attach">2</property>
172
+ <property name="x_options">GTK_FILL</property>
173
+ <property name="y_options"></property>
145
174
  </packing>
146
175
  </child>
147
176
  </widget>
@@ -222,33 +251,27 @@ debugger</property>
222
251
  <property name="column_spacing">6</property>
223
252
  <property name="row_spacing">3</property>
224
253
  <child>
225
- <widget class="GtkEntry" id="change">
254
+ <widget class="GtkLabel" id="label9">
226
255
  <property name="visible">True</property>
227
- <property name="can_focus">True</property>
228
- <property name="editable">False</property>
229
- <property name="has_frame">False</property>
230
- <property name="width_chars">9</property>
256
+ <property name="xalign">0</property>
257
+ <property name="label" translatable="yes">€</property>
231
258
  </widget>
232
259
  <packing>
233
- <property name="left_attach">1</property>
234
- <property name="right_attach">2</property>
235
- <property name="top_attach">2</property>
236
- <property name="bottom_attach">3</property>
260
+ <property name="left_attach">2</property>
261
+ <property name="right_attach">3</property>
237
262
  <property name="x_options">GTK_FILL</property>
238
263
  <property name="y_options"></property>
239
264
  </packing>
240
265
  </child>
241
266
  <child>
242
- <widget class="GtkEntry" id="paid">
267
+ <widget class="GtkLabel" id="label10">
243
268
  <property name="visible">True</property>
244
- <property name="can_focus">True</property>
245
- <property name="has_frame">False</property>
246
- <property name="width_chars">9</property>
247
- <signal name="changed" handler="price_entries_changed"/>
269
+ <property name="xalign">0</property>
270
+ <property name="label" translatable="yes">€</property>
248
271
  </widget>
249
272
  <packing>
250
- <property name="left_attach">1</property>
251
- <property name="right_attach">2</property>
273
+ <property name="left_attach">2</property>
274
+ <property name="right_attach">3</property>
252
275
  <property name="top_attach">1</property>
253
276
  <property name="bottom_attach">2</property>
254
277
  <property name="x_options">GTK_FILL</property>
@@ -256,31 +279,27 @@ debugger</property>
256
279
  </packing>
257
280
  </child>
258
281
  <child>
259
- <widget class="GtkEntry" id="total">
282
+ <widget class="GtkLabel" id="label11">
260
283
  <property name="visible">True</property>
261
- <property name="can_focus">True</property>
262
- <property name="editable">False</property>
263
- <property name="has_frame">False</property>
264
- <property name="width_chars">9</property>
265
- <property name="text" translatable="yes">0.00</property>
266
- <signal name="changed" handler="price_entries_changed"/>
284
+ <property name="xalign">0</property>
285
+ <property name="label" translatable="yes">€</property>
267
286
  </widget>
268
287
  <packing>
269
- <property name="left_attach">1</property>
270
- <property name="right_attach">2</property>
288
+ <property name="left_attach">2</property>
289
+ <property name="right_attach">3</property>
290
+ <property name="top_attach">2</property>
291
+ <property name="bottom_attach">3</property>
271
292
  <property name="x_options">GTK_FILL</property>
272
293
  <property name="y_options"></property>
273
294
  </packing>
274
295
  </child>
275
296
  <child>
276
- <widget class="GtkLabel" id="label14">
297
+ <widget class="GtkLabel" id="label12">
277
298
  <property name="visible">True</property>
278
299
  <property name="xalign">0</property>
279
- <property name="label" translatable="yes">Terug:</property>
300
+ <property name="label" translatable="yes">Totaal:</property>
280
301
  </widget>
281
302
  <packing>
282
- <property name="top_attach">2</property>
283
- <property name="bottom_attach">3</property>
284
303
  <property name="x_options">GTK_FILL</property>
285
304
  <property name="y_options"></property>
286
305
  </packing>
@@ -299,40 +318,46 @@ debugger</property>
299
318
  </packing>
300
319
  </child>
301
320
  <child>
302
- <widget class="GtkLabel" id="label12">
321
+ <widget class="GtkLabel" id="label14">
303
322
  <property name="visible">True</property>
304
323
  <property name="xalign">0</property>
305
- <property name="label" translatable="yes">Totaal:</property>
324
+ <property name="label" translatable="yes">Terug:</property>
306
325
  </widget>
307
326
  <packing>
327
+ <property name="top_attach">2</property>
328
+ <property name="bottom_attach">3</property>
308
329
  <property name="x_options">GTK_FILL</property>
309
330
  <property name="y_options"></property>
310
331
  </packing>
311
332
  </child>
312
333
  <child>
313
- <widget class="GtkLabel" id="label11">
334
+ <widget class="GtkEntry" id="total">
314
335
  <property name="visible">True</property>
315
- <property name="xalign">0</property>
316
- <property name="label" translatable="yes">€</property>
336
+ <property name="can_focus">True</property>
337
+ <property name="editable">False</property>
338
+ <property name="has_frame">False</property>
339
+ <property name="width_chars">9</property>
340
+ <property name="text" translatable="yes">0.00</property>
341
+ <signal name="changed" handler="price_entries_changed"/>
317
342
  </widget>
318
343
  <packing>
319
- <property name="left_attach">2</property>
320
- <property name="right_attach">3</property>
321
- <property name="top_attach">2</property>
322
- <property name="bottom_attach">3</property>
344
+ <property name="left_attach">1</property>
345
+ <property name="right_attach">2</property>
323
346
  <property name="x_options">GTK_FILL</property>
324
347
  <property name="y_options"></property>
325
348
  </packing>
326
349
  </child>
327
350
  <child>
328
- <widget class="GtkLabel" id="label10">
351
+ <widget class="GtkEntry" id="paid">
329
352
  <property name="visible">True</property>
330
- <property name="xalign">0</property>
331
- <property name="label" translatable="yes">€</property>
353
+ <property name="can_focus">True</property>
354
+ <property name="has_frame">False</property>
355
+ <property name="width_chars">9</property>
356
+ <signal name="changed" handler="price_entries_changed"/>
332
357
  </widget>
333
358
  <packing>
334
- <property name="left_attach">2</property>
335
- <property name="right_attach">3</property>
359
+ <property name="left_attach">1</property>
360
+ <property name="right_attach">2</property>
336
361
  <property name="top_attach">1</property>
337
362
  <property name="bottom_attach">2</property>
338
363
  <property name="x_options">GTK_FILL</property>
@@ -340,14 +365,18 @@ debugger</property>
340
365
  </packing>
341
366
  </child>
342
367
  <child>
343
- <widget class="GtkLabel" id="label9">
368
+ <widget class="GtkEntry" id="change">
344
369
  <property name="visible">True</property>
345
- <property name="xalign">0</property>
346
- <property name="label" translatable="yes">€</property>
370
+ <property name="can_focus">True</property>
371
+ <property name="editable">False</property>
372
+ <property name="has_frame">False</property>
373
+ <property name="width_chars">9</property>
347
374
  </widget>
348
375
  <packing>
349
- <property name="left_attach">2</property>
350
- <property name="right_attach">3</property>
376
+ <property name="left_attach">1</property>
377
+ <property name="right_attach">2</property>
378
+ <property name="top_attach">2</property>
379
+ <property name="bottom_attach">3</property>
351
380
  <property name="x_options">GTK_FILL</property>
352
381
  <property name="y_options"></property>
353
382
  </packing>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/lib/lib/errors.rb CHANGED
@@ -30,6 +30,10 @@ module Ig3tool
30
30
  class WrongRequestType < IG3Error
31
31
  end
32
32
 
33
+ class InternalError < IG3Error
34
+ end
35
+
36
+
33
37
 
34
38
  # PRINTING
35
39
 
@@ -10,7 +10,7 @@ module Ig3tool
10
10
  [ "Fanta Orange", "5449000011527" ],
11
11
  [ "Fanta Lemon", "5449000006004" ],
12
12
  [ "Minute Maid", "90494024" ],
13
- [ "Minute Maid Tropical", "5449000018243" ],
13
+ [ "Minute Maid Tropical", "5449000100573" ],
14
14
  [ "Nestea", "5449000027382" ],
15
15
  [ "Coca Light Lemon", "5449000089229" ],
16
16
  ]
@@ -20,8 +20,8 @@ module Ig3tool
20
20
  [ "Coca Cola Light", "54492387" ],
21
21
  [ "Fanta Orange", "40822938" ],
22
22
  [ "Fanta Lemon", "54492493" ],
23
- [ "Sprite", "54491069" ],
24
- [ "Fanta Pomelo", "42115731" ],
23
+ [ "Aquarius Orange", "54490802" ],
24
+ [ "Water", "5449000111678" ],
25
25
  ]
26
26
 
27
27
  def initialize
@@ -31,7 +31,7 @@ module Ig3tool
31
31
 
32
32
  @entries = [ ]
33
33
 
34
- [[BLIKJES, @glade.get_widget("blikjes_table")],
34
+ [[BLIKJES, @glade.get_widget("blikjes_table")],
35
35
  [FLESJES, @glade.get_widget("flesjes_table")]].
36
36
  each do |list, table|
37
37
  table.resize(list.length, 2)
@@ -53,9 +53,9 @@ module Ig3tool
53
53
  @window.show_all
54
54
  end
55
55
 
56
- def number_eval_widget(widget)
56
+ def number_eval_widget(widget, fallback)
57
57
  # Controleer of het een nummer is
58
- super(entry)
58
+ super(widget, fallback)
59
59
  # Clear notification
60
60
  @notification.text = ""
61
61
  end
@@ -129,10 +129,11 @@ module Ig3tool
129
129
  #end
130
130
  end
131
131
 
132
- def get_fields
132
+ def get_fields(ignore_empty = true)
133
133
  fields = {}
134
134
  @books_fields.each do |k, f|
135
- fields[k] = f.text unless f.text.strip.empty?
135
+ temp = f.text.strip
136
+ fields[k] = temp unless temp.empty? and ignore_empty
136
137
  end
137
138
  fields["section"] = @books_section.active_iter[0].name unless @books_section.active_iter[0].nil?
138
139
  fields
@@ -148,7 +149,7 @@ module Ig3tool
148
149
 
149
150
  def books_save(widget)
150
151
  begin
151
- $client.bib_add!(get_fields)
152
+ $client.bib_add!(get_fields(false))
152
153
  _update_books_list
153
154
  #books_clear
154
155
  @books_notification.text = "changes saved to book!"
@@ -187,7 +188,7 @@ module Ig3tool
187
188
 
188
189
  def books_delete(widget)
189
190
  begin
190
- $client.bib_remove!(get_fields)
191
+ $client.bib_remove!(@books_isbn.text.strip)
191
192
  _update_books_list
192
193
  reset_books_fields
193
194
  @books_notification.text = "the ig3tool imps trashed the book..."
@@ -15,12 +15,42 @@ module Ig3tool
15
15
  @window.hide
16
16
  true
17
17
  end
18
+
19
+
20
+
21
+ @sounds = Hash.new
22
+ load_sounds
23
+
18
24
  end
19
25
 
20
26
  def show
21
27
  @window.show
22
28
  end
23
29
 
30
+ def load_sounds
31
+ sounddir = File.join(GLADE_DIR, "sound", "*.wav")
32
+ Dir.glob(sounddir).each do |wavfile|
33
+ key = File.basename(wavfile, ".wav")
34
+ @sounds[key] = File.basename(wavfile)
35
+ end
36
+ @sounds["cash"] = "cash2.wav"
37
+ @sounds["tetten"] = "shaglic1.wav"
38
+ end
39
+
40
+ def play(key)
41
+ filename = @sounds[key]
42
+ unless filename.nil?
43
+ filename = File.join(GLADE_DIR, "sound", filename)
44
+ Thread.new do
45
+ begin
46
+ `aplay #{filename}`
47
+ rescue Exception => e
48
+ warn "sound error: #{e.message}"
49
+ end
50
+ end
51
+ end
52
+ end
53
+
24
54
  def present
25
55
  @window.present
26
56
  end