zik 0.16.2 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- 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.tar.gz.sig
CHANGED
Binary file
|
data/ChangeLog
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
###Version 0.17.0
|
2
|
+
Use new icons picture. Thanks J. Kaiden for the artwork.
|
3
|
+
Add choices for theme in preferences window.
|
4
|
+
Tray icon: add a option to hide ZiK on close.
|
5
|
+
Hotkeys: add hide/show ZiK.
|
6
|
+
Do not freeze browser when editing playlist (close bug #28638).
|
7
|
+
Multi and single sessions were switched in preferences dialog.
|
8
|
+
Choice between multi and single sessions is applied immediately.
|
9
|
+
Fix a bug in hotkeys module that prevents multi-sessions.
|
10
|
+
Fix a bug that can prevent loading previous browser view.
|
11
|
+
Brainz module: fix a in error handling (thanks Merle from forum.ubuntu-fr.org for the report).
|
12
|
+
Show the info dialog only the first time playlist is edited.
|
13
|
+
Restore position when showing main window.
|
14
|
+
Add scrollbars for the assistant.
|
15
|
+
|
16
|
+
Support only "zik" command to launch ZiK (nor ZiK or ZiK.rb).
|
17
|
+
Drop support of old version of rghk (< 0.2)
|
18
|
+
Start to implement XDG base directory specification for user directories.
|
19
|
+
|
20
|
+
translation:
|
21
|
+
update french.
|
22
|
+
|
1
23
|
###Version 0.16.2
|
2
24
|
Fix a bug : ZiK crash when showing an error before main window is defined.
|
3
25
|
Fix a bug: ZiK crash when loading a module failed.
|
data/Makefile.in
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
NAME=ZiK
|
2
|
-
VERSION=0.
|
2
|
+
VERSION=0.17.0
|
3
3
|
|
4
4
|
SHELL=/bin/sh
|
5
5
|
RUBY=/usr/bin/ruby
|
@@ -31,6 +31,8 @@ HTMLFILES=$(wildcard $(SRCDIR)/doc/html/*.html)
|
|
31
31
|
HTMLFILESPIX=$(wildcard $(SRCDIR)/doc/html/pix/*.png)
|
32
32
|
HTMLFILESCSS=$(wildcard $(SRCDIR)/doc/html/styles/*.css)
|
33
33
|
HTMLLANGUAGES=fr
|
34
|
+
THEMEDIR=$(DATADIR)/$(NAME)/theme
|
35
|
+
THEMES=dark ligth
|
34
36
|
GUIDIR=$(DATADIR)/$(NAME)/gui
|
35
37
|
GUIFILES=$(wildcard $(SRCDIR)/gui/*.rb)
|
36
38
|
PIXDIR=$(DATADIR)/$(NAME)/pix
|
@@ -70,22 +72,27 @@ check-depend: dependencies
|
|
70
72
|
test: zik
|
71
73
|
$(RUBY) -c zik
|
72
74
|
|
73
|
-
install: install-exec install-
|
75
|
+
install: install-exec install-data install-desktop install-module install-doc install-local
|
74
76
|
|
75
77
|
install-exec: zik
|
76
78
|
$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
|
77
79
|
$(INSTALL_PROGRAM) $(SRCDIR)/zik $(DESTDIR)$(BINDIR)/zik
|
78
80
|
|
79
|
-
install-
|
80
|
-
ln --symbolic $(BINDIR)/zik $(DESTDIR)$(BINDIR)/ZiK
|
81
|
-
|
82
|
-
install-data:
|
81
|
+
install-data: install-theme
|
83
82
|
$(INSTALL_DIR) $(DESTDIR)$(GUIDIR) $(DESTDIR)$(PIXDIR) $(DESTDIR)$(PIXDIR)/assistant $(DESTDIR)$(PLAYLISTDIR) $(DESTDIR)$(PLAYERDIR)
|
84
83
|
$(INSTALL_DATA) $(GUIFILES) $(DESTDIR)$(GUIDIR)
|
85
84
|
$(INSTALL_DATA) $(PIXFILES) $(DESTDIR)$(PIXDIR)
|
86
85
|
$(INSTALL_DATA) $(PLAYLISTFILES) $(DESTDIR)$(PLAYLISTDIR)
|
87
86
|
$(INSTALL_DATA) $(PLAYERFILES) $(DESTDIR)$(PLAYERDIR)
|
88
87
|
|
88
|
+
install-theme:
|
89
|
+
$(INSTALL_DIR) $(DESTDIR)$(THEMEDIR)
|
90
|
+
for theme in $(THEMES); do \
|
91
|
+
$(INSTALL_DIR) $(DESTDIR)$(THEMEDIR)/$$theme; \
|
92
|
+
# echo $(SRCDIR)/theme/$theme/*; \
|
93
|
+
$(INSTALL_DATA) $(SRCDIR)/theme/$$theme/* $(DESTDIR)$(THEMEDIR)/$$theme; \
|
94
|
+
done
|
95
|
+
|
89
96
|
install-desktop:
|
90
97
|
$(INSTALL_DIR) $(DESTDIR)$(DESKTOPDIR)
|
91
98
|
$(INSTALL_DESKTOP) $(DESTDIR)$(DESKTOPDIR) $(SRCDIR)/zik.desktop
|
@@ -148,18 +155,18 @@ install-local:
|
|
148
155
|
$(INSTALL_DATA) $(SRCDIR)/locale/$$lang/LC_MESSAGES/ZiK.mo $(DESTDIR)$(LOCALEDIR)/$$lang/LC_MESSAGES; \
|
149
156
|
done
|
150
157
|
|
151
|
-
uninstall: uninstall-exec uninstall-
|
158
|
+
uninstall: uninstall-exec uninstall-data uninstall-desktop uninstall-module uninstall-doc uninstall-local
|
152
159
|
|
153
160
|
uninstall-exec:
|
154
161
|
rm -f $(DESTDIR)$(BINDIR)/zik
|
155
|
-
|
156
|
-
uninstall-link:
|
157
|
-
rm -f $(DESTDIR)$(BINDIR)/ZiK
|
158
162
|
|
159
|
-
uninstall-data:
|
163
|
+
uninstall-data: uninstall-theme
|
160
164
|
rm -rf $(DESTDIR)$(GUIDIR) $(DESTDIR)$(PIXDIR) $(DESTDIR)$(PLAYLISTDIR) $(DESTDIR)$(PLAYERDIR)
|
161
165
|
rmdir $(DESTDIR)$(DATADIR)/$(NAME) --ignore-fail-on-non-empty
|
162
166
|
|
167
|
+
uninstall-theme:
|
168
|
+
rm -rf $(DESTDIR)$(THEMEDIR)
|
169
|
+
|
163
170
|
uninstall-desktop:
|
164
171
|
rm -f $(DESTDIR)$(DESKTOPDIR)/zik.desktop
|
165
172
|
$(UPDATE_MIME)
|
data/README
CHANGED
@@ -20,6 +20,10 @@ gst-plugins-ugly http://gstreamer.freedesktop.org/
|
|
20
20
|
For other format suppport (ie: mp3,wav), check gstreamer plug-ins:
|
21
21
|
gst-plugins-* http://gstreamer.freedesktop.org/
|
22
22
|
|
23
|
+
For modules:
|
24
|
+
cover -> ruby-mp3info http://rubyforge.org/projects/ruby-mp3info/
|
25
|
+
notify -> ruby-libnotify http://ruby-libnotify.rubyforge.org/
|
26
|
+
hotkeys -> rghk http://zik.rubyforge.org/rghk/
|
23
27
|
|
24
28
|
You can use check the dependencies by running (after running the configure script):
|
25
29
|
make check-depend
|
data/ZiK.rb
CHANGED
@@ -101,6 +101,7 @@ end
|
|
101
101
|
|
102
102
|
Data_dir=File.dirname(__FILE__)
|
103
103
|
Pix_dir=File.join(Data_dir,'pix')
|
104
|
+
Theme_dir=File.join(Data_dir, 'theme')
|
104
105
|
Doc_dir=File.join(Data_dir,'doc')
|
105
106
|
Locale_dir=File.join(Data_dir,'locale')
|
106
107
|
|
@@ -111,18 +112,38 @@ require File.join(Data_dir, 'gui/error')
|
|
111
112
|
estock=ErrorsStock.new
|
112
113
|
|
113
114
|
ErrorInfo.new("Hi! This is #{$name} (#{Version}). Enjoy your music.")
|
114
|
-
ErrorWarning.new("ZiK is deprecated. You should call ZiK by zik") if __FILE__=~/ZiK$/
|
115
115
|
|
116
116
|
#Global configuration
|
117
117
|
$border=5
|
118
118
|
|
119
119
|
#Configuration
|
120
120
|
require File.join(Data_dir, 'gui/config')
|
121
|
-
|
121
|
+
if (defined? User_dir)
|
122
|
+
Cache_dir=File.join('User_dir', 'cache')
|
123
|
+
Runtime_dir=File.join('User_dir', 'runtime')
|
124
|
+
else
|
125
|
+
User_dir= ENV['XDG_CONFIG_HOME'] ? File.join(ENV['XDG_CONFIG_HOME'], 'ZiK') :
|
126
|
+
File.join(ENV['HOME'], '.config', 'ZiK')
|
127
|
+
unless File.exist?(User_dir)#Check for deprecated location of User_dir
|
128
|
+
old_user_dir=File.join(ENV['HOME'],'.ZiK')
|
129
|
+
File.rename(old_user_dir, User_dir) if File.directory?(old_user_dir)
|
130
|
+
end
|
131
|
+
Cache_dir= ENV['XDG_CACHE_HOME'] ? File.join(ENV['XDG_CACHE_HOME'], 'ZiK') :
|
132
|
+
File.join(ENV['HOME'], '.cache', 'ZiK')
|
133
|
+
if ENV['XDG_RUNTIME_DIR']
|
134
|
+
Runtime_dir=File.join(ENV['XDG_RUNTIME_DIR'], 'ZiK')
|
135
|
+
else
|
136
|
+
require 'tempfile'
|
137
|
+
Runtime_dir=File.join(Dir.tmpdir, 'ZiK-'+ENV['USER'])
|
138
|
+
ErrorWarning.new("XDG_RUNTIME_DIR is not set. #{Runtime_dir} is used instead.")
|
139
|
+
end
|
140
|
+
end
|
122
141
|
unless File.exist?(User_dir)
|
123
142
|
Dir.mkdir(User_dir)
|
124
143
|
config_new=true
|
125
144
|
end
|
145
|
+
Dir.mkdir(Cache_dir) unless File.exist?(Cache_dir)
|
146
|
+
Dir.mkdir(Runtime_dir, 0700) unless File.exist?(Runtime_dir)
|
126
147
|
if File.directory?(User_dir)
|
127
148
|
configuration_file=File.join(User_dir,'ZiKrc')
|
128
149
|
config=Configuration.new(configuration_file)
|
@@ -137,26 +158,23 @@ config['view']=view if view
|
|
137
158
|
|
138
159
|
#Socket (client part)
|
139
160
|
module ZiKSocket
|
140
|
-
Address=File.join(
|
161
|
+
Address=File.join(Runtime_dir, 'socket')
|
141
162
|
end
|
142
|
-
if
|
143
|
-
require 'socket'
|
163
|
+
if File.socket?(ZiKSocket::Address)
|
144
164
|
require File.join(Data_dir, 'gui/socket')
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
File.delete(ZiKSocket::Address)
|
159
|
-
end
|
165
|
+
begin
|
166
|
+
client=ZiKSocket::Client.new
|
167
|
+
ErrorInfo.new(_("Multisession : server already exists."))
|
168
|
+
playfiles.each{|file|
|
169
|
+
file=File.join(Dir.pwd, file) unless file =~ /^\//#absolute path
|
170
|
+
p client.command("add #{file}")
|
171
|
+
}
|
172
|
+
client.command("show")
|
173
|
+
client.close
|
174
|
+
exit 0
|
175
|
+
rescue Errno::ECONNREFUSED
|
176
|
+
ErrorError.new(_("Multissession: socket exists but server does not respond."))
|
177
|
+
File.delete(ZiKSocket::Address)
|
160
178
|
end
|
161
179
|
end
|
162
180
|
|
@@ -310,7 +328,8 @@ module ZiKSocket
|
|
310
328
|
end
|
311
329
|
end
|
312
330
|
if config['socket']
|
313
|
-
|
331
|
+
require File.join(Data_dir, 'gui/socket')
|
332
|
+
ZiKSocket.start_server(gui, config, playlist)
|
314
333
|
end
|
315
334
|
|
316
335
|
#Modules
|
@@ -372,6 +391,11 @@ ensure
|
|
372
391
|
cdplayer.stop if $cd
|
373
392
|
radioplayer.stop if $radio
|
374
393
|
ZiKSocket.clean
|
394
|
+
begin
|
395
|
+
Dir.rmdir(Runtime_dir) if File.directory?(Runtime_dir)
|
396
|
+
rescue Errno::ENOTEMPTY
|
397
|
+
ErrorError.new("Cannot delete #{Runtime_dir}.")
|
398
|
+
end
|
375
399
|
end
|
376
400
|
|
377
401
|
ErrorInfo.new("Bye.")
|
data/doc/ChangeLog
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
###Version 0.17.0
|
2
|
+
Use new icons picture. Thanks J. Kaiden for the artwork.
|
3
|
+
Add choices for theme in preferences window.
|
4
|
+
Tray icon: add a option to hide ZiK on close.
|
5
|
+
Hotkeys: add hide/show ZiK.
|
6
|
+
Do not freeze browser when editing playlist (close bug #28638).
|
7
|
+
Multi and single sessions were switched in preferences dialog.
|
8
|
+
Choice between multi and single sessions is applied immediately.
|
9
|
+
Fix a bug in hotkeys module that prevents multi-sessions.
|
10
|
+
Fix a bug that can prevent loading previous browser view.
|
11
|
+
Brainz module: fix a in error handling (thanks Merle from forum.ubuntu-fr.org for the report).
|
12
|
+
Show the info dialog only the first time playlist is edited.
|
13
|
+
Restore position when showing main window.
|
14
|
+
Add scrollbars for the assistant.
|
15
|
+
|
16
|
+
Support only "zik" command to launch ZiK (nor ZiK or ZiK.rb).
|
17
|
+
Drop support of old version of rghk (< 0.2)
|
18
|
+
Start to implement XDG base directory specification for user directories.
|
19
|
+
|
20
|
+
translation:
|
21
|
+
update french.
|
22
|
+
|
1
23
|
###Version 0.16.2
|
2
24
|
Fix a bug : ZiK crash when showing an error before main window is defined.
|
3
25
|
Fix a bug: ZiK crash when loading a module failed.
|
data/gui/assistant.rb
CHANGED
@@ -23,6 +23,8 @@ class Assistant < Gtk::Assistant
|
|
23
23
|
def initialize(config, zik=nil)
|
24
24
|
@config=config; @zik=zik
|
25
25
|
super()
|
26
|
+
self.title=$name
|
27
|
+
self.set_default_size(800, 800)
|
26
28
|
signal_connect('delete_event'){quit}
|
27
29
|
signal_connect('cancel'){quit}
|
28
30
|
signal_connect('close'){close}
|
@@ -53,11 +55,14 @@ class Assistant < Gtk::Assistant
|
|
53
55
|
vbox1.border_width=$border
|
54
56
|
vbox1.pack_start(label1)
|
55
57
|
vbox1.pack_start(icapture, false)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
w1=Gtk::ScrolledWindow.new
|
59
|
+
w1.set_policy(Gtk::POLICY_AUTOMATIC,Gtk::POLICY_AUTOMATIC)
|
60
|
+
w1.add_with_viewport(vbox1)
|
61
|
+
append_page(w1)
|
62
|
+
set_page_header_image(w1, Gdk::Pixbuf.new(File.join(Pix_dir, 'ZiK3.png'), 128, 64))
|
63
|
+
set_page_title(w1, _("Main window (2/6)"))
|
64
|
+
set_page_type(w1, Gtk::Assistant::PAGE_CONTENT)
|
65
|
+
set_page_complete(w1, true)
|
61
66
|
|
62
67
|
#*********************Page 2******************************
|
63
68
|
#Directories
|
@@ -78,24 +83,34 @@ Please select at least one Diretory.')
|
|
78
83
|
vbox2.pack_start(@dirbox, false)
|
79
84
|
vbox2.pack_start(@extbox, false)
|
80
85
|
vbox2.pack_start(label2, false)
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
+
w2=Gtk::ScrolledWindow.new
|
87
|
+
w2.set_policy(Gtk::POLICY_AUTOMATIC,Gtk::POLICY_AUTOMATIC)
|
88
|
+
w2.add_with_viewport(vbox2)
|
89
|
+
append_page(w2)
|
90
|
+
set_page_header_image(w2, Gdk::Pixbuf.new(File.join(Pix_dir, 'ZiK3.png'), 128, 64))
|
91
|
+
set_page_title(w2, _("Configuration (3/6)"))
|
92
|
+
set_page_type(w2, Gtk::Assistant::PAGE_CONTENT)
|
93
|
+
set_page_complete(w2, true)
|
86
94
|
|
87
95
|
#*********************Page 3******************************
|
88
96
|
label3=Gtk::Label.new(_(
|
89
97
|
"ZiK uses GStreamer to play audio files. GStreamer supports a lot of formats."+" "+
|
90
98
|
"The number of supported formats depends on which gstreamer plug-ins are installed"+" "+
|
99
|
+
"If gstreamer plug-ins are missing ZiK will try to install them."+" "+
|
91
100
|
"If you cannot play a file you should check which plug-ins are not installed."+" "+
|
92
|
-
"More informations on
|
101
|
+
"More informations on "))
|
93
102
|
label3.wrap=true
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
103
|
+
b3=Gtk::LinkButton.new(_('http://zik.rubyforge.org/wiki/wiki.pl?Supported_Formats'))
|
104
|
+
vbox3=Gtk::VBox.new
|
105
|
+
vbox3.spacing=$border
|
106
|
+
vbox3.border_width=$border
|
107
|
+
vbox3.pack_start(label3, false)
|
108
|
+
vbox3.pack_start(b3, false)
|
109
|
+
append_page(vbox3)
|
110
|
+
set_page_header_image(vbox3, Gdk::Pixbuf.new(File.join(Pix_dir, 'ZiK3.png'), 128, 64))
|
111
|
+
set_page_title(vbox3, _("GStreamer (4/5)"))
|
112
|
+
set_page_type(vbox3, Gtk::Assistant::PAGE_CONTENT)
|
113
|
+
set_page_complete(vbox3, true)
|
99
114
|
|
100
115
|
#*********************Page 4******************************
|
101
116
|
label4=Gtk::Label.new(_(
|
data/gui/common.rb
CHANGED
@@ -37,7 +37,8 @@ end
|
|
37
37
|
|
38
38
|
module Pack
|
39
39
|
private
|
40
|
-
def hpack(
|
40
|
+
def hpack(*a)#Accept both forms: hpack([1, 2, 3]) and hpack(1, 2, 3)
|
41
|
+
array=*a
|
41
42
|
hbox=Gtk::HBox.new
|
42
43
|
hbox.border_width=$border
|
43
44
|
hbox.spacing=$border
|
@@ -46,7 +47,8 @@ def hpack(array)
|
|
46
47
|
hbox.pack_start(el, expand)}
|
47
48
|
hbox
|
48
49
|
end
|
49
|
-
def vpack(
|
50
|
+
def vpack(*a)
|
51
|
+
array=*a
|
50
52
|
vbox=Gtk::VBox.new
|
51
53
|
vbox.border_width=$border
|
52
54
|
vbox.spacing=$border
|
data/gui/config.rb
CHANGED
@@ -30,7 +30,7 @@ class Configuration < Hash
|
|
30
30
|
'play_on_start'=>false, 'current_song'=>0, 'volume'=>1.0, 'shuffle'=>false, 'repeat'=>false,
|
31
31
|
'sort_by_track'=>false,
|
32
32
|
'x'=>0, 'y'=>0, 'width'=>500, 'height'=>500, 'view'=>'all', 'paned_position'=>250,
|
33
|
-
'playing_color'=>'Pink', 'compact'=>false,
|
33
|
+
'playing_color'=>'Pink', 'theme'=>'dark', 'compact'=>false,
|
34
34
|
'directory'=>',', 'extension'=>'wav,flac,ogg,mp3,wma,xspf,m3u,pls',
|
35
35
|
'sort_directories_first'=>true, 'sort_case_sensitive'=>true, 'refresh_on_start'=>true,
|
36
36
|
'search_in_path'=>true, 'search_in_title'=>false, 'search_in_artist'=>false,
|
data/gui/gui.rb
CHANGED
@@ -114,7 +114,7 @@ class Gui < Gtk::Window
|
|
114
114
|
@find2_it=Gtk::ImageMenuItem.new(Gtk::Stock::FIND)
|
115
115
|
@find2_it.signal_connect('activate'){search}
|
116
116
|
@edit_it=Gtk::ImageMenuItem.new(Gtk::Stock::EDIT)
|
117
|
-
@edit_it.signal_connect('activate'){list_edit}
|
117
|
+
@edit_it.signal_connect('activate'){GLib::Idle.add{list_edit}}#GLib::Idle.add closes bug #28638
|
118
118
|
@bsave=Gtk::ImageMenuItem.new(Gtk::Stock::SAVE)
|
119
119
|
@separator_it2=Gtk::SeparatorMenuItem.new
|
120
120
|
@bsave.signal_connect('activate'){list_save}
|
@@ -132,10 +132,7 @@ class Gui < Gtk::Window
|
|
132
132
|
}
|
133
133
|
|
134
134
|
@playlist_menu=Gtk::Menu.new
|
135
|
-
|
136
|
-
#Fixme
|
137
|
-
# [@add_it, @rm_it, @clear_it, @find2_it, @edit_it, @bsave, @separator_it2, @bexport,
|
138
|
-
[@add_it, @rm_it, @clear_it, @find2_it, @bsave, @separator_it2, @bexport,
|
135
|
+
[@add_it, @rm_it, @clear_it, @find2_it, @edit_it, @bsave, @separator_it2, @bexport,
|
139
136
|
@separator_it3, @preference_it3].each{|it| @playlist_menu.append(it)}
|
140
137
|
|
141
138
|
#Radio menu
|
@@ -472,35 +469,14 @@ class Gui < Gtk::Window
|
|
472
469
|
|
473
470
|
#*********************Player zone******************************
|
474
471
|
#View selection
|
475
|
-
#@icon_theme=Gtk::IconTheme.default
|
476
|
-
#@idir=@icon_theme.load_icon('gtk-directory', Gtk::IconSize::BUTTON, Gtk::IconTheme::LOOKUP_FORCE_SVG)
|
477
472
|
@viewstore=Gtk::ListStore.new(Gdk::Pixbuf)
|
478
|
-
['sound_directory.svg','sound.svg','gtk-directory.svg','player_play.svg'].each{|image|
|
479
|
-
child=@viewstore.append
|
480
|
-
child[0]=Gdk::Pixbuf.new(File.join(Pix_dir, image), 24, 24)
|
481
|
-
}
|
482
|
-
if $cd
|
483
|
-
child=@viewstore.append
|
484
|
-
child[0]=Gdk::Pixbuf.new(File.join(Pix_dir, 'media-cdrom.svg'), 24, 24)
|
485
|
-
end
|
486
|
-
if $radio
|
487
|
-
child=@viewstore.append
|
488
|
-
child[0]=Gdk::Pixbuf.new(File.join(Pix_dir, 'network-wireless.svg'), 24, 24)
|
489
|
-
end
|
490
473
|
@renderer3=Gtk::CellRendererPixbuf.new
|
491
474
|
@selectview=Gtk::ComboBox.new(false)
|
492
475
|
@selectview.model=@viewstore
|
493
476
|
@selectview.pack_start(@renderer3,false)
|
494
477
|
@selectview.set_attributes(@renderer3, :pixbuf => 0)
|
478
|
+
change_theme
|
495
479
|
|
496
|
-
case @config['view']
|
497
|
-
when 'playlist' then @selectview.active=View::PLAYLIST
|
498
|
-
when 'browser' then @selectview.active=View::BROWSER
|
499
|
-
when 'player' then @selectview.active=View::COMPACT
|
500
|
-
when 'cd' then @selectview.active=View::CD
|
501
|
-
when 'radio' then @selectview.active=View::RADIO
|
502
|
-
else @selectview.active=View::ALL
|
503
|
-
end
|
504
480
|
@selectview.signal_connect('changed'){change_view}
|
505
481
|
#Song title
|
506
482
|
@song_title=Gtk::Label.new
|
@@ -619,7 +595,7 @@ class Gui < Gtk::Window
|
|
619
595
|
@vbox.pack_start(@button_container, false, false)
|
620
596
|
|
621
597
|
super()
|
622
|
-
self.
|
598
|
+
self.delete_event_connect
|
623
599
|
self.title=$name
|
624
600
|
@icon_Z=Gdk::Pixbuf.new(File.join(Pix_dir,'ZiK.svg'))
|
625
601
|
self.icon=(@icon_Z)
|
@@ -635,6 +611,45 @@ class Gui < Gtk::Window
|
|
635
611
|
self.show
|
636
612
|
end
|
637
613
|
|
614
|
+
def change_theme
|
615
|
+
#@icon_theme=Gtk::IconTheme.default
|
616
|
+
#@idir=@icon_theme.load_icon('gtk-directory', Gtk::IconSize::BUTTON, Gtk::IconTheme::LOOKUP_FORCE_SVG)
|
617
|
+
theme=File.join(Theme_dir, @config['theme'])
|
618
|
+
begin
|
619
|
+
@viewstore.clear
|
620
|
+
%w(all.png playlist.png browser.png compact.png).each{|image|
|
621
|
+
child=@viewstore.append
|
622
|
+
child[0]=Gdk::Pixbuf.new(File.join(theme, image), 24, 24)
|
623
|
+
}
|
624
|
+
if $cd
|
625
|
+
child=@viewstore.append
|
626
|
+
child[0]=Gdk::Pixbuf.new(File.join(theme, 'cd.png'), 24, 24)
|
627
|
+
end
|
628
|
+
if $radio
|
629
|
+
child=@viewstore.append
|
630
|
+
child[0]=Gdk::Pixbuf.new(File.join(theme, 'radio.png'), 24, 24)
|
631
|
+
end
|
632
|
+
|
633
|
+
case @config['view']
|
634
|
+
when 'playlist' then @selectview.active=View::PLAYLIST
|
635
|
+
when 'browser' then @selectview.active=View::BROWSER
|
636
|
+
when 'player' then @selectview.active=View::COMPACT
|
637
|
+
when 'cd' then @selectview.active=View::CD
|
638
|
+
when 'radio' then @selectview.active=View::RADIO
|
639
|
+
else @selectview.active=View::ALL
|
640
|
+
end
|
641
|
+
rescue => e
|
642
|
+
ErrorError.new("Cannot find #{@config['theme']} theme.")
|
643
|
+
tmp=File.join(Theme_dir, @config.default['theme'])
|
644
|
+
if theme==tmp
|
645
|
+
raise e
|
646
|
+
else
|
647
|
+
theme=tmp
|
648
|
+
retry
|
649
|
+
end
|
650
|
+
end
|
651
|
+
end
|
652
|
+
|
638
653
|
private
|
639
654
|
|
640
655
|
def change_view
|
@@ -698,6 +713,15 @@ private
|
|
698
713
|
end
|
699
714
|
|
700
715
|
public
|
716
|
+
|
717
|
+
def delete_event_connect(&block)
|
718
|
+
self.signal_handler_disconnect(@id_delete_event) if defined?(@id_delete_event)
|
719
|
+
if block
|
720
|
+
@id_delete_event=self.signal_connect("delete_event", &block)
|
721
|
+
else
|
722
|
+
@id_delete_event=self.signal_connect("delete_event"){quit; false}
|
723
|
+
end
|
724
|
+
end
|
701
725
|
|
702
726
|
def quit
|
703
727
|
pos=self.position;@config['x']=pos[0];@config['y']=pos[1]
|
@@ -706,7 +730,19 @@ public
|
|
706
730
|
|
707
731
|
Gtk.main_quit
|
708
732
|
end
|
709
|
-
|
733
|
+
|
734
|
+
alias :super_hide :hide
|
735
|
+
def hide
|
736
|
+
@config['x'], @config['y']=self.position
|
737
|
+
super_hide
|
738
|
+
end
|
739
|
+
|
740
|
+
alias :super_show :show
|
741
|
+
def show
|
742
|
+
self.move(@config['x'],@config['y'])
|
743
|
+
super_show
|
744
|
+
end
|
745
|
+
|
710
746
|
def play(player_wanted=@active_view)
|
711
747
|
case player_wanted
|
712
748
|
when 'default'
|
@@ -961,9 +997,9 @@ public
|
|
961
997
|
ErrorInfo.new('Refreshing tree view...')
|
962
998
|
self.cursor=Gdk::Cursor::WATCH
|
963
999
|
|
964
|
-
backup=File.join(
|
1000
|
+
backup=File.join(Cache_dir,'tree')
|
965
1001
|
unless File.exist?(backup)
|
966
|
-
Dir.mkdir(backup) if $
|
1002
|
+
Dir.mkdir(backup) if $write_config
|
967
1003
|
end
|
968
1004
|
BrowseSearchWindow.refresh
|
969
1005
|
@treestore.clear
|
@@ -983,7 +1019,7 @@ public
|
|
983
1019
|
files=[]
|
984
1020
|
Find.find(directory){|f| files.push(f) if f=~rexp}
|
985
1021
|
@config['sort_case_sensitive'] ? files.sort! : files=files.sort_by{|f| f.downcase}
|
986
|
-
if $
|
1022
|
+
if $write_config
|
987
1023
|
if @config['refresh_on_start']
|
988
1024
|
#Delete list
|
989
1025
|
ff=Dir.glob(File.join(backup,'*'))
|
@@ -1310,10 +1346,13 @@ _("An error occured while exporting songs.\nUnknown queued object type (#{o.clas
|
|
1310
1346
|
@table.attach(bok, 7, 8, 8, 9, Gtk::SHRINK, Gtk::SHRINK)
|
1311
1347
|
@bedit.sensitive=false
|
1312
1348
|
@wlist.hide
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1349
|
+
unless defined?(@list_edit_dialog)
|
1350
|
+
@list_edit_dialog=true
|
1351
|
+
dialog=Gtk::MessageDialog.new(self, Gtk::Dialog::MODAL, Gtk::MessageDialog::INFO,
|
1352
|
+
Gtk::MessageDialog::BUTTONS_CLOSE,
|
1353
|
+
_("Do not forget to validate your changes after editing the playlist."))
|
1354
|
+
dialog.run; dialog.destroy
|
1355
|
+
end
|
1317
1356
|
end
|
1318
1357
|
|
1319
1358
|
if $radio
|
@@ -1373,10 +1412,10 @@ end
|
|
1373
1412
|
Mod.all.each{|mod| authors.push(" "+mod.title+": "+mod.author)}
|
1374
1413
|
end
|
1375
1414
|
Gtk::AboutDialog.show(self, {:name=>$name, :version=>Version, :program_name=>$name,
|
1376
|
-
:copyright=>'Copyright 2007-
|
1415
|
+
:copyright=>'Copyright 2007-2011 Vincent Carmona', :comments=>_('Audio player'),
|
1377
1416
|
:website=>'http://zik.rubyforge.org/', :license=>copying,
|
1378
1417
|
:authors=>authors,
|
1379
|
-
:artists=>["
|
1418
|
+
:artists=>["Justin Kaiden"],
|
1380
1419
|
:translator_credits=>"Français: Vincent Carmona\n",
|
1381
1420
|
:logo=>Gdk::Pixbuf.new(File.join(Pix_dir,'ZiK3.png'))})
|
1382
1421
|
end
|