zik 0.16.2 → 0.17.0
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.
- data.tar.gz.sig +0 -0
- data/ChangeLog +22 -0
- data/Makefile.in +18 -11
- data/README +4 -0
- data/ZiK.rb +45 -21
- data/doc/ChangeLog +22 -0
- data/gui/assistant.rb +31 -16
- data/gui/common.rb +4 -2
- data/gui/config.rb +1 -1
- data/gui/gui.rb +77 -38
- data/gui/preference.rb +51 -14
- data/gui/socket.rb +5 -1
- data/mod/brainz.rb +4 -1
- data/mod/brainz/functions.rb +4 -4
- data/mod/hotkeys.rb +21 -14
- data/mod/hotkeys/config.rb +4 -2
- data/mod/hotkeys/configwidget.rb +18 -3
- data/mod/trayicon.rb +15 -1
- data/mod/trayicon/config.rb +2 -1
- data/mod/trayicon/configwidget.rb +11 -4
- data/player/cdplayer.rb +3 -3
- data/player/player.rb +5 -5
- data/player/radioplayer.rb +6 -6
- data/po/ZiK.pot +151 -99
- data/po/fr/ZiK.po +130 -98
- data/theme/dark/all.png +0 -0
- data/theme/dark/browser.png +0 -0
- data/theme/dark/cd.png +0 -0
- data/theme/dark/compact.png +0 -0
- data/theme/dark/copyright +10 -0
- data/theme/dark/playlist.png +0 -0
- data/theme/dark/radio.png +0 -0
- data/theme/ligth/all.png +0 -0
- data/theme/ligth/browser.png +0 -0
- data/theme/ligth/cd.png +0 -0
- data/theme/ligth/compact.png +0 -0
- data/theme/ligth/copyright +10 -0
- data/theme/ligth/playlist.png +0 -0
- data/theme/ligth/radio.png +0 -0
- data/zik +49 -25
- metadata +32 -10
- metadata.gz.sig +0 -0
- data/pix/gtk-directory.svg +0 -287
- data/pix/media-cdrom.svg +0 -292
- data/pix/network-wireless.svg +0 -429
- data/pix/player_play.svg +0 -286
- data/pix/sound.svg +0 -244
- data/pix/sound_directory.svg +0 -464
data/gui/preference.rb
CHANGED
@@ -196,7 +196,7 @@ class Preference_window < Gtk::Window
|
|
196
196
|
@@exist=false
|
197
197
|
|
198
198
|
def Preference_window.show(parent, playlist, config, page=:default, cdlist=nil, cdplayer=nil, cdgui=nil)
|
199
|
-
pages={:default=>0, :
|
199
|
+
pages={:default=>0, :global=>0, :browse=>1, :playlist=>2, :player=>3, :cd=>4}
|
200
200
|
if @@exist
|
201
201
|
@@window.hide; @@window.show
|
202
202
|
else
|
@@ -218,6 +218,33 @@ class Preference_window < Gtk::Window
|
|
218
218
|
def initialize(parent, playlist, config, cdlist, cdplayer, cdgui)
|
219
219
|
@@exist=true
|
220
220
|
|
221
|
+
#*********************Global page******************************
|
222
|
+
#theme
|
223
|
+
themes=Dir.glob(File.join(Theme_dir, '*/')).map{|d| d.split('/')[-1]}
|
224
|
+
#Add user themes-> themes.uniq! + priority to user themes (to be tested: themes.reverse!.uniq!)
|
225
|
+
@theme_combo=Gtk::ComboBox.new
|
226
|
+
themes.each_with_index{|theme, i|
|
227
|
+
@theme_combo.append_text(theme)
|
228
|
+
@theme_combo.active=i if config['theme']==theme
|
229
|
+
}
|
230
|
+
|
231
|
+
theme_frame=Gtk::Frame.new(_("Theme"))
|
232
|
+
theme_frame.border_width=$border
|
233
|
+
theme_frame.add(@theme_combo)
|
234
|
+
|
235
|
+
|
236
|
+
#session
|
237
|
+
@bsocket1=Gtk::RadioButton.new(_("Single"))
|
238
|
+
@bsocket2=Gtk::RadioButton.new(@bsocket1, _("Multi"))
|
239
|
+
config['socket'] ? @bsocket1.active=true : @bsocket2.active=true
|
240
|
+
|
241
|
+
@socket_frame=Gtk::Frame.new(_("Session"))
|
242
|
+
@socket_frame.border_width=$border
|
243
|
+
@socket_frame.add(hpack([@bsocket1, @bsocket2]))
|
244
|
+
|
245
|
+
#Main
|
246
|
+
@global_box=vpack(theme_frame, @socket_frame)
|
247
|
+
|
221
248
|
#*********************Browser page******************************
|
222
249
|
#Directories
|
223
250
|
@dirbox=DirBox.new(self)
|
@@ -280,14 +307,6 @@ class Preference_window < Gtk::Window
|
|
280
307
|
@wbrowser.add_with_viewport(@browser_box)
|
281
308
|
|
282
309
|
#*********************Playlist page*****************************
|
283
|
-
#session
|
284
|
-
@bsocket1=Gtk::RadioButton.new(_("Single"))
|
285
|
-
@bsocket2=Gtk::RadioButton.new(@bsocket1, _("Multi"))
|
286
|
-
config['socket'] ? @bsocket2.active=true : @bsocket1.active=true
|
287
|
-
|
288
|
-
@socket_frame=Gtk::Frame.new(_("Session"))
|
289
|
-
@socket_frame.border_width=$border
|
290
|
-
@socket_frame.add(hpack([@bsocket1, @bsocket2]))
|
291
310
|
#format
|
292
311
|
@format_selector=FormatSelector.new(config['name_format'])
|
293
312
|
@format_label=Gtk::Label.new(_('Format used to display songs\' name. Set all to None if you want to use file name.'))
|
@@ -335,8 +354,11 @@ class Preference_window < Gtk::Window
|
|
335
354
|
@relative_frame.add(vpack([@brelative, @relative_label]))
|
336
355
|
|
337
356
|
#main
|
338
|
-
@playlist_box=vpack([@
|
357
|
+
@playlist_box=vpack([@format_frame, @color_frame, @compact_frame,
|
339
358
|
@sort2_frame, @relative_frame])
|
359
|
+
@wplaylist=Gtk::ScrolledWindow.new
|
360
|
+
@wplaylist.set_policy(Gtk::POLICY_AUTOMATIC,Gtk::POLICY_AUTOMATIC)
|
361
|
+
@wplaylist.add_with_viewport(@playlist_box)
|
340
362
|
|
341
363
|
#*********************Player page*******************************
|
342
364
|
@bplay=Gtk::CheckButton.new(_('Play on start'))
|
@@ -401,8 +423,9 @@ class Preference_window < Gtk::Window
|
|
401
423
|
#*********************Main window*******************************
|
402
424
|
@notebook=Gtk::Notebook.new
|
403
425
|
@notebook.tab_pos=Gtk::POS_LEFT
|
426
|
+
@notebook.append_page(@global_box, Gtk::Label.new(_('Global')))
|
404
427
|
@notebook.append_page(@wbrowser, Gtk::Label.new(_('Browser')))
|
405
|
-
@notebook.append_page(@
|
428
|
+
@notebook.append_page(@wplaylist, Gtk::Label.new(_('Playlist')))
|
406
429
|
@notebook.append_page(@player_box, Gtk::Label.new(_('Player')))
|
407
430
|
@notebook.append_page(@cd_box, Gtk::Label.new(_('Cd')))
|
408
431
|
@notebook.append_page(@wmodule, Gtk::Label.new(_('Modules'))) if $module
|
@@ -412,20 +435,33 @@ class Preference_window < Gtk::Window
|
|
412
435
|
@bok=Gtk::Button.new(Gtk::Stock::OK)
|
413
436
|
@bok.signal_connect('clicked'){
|
414
437
|
oldconfig={}; oldconfig.merge!(config)
|
415
|
-
|
438
|
+
h={'directory'=>@dirbox.sdirectory, 'extension'=>@extbox.sext,
|
416
439
|
'sort_directories_first'=>@bsortdir.active?, 'sort_case_sensitive'=>@bsortcase.active?, 'refresh_on_start'=>@brefresh.active?,
|
417
440
|
'search_in_path'=>@bpath.active?, 'search_in_title'=>@btitle.active?,
|
418
441
|
'search_in_artist'=>@bartist.active?, 'search_in_album'=>@balbum.active?, 'search_in_genre'=>@bgenre.active?,
|
419
|
-
'
|
442
|
+
'theme'=>@theme_combo.active_text,
|
420
443
|
'name_format'=>@format_selector.format, 'relative_playlist'=>@brelative.active?,
|
421
444
|
'compact'=>@bcompact.active?,
|
422
445
|
'sort_by_track'=>@bsorttrack.active?, 'playing_color'=>@color_entry.text,
|
423
446
|
'play_on_start'=>@bplay.active?, 'shuffle'=>@bshuffle.active?, 'repeat'=>@brepeat.active?,
|
424
|
-
'cd_device'=>@device_entry.text, 'cd_web'=>@bweb.active?}
|
447
|
+
'cd_device'=>@device_entry.text, 'cd_web'=>@bweb.active?}
|
448
|
+
h['theme']=@theme_combo.active_text if @theme_combo.active_text
|
449
|
+
config.merge!(h)
|
425
450
|
if $module
|
426
451
|
config['module']=''
|
427
452
|
@module_hbuttons.each_pair{|key, value| config['module']+=key+',' if value.active?}
|
428
453
|
end
|
454
|
+
unless oldconfig['theme']==config['theme']
|
455
|
+
parent.change_theme
|
456
|
+
end
|
457
|
+
unless oldconfig['socket']==config['socket']
|
458
|
+
if config['socket']
|
459
|
+
require File.join(Data_dir, 'gui/socket')
|
460
|
+
ZiKSocket.start_server(parent, config, playlist)
|
461
|
+
else
|
462
|
+
ZiKSocket.clean
|
463
|
+
end
|
464
|
+
end
|
429
465
|
begin
|
430
466
|
Gdk::Color.parse(config['playing_color'])
|
431
467
|
rescue
|
@@ -480,6 +516,7 @@ class Preference_window < Gtk::Window
|
|
480
516
|
self.skip_taskbar_hint=true
|
481
517
|
self.skip_pager_hint=true
|
482
518
|
self.title=_('Preferences')
|
519
|
+
self.set_default_size(800, 800)
|
483
520
|
self.icon=Gdk::Pixbuf.new(File.join(Pix_dir,'ZiK.svg'))
|
484
521
|
|
485
522
|
self.signal_connect("delete_event") {quit;true}
|
data/gui/socket.rb
CHANGED
@@ -19,6 +19,8 @@ This file is part of ZiK.
|
|
19
19
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
20
20
|
=end
|
21
21
|
|
22
|
+
require 'socket'
|
23
|
+
|
22
24
|
module ZiKSocket
|
23
25
|
#Address and clean function are defined in ZiK.rb
|
24
26
|
Welcome_message="Hi! This is #{$name} through unix socket."
|
@@ -33,7 +35,9 @@ class CloseServer < Exception; end
|
|
33
35
|
end
|
34
36
|
|
35
37
|
def ZiKSocket.start_server(gui, config, playlist)
|
36
|
-
|
38
|
+
ErrorError.new(_("Single session: server not started."), true) if Thread.new{
|
39
|
+
ZiKSocket::Server.new(gui, config, playlist)
|
40
|
+
}.status.nil?#Except raise in thread used to start server.
|
37
41
|
end
|
38
42
|
|
39
43
|
class Server
|
data/mod/brainz.rb
CHANGED
@@ -41,7 +41,10 @@ module Brainz
|
|
41
41
|
require File.join(@dir, 'brainz', 'dialogs')
|
42
42
|
require File.join(@dir, 'brainz', 'widget')
|
43
43
|
@widget=Widget.new(zik)
|
44
|
-
|
44
|
+
vbox=Gtk::VBox.new
|
45
|
+
vbox.show
|
46
|
+
vbox.pack_start(@widget, false, false)
|
47
|
+
pack(vbox, true, false)
|
45
48
|
it=Gtk::MenuItem.new("Brainz")
|
46
49
|
it.signal_connect('activate'){
|
47
50
|
s=zik.list_selection.selected_rows
|
data/mod/brainz/functions.rb
CHANGED
@@ -39,16 +39,16 @@ def Brainz.tag(zik, zikSong)
|
|
39
39
|
begin
|
40
40
|
puids=song.puids
|
41
41
|
raise PuidsError.new if puids.nil?
|
42
|
-
ModErrorInfo.new(
|
42
|
+
ModErrorInfo.new(Brainz.mod, "get puids: #{puids.join(', ')}.")
|
43
43
|
song.get_tag
|
44
44
|
TagDialog.new(zik, song)
|
45
45
|
rescue PuidsParseError
|
46
|
-
ModErrorError.new(
|
46
|
+
ModErrorError.new(Brainz.mod, _("Cannot retrieve song id (parse error)."), true)
|
47
47
|
rescue PuidsError
|
48
|
-
ModErrorError.new(
|
48
|
+
ModErrorError.new(Brainz.mod, _("Cannot retrieve song id."), true)
|
49
49
|
end
|
50
50
|
else
|
51
|
-
ModErrorError.new(
|
51
|
+
ModErrorError.new(Brainz.mod, _("Only files are supported."), true)
|
52
52
|
end
|
53
53
|
zik.cursor=Gdk::Cursor::ARROW
|
54
54
|
end
|
data/mod/hotkeys.rb
CHANGED
@@ -44,29 +44,22 @@ module Hotkeys
|
|
44
44
|
|
45
45
|
def @m.load
|
46
46
|
unless @loaded
|
47
|
-
#Some deprecated code to be cleaned
|
48
|
-
#Since 0.2.0 rghk is required using the 'globalhotkeys' string
|
49
|
-
rghk='globalhotkeys'
|
50
47
|
begin
|
51
|
-
require
|
48
|
+
require 'globalhotkeys'
|
52
49
|
@rghk=true
|
53
50
|
|
54
51
|
@kb_prev||=GlobalHotKeys::KeyBinder.new
|
55
52
|
@kb_stop||=GlobalHotKeys::KeyBinder.new
|
56
53
|
@kb_play||=GlobalHotKeys::KeyBinder.new
|
57
54
|
@kb_next||=GlobalHotKeys::KeyBinder.new
|
55
|
+
@kb_hide||=GlobalHotKeys::KeyBinder.new
|
58
56
|
reload(true)
|
59
57
|
|
60
58
|
ModErrorInfo.new(self, "module loaded.")
|
61
59
|
@loaded=true
|
62
60
|
rescue LoadError
|
63
|
-
if rghk=='globalhotkeys'
|
64
|
-
rghk='rghk'
|
65
|
-
retry
|
66
|
-
else
|
67
61
|
ModErrorLoadError.new(self, _("Cannot find rghk. Please install it."))
|
68
62
|
@loaded=false
|
69
|
-
end
|
70
63
|
end
|
71
64
|
else
|
72
65
|
false
|
@@ -99,6 +92,8 @@ module Hotkeys
|
|
99
92
|
save_key(@wconfig.eplay.text, :play_key)
|
100
93
|
save_mask([@wconfig.bcnext, @wconfig.bsnext, @wconfig.banext], :next_mask)
|
101
94
|
save_key(@wconfig.enext.text, :next_key)
|
95
|
+
save_mask([@wconfig.bchide, @wconfig.bshide, @wconfig.bahide], :hide_mask)
|
96
|
+
save_key(@wconfig.ehide.text, :hide_key)
|
102
97
|
reload
|
103
98
|
end
|
104
99
|
end
|
@@ -111,11 +106,23 @@ private
|
|
111
106
|
|
112
107
|
def @m.reload(force=false)
|
113
108
|
if @loaded||force
|
114
|
-
[@kb_prev, @kb_stop, @kb_play, @kb_next].each{|kb| kb.unbind}
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
109
|
+
[@kb_prev, @kb_stop, @kb_play, @kb_next, @kb_hide].each{|kb| kb.unbind}
|
110
|
+
begin
|
111
|
+
@kb_prev.bind(Gdk::Keyval.from_name(@config[:prev_key]),
|
112
|
+
@config[:prev_mask]){@zik.previous_song}
|
113
|
+
@kb_stop.bind(Gdk::Keyval.from_name(@config[:stop_key]),
|
114
|
+
@config[:stop_mask]){@zik.stop}
|
115
|
+
@kb_play.bind(Gdk::Keyval.from_name(@config[:play_key]),
|
116
|
+
@config[:play_mask]){@zik.playpause}
|
117
|
+
@kb_next.bind(Gdk::Keyval.from_name(@config[:next_key]),
|
118
|
+
@config[:next_mask]){@zik.next_song}
|
119
|
+
@kb_hide.bind(Gdk::Keyval.from_name(@config[:hide_key]),
|
120
|
+
@config[:hide_mask]){@zik.visible? ? @zik.hide : @zik.show}
|
121
|
+
rescue GlobalHotKeys::XlibError
|
122
|
+
mess=_("Cannot bind these keys.")
|
123
|
+
ModErrorError.new(self, mess, true,
|
124
|
+
mess+_( "They must already used by another programm."))
|
125
|
+
end
|
119
126
|
end
|
120
127
|
end
|
121
128
|
|
data/mod/hotkeys/config.rb
CHANGED
@@ -24,8 +24,9 @@ module Hotkeys
|
|
24
24
|
class Configuration < Hash
|
25
25
|
def initialize(dir)
|
26
26
|
@file=File.join(dir,'hotkeysrc')
|
27
|
-
default={:prev_mask=>0, :prev_key=>"F9", :stop_mask=>0, :stop_key=>"F10",
|
28
|
-
:next_mask=>0, :next_key=>"F12"
|
27
|
+
default={:prev_mask=>0, :prev_key=>"F9", :stop_mask=>0, :stop_key=>"F10",
|
28
|
+
:play_mask=>0, :play_key=>"F11", :next_mask=>0, :next_key=>"F12",
|
29
|
+
:hide_mask=>0, :hide_key=>"F8"}
|
29
30
|
super
|
30
31
|
self.merge!(default)
|
31
32
|
if File.exist?(@file)
|
@@ -79,6 +80,7 @@ private
|
|
79
80
|
self[:stop_mask]=self[:stop_mask].to_i
|
80
81
|
self[:play_mask]=self[:play_mask].to_i
|
81
82
|
self[:next_mask]=self[:next_mask].to_i
|
83
|
+
self[:hide_mask]=self[:hide_mask].to_i
|
82
84
|
end
|
83
85
|
end
|
84
86
|
end
|
data/mod/hotkeys/configwidget.rb
CHANGED
@@ -22,8 +22,8 @@ This file is part of ZiK.
|
|
22
22
|
|
23
23
|
module Hotkeys
|
24
24
|
class ConfigWidget < Gtk::Table
|
25
|
-
attr_reader :eprev, :estop, :eplay, :enext, :bcprev, :bsprev, :baprev, :bcstop, :bsstop, :bastop,
|
26
|
-
:bcplay, :bsplay, :baplay, :bcnext, :bsnext, :banext
|
25
|
+
attr_reader :eprev, :estop, :eplay, :enext, :ehide, :bcprev, :bsprev, :baprev, :bcstop, :bsstop, :bastop,
|
26
|
+
:bcplay, :bsplay, :baplay, :bcnext, :bsnext, :banext, :bchide, :bshide, :bahide
|
27
27
|
|
28
28
|
def initialize(config)
|
29
29
|
@lprev=Gtk::Label.new(_("Previous:\t"))
|
@@ -66,7 +66,17 @@ class ConfigWidget < Gtk::Table
|
|
66
66
|
@enext=Gtk::Entry.new
|
67
67
|
@enext.text=config[:next_key]
|
68
68
|
|
69
|
-
|
69
|
+
@lhide=Gtk::Label.new(_("Hide/show:\t"))
|
70
|
+
@bchide=Gtk::CheckButton.new('Ctrl')
|
71
|
+
@bchide.active=config[:hide_mask]&GlobalHotKeys::Modifier::CONTROL_MASK==GlobalHotKeys::Modifier::CONTROL_MASK
|
72
|
+
@bshide=Gtk::CheckButton.new('Shift')
|
73
|
+
@bshide.active=config[:hide_mask]&GlobalHotKeys::Modifier::SHIFT_MASK==GlobalHotKeys::Modifier::SHIFT_MASK
|
74
|
+
@bahide=Gtk::CheckButton.new('Alt')
|
75
|
+
@bahide.active=config[:hide_mask]&GlobalHotKeys::Modifier::MOD1_MASK==GlobalHotKeys::Modifier::MOD1_MASK
|
76
|
+
@ehide=Gtk::Entry.new
|
77
|
+
@ehide.text=config[:hide_key]
|
78
|
+
|
79
|
+
super(5, 5)
|
70
80
|
#self.column_spacings=$border
|
71
81
|
self.attach(@lprev, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, $border)
|
72
82
|
self.attach(@bcprev, 1, 2, 0, 1)
|
@@ -88,6 +98,11 @@ class ConfigWidget < Gtk::Table
|
|
88
98
|
self.attach(@bsnext, 2, 3, 3, 4)
|
89
99
|
self.attach(@banext, 3, 4, 3, 4)
|
90
100
|
self.attach(@enext, 4, 5, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, $border)
|
101
|
+
self.attach(@lhide, 0, 1, 4, 5, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, $border)
|
102
|
+
self.attach(@bchide, 1, 2, 4, 5)
|
103
|
+
self.attach(@bshide, 2, 3, 4, 5)
|
104
|
+
self.attach(@bahide, 3, 4, 4, 5)
|
105
|
+
self.attach(@ehide, 4, 5, 4, 5, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, $border)
|
91
106
|
end
|
92
107
|
end
|
93
108
|
end
|
data/mod/trayicon.rb
CHANGED
@@ -45,6 +45,7 @@ module Trayicon
|
|
45
45
|
end
|
46
46
|
}
|
47
47
|
@zik.signal_connect('stop'){@tray.tooltip='ZiK' if @loaded}
|
48
|
+
reload
|
48
49
|
ModErrorInfo.new(self, "module loaded.")
|
49
50
|
@loaded=true
|
50
51
|
else
|
@@ -56,7 +57,8 @@ module Trayicon
|
|
56
57
|
if @loaded
|
57
58
|
#@tray.destroy #No method to destroy an Gtk::StatusIcon.
|
58
59
|
@tray.visible=false
|
59
|
-
|
60
|
+
@zik.delete_event_connect
|
61
|
+
ModErrorInfo.new(self, "module unloaded.")
|
60
62
|
@loaded=false
|
61
63
|
true
|
62
64
|
else
|
@@ -71,6 +73,8 @@ module Trayicon
|
|
71
73
|
def @m.saveconfig
|
72
74
|
if @loaded
|
73
75
|
@config[:scroll_event]=@wconfig.bscroll.active?
|
76
|
+
@config[:hide]=@wconfig.bhide.active?
|
77
|
+
reload
|
74
78
|
true
|
75
79
|
else
|
76
80
|
false
|
@@ -80,4 +84,14 @@ module Trayicon
|
|
80
84
|
def @m.quit
|
81
85
|
@config.save if @config
|
82
86
|
end
|
87
|
+
|
88
|
+
private
|
89
|
+
|
90
|
+
def @m.reload
|
91
|
+
if @config[:hide]
|
92
|
+
@zik.delete_event_connect{@zik.hide; true}
|
93
|
+
else
|
94
|
+
@zik.delete_event_connect
|
95
|
+
end
|
96
|
+
end
|
83
97
|
end
|
data/mod/trayicon/config.rb
CHANGED
@@ -24,7 +24,7 @@ module Trayicon
|
|
24
24
|
class Configuration < Hash
|
25
25
|
def initialize(dir)
|
26
26
|
@file=File.join(dir,'trayiconrc')
|
27
|
-
default={:scroll_event=>false}
|
27
|
+
default={:scroll_event=>false, :hide=>false}
|
28
28
|
super
|
29
29
|
self.merge!(default)
|
30
30
|
if File.exist?(@file)
|
@@ -74,6 +74,7 @@ class Configuration < Hash
|
|
74
74
|
private
|
75
75
|
def str2value
|
76
76
|
self[:scroll_event]=="true" ? self[:scroll_event]=true : self[:scroll_event]=false
|
77
|
+
self[:hide]=="true" ? self[:hide]=true : self[:hide]=false
|
77
78
|
end
|
78
79
|
end
|
79
80
|
end
|
@@ -21,15 +21,22 @@ This file is part of ZiK.
|
|
21
21
|
=end
|
22
22
|
|
23
23
|
module Trayicon
|
24
|
-
class ConfigWidget < Gtk::
|
25
|
-
attr_reader :bscroll
|
24
|
+
class ConfigWidget < Gtk::VBox
|
25
|
+
attr_reader :bscroll, :bhide
|
26
26
|
|
27
27
|
def initialize(config)
|
28
28
|
@bscroll=Gtk::CheckButton.new(_("Check to add interactions with third button mouse.\ndown : next song.\nup : previous song.\nCtrl+down : decrease volume.\nCtrl+up : increase volume."))
|
29
29
|
@bscroll.active=config[:scroll_event]
|
30
|
+
@fscroll=Gtk::Frame.new(_('Scroll actions'))
|
31
|
+
@fscroll.add(@bscroll)
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
+
@bhide=Gtk::CheckButton.new(_("Hide ZiK on close"))
|
34
|
+
@bhide.active=config[:hide]
|
35
|
+
|
36
|
+
super()
|
37
|
+
self.spacing=$border
|
38
|
+
self.pack_start(@fscroll, false)
|
39
|
+
self.pack_start(@bhide, false)
|
33
40
|
end
|
34
41
|
end
|
35
42
|
end
|
data/player/cdplayer.rb
CHANGED
@@ -95,11 +95,11 @@ class Player
|
|
95
95
|
private
|
96
96
|
|
97
97
|
def got_bus_message(message)
|
98
|
-
case message
|
99
|
-
when Gst::
|
98
|
+
case message
|
99
|
+
when Gst::MessageError
|
100
100
|
ErrorError.new(_("Gstreamer error."), true)
|
101
101
|
stop
|
102
|
-
when Gst::
|
102
|
+
when Gst::MessageEos
|
103
103
|
@gui.next_song#Use Dbus to propagate message instead of :gui ???
|
104
104
|
end
|
105
105
|
true#Without this line only the first message is processed
|
data/player/player.rb
CHANGED
@@ -97,10 +97,10 @@ private
|
|
97
97
|
Gst::InstallPlugins
|
98
98
|
def got_bus_message(message)
|
99
99
|
case message
|
100
|
-
when Gst::
|
100
|
+
when Gst::MessageError
|
101
101
|
ErrorError.new(_("Gstreamer error."), true)
|
102
102
|
@gui.next_song_on_error
|
103
|
-
when Gst::
|
103
|
+
when Gst::MessageEos
|
104
104
|
@gui.next_song#Use Dbus to propagate message instead of :gui or a SIGNAL???
|
105
105
|
when Gst::MissingMessage
|
106
106
|
ErrorInfo.new("Missing plugins.")
|
@@ -119,11 +119,11 @@ private
|
|
119
119
|
end
|
120
120
|
rescue NameError
|
121
121
|
def got_bus_message(message)
|
122
|
-
case message
|
123
|
-
when Gst::
|
122
|
+
case message
|
123
|
+
when Gst::MessageError
|
124
124
|
ErrorError.new(_("Gstreamer error."), true)
|
125
125
|
@gui.next_song_on_error
|
126
|
-
when Gst::
|
126
|
+
when Gst::MessageEos
|
127
127
|
@gui.next_song#Use Dbus to propagate message instead of :gui or a SIGNAL???
|
128
128
|
end
|
129
129
|
true#Without this line only the first message is processed
|
data/player/radioplayer.rb
CHANGED
@@ -63,12 +63,12 @@ private
|
|
63
63
|
begin
|
64
64
|
Gst::InstallPlugins
|
65
65
|
def got_bus_message(message)
|
66
|
-
case message
|
67
|
-
when Gst::
|
66
|
+
case message
|
67
|
+
when Gst::MessageError
|
68
68
|
ErrorError.new(_('Gstreamer error'), true)
|
69
69
|
stop
|
70
70
|
next_stream
|
71
|
-
when Gst::
|
71
|
+
when Gst::MessageEos
|
72
72
|
@gui.next_song#Use Dbus to propagate message instead of :gui ???
|
73
73
|
when Gst::MissingMessage
|
74
74
|
ErrorInfo.new("Missing plugins.")
|
@@ -88,12 +88,12 @@ private
|
|
88
88
|
end
|
89
89
|
rescue NameError
|
90
90
|
def got_bus_message(message)
|
91
|
-
case message
|
92
|
-
when Gst::
|
91
|
+
case message
|
92
|
+
when Gst::MessageError
|
93
93
|
ErrorError.new(_('Gstreamer error'), true)
|
94
94
|
stop
|
95
95
|
next_stream
|
96
|
-
when Gst::
|
96
|
+
when Gst::MessageEos
|
97
97
|
@gui.next_song#Use Dbus to propagate message instead of :gui ???
|
98
98
|
end
|
99
99
|
true#Without this line only the first message is processed
|