irecorder 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,264 @@
1
+ #****************************************************************************
2
+ #** Ruby Resource object code
3
+ #**
4
+ #** Created: Wed Aug 18 06:13:07 2010
5
+ #** by: The Ruby Resource Compiler for Qt version 4.5.3
6
+ #**
7
+ #** WARNING! All changes made in this file will be lost!
8
+ #****************************************************************************/
9
+
10
+ class QCleanupResources__dest_class__
11
+ def self.qt_resource_data
12
+ return @@qt_resource_data
13
+ end
14
+
15
+ def self.qt_resource_name
16
+ return @@qt_resource_name
17
+ end
18
+
19
+ def self.qt_resource_struct
20
+ return @@qt_resource_struct
21
+ end
22
+
23
+ @@qt_resource_data = [
24
+ # /home/kaji/dev/projects/ruby/irecorder/resources/images/play-22.png
25
+ 0x0,0x0,0x4,0x1a,
26
+ 0x89,
27
+ 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
28
+ 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b,
29
+ 0x0,0x0,0x0,0x4,0x73,0x42,0x49,0x54,0x8,0x8,0x8,0x8,0x7c,0x8,0x64,0x88,
30
+ 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0x6,0x58,0x0,0x0,0x6,0x58,
31
+ 0x1,0x1f,0x87,0x2,0xea,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,
32
+ 0x74,0x77,0x61,0x72,0x65,0x0,0x77,0x77,0x77,0x2e,0x69,0x6e,0x6b,0x73,0x63,0x61,
33
+ 0x70,0x65,0x2e,0x6f,0x72,0x67,0x9b,0xee,0x3c,0x1a,0x0,0x0,0x3,0x97,0x49,0x44,
34
+ 0x41,0x54,0x38,0x8d,0xad,0x93,0x5d,0x68,0x1c,0x55,0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2,0xc9,0xe8,0x1f,0xca,0xbd,0xbf,0xd7,0x3d,0x91,0x5e,0x66,0xb0,0xad,
88
+ 0x2f,0x81,0x57,0x4d,0x53,0xeb,0x72,0x59,0x34,0xf0,0x21,0x70,0x58,0xf,0x8d,0xab,
89
+ 0x95,0xa0,0xb0,0x78,0xb4,0x89,0x39,0xa9,0xa0,0x17,0x96,0x41,0x2b,0xd2,0x0,0xe5,
90
+ 0x50,0x6e,0x1,0x7b,0x56,0x8a,0x7e,0x5b,0xf0,0x1d,0x34,0xc,0x18,0x68,0xde,0x5d,
91
+ 0x2d,0x7a,0xbd,0xfe,0x1,0x33,0xdd,0xd9,0xd0,0xad,0x52,0xa4,0x3,0x0,0x0,0x0,
92
+ 0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
93
+ # /home/kaji/dev/projects/ruby/irecorder/resources/images/irecorder-22.png
94
+ 0x0,0x0,0x4,0x45,
95
+ 0x89,
96
+ 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
97
+ 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b,
98
+ 0x0,0x0,0x0,0x4,0x73,0x42,0x49,0x54,0x8,0x8,0x8,0x8,0x7c,0x8,0x64,0x88,
99
+ 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0x4,0xc2,0x0,0x0,0x4,0xc2,
100
+ 0x1,0xbc,0xcf,0x90,0x18,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,
101
+ 0x74,0x77,0x61,0x72,0x65,0x0,0x77,0x77,0x77,0x2e,0x69,0x6e,0x6b,0x73,0x63,0x61,
102
+ 0x70,0x65,0x2e,0x6f,0x72,0x67,0x9b,0xee,0x3c,0x1a,0x0,0x0,0x3,0xc2,0x49,0x44,
103
+ 0x41,0x54,0x38,0x8d,0x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0xc5,0x50,0xb1,0x89,0x9f,0x9c,0x24,0x5,0x51,0xae,0x0,
143
+ 0x1b,0x63,0x1a,0xa4,0x30,0xa6,0x62,0x88,0x14,0x95,0xdb,0xd8,0x58,0x1c,0xd3,0x8f,
144
+ 0x72,0x58,0x8f,0xb2,0xac,0x57,0x39,0x9f,0x9d,0xe4,0xe,0x27,0x82,0x74,0xcb,0x64,
145
+ 0xb5,0xa4,0xd5,0x78,0x0,0x3c,0x56,0xec,0x24,0x50,0x16,0x9c,0x88,0x4c,0x6f,0x90,
146
+ 0x62,0xd3,0x5b,0xe0,0xfb,0x3e,0xa,0x45,0x8,0x97,0xe3,0xe2,0x8,0x63,0xc,0x70,
147
+ 0xc3,0x5f,0x64,0x2a,0x7b,0x99,0x7,0xdc,0x18,0x97,0xbc,0x14,0xef,0x4,0xa6,0x30,
148
+ 0xc6,0xf0,0x9c,0xdf,0xcb,0x6b,0x72,0x18,0x80,0x7,0x55,0x7,0x7b,0x8a,0x81,0xed,
149
+ 0xab,0xa2,0xa,0xdc,0xe2,0x7b,0x9c,0xe4,0x25,0xc6,0x18,0xe0,0x52,0xe9,0x6f,0xde,
150
+ 0x5f,0xf9,0x8a,0x87,0xbd,0x38,0xcd,0x96,0x8b,0xd6,0x1a,0x29,0x25,0x4a,0x29,0x3e,
151
+ 0x35,0xd7,0x98,0x12,0xe9,0x1a,0xbf,0x31,0xd5,0xb6,0x41,0xa,0xd7,0xd4,0x58,0x1b,
152
+ 0x63,0xe8,0x28,0x37,0x71,0xc2,0x7b,0x81,0xdd,0x22,0xca,0x77,0x85,0x69,0x3e,0xc8,
153
+ 0x9f,0x25,0xe6,0x39,0x4,0x85,0xd,0x80,0xd6,0xa6,0xc1,0x83,0x69,0x52,0x1c,0x24,
154
+ 0xe,0xc0,0xae,0xb2,0xb7,0x7d,0x55,0x38,0x58,0xbc,0xed,0x3d,0x4f,0xd8,0x72,0x39,
155
+ 0x95,0x3b,0xcf,0xc7,0xc5,0xb,0xcc,0x39,0x19,0xee,0x2d,0x77,0x42,0xb5,0x17,0x68,
156
+ 0x8d,0x2a,0xab,0x9a,0x37,0x9,0x3b,0x7,0x95,0x33,0x69,0xd3,0xc1,0x7a,0x55,0xd8,
157
+ 0xd4,0x9f,0xcd,0x88,0x8,0xa2,0xd1,0xbc,0xb7,0xfc,0xd,0x9f,0x95,0x2e,0x92,0x14,
158
+ 0x2b,0x20,0xa1,0x6c,0xfb,0x35,0xe0,0xaa,0x14,0xd5,0x48,0xe8,0x3a,0x70,0x3b,0xa1,
159
+ 0x3a,0xe3,0xcf,0xd7,0x2e,0x32,0x60,0x75,0x56,0x80,0xed,0x20,0xa7,0x57,0x7e,0xe6,
160
+ 0x4b,0x39,0x45,0xca,0xe4,0x6a,0xc9,0x45,0xa3,0x48,0x9b,0x4a,0xbb,0xca,0xea,0x62,
161
+ 0x83,0x37,0xb3,0x3a,0x43,0x3a,0x50,0x59,0xb3,0x8d,0x40,0xb8,0xae,0x6b,0xaa,0x8c,
162
+ 0xa3,0x22,0x82,0x59,0xff,0xa,0x28,0x8a,0xdb,0xfc,0x79,0xff,0xb7,0x35,0xfd,0xb,
163
+ 0xd8,0x36,0x1b,0x21,0xb5,0xda,0x41,0x63,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,
164
+ 0xae,0x42,0x60,0x82,
165
+ # /home/kaji/dev/projects/ruby/irecorder/resources/images/download-22.png
166
+ 0x0,0x0,0x2,0xe6,
167
+ 0x89,
168
+ 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
169
+ 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b,
170
+ 0x0,0x0,0x0,0x4,0x73,0x42,0x49,0x54,0x8,0x8,0x8,0x8,0x7c,0x8,0x64,0x88,
171
+ 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0x6,0x58,0x0,0x0,0x6,0x58,
172
+ 0x1,0x1f,0x87,0x2,0xea,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,
173
+ 0x74,0x77,0x61,0x72,0x65,0x0,0x77,0x77,0x77,0x2e,0x69,0x6e,0x6b,0x73,0x63,0x61,
174
+ 0x70,0x65,0x2e,0x6f,0x72,0x67,0x9b,0xee,0x3c,0x1a,0x0,0x0,0x2,0x63,0x49,0x44,
175
+ 0x41,0x54,0x38,0x8d,0xb5,0x95,0xbd,0x6b,0x53,0x51,0x18,0x87,0x9f,0x73,0x6f,0x9a,
176
+ 0xa4,0x31,0x92,0x3a,0x85,0xb6,0x50,0x3f,0x28,0x4,0x29,0x14,0x41,0xdb,0xa2,0x6b,
177
+ 0xa2,0x9b,0x88,0x93,0x83,0xe2,0x22,0x82,0x2e,0xa,0xd2,0x4d,0x1b,0x21,0x2a,0x8,
178
+ 0x4e,0xd2,0xc1,0x3f,0xa0,0x8b,0x8b,0x83,0xa5,0x83,0x43,0x4,0x27,0x49,0x74,0x17,
179
+ 0xa,0x6a,0xab,0x60,0x9a,0xb8,0x98,0x92,0xf6,0x7e,0xe5,0x9e,0x73,0x1c,0x92,0xb4,
180
+ 0xf9,0xb8,0x9,0xb1,0xc5,0x3,0x87,0xf7,0x72,0xdf,0x73,0x1f,0x7e,0xef,0xef,0xf2,
181
+ 0xbe,0x47,0x68,0xad,0x9,0x5a,0xc9,0x5c,0x3e,0xa,0xcc,0x3,0x46,0xe0,0x1,0x50,
182
+ 0xc0,0xa7,0x4a,0x36,0xe3,0x4,0x25,0x45,0x10,0x38,0x99,0xcb,0x8b,0xf1,0x44,0xf4,
183
+ 0x9b,0x55,0x57,0x53,0xd1,0x11,0x43,0xb5,0xde,0xb7,0x9f,0x74,0xea,0x52,0xc4,0x46,
184
+ 0xcc,0x9f,0xe5,0x6d,0x67,0xba,0x92,0xcd,0xf4,0x40,0x42,0x7d,0xd4,0x24,0xb6,0xb6,
185
+ 0x9d,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a,0xb1,0xa3,0xf3,0x5a,0xf7,0xd6,0xbd,0xe6,0x3e,0xe8,0x92,0x80,0xdd,0xe,
212
+ 0x5e,0x1,0x66,0x80,0x69,0x1a,0x57,0xdb,0x41,0xf7,0xdb,0xf5,0x85,0x89,0x2d,0x80,
213
+ 0xbf,0xa3,0x46,0x57,0x37,0xa5,0xde,0xc2,0x9f,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,
214
+ 0x44,0xae,0x42,0x60,0x82,
215
+ ]
216
+
217
+ @@qt_resource_name = [
218
+ # images
219
+ 0x0,0x6,
220
+ 0x7,0x3,0x7d,0xc3,
221
+ 0x0,0x69,
222
+ 0x0,0x6d,0x0,0x61,0x0,0x67,0x0,0x65,0x0,0x73,
223
+ # play-22.png
224
+ 0x0,0xb,
225
+ 0x0,0xbb,0x6,0xc7,
226
+ 0x0,0x70,
227
+ 0x0,0x6c,0x0,0x61,0x0,0x79,0x0,0x2d,0x0,0x32,0x0,0x32,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
228
+ # irecorder-22.png
229
+ 0x0,0x10,
230
+ 0x4,0x98,0x2d,0x7,
231
+ 0x0,0x69,
232
+ 0x0,0x72,0x0,0x65,0x0,0x63,0x0,0x6f,0x0,0x72,0x0,0x64,0x0,0x65,0x0,0x72,0x0,0x2d,0x0,0x32,0x0,0x32,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
233
+ # download-22.png
234
+ 0x0,0xf,
235
+ 0xc,0xf2,0x54,0x7,
236
+ 0x0,0x64,
237
+ 0x0,0x6f,0x0,0x77,0x0,0x6e,0x0,0x6c,0x0,0x6f,0x0,0x61,0x0,0x64,0x0,0x2d,0x0,0x32,0x0,0x32,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
238
+ ]
239
+
240
+ @@qt_resource_struct = [
241
+ # :
242
+ 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
243
+ # :/images
244
+ 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x2,
245
+ # :/images/play-22.png
246
+ 0x0,0x0,0x0,0x12,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
247
+ # :/images/irecorder-22.png
248
+ 0x0,0x0,0x0,0x2e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x4,0x1e,
249
+ # :/images/download-22.png
250
+ 0x0,0x0,0x0,0x54,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x8,0x67,
251
+ ]
252
+
253
+ def self.qInitResources()
254
+ Qt.qRegisterResourceData(0x01, QCleanupResources__dest_class__.qt_resource_struct.pack("C*"), QCleanupResources__dest_class__.qt_resource_name.pack("C*"), QCleanupResources__dest_class__.qt_resource_data.pack("C*"))
255
+ return 1
256
+ end
257
+ def self.qCleanupResources()
258
+ Qt.qUnregisterResourceData(0x01, QCleanupResources__dest_class__.qt_resource_struct.pack("C*"), QCleanupResources__dest_class__.qt_resource_name.pack("C*"), QCleanupResources__dest_class__.qt_resource_data.pack("C*"))
259
+ return 1
260
+ end
261
+
262
+ end
263
+
264
+ QCleanupResources__dest_class__.qInitResources()
@@ -0,0 +1,119 @@
1
+ #
2
+ # Log Window
3
+ #
4
+ class LogWindow < Qt::Widget
5
+
6
+ def initialize()
7
+ super
8
+
9
+ # create widgets
10
+ @textWidget = KDE::TextEdit.new
11
+ @textWidget.setReadOnly(true)
12
+ clearBtn = KDE::PushButton.new( KDE::Icon.new('edit-clear'), i18n("C&lear") )
13
+ connect(clearBtn, SIGNAL(:clicked)) do
14
+ @textWidget.clear
15
+ end
16
+
17
+ # layout
18
+ layout = Qt::VBoxLayout.new
19
+ layout.addWidget(@textWidget)
20
+ layout.addWidgetAtLeft(clearBtn)
21
+ setLayout(layout)
22
+ end
23
+
24
+ public
25
+ def write(text)
26
+ puts text
27
+ @textWidget.append(text)
28
+ end
29
+
30
+ end
31
+
32
+ class MyLogger
33
+ MISC = 0
34
+ CODE = 1
35
+ DEBUG = 2
36
+ INFO = 3
37
+ WARN = 4
38
+ ERROR = 5
39
+ FATAL = 6
40
+ UNKNOWN = 7
41
+
42
+ attr_accessor :level
43
+
44
+ def initialize(logDevice)
45
+ @logdev = logDevice
46
+ @level = 0
47
+ end
48
+
49
+ public
50
+ def misc(msg = nil, &block)
51
+ add(MISC, msg, &block)
52
+ end
53
+
54
+ def code(msg = nil, &block)
55
+ add(CODE, msg, &block)
56
+ end
57
+
58
+ def debug(msg = nil, &block)
59
+ add(DEBUG, msg, &block)
60
+ end
61
+
62
+ def info(msg = nil, &block)
63
+ add(INFO, msg, &block)
64
+ end
65
+
66
+ def warn(msg = nil, &block)
67
+ add(WARN, msg, &block)
68
+ end
69
+
70
+ def error(msg = nil, &block)
71
+ add(ERROR, msg, &block)
72
+ end
73
+
74
+ def fatal(msg = nil, &block)
75
+ add(FATAL, msg, &block)
76
+ end
77
+
78
+
79
+ protected
80
+ def add(lvl, msg, &block)
81
+ return if lvl < @level
82
+ if msg.nil? then
83
+ if block_given? then
84
+ msg = yield
85
+ return if msg.nil?
86
+ else
87
+ return
88
+ end
89
+ end
90
+
91
+ msgs = formatMessages(lvl, msg)
92
+ msgs.each do |m|
93
+ @logdev.write(m.chomp)
94
+ end
95
+ end
96
+ alias log add
97
+
98
+
99
+ def formatMessages(lvl, msg)
100
+ a = msg2a(msg)
101
+ a.map do |m|
102
+ "%-5s:%s" % [%w(MISC CODE DEBUG INFO WARN ERROR FATAL ANY)[lvl], m]
103
+ end
104
+ end
105
+
106
+ def msg2a(msg)
107
+ case msg
108
+ when ::String
109
+ [ msg ]
110
+ when ::Array
111
+ msg
112
+ when ::Exception
113
+ [ msg.class.to_s + ': ' + msg.message ] + [ msg ] +
114
+ (msg.backtrace || []).map do |m| ' from ' + m end
115
+ else
116
+ [ msg.inspect ]
117
+ end
118
+ end
119
+ end
@@ -0,0 +1,462 @@
1
+ #
2
+ # My library
3
+ #
4
+ # Qt & other miscs
5
+
6
+ require 'singleton'
7
+ require 'korundum4'
8
+
9
+ #
10
+ class Qt::HBoxLayout
11
+ def addWidgets(*w)
12
+ w.each do |i|
13
+ if i then
14
+ e = i.kind_of?(String) ? Qt::Label.new(i) : i
15
+ addWidget(e)
16
+ else
17
+ addStretch
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ class Qt::VBoxLayout
24
+ def addWidgetWithNilStretch(*w)
25
+ addLayout(
26
+ Qt::HBoxLayout.new do |l|
27
+ l.addWidgets(*w)
28
+ end
29
+ )
30
+ end
31
+ alias :addWidgets :addWidgetWithNilStretch
32
+
33
+ def addWidgetAtCenter(*w)
34
+ w.unshift(nil)
35
+ addWidgetWithNilStretch(*w)
36
+ end
37
+
38
+ def addWidgetAtRight(*w)
39
+ w.unshift(nil)
40
+ addWidgetWithNilStretch(*w)
41
+ end
42
+
43
+ def addWidgetAtLeft(*w)
44
+ w.push(nil)
45
+ addWidgetWithNilStretch(*w)
46
+ end
47
+ end
48
+
49
+
50
+ #
51
+ class VBoxLayoutWidget < Qt::Widget
52
+ def initialize(parent=nil)
53
+ @layout = Qt::VBoxLayout.new
54
+ super(parent)
55
+ setLayout(@layout)
56
+ end
57
+
58
+ def addLayout(l)
59
+ @layout.addLayout(l)
60
+ end
61
+
62
+ def addWidget(w)
63
+ @layout.addWidget(w)
64
+ end
65
+
66
+ def addWidgetWithNilStretch(*w)
67
+ @layout.addWidgetWithNilStretch(*w)
68
+ end
69
+ alias :addWidgets :addWidgetWithNilStretch
70
+
71
+ def addWidgetAtRight(*w)
72
+ @layout.addWidgetAtRight(*w)
73
+ end
74
+
75
+ def addWidgetAtCenter(*w)
76
+ @layout.addWidgetAtCenter(*w)
77
+ end
78
+
79
+ def layout
80
+ @layout
81
+ end
82
+ end
83
+
84
+ class HBoxLayoutWidget < Qt::Widget
85
+ def initialize(parent=nil)
86
+ @layout = Qt::HBoxLayout.new
87
+ super(parent)
88
+ setLayout(@layout)
89
+ end
90
+
91
+ def addLayout(l)
92
+ @layout.addLayout(l)
93
+ end
94
+
95
+ def addWidget(w)
96
+ @layout.addWidget(w)
97
+ end
98
+
99
+ def addWidgets(*w)
100
+ @layout.addWidgets(*w)
101
+ end
102
+
103
+ def layout
104
+ @layout
105
+ end
106
+ end
107
+
108
+
109
+ #--------------------------------------------------------------------------
110
+ #
111
+ #
112
+ def passiveMessage(text)
113
+ %x{ kdialog --passivepopup #{text.shellescape} }
114
+ end
115
+
116
+
117
+ #--------------------------------------------------------------------------
118
+ #
119
+ # Mandriva doesn't include kio smoke library.
120
+ # FolderSelectorLineEdit substitute KDE::UrlRequester
121
+ #
122
+ class FolderSelectorLineEdit < Qt::Widget
123
+ def initialize(dir=nil, parent=nil)
124
+ super(parent)
125
+
126
+ # widgets
127
+ @lineEdit = KDE::LineEdit.new
128
+ @lineEdit.text = dir if dir
129
+ @dirSelectBtn = KDE::PushButton.new(KDE::Icon.new('folder'),'')
130
+
131
+ # connect
132
+ connect(@dirSelectBtn, SIGNAL(:clicked), self, SLOT(:openSelectDlg))
133
+
134
+ # layout
135
+ lo = Qt::HBoxLayout.new do |l|
136
+ l.setContentsMargins(0,0,0,0)
137
+ l.addWidgets(@lineEdit, @dirSelectBtn)
138
+ end
139
+ setLayout(lo)
140
+ end
141
+
142
+ slots :openSelectDlg
143
+ def openSelectDlg
144
+ path = Qt::FileDialog::getExistingDirectory(self,'select folder', @lineEdit.text)
145
+ unless !path || path.empty?
146
+ @lineEdit.text = path
147
+ end
148
+ end
149
+
150
+ # for settings manager.
151
+ def objectName=(name)
152
+ @lineEdit.objectName = name
153
+ end
154
+
155
+ def folder
156
+ @LineEdit.text
157
+ end
158
+ # compatibility for UrlRequester
159
+ alias text folder
160
+
161
+ def folder=(dir)
162
+ @LineEdit.text = dir
163
+ end
164
+ end
165
+
166
+
167
+
168
+
169
+ #--------------------------------------------------------------------------
170
+ #
171
+ #
172
+
173
+ class Qt::Action
174
+ def setVData(data)
175
+ setData(Qt::Variant.new(data))
176
+ end
177
+
178
+ def vData
179
+ self.data.toString
180
+ end
181
+ end
182
+
183
+ module Mime
184
+ def self.services(url)
185
+ mimeType = KDE::MimeType.findByUrl(KDE::Url.new(url))
186
+ mime = mimeType.name
187
+ services = KDE::MimeTypeTrader.self.query(mime)
188
+ end
189
+ end
190
+
191
+ class KDE::ActionCollection
192
+ # @return : KDE::Action
193
+ # @parameter name :
194
+ # @parameter parent : parent Qt::Object
195
+ # @parameter options { :text=>name, :icon=>iconName, :shortCut=>key, :triggered=>SLOT or [object, SLOT] }
196
+ def addNew(name, parent=self.parent, options = {})
197
+ text = options[:text] || name
198
+ icon = options[:icon]
199
+ if icon then
200
+ action = KDE::Action.new(KDE::Icon.new(icon), text, parent)
201
+ else
202
+ action = KDE::Action.new(text, parent)
203
+ end
204
+ shortCut = options[:shortCut]
205
+ if shortCut then
206
+ action.setShortcut(KDE::Shortcut.new(shortCut))
207
+ end
208
+ self.addAction(action.text, action)
209
+ slot = options[:triggered]
210
+ if slot then
211
+ if slot.kind_of? Array then
212
+ self.connect(action, SIGNAL(:triggered), slot[0], \
213
+ SLOT(slot[1]))
214
+ else
215
+ self.connect(action, SIGNAL(:triggered), parent, \
216
+ SLOT(slot))
217
+ end
218
+ end
219
+ action
220
+ end
221
+ end
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+ #--------------------------------------------------------------------------
230
+ #
231
+ #
232
+ class SettingsBase < KDE::ConfigSkeleton
233
+ include Singleton
234
+
235
+ public
236
+ # @sym : instance symbol to be added.
237
+ def addBoolItem(sym, default=true)
238
+ name = sym.to_s
239
+ defineItem(sym, 'value', ItemBool, default)
240
+ end
241
+
242
+ def addStringItem(sym, default="")
243
+ defineItem(sym, 'toString', ItemString, default)
244
+ end
245
+
246
+ def addIntItem(sym, default="")
247
+ defineItem(sym, 'value', ItemInt, default)
248
+ end
249
+
250
+ def addUrlItem(sym, default=KDE::Url.new)
251
+ if default.kind_of? String then
252
+ default = KDE::Url.new(default)
253
+ end
254
+ defineItem(sym, 'value', ItemUrl, default)
255
+ end
256
+
257
+ def addStringListItem(sym, default="")
258
+ defineItem(sym, 'value', ItemStringList, default)
259
+ end
260
+
261
+ def addChoiceItem(name, list, default=0)
262
+ choices = makeChoices(list)
263
+ defineItemProperty(name, 'value')
264
+ item = ItemEnum.new(currentGroup, name.to_s, default, choices, default)
265
+ addItem(item)
266
+ end
267
+
268
+ def [](name)
269
+ findItem(name)
270
+ end
271
+
272
+ protected
273
+ def makeChoices(list)
274
+ choices = []
275
+ list.each do |i|
276
+ c = ItemEnum::Choice.new
277
+ c.name = i
278
+ choices << c
279
+ end
280
+ choices
281
+ end
282
+
283
+ def defineItem(name, valueMethod, itemClass, default)
284
+ defineItemProperty(name, valueMethod)
285
+ item = itemClass.new(currentGroup, name.to_s, default, default)
286
+ addItem(item)
287
+ end
288
+
289
+ def defineItemProperty(name, valueMethod)
290
+ self.class.class_eval %Q{
291
+ def #{name}
292
+ findItem('#{name}').property.#{valueMethod}
293
+ end
294
+
295
+ def self.#{name}
296
+ s = self.instance
297
+ s.#{name}
298
+ end
299
+
300
+ def set#{name}(v)
301
+ item = findItem('#{name}')
302
+ # unless item.immutable?
303
+ item.property = Qt::Variant.fromValue(v)
304
+ # end
305
+ end
306
+
307
+ def self.set#{name}(v)
308
+ s = self.instance
309
+ s.set#{name}(v)
310
+ end
311
+
312
+ def #{name}=(v)
313
+ set#{name}(v)
314
+ end
315
+
316
+ def self.#{name}=(v)
317
+ self.set#{name}(v)
318
+ end
319
+ }
320
+ end
321
+
322
+ def self.allChildren(obj)
323
+ all = children = obj.children
324
+ children.each do |o|
325
+ all += allChildren(o)
326
+ end
327
+ all
328
+ end
329
+
330
+ def self.printAllProperties(obj)
331
+ puts "============= settings properties =============="
332
+ options = self.instance
333
+ allChildren(obj).each do |o|
334
+ if o.objectName =~ /^kcfg_/ then
335
+ name = o.objectName.sub(/^kcfg_/, '')
336
+ if o.kind_of? Qt::CheckBox
337
+ prop = o.checked.to_s
338
+ elsif o.kind_of? Qt::ComboBox
339
+ prop = o.currentIndex.to_s
340
+ elsif o.kind_of? KDE::UrlRequester
341
+ prop = o.text
342
+ else
343
+ prop = '?'
344
+ end
345
+ if options.respond_to? name then
346
+ val = options.send(name).inspect
347
+ else
348
+ val = ''
349
+ end
350
+ err = prop == val ? '' : ' !! Error !!'
351
+ puts " name:#{name}, property:#{prop}, settings value:#{val} #{err}"
352
+ end
353
+ end
354
+ end
355
+
356
+ def self.updateWidgets(obj)
357
+ options = self.instance
358
+ allChildren(obj).each do |o|
359
+ if o.objectName =~ /^kcfg_/ then
360
+ name = o.objectName.sub(/^kcfg_/, '')
361
+ if options.respond_to? name then
362
+ val = options.send(name)
363
+ if o.kind_of? Qt::CheckBox
364
+ o.checked = val
365
+ elsif o.kind_of? Qt::ComboBox
366
+ o.currentIndex = val
367
+ elsif o.kind_of? KDE::LineEdit
368
+ o.text = val
369
+ elsif o.kind_of? KDE::UrlRequester
370
+ o.setUrl(val)
371
+ end
372
+ end
373
+ end
374
+ end
375
+ end
376
+
377
+ def self.updateSettings(obj)
378
+ options = self.instance
379
+ allChildren(obj).each do |o|
380
+ if o.objectName =~ /^kcfg_/ then
381
+ name = o.objectName.sub(/^kcfg_/, '') + '='
382
+ if options.respond_to? name then
383
+ if o.kind_of? Qt::CheckBox
384
+ options.send(name, o.checked)
385
+ if options.send(name[0..-2]) != o.checked then
386
+ puts "Error !! : #{name[0..-2]}(#{options.send(name[0..-2])} != #{o.checked}"
387
+ end
388
+ elsif o.kind_of? Qt::ComboBox
389
+ options.send(name, o.currentIndex)
390
+ elsif o.kind_of? KDE::LineEdit
391
+ options.send(name, o.text)
392
+ elsif o.kind_of? KDE::UrlRequester
393
+ options.send(name, o.url)
394
+ else
395
+ puts "not know type class:#{o.class.name}"
396
+ end
397
+ end
398
+ end
399
+ end
400
+ end
401
+ end
402
+
403
+
404
+ #--------------------------------------------------------------------------
405
+ #
406
+ #
407
+ def openDirectory(dir)
408
+ cmd = KDE::MimeTypeTrader.self.query('inode/directory').first.exec[/\w+/]
409
+ cmd += " " + dir
410
+ fork do exec(cmd) end
411
+ end
412
+
413
+ #--------------------------------------------------------------------------
414
+ #
415
+ # stdlib
416
+ #
417
+ module Enumerable
418
+ class Proxy
419
+ instance_methods.each { |m| undef_method(m) unless m.match(/^__/) }
420
+ def initialize(enum, method=:map)
421
+ @enum, @method = enum, method
422
+ end
423
+ def method_missing(method, *args, &block)
424
+ @enum.__send__(@method) {|o| o.__send__(method, *args, &block) }
425
+ end
426
+ end
427
+
428
+ def every
429
+ Proxy.new(self)
430
+ end
431
+ end
432
+
433
+ #
434
+ #
435
+ #
436
+ class String
437
+ def double_quote
438
+ '"' + self + '"'
439
+ end
440
+ alias :dquote :double_quote
441
+
442
+ def single_quote
443
+ "'" + self + "'"
444
+ end
445
+ alias :squote :single_quote
446
+
447
+ def _chomp_null
448
+ gsub(/\0.*/, '')
449
+ end
450
+
451
+ def sql_quote
452
+ str = _chomp_null
453
+ return 'NULL' if str.empty?
454
+ "'#{str.sql_escape}'"
455
+ end
456
+
457
+ def sql_escape
458
+ str = _chomp_null
459
+ str.gsub(/\\/, '\&\&').gsub(/'/, "''") #'
460
+ end
461
+ end
462
+