Merge lp:~victored/beat-box/icon-system into lp:beat-box
- icon-system
- Merge into trunk
Proposed by
Victor Martinez
Status: | Merged |
---|---|
Merged at revision: | 505 |
Proposed branch: | lp:~victored/beat-box/icon-system |
Merge into: | lp:beat-box |
Diff against target: |
7057 lines (+2311/-1416) 38 files modified
images/CMakeLists.txt (+9/-1) images/icons/16x16/actions/media-playback-pause-symbolic.svg (+61/-0) images/icons/16x16/actions/media-playback-start-symbolic.svg (+65/-0) images/icons/16x16/mimetypes/media-cdrom-audio.svg (+481/-0) images/icons/16x16/status/audio-volume-high-symbolic.svg (+0/-31) images/icons/16x16/status/non-starred-symbolic.svg (+70/-0) images/icons/16x16/status/starred-symbolic.svg (+34/-0) src/BeatBox.vala (+9/-6) src/CMakeLists.txt (+3/-2) src/Devices/CDRomDevice.vala (+1/-1) src/Dialogs/AddPodcastWindow.vala (+4/-4) src/Dialogs/EqualizerWindow.vala (+49/-48) src/Dialogs/SetMusicFolderConfirmation.vala (+2/-2) src/GStreamer/Streamer.vala (+1/-3) src/Icons.vala (+203/-0) src/LibraryManager.vala (+7/-25) src/LibraryWindow.vala (+322/-326) src/Objects/EqualizerPreset.vala (+1/-10) src/Objects/Icon.vala (+222/-0) src/Objects/Icons.vala (+0/-272) src/Views/AlbumView/AlbumIconView.vala (+7/-4) src/Views/AlbumView/AlbumListView.vala (+97/-72) src/Views/AlbumView/AlbumViewModel.vala (+1/-1) src/Views/CellDataFunctionHelper.vala (+2/-2) src/Views/DeviceSummaryWidget.vala (+5/-5) src/Views/ListView/MusicTreeModel.vala (+133/-131) src/Views/ListView/MusicTreeView.vala (+267/-260) src/Views/ListView/PodcastListView.vala (+13/-6) src/Views/ListView/PodcastTreeModel.vala (+43/-43) src/Views/ListView/RadioListView.vala (+12/-5) src/Views/ListView/RadioTreeModel.vala (+47/-47) src/Views/ViewWrapper.vala (+1/-1) src/Widgets/InfoPanel.vala (+2/-2) src/Widgets/RatingWidget.vala (+51/-47) src/Widgets/SideTreeView.vala (+17/-15) src/Widgets/SimpleOptionChooser.vala (+59/-33) src/Widgets/TopDisplay.vala (+1/-2) src/Widgets/WarningLabel.vala (+9/-9) |
To merge this branch: | bzr merge lp:~victored/beat-box/icon-system |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
BeatBox Team | Pending | ||
Review via email: mp+90763@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Scott Ringwelski (sgringwe) wrote : | # |
Revision history for this message
Victor Martinez (victored) wrote : | # |
Ok, thanks for your review!
That issue is weird. Although I removed the pixbuf property, it appears sometimes. It might have something to to with the initialization process.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'images/CMakeLists.txt' |
2 | --- images/CMakeLists.txt 2012-01-11 22:40:39 +0000 |
3 | +++ images/CMakeLists.txt 2012-01-31 01:07:25 +0000 |
4 | @@ -19,6 +19,9 @@ |
5 | # radio icon |
6 | install(FILES icons/16x16/mimetypes/internet-radio.svg DESTINATION share/beatbox/icons/hicolor/16x16/mimetypes) |
7 | |
8 | +# CD icon |
9 | +install(FILES icons/16x16/mimetypes/media-cdrom-audio.svg DESTINATION share/beatbox/icons/hicolor/16x16/mimetypes) |
10 | + |
11 | # media-audio for default album image |
12 | install(FILES icons/128x128/mimetypes/media-audio.png DESTINATION share/beatbox/icons/hicolor/128x128/mimetypes) |
13 | install(FILES icons/128x128/mimetypes/drop-album.svg DESTINATION share/beatbox/icons/hicolor/128x128/mimetypes) |
14 | @@ -37,11 +40,16 @@ |
15 | install(FILES icons/16x16/status/media-playlist-no-shuffle-symbolic.svg DESTINATION share/beatbox/icons/hicolor/16x16/status) |
16 | |
17 | # now-playing icon |
18 | -install(FILES icons/16x16/status/audio-volume-high-symbolic.svg DESTINATION share/beatbox/icons/hicolor/16x16/status) |
19 | +install(FILES icons/16x16/actions/media-playback-start-symbolic.svg DESTINATION share/beatbox/icons/hicolor/16x16/actions) |
20 | +install(FILES icons/16x16/actions/media-playback-pause-symbolic.svg DESTINATION share/beatbox/icons/hicolor/16x16/actions) |
21 | |
22 | # starred and not-starrred icons |
23 | install(FILES icons/16x16/status/starred.svg DESTINATION share/beatbox/icons/hicolor/16x16/status) |
24 | install(FILES icons/16x16/status/not-starred.svg DESTINATION share/beatbox/icons/hicolor/16x16/status) |
25 | +install(FILES icons/16x16/status/starred-symbolic.svg DESTINATION share/beatbox/icons/hicolor/16x16/status) |
26 | +install(FILES icons/16x16/status/non-starred-symbolic.svg DESTINATION share/beatbox/icons/hicolor/16x16/status) |
27 | + |
28 | +# new podcast icon |
29 | install(FILES icons/16x16/status/podcast-new.svg DESTINATION share/beatbox/icons/hicolor/16x16/status) |
30 | |
31 | # playlist icons |
32 | |
33 | === added file 'images/icons/16x16/actions/media-playback-pause-symbolic.svg' |
34 | --- images/icons/16x16/actions/media-playback-pause-symbolic.svg 1970-01-01 00:00:00 +0000 |
35 | +++ images/icons/16x16/actions/media-playback-pause-symbolic.svg 2012-01-31 01:07:25 +0000 |
36 | @@ -0,0 +1,61 @@ |
37 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
38 | +<!-- Created with Inkscape (http://www.inkscape.org/) --> |
39 | + |
40 | +<svg |
41 | + xmlns:dc="http://purl.org/dc/elements/1.1/" |
42 | + xmlns:cc="http://creativecommons.org/ns#" |
43 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
44 | + xmlns:svg="http://www.w3.org/2000/svg" |
45 | + xmlns="http://www.w3.org/2000/svg" |
46 | + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
47 | + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
48 | + width="16px" |
49 | + height="16px" |
50 | + id="svg5979" |
51 | + version="1.1" |
52 | + inkscape:version="0.48.2 r9819" |
53 | + sodipodi:docname="media-playback-pause-symbolic.svg"> |
54 | + <defs |
55 | + id="defs5981" /> |
56 | + <sodipodi:namedview |
57 | + id="base" |
58 | + pagecolor="#ffffff" |
59 | + bordercolor="#666666" |
60 | + borderopacity="1.0" |
61 | + inkscape:pageopacity="0.0" |
62 | + inkscape:pageshadow="2" |
63 | + inkscape:zoom="22.197802" |
64 | + inkscape:cx="7.0314356" |
65 | + inkscape:cy="8" |
66 | + inkscape:current-layer="layer1" |
67 | + showgrid="true" |
68 | + inkscape:grid-bbox="true" |
69 | + inkscape:document-units="px" |
70 | + inkscape:window-width="1280" |
71 | + inkscape:window-height="753" |
72 | + inkscape:window-x="0" |
73 | + inkscape:window-y="24" |
74 | + inkscape:window-maximized="1" /> |
75 | + <metadata |
76 | + id="metadata5984"> |
77 | + <rdf:RDF> |
78 | + <cc:Work |
79 | + rdf:about=""> |
80 | + <dc:format>image/svg+xml</dc:format> |
81 | + <dc:type |
82 | + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
83 | + <dc:title /> |
84 | + </cc:Work> |
85 | + </rdf:RDF> |
86 | + </metadata> |
87 | + <g |
88 | + id="layer1" |
89 | + inkscape:label="Layer 1" |
90 | + inkscape:groupmode="layer"> |
91 | + <path |
92 | + id="rect10309-7" |
93 | + style="opacity:1;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
94 | + d="m 9,1 4,0 0,13 -4,0 z M 3,1 7,1 7,14 3,14 z" |
95 | + inkscape:connector-curvature="0" /> |
96 | + </g> |
97 | +</svg> |
98 | |
99 | === added file 'images/icons/16x16/actions/media-playback-start-symbolic.svg' |
100 | --- images/icons/16x16/actions/media-playback-start-symbolic.svg 1970-01-01 00:00:00 +0000 |
101 | +++ images/icons/16x16/actions/media-playback-start-symbolic.svg 2012-01-31 01:07:25 +0000 |
102 | @@ -0,0 +1,65 @@ |
103 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
104 | +<!-- Created with Inkscape (http://www.inkscape.org/) --> |
105 | + |
106 | +<svg |
107 | + xmlns:dc="http://purl.org/dc/elements/1.1/" |
108 | + xmlns:cc="http://creativecommons.org/ns#" |
109 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
110 | + xmlns:svg="http://www.w3.org/2000/svg" |
111 | + xmlns="http://www.w3.org/2000/svg" |
112 | + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
113 | + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
114 | + version="1.1" |
115 | + width="16" |
116 | + height="16" |
117 | + id="svg7384" |
118 | + inkscape:version="0.48.2 r9819" |
119 | + sodipodi:docname="media-playback-start-symbolic.svg"> |
120 | + <sodipodi:namedview |
121 | + pagecolor="#ffffff" |
122 | + bordercolor="#666666" |
123 | + borderopacity="1" |
124 | + objecttolerance="10" |
125 | + gridtolerance="10" |
126 | + guidetolerance="10" |
127 | + inkscape:pageopacity="0" |
128 | + inkscape:pageshadow="2" |
129 | + inkscape:window-width="1129" |
130 | + inkscape:window-height="664" |
131 | + id="namedview7" |
132 | + showgrid="true" |
133 | + inkscape:zoom="29.375" |
134 | + inkscape:cx="2.9957447" |
135 | + inkscape:cy="8" |
136 | + inkscape:window-x="0" |
137 | + inkscape:window-y="24" |
138 | + inkscape:window-maximized="0" |
139 | + inkscape:current-layer="svg7384" |
140 | + showguides="true" |
141 | + inkscape:guide-bbox="true"> |
142 | + <inkscape:grid |
143 | + type="xygrid" |
144 | + id="grid3025" /> |
145 | + </sodipodi:namedview> |
146 | + <title |
147 | + id="title9167">Gnome Symbolic Icon Theme</title> |
148 | + <defs |
149 | + id="defs11" /> |
150 | + <metadata |
151 | + id="metadata90"> |
152 | + <rdf:RDF> |
153 | + <cc:Work |
154 | + rdf:about=""> |
155 | + <dc:format>image/svg+xml</dc:format> |
156 | + <dc:type |
157 | + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
158 | + <dc:title>Gnome Symbolic Icon Theme</dc:title> |
159 | + </cc:Work> |
160 | + </rdf:RDF> |
161 | + </metadata> |
162 | + <path |
163 | + inkscape:connector-curvature="0" |
164 | + d="m 2,0.99996 0,13 L 14,7.49997 2,0.99996 z" |
165 | + id="path2843-39-5-5" |
166 | + style="opacity:1;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> |
167 | +</svg> |
168 | |
169 | === added file 'images/icons/16x16/mimetypes/media-cdrom-audio.svg' |
170 | --- images/icons/16x16/mimetypes/media-cdrom-audio.svg 1970-01-01 00:00:00 +0000 |
171 | +++ images/icons/16x16/mimetypes/media-cdrom-audio.svg 2012-01-31 01:07:25 +0000 |
172 | @@ -0,0 +1,481 @@ |
173 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
174 | +<!-- Created with Inkscape (http://www.inkscape.org/) --> |
175 | + |
176 | +<svg |
177 | + xmlns:dc="http://purl.org/dc/elements/1.1/" |
178 | + xmlns:cc="http://creativecommons.org/ns#" |
179 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
180 | + xmlns:svg="http://www.w3.org/2000/svg" |
181 | + xmlns="http://www.w3.org/2000/svg" |
182 | + xmlns:xlink="http://www.w3.org/1999/xlink" |
183 | + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
184 | + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
185 | + width="16px" |
186 | + height="16px" |
187 | + id="svg3468" |
188 | + version="1.1" |
189 | + inkscape:version="0.48.0 r9654" |
190 | + sodipodi:docname="media-optical-audio.svg"> |
191 | + <defs |
192 | + id="defs3470"> |
193 | + <radialGradient |
194 | + inkscape:collect="always" |
195 | + xlink:href="#linearGradient7067-5" |
196 | + id="radialGradient3328" |
197 | + gradientUnits="userSpaceOnUse" |
198 | + gradientTransform="matrix(0.17229922,-0.03416223,0.00604943,0.18162052,5.8195328,7.0847586)" |
199 | + cx="17.058823" |
200 | + cy="41.058823" |
201 | + fx="14.68769" |
202 | + fy="37.45607" |
203 | + r="5.7384715" /> |
204 | + <linearGradient |
205 | + id="linearGradient7067-5"> |
206 | + <stop |
207 | + id="stop7069-9" |
208 | + style="stop-color:white;stop-opacity:1" |
209 | + offset="0" /> |
210 | + <stop |
211 | + id="stop7071-3" |
212 | + style="stop-color:white;stop-opacity:0" |
213 | + offset="1" /> |
214 | + </linearGradient> |
215 | + <linearGradient |
216 | + inkscape:collect="always" |
217 | + xlink:href="#linearGradient2372-9" |
218 | + id="linearGradient3340" |
219 | + gradientUnits="userSpaceOnUse" |
220 | + gradientTransform="matrix(0.08571781,0,0,0.08522814,7.9176253,-4.3076115)" |
221 | + x1="28.503141" |
222 | + y1="137.53885" |
223 | + x2="26.256771" |
224 | + y2="125.39074" /> |
225 | + <linearGradient |
226 | + id="linearGradient2372-9"> |
227 | + <stop |
228 | + id="stop2374-9" |
229 | + style="stop-color:white;stop-opacity:1" |
230 | + offset="0" /> |
231 | + <stop |
232 | + id="stop2376-4" |
233 | + style="stop-color:white;stop-opacity:0.34482759" |
234 | + offset="1" /> |
235 | + </linearGradient> |
236 | + <radialGradient |
237 | + inkscape:collect="always" |
238 | + xlink:href="#linearGradient3668-5" |
239 | + id="radialGradient3334" |
240 | + gradientUnits="userSpaceOnUse" |
241 | + gradientTransform="matrix(0.20116938,-0.03223979,0.00439091,0.18585691,10.178365,6.1248025)" |
242 | + cx="17.058823" |
243 | + cy="41.058823" |
244 | + fx="14.757765" |
245 | + fy="37.841019" |
246 | + r="5.7384715" /> |
247 | + <linearGradient |
248 | + id="linearGradient3668-5"> |
249 | + <stop |
250 | + id="stop3670-7" |
251 | + style="stop-color:white;stop-opacity:1" |
252 | + offset="0" /> |
253 | + <stop |
254 | + id="stop3672-4" |
255 | + style="stop-color:white;stop-opacity:0" |
256 | + offset="1" /> |
257 | + </linearGradient> |
258 | + <linearGradient |
259 | + inkscape:collect="always" |
260 | + xlink:href="#linearGradient2372-9" |
261 | + id="linearGradient3337" |
262 | + gradientUnits="userSpaceOnUse" |
263 | + gradientTransform="matrix(0.16347277,0,0,0.08545271,11.122671,-4.958012)" |
264 | + x1="28.739122" |
265 | + y1="144.11652" |
266 | + x2="26.256771" |
267 | + y2="125.39074" /> |
268 | + <linearGradient |
269 | + x1="12.2744" |
270 | + y1="32.4165" |
271 | + x2="35.391201" |
272 | + y2="14.2033" |
273 | + id="linearGradient4083" |
274 | + xlink:href="#linearGradient3263" |
275 | + gradientUnits="userSpaceOnUse" |
276 | + gradientTransform="matrix(0,0.4285752,-0.4285752,0,17.900088,-2.2858061)" /> |
277 | + <linearGradient |
278 | + x1="12.2744" |
279 | + y1="32.4165" |
280 | + x2="35.391201" |
281 | + y2="14.2033" |
282 | + id="linearGradient3263" |
283 | + gradientUnits="userSpaceOnUse"> |
284 | + <stop |
285 | + id="stop3265" |
286 | + style="stop-color:#dedbde;stop-opacity:1" |
287 | + offset="0" /> |
288 | + <stop |
289 | + id="stop3267" |
290 | + style="stop-color:#e6e6e6;stop-opacity:1" |
291 | + offset="0.5" /> |
292 | + <stop |
293 | + id="stop3269" |
294 | + style="stop-color:#d2d2d2;stop-opacity:1" |
295 | + offset="1" /> |
296 | + </linearGradient> |
297 | + <linearGradient |
298 | + x1="-21.915663" |
299 | + y1="3" |
300 | + x2="-21.915663" |
301 | + y2="45.032898" |
302 | + id="linearGradient4085" |
303 | + xlink:href="#linearGradient3772" |
304 | + gradientUnits="userSpaceOnUse" |
305 | + gradientTransform="matrix(0.3658536,0,0,0.3658536,17.609167,-0.78048667)" /> |
306 | + <linearGradient |
307 | + id="linearGradient3772"> |
308 | + <stop |
309 | + id="stop3774" |
310 | + style="stop-color:#b4b4b4;stop-opacity:1" |
311 | + offset="0" /> |
312 | + <stop |
313 | + id="stop3776" |
314 | + style="stop-color:#969696;stop-opacity:1" |
315 | + offset="1" /> |
316 | + </linearGradient> |
317 | + <linearGradient |
318 | + x1="20.580074" |
319 | + y1="10.774516" |
320 | + x2="24.27351" |
321 | + y2="9.8622112" |
322 | + id="linearGradient3312" |
323 | + xlink:href="#linearGradient3487" |
324 | + gradientUnits="userSpaceOnUse" |
325 | + spreadMethod="reflect" /> |
326 | + <linearGradient |
327 | + id="linearGradient3487"> |
328 | + <stop |
329 | + id="stop3489" |
330 | + style="stop-color:#e6cde2;stop-opacity:1" |
331 | + offset="0" /> |
332 | + <stop |
333 | + id="stop3491" |
334 | + style="stop-color:#e6cde2;stop-opacity:0" |
335 | + offset="1" /> |
336 | + </linearGradient> |
337 | + <linearGradient |
338 | + x1="17.494959" |
339 | + y1="11.200086" |
340 | + x2="21.047453" |
341 | + y2="9.7956104" |
342 | + id="linearGradient3314" |
343 | + xlink:href="#linearGradient3495" |
344 | + gradientUnits="userSpaceOnUse" |
345 | + spreadMethod="reflect" /> |
346 | + <linearGradient |
347 | + id="linearGradient3495"> |
348 | + <stop |
349 | + id="stop3497" |
350 | + style="stop-color:#c1cbe4;stop-opacity:1" |
351 | + offset="0" /> |
352 | + <stop |
353 | + id="stop3499" |
354 | + style="stop-color:#c1cbe4;stop-opacity:0" |
355 | + offset="1" /> |
356 | + </linearGradient> |
357 | + <linearGradient |
358 | + x1="14.084608" |
359 | + y1="13.045606" |
360 | + x2="16.994024" |
361 | + y2="10.732353" |
362 | + id="linearGradient3316" |
363 | + xlink:href="#linearGradient3503" |
364 | + gradientUnits="userSpaceOnUse" |
365 | + spreadMethod="reflect" /> |
366 | + <linearGradient |
367 | + id="linearGradient3503"> |
368 | + <stop |
369 | + id="stop3505" |
370 | + style="stop-color:#c4ebdd;stop-opacity:1" |
371 | + offset="0" /> |
372 | + <stop |
373 | + id="stop3507" |
374 | + style="stop-color:#c4ebdd;stop-opacity:0" |
375 | + offset="1" /> |
376 | + </linearGradient> |
377 | + <linearGradient |
378 | + x1="12.371647" |
379 | + y1="16.188046" |
380 | + x2="14.609327" |
381 | + y2="13.461712" |
382 | + id="linearGradient3318" |
383 | + xlink:href="#linearGradient3511" |
384 | + gradientUnits="userSpaceOnUse" |
385 | + spreadMethod="reflect" /> |
386 | + <linearGradient |
387 | + id="linearGradient3511"> |
388 | + <stop |
389 | + id="stop3513" |
390 | + style="stop-color:#ebeec7;stop-opacity:1" |
391 | + offset="0" /> |
392 | + <stop |
393 | + id="stop3515" |
394 | + style="stop-color:#ebeec7;stop-opacity:0" |
395 | + offset="1" /> |
396 | + </linearGradient> |
397 | + <linearGradient |
398 | + x1="10.609375" |
399 | + y1="17.886322" |
400 | + x2="9.7297754" |
401 | + y2="20.612656" |
402 | + id="linearGradient3320" |
403 | + xlink:href="#linearGradient3519" |
404 | + gradientUnits="userSpaceOnUse" |
405 | + spreadMethod="reflect" /> |
406 | + <linearGradient |
407 | + id="linearGradient3519"> |
408 | + <stop |
409 | + id="stop3521" |
410 | + style="stop-color:#fcd9cd;stop-opacity:1" |
411 | + offset="0" /> |
412 | + <stop |
413 | + id="stop3523" |
414 | + style="stop-color:#fcd9cd;stop-opacity:0" |
415 | + offset="1" /> |
416 | + </linearGradient> |
417 | + <linearGradient |
418 | + x1="20.580074" |
419 | + y1="10.774516" |
420 | + x2="24.27351" |
421 | + y2="9.8622112" |
422 | + id="linearGradient3301" |
423 | + xlink:href="#linearGradient3487" |
424 | + gradientUnits="userSpaceOnUse" |
425 | + spreadMethod="reflect" /> |
426 | + <linearGradient |
427 | + x1="17.494959" |
428 | + y1="11.200086" |
429 | + x2="21.047453" |
430 | + y2="9.7956104" |
431 | + id="linearGradient3303" |
432 | + xlink:href="#linearGradient3495" |
433 | + gradientUnits="userSpaceOnUse" |
434 | + spreadMethod="reflect" /> |
435 | + <linearGradient |
436 | + x1="14.084608" |
437 | + y1="13.045606" |
438 | + x2="16.994024" |
439 | + y2="10.732353" |
440 | + id="linearGradient3305" |
441 | + xlink:href="#linearGradient3503" |
442 | + gradientUnits="userSpaceOnUse" |
443 | + spreadMethod="reflect" /> |
444 | + <linearGradient |
445 | + x1="12.371647" |
446 | + y1="16.188046" |
447 | + x2="14.609327" |
448 | + y2="13.461712" |
449 | + id="linearGradient3307" |
450 | + xlink:href="#linearGradient3511" |
451 | + gradientUnits="userSpaceOnUse" |
452 | + spreadMethod="reflect" /> |
453 | + <linearGradient |
454 | + x1="10.609375" |
455 | + y1="17.886322" |
456 | + x2="9.7297754" |
457 | + y2="20.612656" |
458 | + id="linearGradient3309" |
459 | + xlink:href="#linearGradient3519" |
460 | + gradientUnits="userSpaceOnUse" |
461 | + spreadMethod="reflect" /> |
462 | + <linearGradient |
463 | + x1="18.775953" |
464 | + y1="4.0378027" |
465 | + x2="18.203465" |
466 | + y2="45.962208" |
467 | + id="linearGradient3054" |
468 | + xlink:href="#linearGradient6036" |
469 | + gradientUnits="userSpaceOnUse" |
470 | + gradientTransform="matrix(0.1767888,0,0,-0.1767887,3.6957217,12.41972)" /> |
471 | + <linearGradient |
472 | + id="linearGradient6036"> |
473 | + <stop |
474 | + id="stop6038" |
475 | + style="stop-color:#ffffff;stop-opacity:1" |
476 | + offset="0" /> |
477 | + <stop |
478 | + id="stop6040" |
479 | + style="stop-color:#ffffff;stop-opacity:0" |
480 | + offset="1" /> |
481 | + </linearGradient> |
482 | + <linearGradient |
483 | + id="linearGradient4011"> |
484 | + <stop |
485 | + id="stop4013" |
486 | + style="stop-color:#ffffff;stop-opacity:1" |
487 | + offset="0" /> |
488 | + <stop |
489 | + id="stop4015" |
490 | + style="stop-color:#ffffff;stop-opacity:0.23529412" |
491 | + offset="0.507761" /> |
492 | + <stop |
493 | + id="stop4017" |
494 | + style="stop-color:#ffffff;stop-opacity:0.15686275" |
495 | + offset="0.83456558" /> |
496 | + <stop |
497 | + id="stop4019" |
498 | + style="stop-color:#ffffff;stop-opacity:0.39215687" |
499 | + offset="1" /> |
500 | + </linearGradient> |
501 | + <linearGradient |
502 | + y2="44.340794" |
503 | + x2="71.204407" |
504 | + y1="6.2375584" |
505 | + x1="71.204407" |
506 | + gradientTransform="matrix(0.35135135,0,0,0.35135138,-17.203666,-0.9093005)" |
507 | + gradientUnits="userSpaceOnUse" |
508 | + id="linearGradient3466" |
509 | + xlink:href="#linearGradient4011" |
510 | + inkscape:collect="always" /> |
511 | + </defs> |
512 | + <sodipodi:namedview |
513 | + id="base" |
514 | + pagecolor="#ffffff" |
515 | + bordercolor="#666666" |
516 | + borderopacity="1.0" |
517 | + inkscape:pageopacity="0.0" |
518 | + inkscape:pageshadow="2" |
519 | + inkscape:zoom="22.197802" |
520 | + inkscape:cx="8" |
521 | + inkscape:cy="8" |
522 | + inkscape:current-layer="layer1" |
523 | + showgrid="true" |
524 | + inkscape:grid-bbox="true" |
525 | + inkscape:document-units="px" |
526 | + inkscape:window-width="447" |
527 | + inkscape:window-height="446" |
528 | + inkscape:window-x="415" |
529 | + inkscape:window-y="167" |
530 | + inkscape:window-maximized="0" /> |
531 | + <metadata |
532 | + id="metadata3473"> |
533 | + <rdf:RDF> |
534 | + <cc:Work |
535 | + rdf:about=""> |
536 | + <dc:format>image/svg+xml</dc:format> |
537 | + <dc:type |
538 | + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
539 | + <dc:title></dc:title> |
540 | + </cc:Work> |
541 | + </rdf:RDF> |
542 | + </metadata> |
543 | + <g |
544 | + id="layer1" |
545 | + inkscape:label="Layer 1" |
546 | + inkscape:groupmode="layer"> |
547 | + <g |
548 | + id="layer1-4"> |
549 | + <path |
550 | + inkscape:connector-curvature="0" |
551 | + d="m 15.5,8.0000004 c 0,-4.1571805 -3.34282,-7.49999949 -7.5000007,-7.49999949 -4.1571809,0 -7.49999939,3.34281929 -7.49999939,7.49999949 C 0.49999911,12.15718 3.8428187,15.5 7.9999993,15.5 12.157179,15.499999 15.5,12.15718 15.5,8.0000004 z m -5,0 C 10.5,9.2939445 9.5060913,10.5 7.9999993,10.5 6.4939073,10.5 5.5,9.1934915 5.5,8.0000004 c 0,-1.2270178 1.0349902,-2.5 2.4999993,-2.5 1.4985143,0 2.5000007,1.2056213 2.5000007,2.5 z" |
552 | + id="path2781" |
553 | + style="fill:url(#linearGradient4083);fill-rule:nonzero;stroke:url(#linearGradient4085);stroke-width:0.99999982;stroke-miterlimit:4;stroke-opacity:1" /> |
554 | + <g |
555 | + transform="matrix(0.3357395,0,0,0.3357395,-0.1714995,-0.39196467)" |
556 | + id="g3527"> |
557 | + <path |
558 | + inkscape:connector-curvature="0" |
559 | + d="M 15.856928,5.7307748 20.625,16.34375 C 21.660403,15.885186 22.795334,15.625 24,15.625 c 0.03206,0 0.06178,-3.6e-4 0.09375,0 L 24.10801,4.0047512 c -2.94215,-0.070687 -5.543041,0.6572865 -8.251083,1.7260236 l 10e-7,0 z" |
560 | + transform="matrix(0.9996011,0.02824295,-0.02824295,0.9996011,0.6924114,-0.6708346)" |
561 | + id="path3296" |
562 | + style="opacity:0.8;fill:url(#linearGradient3312);fill-opacity:1;fill-rule:nonzero;stroke:none" /> |
563 | + <path |
564 | + inkscape:connector-curvature="0" |
565 | + d="m 12.121471,7.9060109 6.931026,9.3601041 c 0.913109,-0.669755 1.965938,-1.167064 3.142629,-1.425169 0.03132,-0.0069 0.06026,-0.01359 0.09157,-0.02009 L 19.857174,4.426276 c -2.888973,0.5613244 -5.31953,1.8556038 -7.735703,3.4797349 l 0,0 z" |
566 | + id="path3308" |
567 | + style="opacity:0.8;fill:url(#linearGradient3314);fill-opacity:1;fill-rule:nonzero;stroke:none" /> |
568 | + <path |
569 | + inkscape:connector-curvature="0" |
570 | + d="m 8.2523933,11.646535 9.2137237,7.155818 c 0.70865,-0.883264 1.596891,-1.636119 2.666685,-2.18998 0.02847,-0.01474 0.05469,-0.02872 0.08325,-0.0431 L 14.86585,6.2506132 C 12.220599,7.5405321 10.165881,9.452393 8.2523933,11.646535 z" |
571 | + id="path3310" |
572 | + style="opacity:0.8;fill:url(#linearGradient3316);fill-opacity:1;fill-rule:nonzero;stroke:none" /> |
573 | + <path |
574 | + inkscape:connector-curvature="0" |
575 | + d="m 5.6328855,16.073974 c 7.1748065,2.242248 7.8502625,7.031463 12.7767855,1.754127 L 10.499985,9.1321388 C 8.2787249,11.062747 6.9132871,13.459349 5.6328855,16.073974 z" |
576 | + id="path3312" |
577 | + style="opacity:0.8;fill:url(#linearGradient3318);fill-opacity:1;fill-rule:nonzero;stroke:none" /> |
578 | + <path |
579 | + inkscape:connector-curvature="0" |
580 | + d="M 7.155289,13.193173 C 5.9722117,14.945185 5.2475768,16.829547 4.6301929,18.837116 L 15.96875,21.8125 C 16.184264,21.049497 16.486796,20.297733 16.9375,19.59375 16.95479,19.56675 16.98246,19.52673 17,19.5 L 7.155289,13.193173 z" |
581 | + id="path3314" |
582 | + style="opacity:0.8;fill:url(#linearGradient3320);fill-opacity:1;fill-rule:nonzero;stroke:none" /> |
583 | + </g> |
584 | + <g |
585 | + transform="matrix(-0.3507965,0,0,-0.3507965,16.408914,16.448702)" |
586 | + id="g3297"> |
587 | + <path |
588 | + inkscape:connector-curvature="0" |
589 | + d="M 15.856928,5.7307748 20.625,16.34375 C 21.660403,15.885186 22.795334,15.625 24,15.625 c 0.03206,0 0.06178,-3.6e-4 0.09375,0 L 24.10801,4.0047512 c -2.94215,-0.070687 -5.543041,0.6572865 -8.251083,1.7260236 l 10e-7,0 z" |
590 | + transform="matrix(0.9996011,0.02824295,-0.02824295,0.9996011,0.6924114,-0.6708346)" |
591 | + id="path3299" |
592 | + style="opacity:0.8;fill:url(#linearGradient3301);fill-opacity:1;fill-rule:nonzero;stroke:none" /> |
593 | + <path |
594 | + inkscape:connector-curvature="0" |
595 | + d="m 12.121471,7.9060109 6.931026,9.3601041 c 0.913109,-0.669755 1.965938,-1.167064 3.142629,-1.425169 0.03132,-0.0069 0.06026,-0.01359 0.09157,-0.02009 L 19.857174,4.426276 c -2.888973,0.5613244 -5.31953,1.8556038 -7.735703,3.4797349 l 0,0 z" |
596 | + id="path3301" |
597 | + style="opacity:0.8;fill:url(#linearGradient3303);fill-opacity:1;fill-rule:nonzero;stroke:none" /> |
598 | + <path |
599 | + inkscape:connector-curvature="0" |
600 | + d="m 8.2523933,11.646535 9.2137237,7.155818 c 0.70865,-0.883264 1.596891,-1.636119 2.666685,-2.18998 0.02847,-0.01474 0.05469,-0.02872 0.08325,-0.0431 L 14.86585,6.2506132 C 12.220599,7.5405321 10.165881,9.452393 8.2523933,11.646535 z" |
601 | + id="path3303" |
602 | + style="opacity:0.8;fill:url(#linearGradient3305);fill-opacity:1;fill-rule:nonzero;stroke:none" /> |
603 | + <path |
604 | + inkscape:connector-curvature="0" |
605 | + d="m 5.6328855,16.073974 c 7.1748065,2.242248 7.8502625,7.031463 12.7767855,1.754127 L 10.499985,9.1321388 C 8.2787249,11.062747 6.9132871,13.459349 5.6328855,16.073974 z" |
606 | + id="path3305" |
607 | + style="opacity:0.8;fill:url(#linearGradient3307);fill-opacity:1;fill-rule:nonzero;stroke:none" /> |
608 | + <path |
609 | + inkscape:connector-curvature="0" |
610 | + d="M 7.155289,13.193173 C 5.9722117,14.945185 5.2475768,16.829547 4.6301929,18.837116 L 15.96875,21.8125 C 16.184264,21.049497 16.486796,20.297733 16.9375,19.59375 16.95479,19.56675 16.98246,19.52673 17,19.5 L 7.155289,13.193173 z" |
611 | + id="path3307" |
612 | + style="opacity:0.8;fill:url(#linearGradient3309);fill-opacity:1;fill-rule:nonzero;stroke:none" /> |
613 | + </g> |
614 | + <path |
615 | + inkscape:connector-curvature="0" |
616 | + d="M 7.9999996,11.5 C 6.0599997,11.5 4.5,9.9400008 4.5,8.000001 4.5,6.0600013 6.0599997,4.5000015 7.9999996,4.5000015 9.9399998,4.5000015 11.5,6.0600013 11.5,8.000001 11.5,9.9400008 9.9399998,11.5 7.9999996,11.5 l 0,0 0,0 0,0 z" |
617 | + id="path3281" |
618 | + style="opacity:0.4;fill:none;stroke:url(#linearGradient3054);stroke-width:0.99999982;stroke-miterlimit:4;stroke-opacity:1" /> |
619 | + <path |
620 | + inkscape:connector-curvature="0" |
621 | + d="M 14.5,7.9997706 C 14.5,11.589738 11.589638,14.5 8.0000825,14.5 4.4102002,14.5 1.5,11.589704 1.5,7.9997706 c 0,-3.5898007 2.9102002,-6.49977 6.5000825,-6.49977 3.5895555,0 6.4999175,2.9099693 6.4999175,6.49977 l 0,0 z" |
622 | + id="path8655" |
623 | + style="opacity:0.55;color:#000000;fill:none;stroke:url(#linearGradient3466);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> |
624 | + </g> |
625 | + <path |
626 | + inkscape:connector-curvature="0" |
627 | + d="M 15.014621,5.506415 C 13.419752,5.7588616 11.387357,5.9855721 9.7937385,6.2444672 9.3599881,6.459916 9.527947,7.0071043 9.5,7.393093 c -3e-7,1.6700032 0,3.340006 0,5.010009 -1.1136559,-0.245674 -1.978553,0.614328 -1.9880749,1.782557 -0.050141,0.750216 0.6811556,1.371844 1.4168459,1.303138 0.9972545,-0.05062 1.678008,-1.006812 1.571229,-2.02782 -10e-7,-1.670184 0,-3.600649 0,-5.2708335 1.315246,-0.1877147 2.684807,-0.3941718 4,-0.5822413 -10e-7,1.2874907 0,2.8352618 0,4.1227528 -1.067149,-0.304301 -2.176088,0.393273 -2.352921,1.508425 -0.147859,0.657173 0.316097,1.317694 0.949833,1.505511 1.186282,0.384896 2.523393,-0.750309 2.383483,-1.964262 -0.0032,-2.277028 0.01,-4.5540619 0,-6.8310825 C 15.452519,5.7229137 15.263681,5.494971 15.014621,5.506415 z" |
628 | + id="path3406" |
629 | + style="fill:#4d4d4d;fill-opacity:1;stroke:#333333;stroke-width:1.00000012;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" |
630 | + sodipodi:nodetypes="ccccccccccccccc" /> |
631 | + <path |
632 | + inkscape:connector-curvature="0" |
633 | + d="m 14.921691,11.92924 0.02179,-4.3530885 c 0.229606,-0.021437 0.03525,-0.00344 0.344866,-0.035557 0.0042,0.8131135 0.0058,1.3607734 0.0058,4.4316845 0,0.02285 -0.133724,-0.01147 -0.372473,-0.04304 l 2e-6,0 z" |
634 | + id="path3996" |
635 | + style="opacity:0.25;fill:url(#linearGradient3337);fill-opacity:1;fill-rule:evenodd;stroke:none" /> |
636 | + <path |
637 | + inkscape:connector-curvature="0" |
638 | + d="m 14.944768,13.011681 c 0,0.580213 -0.516845,1.137525 -1.154405,1.244791 -0.63756,0.107266 -1.154405,-0.276135 -1.154405,-0.856347 0,-0.580213 0.516845,-1.137526 1.154405,-1.244792 0.63756,-0.107265 1.154405,0.276135 1.154405,0.856348 z" |
639 | + id="path2716" |
640 | + style="opacity:0.6;fill:url(#radialGradient3334);fill-opacity:1;stroke:none" /> |
641 | + <path |
642 | + inkscape:connector-curvature="0" |
643 | + d="m 9.8732835,12.574598 0,-5.6854586 c 0,0 0.09148,-0.3687964 0.3724725,-0.3699258 0.02442,0.041852 4.469668,-0.7398515 4.469668,-0.7398515 0,0 0.07318,0.3761083 -1.966354,0.6660794 -2.9029735,0.412731 -2.503314,0.5170323 -2.503314,0.8136236 0,0.8748438 0,2.363452 0,5.5488869 -0.06242,-0.05272 -0.2472855,-0.201869 -0.3724725,-0.233354 z" |
644 | + id="path2720" |
645 | + style="opacity:0.3;fill:url(#linearGradient3340);fill-opacity:1;fill-rule:evenodd;stroke:none" |
646 | + sodipodi:nodetypes="ccccssccc" /> |
647 | + <path |
648 | + inkscape:connector-curvature="0" |
649 | + d="m 9.9958716,13.769247 c 0,0.567226 -0.4426717,1.112062 -0.9887343,1.216927 -0.5460633,0.104865 -0.9887345,-0.269953 -0.9887345,-0.837179 0,-0.567225 0.4426712,-1.112062 0.9887345,-1.216927 0.5460626,-0.104865 0.9887343,0.269953 0.9887343,0.837179 z" |
650 | + id="path2712" |
651 | + style="opacity:0.6;fill:url(#radialGradient3328);fill-opacity:1;stroke:none" /> |
652 | + </g> |
653 | +</svg> |
654 | |
655 | === removed file 'images/icons/16x16/status/audio-volume-high-symbolic.svg' |
656 | --- images/icons/16x16/status/audio-volume-high-symbolic.svg 2011-12-30 01:58:16 +0000 |
657 | +++ images/icons/16x16/status/audio-volume-high-symbolic.svg 1970-01-01 00:00:00 +0000 |
658 | @@ -1,31 +0,0 @@ |
659 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
660 | -<!-- Created with Inkscape (http://www.inkscape.org/) --> |
661 | -<svg id="svg7384" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> |
662 | - <title id="title9167">Gnome Symbolic Icon Theme</title> |
663 | - <metadata id="metadata90"> |
664 | - <rdf:RDF> |
665 | - <cc:Work rdf:about=""> |
666 | - <dc:format>image/svg+xml</dc:format> |
667 | - <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> |
668 | - <dc:title>Gnome Symbolic Icon Theme</dc:title> |
669 | - </cc:Work> |
670 | - </rdf:RDF> |
671 | - </metadata> |
672 | - <defs id="defs7386"> |
673 | - <clipPath id="clipPath6279-3"> |
674 | - <rect id="rect6281-9" style="color:#bebebe;fill:#bebebe" height="6.375" width="3.825" y="220.75" x="26.85"/> |
675 | - </clipPath> |
676 | - <clipPath id="clipPath6265-334"> |
677 | - <rect id="rect6267-61" style="color:#bebebe;fill:#bebebe" height="5.2159" width="2.8977" y="221.33" x="26.966"/> |
678 | - </clipPath> |
679 | - <clipPath id="clipPath6259-5"> |
680 | - <rect id="rect6261-61" style="color:#bebebe;fill:#bebebe" height="4.8735" width="1.8763" y="221.5" x="26.999"/> |
681 | - </clipPath> |
682 | - </defs> |
683 | - <g id="layer9" transform="translate(-41 -197)"> |
684 | - <path id="path3718" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none;fill:#bebebe" d="m26.938 220.41a1.2751 1.2751 0 0 0 -0.65625 2.1875c0.75756 0.75756 0.75756 1.9299 0 2.6875a1.2816 1.2816 0 1 0 1.8125 1.8125c1.732-1.732 1.732-4.5805 0-6.3125a1.2751 1.2751 0 0 0 -1.1562 -0.375z" clip-path="url(#clipPath6279-3)" transform="matrix(.78431 0 0 .78431 26.941 28.863)"/> |
685 | - <path id="path3726" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none;fill:#bebebe" d="m27.125 221.09a0.5796 0.5796 0 0 0 -0.34375 1c1.0233 1.0233 1.0233 2.6642 0 3.6875a0.5796 0.5796 0 1 0 0.8125 0.8125c1.4663-1.4663 1.4663-3.8462 0-5.3125a0.5796 0.5796 0 0 0 -0.46875 -0.1875z" clip-path="url(#clipPath6265-334)" transform="matrix(1.7255 0 0 1.7255 3.4708 -181.9)"/> |
686 | - <path id="path3728" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none;fill:#bebebe" d="m27.062 221.31a0.37504 0.37504 0 0 0 -0.125 0.625c1.1015 1.1015 1.1015 2.8985 0 4a0.37565 0.37565 0 1 0 0.53125 0.53125c1.3881-1.3881 1.3881-3.6744 0-5.0625a0.37504 0.37504 0 0 0 -0.40625 -0.0937z" clip-path="url(#clipPath6259-5)" transform="matrix(2.6667 0 0 2.6667 -20 -392.67)"/> |
687 | - <path id="path5491" style="color:#bebebe;fill:#bebebe" d="m41 202h2.4844l2.9688-3 0.54687 0.0156v11l-0.4753 0.00083-3.04-3.02h-2.4844v-5z"/> |
688 | - </g> |
689 | -</svg> |
690 | |
691 | === added file 'images/icons/16x16/status/non-starred-symbolic.svg' |
692 | --- images/icons/16x16/status/non-starred-symbolic.svg 1970-01-01 00:00:00 +0000 |
693 | +++ images/icons/16x16/status/non-starred-symbolic.svg 2012-01-31 01:07:25 +0000 |
694 | @@ -0,0 +1,70 @@ |
695 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
696 | +<!-- Created with Inkscape (http://www.inkscape.org/) --> |
697 | + |
698 | +<svg |
699 | + xmlns:dc="http://purl.org/dc/elements/1.1/" |
700 | + xmlns:cc="http://creativecommons.org/ns#" |
701 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
702 | + xmlns:svg="http://www.w3.org/2000/svg" |
703 | + xmlns="http://www.w3.org/2000/svg" |
704 | + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
705 | + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
706 | + version="1.1" |
707 | + width="16" |
708 | + height="16" |
709 | + id="svg7384" |
710 | + inkscape:version="0.48.2 r9819" |
711 | + sodipodi:docname="non-starred-symbolic.svg"> |
712 | + <sodipodi:namedview |
713 | + pagecolor="#ffffff" |
714 | + bordercolor="#666666" |
715 | + borderopacity="1" |
716 | + objecttolerance="10" |
717 | + gridtolerance="10" |
718 | + guidetolerance="10" |
719 | + inkscape:pageopacity="0" |
720 | + inkscape:pageshadow="2" |
721 | + inkscape:window-width="1129" |
722 | + inkscape:window-height="664" |
723 | + id="namedview7" |
724 | + showgrid="true" |
725 | + inkscape:zoom="29.375" |
726 | + inkscape:cx="1.9404256" |
727 | + inkscape:cy="8" |
728 | + inkscape:window-x="0" |
729 | + inkscape:window-y="26" |
730 | + inkscape:window-maximized="0" |
731 | + inkscape:current-layer="svg7384" |
732 | + showguides="true" |
733 | + inkscape:guide-bbox="true"> |
734 | + <inkscape:grid |
735 | + type="xygrid" |
736 | + id="grid3025" /> |
737 | + </sodipodi:namedview> |
738 | + <title |
739 | + id="title9167">Gnome Symbolic Icon Theme</title> |
740 | + <defs |
741 | + id="defs11" /> |
742 | + <metadata |
743 | + id="metadata90"> |
744 | + <rdf:RDF> |
745 | + <cc:Work |
746 | + rdf:about=""> |
747 | + <dc:format>image/svg+xml</dc:format> |
748 | + <dc:type |
749 | + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
750 | + <dc:title>Gnome Symbolic Icon Theme</dc:title> |
751 | + </cc:Work> |
752 | + </rdf:RDF> |
753 | + </metadata> |
754 | + <path |
755 | + sodipodi:type="arc" |
756 | + style="color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
757 | + id="path3027" |
758 | + sodipodi:cx="8" |
759 | + sodipodi:cy="8" |
760 | + sodipodi:rx="1.5319149" |
761 | + sodipodi:ry="1.5319149" |
762 | + d="M 9.5319149,8 A 1.5319149,1.5319149 0 1 1 6.4680851,8 1.5319149,1.5319149 0 1 1 9.5319149,8 z" |
763 | + transform="matrix(1.3055555,0,0,1.3055555,-2.444444,-2.444444)" /> |
764 | +</svg> |
765 | |
766 | === added file 'images/icons/16x16/status/starred-symbolic.svg' |
767 | --- images/icons/16x16/status/starred-symbolic.svg 1970-01-01 00:00:00 +0000 |
768 | +++ images/icons/16x16/status/starred-symbolic.svg 2012-01-31 01:07:25 +0000 |
769 | @@ -0,0 +1,34 @@ |
770 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
771 | +<!-- Created with Inkscape (http://www.inkscape.org/) --> |
772 | + |
773 | +<svg |
774 | + xmlns:dc="http://purl.org/dc/elements/1.1/" |
775 | + xmlns:cc="http://creativecommons.org/ns#" |
776 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
777 | + xmlns:svg="http://www.w3.org/2000/svg" |
778 | + xmlns="http://www.w3.org/2000/svg" |
779 | + version="1.1" |
780 | + width="16" |
781 | + height="16" |
782 | + id="svg7384"> |
783 | + <title |
784 | + id="title9167">Gnome Symbolic Icon Theme</title> |
785 | + <defs |
786 | + id="defs11" /> |
787 | + <metadata |
788 | + id="metadata90"> |
789 | + <rdf:RDF> |
790 | + <cc:Work |
791 | + rdf:about=""> |
792 | + <dc:format>image/svg+xml</dc:format> |
793 | + <dc:type |
794 | + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
795 | + <dc:title>Gnome Symbolic Icon Theme</dc:title> |
796 | + </cc:Work> |
797 | + </rdf:RDF> |
798 | + </metadata> |
799 | + <path |
800 | + d="M 7.96875,1 C 7.3575435,1.0990989 7.1304889,1.770894 6.8421505,2.2428721 6.3809449,3.1598603 6.017643,4.1176435 5.5153311,5.0106092 5.0291624,5.2825821 4.3915699,5.2577824 3.8400152,5.3779423 3.066531,5.5163683 2.2779276,5.5751356 1.5235455,5.7975165 0.9267977,6.005526 0.8353545,6.8090819 1.3106319,7.1930703 c 0.6207334,0.8504968 1.4519447,1.5167073 2.1019628,2.328389 0.61245,0.4060827 0.4327151,1.0986887 0.31253,1.7042007 -0.1638765,1.00286 -0.403059,2.005472 -0.4085828,3.024766 0.031918,0.610342 0.7660244,0.940977 1.2610558,0.599969 1.0409092,-0.393598 1.9569489,-1.040628 2.9735473,-1.478759 0.5591475,-0.426642 1.1031916,0.164269 1.6217991,0.37229 0.7520546,0.415344 1.5117309,0.814302 2.2880419,1.177032 0.558015,0.244868 1.264576,-0.250942 1.137888,-0.866843 C 12.574142,12.72886 12.226383,11.435829 12.10962,10.121032 12.337194,9.601525 12.875802,9.2387371 13.253925,8.8078584 13.849712,8.2131103 14.451544,7.6094892 14.916867,6.9080348 15.149211,6.4124494 14.776425,5.7992397 14.236509,5.7493533 13.449492,5.4973688 12.623198,5.4208897 11.8125,5.28125 11.328208,5.1941709 10.45489,5.2462638 10.291367,4.5675274 9.7704237,3.6047931 9.3370261,2.6021655 8.8268353,1.6391087 8.6191976,1.364994 8.3467069,1.005705 7.96875,1 z" |
801 | + id="path3800" |
802 | + style="color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> |
803 | +</svg> |
804 | |
805 | === modified file 'src/BeatBox.vala' |
806 | --- src/BeatBox.vala 2012-01-25 02:40:53 +0000 |
807 | +++ src/BeatBox.vala 2012-01-31 01:07:25 +0000 |
808 | @@ -34,7 +34,8 @@ |
809 | public static LibraryWindow _program; |
810 | public static bool enableStore; |
811 | public static unowned string[] args; |
812 | - |
813 | + |
814 | +/* |
815 | const Gtk.StockItem[] stock_items = { |
816 | { "beatbox", null, 0, 0 }, |
817 | { "library-music", null, 0, 0 }, |
818 | @@ -64,10 +65,10 @@ |
819 | { "multimedia-player", null, 0, 0}, |
820 | { "media-eject", null, 0, 0 }, |
821 | { "process-completed-symbolic", null, 0, 0}, |
822 | - { "process-error-symbolic", null, 0, 0} |
823 | - |
824 | + { "process-error-symbolic", null, 0, 0} |
825 | }; |
826 | - |
827 | +*/ |
828 | + |
829 | static const OptionEntry[] my_options = { |
830 | { "add-to-library", 'a', 0, OptionArg.FILENAME_ARRAY, ref Option.to_add, "Adds the list of files to the BeatBox library", "FILE1 FILE2 ..." }, |
831 | { "play-uri", 'p', 0, OptionArg.STRING, ref Option.to_play, "Plays given uri", "URI" }, |
832 | @@ -94,7 +95,7 @@ |
833 | //BeatBox.clutter_usable = GtkClutter.init(ref args) == Clutter.InitError.SUCCESS; |
834 | |
835 | Notify.init("beatbox"); |
836 | - add_stock_images(); |
837 | + //add_stock_images(); |
838 | |
839 | app = new Beatbox(); |
840 | app.set_application_id("net.launchpad.beatbox"); |
841 | @@ -188,7 +189,8 @@ |
842 | |
843 | _program.set_application(this); |
844 | } |
845 | - |
846 | + |
847 | +/* |
848 | public static void add_stock_images() { |
849 | var iFactory = new Gtk.IconFactory(); |
850 | |
851 | @@ -210,4 +212,5 @@ |
852 | Gtk.Stock.add(stock_items); |
853 | iFactory.add_default(); |
854 | } |
855 | +*/ |
856 | } |
857 | |
858 | === modified file 'src/CMakeLists.txt' |
859 | --- src/CMakeLists.txt 2012-01-24 20:20:58 +0000 |
860 | +++ src/CMakeLists.txt 2012-01-31 01:07:25 +0000 |
861 | @@ -6,7 +6,7 @@ |
862 | |
863 | set(DATADIR "${CMAKE_INSTALL_PREFIX}/share") |
864 | set(PKG_DATADIR "${CMAKE_INSTALL_PREFIX}/share/beatbox") |
865 | -set(ICON_FOLDER "${CMAKE_INSTALL_PREFIX}/share/beatbox/icons") |
866 | +set(ICON_FOLDER "${CMAKE_INSTALL_PREFIX}/share/beatbox/icons/hicolor") |
867 | set(GETTEXT_PACKAGE "beatbox") |
868 | set(RELEASE_NAME "Acolyte") |
869 | set(VERSION "0.3") |
870 | @@ -98,6 +98,7 @@ |
871 | Devices/AndroidDevice.vala |
872 | Devices/CDRomDevice.vala |
873 | Devices/DevicePreferences.vala |
874 | + Icons.vala |
875 | LibraryWindow.vala |
876 | LibraryManager.vala |
877 | Objects/TreeViewSetup.vala |
878 | @@ -112,7 +113,7 @@ |
879 | Objects/MPRIS.vala |
880 | Objects/Playlist.vala |
881 | Objects/PodcastManager.vala |
882 | - Objects/Icons.vala |
883 | + Objects/Icon.vala |
884 | Widgets/TopDisplay.vala |
885 | Widgets/SimilarSongsView.vala |
886 | Widgets/ScrollingLabel.vala |
887 | |
888 | === modified file 'src/Devices/CDRomDevice.vala' |
889 | --- src/Devices/CDRomDevice.vala 2012-01-25 01:37:06 +0000 |
890 | +++ src/Devices/CDRomDevice.vala 2012-01-31 01:07:25 +0000 |
891 | @@ -289,7 +289,7 @@ |
892 | lm.lw.notification.close(); |
893 | lm.lw.notification.update("Import Complete", "BeatBox has finished importing " + (current_list_index + 1).to_string() + " songs from Audio CD", "beatbox"); |
894 | |
895 | - var beatbox_icon = lm.icons.beatbox_icon.render(Gtk.IconSize.DIALOG, null); |
896 | + var beatbox_icon = Icons.BEATBOX_ICON.render(Gtk.IconSize.DIALOG, null); |
897 | lm.lw.notification.set_image_from_pixbuf(beatbox_icon); |
898 | |
899 | lm.lw.notification.show(); |
900 | |
901 | === modified file 'src/Dialogs/AddPodcastWindow.vala' |
902 | --- src/Dialogs/AddPodcastWindow.vala 2012-01-06 16:11:04 +0000 |
903 | +++ src/Dialogs/AddPodcastWindow.vala 2012-01-31 01:07:25 +0000 |
904 | @@ -68,13 +68,13 @@ |
905 | padding = new HBox(false, 10); |
906 | |
907 | /* get pixbufs */ |
908 | - valid = lw.lm.icons.process_completed_icon.render (IconSize.MENU, null); |
909 | - not_valid = lw.lm.icons.process_error_icon.render (IconSize.MENU, null); |
910 | + valid = Icons.PROCESS_COMPLETED_ICON.render (IconSize.MENU); |
911 | + not_valid = Icons.PROCESS_ERROR_ICON.render (IconSize.MENU); |
912 | |
913 | if(valid == null) |
914 | - valid = render_icon(Gtk.Stock.YES, IconSize.MENU, null); |
915 | + valid = Icons.render_icon(Gtk.Stock.YES, IconSize.MENU); |
916 | if(not_valid == null) |
917 | - not_valid = render_icon(Gtk.Stock.NO, IconSize.MENU, null); |
918 | + not_valid = Icons.render_icon(Gtk.Stock.NO, IconSize.MENU); |
919 | |
920 | /* start out by creating all category labels */ |
921 | Label sourceLabel = new Label("Podcast RSS Source"); |
922 | |
923 | === modified file 'src/Dialogs/EqualizerWindow.vala' |
924 | --- src/Dialogs/EqualizerWindow.vala 2012-01-14 04:53:53 +0000 |
925 | +++ src/Dialogs/EqualizerWindow.vala 2012-01-31 01:07:25 +0000 |
926 | @@ -26,7 +26,7 @@ |
927 | |
928 | LibraryManager lm; |
929 | LibraryWindow lw; |
930 | - |
931 | + |
932 | private Switch eq_switch; |
933 | private PresetList preset_combo; |
934 | private Entry new_preset_entry; |
935 | @@ -44,29 +44,29 @@ |
936 | |
937 | private List<VScale> scale_list; |
938 | private List<Label> label_list; |
939 | - |
940 | + |
941 | private bool in_transition; |
942 | private Gee.ArrayList<int> target_levels; |
943 | - |
944 | + |
945 | private string new_preset_name; |
946 | |
947 | public EqualizerWindow (LibraryManager lm, LibraryWindow lw) { |
948 | - |
949 | + |
950 | this.lm = lm; |
951 | this.lw = lw; |
952 | - |
953 | + |
954 | scale_list = new List<VScale>(); |
955 | label_list = new List<Label>(); |
956 | target_levels = new Gee.ArrayList<int>(); |
957 | - |
958 | + |
959 | closing = false; |
960 | adding_preset = false; |
961 | initialized = false; |
962 | apply_changes = false; |
963 | - |
964 | + |
965 | build_ui(); |
966 | load_presets(); |
967 | - |
968 | + |
969 | initialized = true; |
970 | |
971 | if (lm.settings.getAutoSwitchPreset ()) { |
972 | @@ -80,10 +80,10 @@ |
973 | on_eq_switch_toggled (); |
974 | apply_changes = true; |
975 | } |
976 | - |
977 | + |
978 | void build_ui () { |
979 | set_title("Equalizer"); |
980 | - |
981 | + |
982 | window_position = WindowPosition.CENTER; |
983 | type_hint = Gdk.WindowTypeHint.DIALOG; |
984 | set_transient_for(lw); |
985 | @@ -92,17 +92,17 @@ |
986 | set_deletable(false); |
987 | |
988 | set_icon(render_icon(Gtk.Stock.PREFERENCES, IconSize.DIALOG, null)); |
989 | - |
990 | + |
991 | var outer_box = new HBox(false, 10); |
992 | var inner_box = new VBox(false, 0); |
993 | var scales = new HBox(false, 0); |
994 | - |
995 | + |
996 | bottom_toolbar = new Toolbar(); |
997 | eq_switch = new Switch(); |
998 | preset_combo = new PresetList(lm, lw); |
999 | - |
1000 | + |
1001 | eq_switch.set_active(lm.settings.getEqualizerEnabled()); |
1002 | - |
1003 | + |
1004 | string[] decibels = {"32", "64", "125", "250", "500", "1k", "2k", "4k", "8k", "16k"}; |
1005 | |
1006 | for (int index = 0; index < 10; ++index) { |
1007 | @@ -113,14 +113,14 @@ |
1008 | v.inverted = true; |
1009 | |
1010 | var label = new Label(decibels[index]); |
1011 | - |
1012 | + |
1013 | holder.pack_start(v, true, true, 0); |
1014 | holder.pack_end(wrap_alignment(label, 4, 0, 0, 0), false, false, 0); |
1015 | - |
1016 | + |
1017 | scales.pack_start(holder, true, true, 6); |
1018 | scale_list.append(v); |
1019 | label_list.append(label); |
1020 | - |
1021 | + |
1022 | v.value_changed.connect( () => { |
1023 | if(apply_changes && initialized && !preset_combo.automatic_chosen) { |
1024 | lm.player.setEqualizerGain(scale_list.index(v), (int)scale_list.nth_data(scale_list.index(v)).get_value()); |
1025 | @@ -146,9 +146,10 @@ |
1026 | |
1027 | new_preset_entry = new Entry(); |
1028 | new_preset_entry.set_size_request(165, -1); |
1029 | - var ok_icon = lm.icons.ok_icon.render(IconSize.MENU, null); |
1030 | - new_preset_entry.set_icon_from_pixbuf(Gtk.EntryIconPosition.SECONDARY, ok_icon); |
1031 | - new_preset_entry.set_icon_tooltip_text(Gtk.EntryIconPosition.SECONDARY, "Save this preset"); |
1032 | + |
1033 | + var entry_icon = Icons.render_icon ("dialog-apply", IconSize.MENU); |
1034 | + new_preset_entry.set_icon_from_pixbuf(Gtk.EntryIconPosition.SECONDARY, entry_icon); |
1035 | + new_preset_entry.set_icon_tooltip_text(Gtk.EntryIconPosition.SECONDARY, "Save preset"); |
1036 | |
1037 | new_preset_field = new ToolItem(); |
1038 | new_preset_field.add(new_preset_entry); |
1039 | @@ -170,12 +171,12 @@ |
1040 | // Set the egtk bottom toolbar style. |
1041 | bottom_toolbar.get_style_context().add_class("bottom-toolbar"); |
1042 | |
1043 | - inner_box.pack_end(wrap_alignment(bottom_toolbar, 0, 0, 0, 0), false, false, 0); |
1044 | + inner_box.pack_end(wrap_alignment(bottom_toolbar, 0, 0, 0, 0), false, false, 0); |
1045 | inner_box.pack_start(wrap_alignment(scales, 0, 12, 0, 12), true, true, 10); |
1046 | - |
1047 | + |
1048 | outer_box.pack_start(inner_box); |
1049 | add(outer_box); |
1050 | - |
1051 | + |
1052 | eq_switch.notify["active"].connect(on_eq_switch_toggled); |
1053 | preset_combo.automatic_preset_chosen.connect(on_automatic_chosen); |
1054 | preset_combo.add_preset_chosen.connect(add_preset_clicked); |
1055 | @@ -187,35 +188,35 @@ |
1056 | |
1057 | close_button.clicked.connect(on_quit); |
1058 | destroy.connect(on_quit); |
1059 | - |
1060 | + |
1061 | show_all(); |
1062 | } |
1063 | - |
1064 | + |
1065 | bool on_entry_focus_out () { |
1066 | if (!closing) |
1067 | new_preset_entry.grab_focus(); |
1068 | return false; |
1069 | } |
1070 | - |
1071 | + |
1072 | static Gtk.Alignment wrap_alignment (Gtk.Widget widget, int top, int right, int bottom, int left) { |
1073 | - |
1074 | + |
1075 | var alignment = new Gtk.Alignment(0.0f, 0.0f, 1.0f, 1.0f); |
1076 | alignment.top_padding = top; |
1077 | alignment.right_padding = right; |
1078 | alignment.bottom_padding = bottom; |
1079 | alignment.left_padding = left; |
1080 | - |
1081 | + |
1082 | alignment.add(widget); |
1083 | return alignment; |
1084 | } |
1085 | - |
1086 | + |
1087 | void set_sliders_sensitivity (bool sensitivity) { |
1088 | foreach (var scale in scale_list) { |
1089 | label_list.nth_data(scale_list.index(scale)).sensitive = sensitivity; |
1090 | scale.sensitive = sensitivity; |
1091 | - } |
1092 | + } |
1093 | } |
1094 | - |
1095 | + |
1096 | void on_eq_switch_toggled () { |
1097 | in_transition = false; |
1098 | |
1099 | @@ -242,7 +243,7 @@ |
1100 | lm.player.setEqualizerGain(i, 0); |
1101 | } |
1102 | } |
1103 | - |
1104 | + |
1105 | void load_presets () { |
1106 | var default_presets = lm.settings.getDefaultPresets(); |
1107 | var custom_presets = lm.settings.getCustomPresets(); |
1108 | @@ -254,7 +255,7 @@ |
1109 | preset.is_default = true; |
1110 | preset_combo.addPreset(preset); |
1111 | } |
1112 | - |
1113 | + |
1114 | foreach (EqualizerPreset preset in custom_presets) |
1115 | preset_combo.addPreset(preset); |
1116 | |
1117 | @@ -286,7 +287,7 @@ |
1118 | |
1119 | set_sliders_sensitivity (true); |
1120 | target_levels.clear(); |
1121 | - |
1122 | + |
1123 | foreach (int i in p.gains) { |
1124 | target_levels.add(i); |
1125 | } |
1126 | @@ -299,25 +300,25 @@ |
1127 | Timeout.add(ANIMATION_TIMEOUT, transition_scales); |
1128 | } |
1129 | } |
1130 | - |
1131 | + |
1132 | void set_target_levels () { |
1133 | in_transition = false; |
1134 | |
1135 | for (int index = 0; index < 10; ++index) |
1136 | scale_list.nth_data(index).set_value(target_levels.get(index)); |
1137 | } |
1138 | - |
1139 | + |
1140 | bool transition_scales () { |
1141 | if (!in_transition) |
1142 | return false; |
1143 | |
1144 | bool is_finished = true; |
1145 | - |
1146 | + |
1147 | for (int index = 0; index < 10; ++index) { |
1148 | double currLvl = scale_list.nth_data(index).get_value(); |
1149 | double targetLvl = target_levels.get(index); |
1150 | double difference = targetLvl - currLvl; |
1151 | - |
1152 | + |
1153 | if (closing || Math.fabs(difference) <= 1) { |
1154 | scale_list.nth_data(index).set_value(targetLvl); |
1155 | // if switching from the automatic mode, apply the changes correctly |
1156 | @@ -329,7 +330,7 @@ |
1157 | is_finished = false; |
1158 | } |
1159 | } |
1160 | - |
1161 | + |
1162 | if (is_finished) { |
1163 | in_transition = false; |
1164 | return false; // stop |
1165 | @@ -337,7 +338,7 @@ |
1166 | |
1167 | return true; // keep going |
1168 | } |
1169 | - |
1170 | + |
1171 | void on_automatic_chosen () { |
1172 | lm.settings.setAutoSwitchPreset (preset_combo.automatic_chosen); |
1173 | |
1174 | @@ -420,14 +421,14 @@ |
1175 | |
1176 | int i = 0; |
1177 | bool is_valid = false; |
1178 | - |
1179 | + |
1180 | string current_preset_name = (from_current)? preset_combo.getSelectedPreset().name : ""; |
1181 | string preset_name = "Custom Preset"; |
1182 | |
1183 | do |
1184 | { |
1185 | preset_name = (from_current)? current_preset_name + " (" : ""; |
1186 | - preset_name += "Custom" + ((from_current)? "" : " Preset"); |
1187 | + preset_name += "Custom" + ((from_current)? "" : " Preset"); |
1188 | preset_name += (!is_valid && i > 0)? " " + i.to_string() : ""; |
1189 | preset_name += (from_current)? ")" : ""; |
1190 | |
1191 | @@ -451,8 +452,8 @@ |
1192 | |
1193 | unichar c; |
1194 | for (int i = 0; preset_name.get_next_char (ref i, out c);) |
1195 | - if (c.isspace()) |
1196 | - ++white_space; |
1197 | + if (c.isspace()) |
1198 | + ++white_space; |
1199 | |
1200 | if (white_space == str_length) |
1201 | return false; |
1202 | @@ -467,7 +468,7 @@ |
1203 | break; |
1204 | } |
1205 | } |
1206 | - |
1207 | + |
1208 | return !preset_already_exists; |
1209 | } |
1210 | |
1211 | @@ -477,17 +478,17 @@ |
1212 | pnw.preset_saved.connect(preset_name_window_saved); |
1213 | pnw.action_canceled.connect(select_last_used_preset); |
1214 | } |
1215 | - |
1216 | + |
1217 | void select_last_used_preset () { |
1218 | |
1219 | var last_preset = preset_combo.last_selected_preset; |
1220 | - |
1221 | + |
1222 | if(!lm.settings.getAutoSwitchPreset () && last_preset != null) |
1223 | preset_combo.selectPreset(last_preset.name); |
1224 | else |
1225 | preset_combo.selectAutomaticPreset(); |
1226 | } |
1227 | - |
1228 | + |
1229 | void preset_name_window_saved (EqualizerPreset p) { |
1230 | preset_combo.addPreset(p); |
1231 | } |
1232 | |
1233 | === modified file 'src/Dialogs/SetMusicFolderConfirmation.vala' |
1234 | --- src/Dialogs/SetMusicFolderConfirmation.vala 2012-01-25 02:40:53 +0000 |
1235 | +++ src/Dialogs/SetMusicFolderConfirmation.vala 2012-01-31 01:07:25 +0000 |
1236 | @@ -121,8 +121,8 @@ |
1237 | is_working.hide(); |
1238 | is_finished.show(); |
1239 | |
1240 | - var process_completed_icon = lm.icons.process_completed_icon.render (IconSize.MENU, null); |
1241 | - var process_error_icon = lm.icons.process_error_icon.render (IconSize.MENU, null); |
1242 | + var process_completed_icon = Icons.PROCESS_COMPLETED_ICON.render (IconSize.MENU); |
1243 | + var process_error_icon = Icons.PROCESS_ERROR_ICON.render (IconSize.MENU); |
1244 | |
1245 | is_finished.set_from_pixbuf(success ? process_completed_icon : process_error_icon); |
1246 | } |
1247 | |
1248 | === modified file 'src/GStreamer/Streamer.vala' |
1249 | --- src/GStreamer/Streamer.vala 2012-01-28 00:17:25 +0000 |
1250 | +++ src/GStreamer/Streamer.vala 2012-01-31 01:07:25 +0000 |
1251 | @@ -175,9 +175,7 @@ |
1252 | if(pipe.videoStreamCount() > 0) { |
1253 | if(lw.viewSelector.get_children().length() != 4) { |
1254 | //stdout.printf("turning on video\n"); |
1255 | - var viewSelectorStyle = lw.viewSelector.get_style_context (); |
1256 | - var view_video_icon = lm.icons.view_video_icon.render (Gtk.IconSize.MENU, viewSelectorStyle); |
1257 | - lw.viewSelector.append(new Gtk.Image.from_pixbuf(view_video_icon)); |
1258 | + lw.viewSelector.append(Icons.VIEW_VIDEO_ICON.render_image (Gtk.IconSize.MENU)); |
1259 | lw.viewSelector.selected = 3; |
1260 | } |
1261 | } |
1262 | |
1263 | === added file 'src/Icons.vala' |
1264 | --- src/Icons.vala 1970-01-01 00:00:00 +0000 |
1265 | +++ src/Icons.vala 2012-01-31 01:07:25 +0000 |
1266 | @@ -0,0 +1,203 @@ |
1267 | +/*- |
1268 | + * Copyright (c) 2011 Scott Ringwelski <sgringwe@mtu.edu> |
1269 | + * |
1270 | + * Originally Written by Scott Ringwelski and Victor Eduardo for |
1271 | + * BeatBox Music Player: http://www.launchpad.net/beat-box |
1272 | + * |
1273 | + * This library is free software; you can redistribute it and/or |
1274 | + * modify it under the terms of the GNU Library General Public |
1275 | + * License as published by the Free Software Foundation; either |
1276 | + * version 2 of the License, or (at your option) any later version. |
1277 | + * |
1278 | + * This library is distributed in the hope that it will be useful, |
1279 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1280 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1281 | + * Library General Public License for more details. |
1282 | + * |
1283 | + * You should have received a copy of the GNU Library General Public |
1284 | + * License along with this library; if not, write to the |
1285 | + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
1286 | + * Boston, MA 02111-1307, USA. |
1287 | + */ |
1288 | + |
1289 | +/** |
1290 | + * Here we store the icon information, Gdk.Pixbuf-related functions and even |
1291 | + * preloaded pixbufs. |
1292 | + */ |
1293 | + |
1294 | +namespace Icons { |
1295 | + |
1296 | + public enum Type { |
1297 | + MIMETYPE, |
1298 | + ACTION, |
1299 | + STATUS, |
1300 | + APP |
1301 | + } |
1302 | + |
1303 | + public enum FileType { |
1304 | + SVG, |
1305 | + PNG |
1306 | + } |
1307 | + |
1308 | + public const string MIMETYPES_FOLDER = "mimetypes"; |
1309 | + public const string ACTIONS_FOLDER = "actions"; |
1310 | + public const string STATUS_FOLDER = "status"; |
1311 | + public const string APPS_FOLDER = "apps"; |
1312 | + |
1313 | + public const string PNG_EXT = ".png"; |
1314 | + public const string SVG_EXT = ".svg"; |
1315 | + |
1316 | + /** |
1317 | + * Size of the cover art used in the album view |
1318 | + **/ |
1319 | + public const int ALBUM_VIEW_IMAGE_SIZE = 128; |
1320 | + |
1321 | + /** |
1322 | + * ICON INFORMATION |
1323 | + * Use render() or render_image() to load these icons |
1324 | + **/ |
1325 | + |
1326 | + // 128 x 128 |
1327 | + public BeatBox.Icon DEFAULT_ALBUM_ART; |
1328 | + public BeatBox.Icon DROP_ALBUM; |
1329 | + public BeatBox.Icon MUSIC_FOLDER; |
1330 | + |
1331 | + // 22 x 22 |
1332 | + public BeatBox.Icon HISTORY_ICON; |
1333 | + |
1334 | + // 16 x 16 |
1335 | + public BeatBox.Icon BEATBOX_ICON; |
1336 | + public BeatBox.Icon RADIO_ICON; |
1337 | + public BeatBox.Icon MUSIC_ICON; |
1338 | + public BeatBox.Icon PODCAST_ICON; |
1339 | + public BeatBox.Icon AUDIOBOOK_ICON; |
1340 | + public BeatBox.Icon AUDIO_CD_ICON; |
1341 | + public BeatBox.Icon PLAYLIST_ICON; |
1342 | + public BeatBox.Icon SMART_PLAYLIST_ICON; |
1343 | + public BeatBox.Icon LASTFM_LOVE_ICON; |
1344 | + public BeatBox.Icon LASTFM_BAN_ICON; |
1345 | + public BeatBox.Icon STARRED_ICON; |
1346 | + public BeatBox.Icon NOT_STARRED_ICON; |
1347 | + public BeatBox.Icon INFO_ICON; |
1348 | + public BeatBox.Icon NEW_PODCAST_ICON; |
1349 | + |
1350 | + // SYMBOLIC ICONS |
1351 | + public BeatBox.Icon MEDIA_PLAY_SYMBOLIC; |
1352 | + public BeatBox.Icon MEDIA_PAUSE_SYMBOLIC; |
1353 | + public BeatBox.Icon STARRED_SYMBOLIC_ICON; |
1354 | + public BeatBox.Icon NOT_STARRED_SYMBOLIC_ICON; |
1355 | + public BeatBox.Icon PROCESS_COMPLETED_ICON; |
1356 | + public BeatBox.Icon PROCESS_ERROR_ICON; |
1357 | + public BeatBox.Icon PROCESS_STOP_ICON; |
1358 | + public BeatBox.Icon SHUFFLE_ON_ICON; |
1359 | + public BeatBox.Icon SHUFFLE_OFF_ICON; |
1360 | + public BeatBox.Icon REPEAT_ON_ICON; |
1361 | + public BeatBox.Icon REPEAT_ONCE_ICON; |
1362 | + public BeatBox.Icon REPEAT_OFF_ICON; |
1363 | + public BeatBox.Icon VIEW_COLUMN_ICON; |
1364 | + public BeatBox.Icon VIEW_DETAILS_ICON; |
1365 | + public BeatBox.Icon VIEW_ICONS_ICON; |
1366 | + public BeatBox.Icon VIEW_VIDEO_ICON; |
1367 | + |
1368 | + /** |
1369 | + * RENDERED ICONS. |
1370 | + * These are pre-rendered pixbufs. Any static image which otherwise would need |
1371 | + * to be rendered many times should be a preloaded pixbuf. They are loaded |
1372 | + * in the load() function. |
1373 | + */ |
1374 | + public Gdk.Pixbuf DROP_ALBUM_PIXBUF; |
1375 | + public Gdk.Pixbuf DEFAULT_ALBUM_ART_PIXBUF; |
1376 | + public Gdk.Pixbuf BEATBOX_DIALOG_PIXBUF; // Used in the notifications from LibraryWindow.vala |
1377 | + |
1378 | + /** |
1379 | + * These methods are useful for rendering non-loaded icons (Stock icons, etc.) |
1380 | + **/ |
1381 | + public Gdk.Pixbuf? render_icon (string icon_name, Gtk.IconSize size, Gtk.StyleContext? context = null) { |
1382 | + var icon = new BeatBox.Icon (icon_name, null, null, null, false); |
1383 | + return icon.render (size, context); |
1384 | + } |
1385 | + |
1386 | + public Gtk.Image? render_image (string icon_name, Gtk.IconSize size) { |
1387 | + var icon = new BeatBox.Icon (icon_name, null, null, null, false); |
1388 | + return icon.render_image (size); |
1389 | + } |
1390 | + |
1391 | + /** |
1392 | + * @param surface_size the size of the new pixbuf. Set a value of 0 to use the pixbuf's natural size. |
1393 | + **/ |
1394 | + public Gdk.Pixbuf get_pixbuf_shadow (Gdk.Pixbuf pixbuf, int surface_size = ALBUM_VIEW_IMAGE_SIZE, |
1395 | + int shadow_size = 5, double alpha = 0.8) { |
1396 | + int S_WIDTH = (surface_size > 0)? surface_size : pixbuf.width; |
1397 | + int S_HEIGHT = (surface_size > 0)? surface_size : pixbuf.height; |
1398 | + |
1399 | + var buffer_surface = new Granite.Drawing.BufferSurface(S_WIDTH, S_HEIGHT); |
1400 | + |
1401 | + S_WIDTH -= 2 * shadow_size; |
1402 | + S_HEIGHT -= 2 * shadow_size; |
1403 | + |
1404 | + buffer_surface.context.rectangle (shadow_size, shadow_size, S_WIDTH, S_HEIGHT); |
1405 | + buffer_surface.context.set_source_rgba (0, 0, 0, alpha); |
1406 | + buffer_surface.context.fill(); |
1407 | + buffer_surface.fast_blur(2, 3); |
1408 | + Gdk.cairo_set_source_pixbuf(buffer_surface.context, pixbuf.scale_simple (S_WIDTH, S_HEIGHT, Gdk.InterpType.BILINEAR), shadow_size, shadow_size); |
1409 | + buffer_surface.context.paint(); |
1410 | + |
1411 | + return buffer_surface.load_to_pixbuf(); |
1412 | + } |
1413 | + |
1414 | + /** |
1415 | + * Loads icon information and renders [preloaded] pixbufs |
1416 | + **/ |
1417 | + public void load () { |
1418 | + |
1419 | + // 128 x 128 |
1420 | + DEFAULT_ALBUM_ART = new BeatBox.Icon ("media-audio", 128, Type.MIMETYPE, FileType.PNG, true); |
1421 | + DROP_ALBUM = new BeatBox.Icon ("drop-album", 128, Type.MIMETYPE, null, true); |
1422 | + MUSIC_FOLDER = new BeatBox.Icon ("folder-music", 128, Type.MIMETYPE, null, true); |
1423 | + |
1424 | + HISTORY_ICON = new BeatBox.Icon ("document-open-recent", 22, Type.ACTION, null, true); |
1425 | + |
1426 | + // 16 x 16 |
1427 | + BEATBOX_ICON = new BeatBox.Icon ("beatbox", 16, Type.APP, null, true); |
1428 | + RADIO_ICON = new BeatBox.Icon ("internet-radio", 16, Type.MIMETYPE, null, true); |
1429 | + MUSIC_ICON = new BeatBox.Icon ("library-music", 16, Type.MIMETYPE, null, true); |
1430 | + PODCAST_ICON = new BeatBox.Icon ("library-podcast", 16, Type.MIMETYPE, null, true); |
1431 | + AUDIOBOOK_ICON = new BeatBox.Icon ("library-audiobook", 16, Type.MIMETYPE, null, true); |
1432 | + AUDIO_CD_ICON = new BeatBox.Icon ("media-cdrom-audio", 16, Type.MIMETYPE, null, true); |
1433 | + PLAYLIST_ICON = new BeatBox.Icon ("playlist", 16, Type.MIMETYPE, null, true); |
1434 | + SMART_PLAYLIST_ICON = new BeatBox.Icon ("playlist-automatic", 16, Type.MIMETYPE, null, true); |
1435 | + LASTFM_LOVE_ICON = new BeatBox.Icon ("lastfm-love", 16, Type.ACTION, null, true); |
1436 | + LASTFM_BAN_ICON = new BeatBox.Icon ("lastfm-ban", 16, Type.ACTION, null, true); |
1437 | + STARRED_ICON = new BeatBox.Icon ("starred", 16, Type.STATUS, null, true); |
1438 | + NOT_STARRED_ICON = new BeatBox.Icon ("not-starred", 16, Type.STATUS, null, true); |
1439 | + INFO_ICON = new BeatBox.Icon ("help-info", 16, Type.STATUS, null, true); |
1440 | + NEW_PODCAST_ICON = new BeatBox.Icon ("podcast-new", 16, Type.STATUS, null, true); |
1441 | + |
1442 | + // SYMBOLIC ICONS |
1443 | + |
1444 | + MEDIA_PLAY_SYMBOLIC = new BeatBox.Icon ("media-playback-start-symbolic", 16, Type.ACTION, null, true); |
1445 | + MEDIA_PAUSE_SYMBOLIC = new BeatBox.Icon ("media-playback-pause-symbolic", 16, Type.ACTION, null, true); |
1446 | + |
1447 | + STARRED_SYMBOLIC_ICON = new BeatBox.Icon ("starred-symbolic", 16, Type.STATUS, null, true); |
1448 | + NOT_STARRED_SYMBOLIC_ICON = new BeatBox.Icon ("non-starred-symbolic", 16, Type.STATUS, null, true); |
1449 | + PROCESS_COMPLETED_ICON = new BeatBox.Icon ("process-completed-symbolic", 16, Type.STATUS, null, true); |
1450 | + PROCESS_ERROR_ICON = new BeatBox.Icon ("process-error-symbolic", 16, Type.STATUS, null, true); |
1451 | + PROCESS_STOP_ICON = new BeatBox.Icon ("process-stop-symbolic", 16, Type.ACTION, null, true); |
1452 | + SHUFFLE_ON_ICON = new BeatBox.Icon ("media-playlist-shuffle-symbolic", 16, Type.STATUS, null, true); |
1453 | + SHUFFLE_OFF_ICON = new BeatBox.Icon ("media-playlist-no-shuffle-symbolic", 16, Type.STATUS, null, true); |
1454 | + REPEAT_ON_ICON = new BeatBox.Icon ("media-playlist-repeat-symbolic", 16, Type.STATUS, null, true); |
1455 | + REPEAT_ONCE_ICON = new BeatBox.Icon ("media-playlist-repeat-one-symbolic", 16, Type.STATUS, null, true); |
1456 | + REPEAT_OFF_ICON = new BeatBox.Icon ("media-playlist-no-repeat-symbolic", 16, Type.STATUS, null, true); |
1457 | + VIEW_COLUMN_ICON = new BeatBox.Icon ("view-list-column-symbolic", 16, Type.ACTION, null, true); |
1458 | + VIEW_DETAILS_ICON =new BeatBox.Icon ("view-list-details-symbolic", 16, Type.ACTION, null, true); |
1459 | + VIEW_ICONS_ICON = new BeatBox.Icon ("view-list-icons-symbolic", 16, Type.ACTION, null, true); |
1460 | + VIEW_VIDEO_ICON = new BeatBox.Icon ("view-list-video-symbolic", 16, Type.ACTION, null, true); |
1461 | + |
1462 | + /* Render Pixbufs */ |
1463 | + DROP_ALBUM_PIXBUF = DROP_ALBUM.render (null, null, 250); |
1464 | + DEFAULT_ALBUM_ART_PIXBUF = DEFAULT_ALBUM_ART.render (null, null, 150); |
1465 | + |
1466 | + BEATBOX_DIALOG_PIXBUF = BEATBOX_ICON.render (Gtk.IconSize.DIALOG); |
1467 | + } |
1468 | +} |
1469 | + |
1470 | |
1471 | === modified file 'src/LibraryManager.vala' |
1472 | --- src/LibraryManager.vala 2012-01-28 19:50:35 +0000 |
1473 | +++ src/LibraryManager.vala 2012-01-31 01:07:25 +0000 |
1474 | @@ -36,7 +36,6 @@ |
1475 | public BeatBox.Streamer player; |
1476 | public BeatBox.DeviceManager dm; |
1477 | public BeatBox.PodcastManager pm; |
1478 | - public BeatBox.Icons icons; |
1479 | |
1480 | private HashMap<int, SmartPlaylist> _smart_playlists; // rowid, smart playlist |
1481 | public HashMap<int, Playlist> _playlists; // rowid, playlist of all playlists |
1482 | @@ -57,7 +56,6 @@ |
1483 | private LinkedList<int> _already_played; // Media of already played |
1484 | private HashMap<string, Gdk.Pixbuf> _album_art; // All album art |
1485 | private HashMap<string, Gdk.Pixbuf> _cover_album_art; // All album art |
1486 | - const int shadow_size = 5; |
1487 | |
1488 | public LastFM.Core lfm; |
1489 | private HashMap<string, LastFM.ArtistInfo> _artists;//key:artist |
1490 | @@ -153,9 +151,6 @@ |
1491 | _album_art = new HashMap<string, Gdk.Pixbuf>(); |
1492 | _cover_album_art = new HashMap<string, Gdk.Pixbuf>(); |
1493 | |
1494 | - icons = new Icons(this, lw); |
1495 | - icons.load_icons(); |
1496 | - |
1497 | lfm = new LastFM.Core(this); |
1498 | _artists = new HashMap<string, LastFM.ArtistInfo>(); |
1499 | _albums = new HashMap<string, LastFM.AlbumInfo>(); |
1500 | @@ -286,20 +281,6 @@ |
1501 | } |
1502 | } |
1503 | |
1504 | - public Gdk.Pixbuf get_cover_shadow(Gdk.Pixbuf pixbuf) { |
1505 | - var buffer_surface = new Granite.Drawing.BufferSurface(128, 128); |
1506 | - |
1507 | - buffer_surface.context.rectangle(shadow_size, shadow_size, 128 - 2*shadow_size, 128-2*shadow_size); |
1508 | - buffer_surface.context.set_source_rgba(0,0,0,0.8); |
1509 | - buffer_surface.context.fill(); |
1510 | - buffer_surface.fast_blur(2, 3); |
1511 | - Gdk.cairo_set_source_pixbuf(buffer_surface.context, pixbuf.scale_simple(128-2*shadow_size, 128-2*shadow_size, Gdk.InterpType.BILINEAR), shadow_size, shadow_size); |
1512 | - buffer_surface.context.paint(); |
1513 | - var pix = buffer_surface.load_to_pixbuf(); |
1514 | - |
1515 | - return pix; |
1516 | - } |
1517 | - |
1518 | /************ Library/Collection management stuff ************/ |
1519 | public virtual void dbProgress(string? message, double progress) { |
1520 | progress_notification(message, progress); |
1521 | @@ -1365,7 +1346,7 @@ |
1522 | |
1523 | // check that the file exists |
1524 | if((settings.getMusicFolder() != "" && File.new_for_uri(m.uri).get_path().has_prefix(settings.getMusicFolder()) && !GLib.File.new_for_uri(m.uri).query_exists())) { |
1525 | - m.unique_status_image = icons.process_error_icon.render(IconSize.MENU, ((ViewWrapper)lw.sideTree.getWidget(lw.sideTree.library_music_iter)).list.get_style_context()); |
1526 | + m.unique_status_image = Icons.PROCESS_ERROR_ICON.render(IconSize.MENU, ((ViewWrapper)lw.sideTree.getWidget(lw.sideTree.library_music_iter)).list.get_style_context()); |
1527 | m.location_unknown = true; |
1528 | lw.media_not_found(id); |
1529 | stopPlayback(); |
1530 | @@ -1653,7 +1634,7 @@ |
1531 | _album_art.set(s.artist+s.album, pix); |
1532 | |
1533 | if(!_cover_album_art.has_key(s.artist + s.album)) |
1534 | - _cover_album_art.set(s.artist+s.album, get_cover_shadow(pix)); |
1535 | + _cover_album_art.set(s.artist+s.album, Icons.get_pixbuf_shadow(pix)); |
1536 | } |
1537 | |
1538 | previousAlbum = s.album; |
1539 | @@ -1721,11 +1702,11 @@ |
1540 | if(s == null) |
1541 | return null; |
1542 | |
1543 | - return _cover_album_art.get(s.artist+s.album); |
1544 | + return _cover_album_art.get(s.artist + s.album); |
1545 | } |
1546 | |
1547 | public Gdk.Pixbuf? get_cover_album_art_from_key(string album_artist, string album) { |
1548 | - return _cover_album_art.get(album_artist+album); |
1549 | + return _cover_album_art.get(album_artist + album); |
1550 | } |
1551 | |
1552 | public void set_album_art(int id, Gdk.Pixbuf pix) { |
1553 | @@ -1734,8 +1715,8 @@ |
1554 | |
1555 | Media s = media_from_id(id); |
1556 | |
1557 | - _album_art.set(s.artist+s.album, pix); |
1558 | - _cover_album_art.set(s.artist+s.album, get_cover_shadow(pix)); |
1559 | + _album_art.set(s.artist + s.album, pix); |
1560 | + _cover_album_art.set(s.artist + s.album, Icons.get_pixbuf_shadow(pix)); |
1561 | } |
1562 | |
1563 | /* Device Preferences */ |
1564 | @@ -1803,3 +1784,4 @@ |
1565 | } |
1566 | } |
1567 | } |
1568 | + |
1569 | |
1570 | === modified file 'src/LibraryWindow.vala' |
1571 | --- src/LibraryWindow.vala 2012-01-28 05:21:55 +0000 |
1572 | +++ src/LibraryWindow.vala 2012-01-31 01:07:25 +0000 |
1573 | @@ -26,12 +26,12 @@ |
1574 | |
1575 | public class BeatBox.LibraryWindow : Gtk.Window { |
1576 | public static Granite.Application app { get; private set; } |
1577 | - |
1578 | + |
1579 | public BeatBox.LibraryManager lm; |
1580 | BeatBox.Settings settings; |
1581 | LastFM.SimilarMedias similarMedias; |
1582 | BeatBox.MediaKeyListener mkl; |
1583 | - |
1584 | + |
1585 | HashMap<int, Device> welcome_screen_keys; |
1586 | bool queriedlastfm; // whether or not we have queried last fm for the current media info |
1587 | bool media_considered_played; //whether or not we have updated last played and added to already played list |
1588 | @@ -40,13 +40,13 @@ |
1589 | bool scrobbled_track; |
1590 | LinkedList<string> timeout_search;//stops from doing useless search |
1591 | string last_search;//stops from searching same thing multiple times |
1592 | - |
1593 | + |
1594 | public bool dragging_from_music; |
1595 | public bool millerVisible; |
1596 | bool askToSetFolder; |
1597 | - |
1598 | + |
1599 | public bool initializationFinished; |
1600 | - |
1601 | + |
1602 | VBox verticalBox; |
1603 | public VBox mainViews; |
1604 | public MillerColumns miller; |
1605 | @@ -76,10 +76,10 @@ |
1606 | SimpleOptionChooser shuffleChooser; |
1607 | SimpleOptionChooser repeatChooser; |
1608 | SimpleOptionChooser infoPanelChooser; |
1609 | - |
1610 | + |
1611 | // we use one album list view popup for the whole app |
1612 | public AlbumListView alv; |
1613 | - |
1614 | + |
1615 | // basic file stuff |
1616 | ImageMenuItem libraryOperations; |
1617 | Gtk.Menu libraryOperationsMenu; |
1618 | @@ -88,30 +88,30 @@ |
1619 | Gtk.MenuItem fileRescanMusicFolder; |
1620 | Gtk.MenuItem editEqualizer; |
1621 | ImageMenuItem editPreferences; |
1622 | - |
1623 | + |
1624 | // Base color |
1625 | public static Gdk.RGBA base_color; |
1626 | |
1627 | Gtk.Menu settingsMenu; |
1628 | - |
1629 | + |
1630 | public Notify.Notification notification; |
1631 | - |
1632 | + |
1633 | public signal void playPauseChanged(); |
1634 | - |
1635 | + |
1636 | public LibraryWindow(Granite.Application app, string[] args) { |
1637 | this.app = app; |
1638 | settings = new BeatBox.Settings(); |
1639 | - |
1640 | + |
1641 | //this is used by many objects, is the media backend |
1642 | lm = new BeatBox.LibraryManager(settings, this, args); |
1643 | - |
1644 | + |
1645 | //various objects |
1646 | welcome_screen_keys = new HashMap<int, Device>(); |
1647 | similarMedias = new LastFM.SimilarMedias(lm); |
1648 | timeout_search = new LinkedList<string>(); |
1649 | mkl = new MediaKeyListener(lm, this); |
1650 | last_search = ""; |
1651 | - |
1652 | + |
1653 | #if HAVE_INDICATE |
1654 | #if HAVE_DBUSMENU |
1655 | stdout.printf("Initializing MPRIS and sound menu\n"); |
1656 | @@ -119,10 +119,10 @@ |
1657 | mpris.initialize(); |
1658 | #endif |
1659 | #endif |
1660 | - |
1661 | + |
1662 | dragging_from_music = false; |
1663 | askToSetFolder = false; |
1664 | - |
1665 | + |
1666 | this.lm.player.end_of_stream.connect(end_of_stream); |
1667 | this.lm.player.current_position_update.connect(current_position_update); |
1668 | //this.lm.player.media_not_found.connect(media_not_found); |
1669 | @@ -139,19 +139,19 @@ |
1670 | this.lm.dm.device_added.connect(device_added); |
1671 | this.lm.dm.device_removed.connect(device_removed); |
1672 | this.similarMedias.similar_retrieved.connect(similarRetrieved); |
1673 | - |
1674 | + |
1675 | destroy.connect (on_quit); |
1676 | check_resize.connect(on_resize); |
1677 | this.destroy.connect (Gtk.main_quit); |
1678 | - |
1679 | + |
1680 | if(lm.media_count() == 0 && settings.getMusicFolder() == "") { |
1681 | stdout.printf("First run.\n"); |
1682 | - |
1683 | + |
1684 | } |
1685 | else { |
1686 | lm.clearCurrent(); |
1687 | //((MusicTreeView)sideTree.getWidget(sideTree.library_music_iter)).set_as_current_list("0"); |
1688 | - |
1689 | + |
1690 | // make sure we don't re-count stats |
1691 | if((int)settings.getLastMediaPosition() > 5) |
1692 | queriedlastfm = true; |
1693 | @@ -159,19 +159,22 @@ |
1694 | media_considered_played = true; |
1695 | if(lm.media_info.media != null && (double)((int)settings.getLastMediaPosition()/(double)lm.media_info.media.length) > 0.90) |
1696 | added_to_play_count = true; |
1697 | - |
1698 | + |
1699 | // rescan on startup |
1700 | /*lm.rescan_music_folder();*/ |
1701 | } |
1702 | - |
1703 | + |
1704 | /*if(!File.new_for_path(settings.getMusicFolder()).query_exists() && settings.getMusicFolder() != "") { |
1705 | doAlert("Music folder not mounted", "Your music folder is not mounted. Please mount your music folder before using BeatBox."); |
1706 | }*/ |
1707 | } |
1708 | - |
1709 | + |
1710 | public void build_ui() { |
1711 | // simple message to terminal |
1712 | - stdout.printf("Building user interface\n"); |
1713 | + stdout.printf ("Building user interface\n"); |
1714 | + |
1715 | + // Load icon information |
1716 | + Icons.load (); |
1717 | |
1718 | // Setup base color |
1719 | var unused_icon_view = new IconView(); |
1720 | @@ -179,22 +182,22 @@ |
1721 | base_style.add_class (Gtk.STYLE_CLASS_VIEW); |
1722 | base_color = base_style.get_background_color(StateFlags.NORMAL); |
1723 | unused_icon_view.destroy(); |
1724 | - |
1725 | + |
1726 | // set the size based on saved gconf settings |
1727 | set_default_size(settings.getWindowWidth(), settings.getWindowHeight()); |
1728 | resize(settings.getWindowWidth(), settings.getWindowHeight()); |
1729 | - |
1730 | + |
1731 | // set window min/max |
1732 | Gdk.Geometry geo = Gdk.Geometry(); |
1733 | geo.min_width = 700; |
1734 | geo.min_height = 400; |
1735 | set_geometry_hints(this, geo, Gdk.WindowHints.MIN_SIZE); |
1736 | - |
1737 | + |
1738 | // set the title |
1739 | set_title("BeatBox"); |
1740 | - |
1741 | + |
1742 | // set the icon |
1743 | - set_icon(lm.icons.beatbox_icon.render (IconSize.MENU, null)); |
1744 | + set_icon(Icons.BEATBOX_ICON.render (IconSize.MENU, null)); |
1745 | |
1746 | /* Initialize all components */ |
1747 | verticalBox = new VBox(false, 0); |
1748 | @@ -206,9 +209,9 @@ |
1749 | videoArea = new DrawingArea(); |
1750 | welcomeScreen = new Welcome(_("Get Some Tunes"), _("BeatBox can't seem to find your music.")); |
1751 | |
1752 | - sideTree = new SideTreeView(lm, this); |
1753 | + sideTree = new SideTreeView(lm, this); |
1754 | sideTreeScroll = new ScrolledWindow(null, null); |
1755 | - coverArt = new CoverArtImage(lm, this); |
1756 | + coverArt = new CoverArtImage(lm, this); |
1757 | libraryOperations = new ImageMenuItem.from_stock("library-music", null); |
1758 | libraryOperationsMenu = new Gtk.Menu(); |
1759 | fileSetMusicFolder = new Gtk.MenuItem.with_label(_("Set Music Folder")); |
1760 | @@ -233,101 +236,102 @@ |
1761 | statusBar = new HBox(false, 0); |
1762 | statusBarLabel = new Label(""); |
1763 | alv = new AlbumListView(lm); |
1764 | - |
1765 | - var statusBarStyle = statusBar.get_style_context (); |
1766 | - |
1767 | - var shuffle_on_icon = lm.icons.shuffle_on_icon.render (IconSize.MENU, statusBarStyle); |
1768 | - var shuffle_off_icon = lm.icons.shuffle_off_icon.render (IconSize.MENU, statusBarStyle); |
1769 | - var repeat_on_icon = lm.icons.repeat_on_icon.render (IconSize.MENU, statusBarStyle); |
1770 | - var repeat_off_icon = lm.icons.repeat_off_icon.render (IconSize.MENU, statusBarStyle); |
1771 | - |
1772 | - shuffleChooser = new SimpleOptionChooser(shuffle_on_icon, shuffle_off_icon); |
1773 | - repeatChooser = new SimpleOptionChooser(repeat_on_icon, repeat_off_icon); |
1774 | - infoPanelChooser = new SimpleOptionChooser(lm.icons.info_icon.render(IconSize.MENU, null), lm.icons.info_icon.render(IconSize.MENU, null)); |
1775 | - |
1776 | + |
1777 | + var shuffle_on_image = Icons.SHUFFLE_ON_ICON.render_image (IconSize.MENU); |
1778 | + var shuffle_off_image = Icons.SHUFFLE_OFF_ICON.render_image (IconSize.MENU); |
1779 | + var repeat_on_image = Icons.REPEAT_ON_ICON.render_image (IconSize.MENU); |
1780 | + var repeat_off_image = Icons.REPEAT_OFF_ICON.render_image (IconSize.MENU); |
1781 | + var info_image = Icons.INFO_ICON.render_image (IconSize.MENU); |
1782 | + |
1783 | + shuffleChooser = new SimpleOptionChooser.from_image (shuffle_on_image, shuffle_off_image); |
1784 | + repeatChooser = new SimpleOptionChooser.from_image (repeat_on_image, repeat_off_image); |
1785 | + infoPanelChooser = new SimpleOptionChooser.from_image (info_image, info_image); |
1786 | + |
1787 | notification = (Notify.Notification)GLib.Object.new ( |
1788 | typeof (Notify.Notification), |
1789 | "summary", _("Title"), |
1790 | "body", "%s\n%s".printf(_("Artist"), _("Album"))); |
1791 | - |
1792 | + |
1793 | /* Set properties of various controls */ |
1794 | //sideBar.set_size_request(200, -1); |
1795 | sourcesToMedias.set_position(settings.getSidebarWidth()); |
1796 | mediasToInfo.set_position((lm.settings.getWindowWidth() - lm.settings.getSidebarWidth()) - lm.settings.getMoreWidth()); |
1797 | - |
1798 | + |
1799 | //for setting maximum size for setting hpane position max size |
1800 | //sideBar.set_geometry_hints( |
1801 | - |
1802 | - stdout.printf("building side tree\n"); |
1803 | + |
1804 | + stdout.printf ("building side tree\n"); |
1805 | buildSideTree(); |
1806 | - stdout.printf("done with side tree\n"); |
1807 | - |
1808 | + stdout.printf ("done with side tree\n"); |
1809 | + |
1810 | sideTreeScroll = new ScrolledWindow(null, null); |
1811 | sideTreeScroll.set_policy (PolicyType.AUTOMATIC, PolicyType.AUTOMATIC); |
1812 | sideTreeScroll.add(sideTree); |
1813 | - |
1814 | + |
1815 | var coverArtScroll = new ScrolledWindow(null, null); |
1816 | coverArtScroll.set_policy (PolicyType.AUTOMATIC, PolicyType.NEVER); |
1817 | coverArtScroll.add_with_viewport(coverArt); |
1818 | - |
1819 | + |
1820 | millerPane.set_position(settings.getMillerHeight()); |
1821 | - |
1822 | + |
1823 | updateSensitivities(); |
1824 | - |
1825 | + |
1826 | /* create appmenu menu */ |
1827 | libraryOperationsMenu.append(fileSetMusicFolder); |
1828 | libraryOperationsMenu.append(fileImportMusic); |
1829 | libraryOperationsMenu.append(fileRescanMusicFolder); |
1830 | libraryOperations.submenu = libraryOperationsMenu; |
1831 | libraryOperations.set_label(_("Library")); |
1832 | - |
1833 | + |
1834 | settingsMenu.append(libraryOperations); |
1835 | settingsMenu.append(new SeparatorMenuItem()); |
1836 | settingsMenu.append(editEqualizer); |
1837 | settingsMenu.append(editPreferences); |
1838 | - |
1839 | + |
1840 | fileSetMusicFolder.activate.connect(editPreferencesClick); |
1841 | fileImportMusic.activate.connect(fileImportMusicClick); |
1842 | fileRescanMusicFolder.activate.connect(fileRescanMusicFolderClick); |
1843 | - |
1844 | + |
1845 | editPreferences.set_label(_("Preferences")); |
1846 | - |
1847 | + |
1848 | editEqualizer.activate.connect(editEqualizerClick); |
1849 | editPreferences.activate.connect(editPreferencesClick); |
1850 | - |
1851 | + |
1852 | EventBox statusEventBox = new EventBox(); |
1853 | statusEventBox.add(statusBar); |
1854 | - |
1855 | + |
1856 | // paint the background |
1857 | statusEventBox.override_background_color (StateFlags.NORMAL, base_color); |
1858 | - |
1859 | + |
1860 | repeatChooser.appendItem(_("Off")); |
1861 | repeatChooser.appendItem(_("Song")); |
1862 | repeatChooser.appendItem(_("Album")); |
1863 | repeatChooser.appendItem(_("Artist")); |
1864 | repeatChooser.appendItem(_("All")); |
1865 | - |
1866 | + |
1867 | shuffleChooser.appendItem(_("Off")); |
1868 | shuffleChooser.appendItem(_("All")); |
1869 | - |
1870 | + |
1871 | infoPanelChooser.appendItem(_("Hide")); |
1872 | infoPanelChooser.appendItem(_("Show")); |
1873 | - |
1874 | + |
1875 | repeatChooser.setOption(settings.getRepeatMode()); |
1876 | shuffleChooser.setOption(settings.getShuffleMode()); |
1877 | infoPanelChooser.setOption(settings.getMoreVisible() ? 1 : 0); |
1878 | - |
1879 | + |
1880 | /* Add controls to the GUI */ |
1881 | add(verticalBox); |
1882 | verticalBox.pack_start(topControls, false, true, 0); |
1883 | verticalBox.pack_start(videoArea, true, true, 0); |
1884 | verticalBox.pack_start(sourcesToMedias, true, true, 0); |
1885 | |
1886 | - // Ugly workaround to make the view-mode button smaller |
1887 | + // FIXME: Ugly workaround to make the view-mode button smaller |
1888 | var viewSelectorContainer = new Box (Orientation.VERTICAL, 0); |
1889 | var viewSelectorInnerContainer = new Box (Orientation.HORIZONTAL, 0); |
1890 | viewSelectorInnerContainer.pack_start (new Box (Orientation.HORIZONTAL, 10), true, true, 0); |
1891 | - viewSelectorInnerContainer.pack_start (viewSelector, false, false, 0); |
1892 | + |
1893 | + viewSelectorInnerContainer.pack_start (viewSelector, false, false, 0); // VIEW SELECTOR |
1894 | + |
1895 | viewSelectorInnerContainer.pack_end (new Box (Orientation.HORIZONTAL, 10), true, true, 0); |
1896 | viewSelectorContainer.pack_start (new Box (Orientation.VERTICAL, 5), true, true, 0); |
1897 | viewSelectorContainer.pack_start (viewSelectorInnerContainer, false, false, 0); |
1898 | @@ -345,21 +349,14 @@ |
1899 | topDisplayBin.set_expand(true); |
1900 | |
1901 | // Set theming |
1902 | - //viewSelector.get_style_context().add_class("raised"); |
1903 | - topControls.get_style_context().add_class("primary-toolbar"); |
1904 | + topControls.get_style_context().add_class("primary-toolbar"); |
1905 | sourcesToMedias.get_style_context().add_class("sidebar-pane-separator"); |
1906 | - sideTree.get_style_context().add_class("sidebar"); |
1907 | - |
1908 | - var viewSelectorStyle = topControls.get_style_context (); |
1909 | - |
1910 | - var view_column_icon = lm.icons.view_column_icon.render (IconSize.MENU, viewSelectorStyle); |
1911 | - var view_details_icon = lm.icons.view_details_icon.render (IconSize.MENU, viewSelectorStyle); |
1912 | - var view_icons_icon = lm.icons.view_icons_icon.render (IconSize.MENU, viewSelectorStyle); |
1913 | - |
1914 | - viewSelector.append(new Image.from_pixbuf(view_icons_icon)); |
1915 | - viewSelector.append(new Image.from_pixbuf(view_details_icon)); |
1916 | - viewSelector.append(new Image.from_pixbuf(view_column_icon)); |
1917 | - |
1918 | + sideTree.get_style_context().add_class("sidebar"); |
1919 | + |
1920 | + viewSelector.append(Icons.VIEW_ICONS_ICON.render_image (IconSize.MENU)); |
1921 | + viewSelector.append(Icons.VIEW_DETAILS_ICON.render_image (IconSize.MENU)); |
1922 | + viewSelector.append(Icons.VIEW_COLUMN_ICON.render_image (IconSize.MENU)); |
1923 | + |
1924 | topControls.insert(previousButton, 0); |
1925 | topControls.insert(playButton, 1); |
1926 | topControls.insert(nextButton, 2); |
1927 | @@ -367,39 +364,39 @@ |
1928 | topControls.insert(topDisplayBin, 4); |
1929 | topControls.insert(searchFieldBin, 5); |
1930 | topControls.insert(app.create_appmenu(settingsMenu), 6); |
1931 | - |
1932 | + |
1933 | // for consistency |
1934 | topControls.set_size_request(-1, 45); |
1935 | |
1936 | contentBox.pack_start(welcomeScreen, true, true, 0); |
1937 | - |
1938 | - var music_folder_icon = lm.icons.music_folder.render (IconSize.DIALOG, null); |
1939 | + |
1940 | + var music_folder_icon = Icons.MUSIC_FOLDER.render (IconSize.DIALOG, null); |
1941 | welcomeScreen.append_with_pixbuf(music_folder_icon, _("Locate"), _("Change your music folder.")); |
1942 | - |
1943 | + |
1944 | millerPane.pack1(miller, false, true); |
1945 | millerPane.pack2(mainViews, true, true); |
1946 | - |
1947 | + |
1948 | contentBox.pack_start(millerPane, true, true, 0); |
1949 | |
1950 | contentBox.pack_start(statusEventBox, false, true, 0); |
1951 | - |
1952 | + |
1953 | mediasToInfo.pack1(contentBox, true, true); |
1954 | mediasToInfo.pack2(infoPanel, false, false); |
1955 | - |
1956 | + |
1957 | sourcesToMedias.pack1(sideBar, false, true); |
1958 | sourcesToMedias.pack2(mediasToInfo, true, true); |
1959 | - |
1960 | + |
1961 | sideBar.pack_start(sideTreeScroll, true, true, 0); |
1962 | sideBar.pack_end(coverArtScroll, false, true, 0); |
1963 | - |
1964 | + |
1965 | statusBar.pack_start(shuffleChooser, false, false, 2); |
1966 | statusBar.pack_start(repeatChooser, false, false, 2); |
1967 | statusBar.pack_start(statusBarLabel, true, true, 0); |
1968 | statusBar.pack_start(wrap_alignment(infoPanelChooser, 0, 10, 0, 0), false, false, 2); |
1969 | - |
1970 | + |
1971 | // add mounts to side tree view |
1972 | lm.dm.loadPreExistingMounts(); |
1973 | - |
1974 | + |
1975 | /* Connect events to functions */ |
1976 | sourcesToMedias.get_child1().size_allocate.connect(sourcesToMediasHandleSet); |
1977 | welcomeScreen.activated.connect(welcomeScreenActivated); |
1978 | @@ -416,19 +413,19 @@ |
1979 | miller.changed.connect(millerChanged); |
1980 | searchField.changed.connect(searchFieldChanged); |
1981 | searchField.activate.connect(searchFieldActivate); |
1982 | - |
1983 | + |
1984 | /* set up drag dest stuff */ |
1985 | drag_dest_set(this, DestDefaults.ALL, {}, Gdk.DragAction.MOVE); |
1986 | Gtk.drag_dest_add_uri_targets(this); |
1987 | drag_data_received.connect(dragReceived); |
1988 | - |
1989 | + |
1990 | viewSelector.selected = settings.getViewMode(); |
1991 | - |
1992 | + |
1993 | bool genreV, artistV, albumV; |
1994 | lm.settings.getMillerVisibilities(out genreV, out artistV, out albumV); |
1995 | miller.updateColumnVisibilities(genreV, artistV, albumV); |
1996 | - stdout.printf("User interface has been built\n"); |
1997 | - |
1998 | + stdout.printf ("User interface has been built\n"); |
1999 | + |
2000 | int i = settings.getLastMediaPlaying(); |
2001 | if(i != 0 && lm.media_from_id(i) != null && File.new_for_uri(lm.media_from_id(i).uri).query_exists()) { |
2002 | lm.media_from_id(i).resume_pos; |
2003 | @@ -438,113 +435,112 @@ |
2004 | // don't show info panel if nothing playing |
2005 | infoPanel.set_visible(false); |
2006 | } |
2007 | - |
2008 | + |
2009 | initializationFinished = true; |
2010 | - |
2011 | + |
2012 | sideTree.resetView(); |
2013 | var vw = (ViewWrapper)sideTree.getSelectedWidget(); |
2014 | if(lm.media_info.media != null) { |
2015 | vw.list.set_as_current_list(0, true); |
2016 | - stdout.printf("set a view as current list\n"); |
2017 | + stdout.printf ("set a view as current list\n"); |
2018 | if(settings.getShuffleMode() == LibraryManager.Shuffle.ALL) { |
2019 | lm.setShuffleMode(LibraryManager.Shuffle.ALL, true); |
2020 | } |
2021 | } |
2022 | - |
2023 | + |
2024 | searchField.set_text(lm.settings.getSearchString()); |
2025 | //vw.doUpdate(vw.currentView, vw.get_media_ids(), false, true, false); |
2026 | - |
2027 | + |
2028 | show_all(); |
2029 | resize(settings.getWindowWidth(), this.default_height); |
2030 | - |
2031 | + |
2032 | updateSensitivities(); |
2033 | - |
2034 | + |
2035 | if(lm.song_ids().size == 0) |
2036 | setMusicFolder(Environment.get_user_special_dir(UserDirectory.MUSIC)); |
2037 | } |
2038 | - |
2039 | + |
2040 | public static Gtk.Alignment wrap_alignment (Gtk.Widget widget, int top, int right, int bottom, int left) { |
2041 | var alignment = new Gtk.Alignment(0.0f, 0.0f, 1.0f, 1.0f); |
2042 | alignment.top_padding = top; |
2043 | alignment.right_padding = right; |
2044 | alignment.bottom_padding = bottom; |
2045 | alignment.left_padding = left; |
2046 | - |
2047 | + |
2048 | alignment.add(widget); |
2049 | return alignment; |
2050 | } |
2051 | - |
2052 | + |
2053 | /** Builds the side tree on TreeView view |
2054 | - * @param view The side tree to build it on |
2055 | + * @param view The side tree to build it on : TODO |
2056 | */ |
2057 | private void buildSideTree() { |
2058 | ViewWrapper vw; |
2059 | - |
2060 | + |
2061 | sideTree.addBasicItems(); |
2062 | - |
2063 | + |
2064 | vw = new ViewWrapper(lm, this, new LinkedList<int>(), lm.similar_setup.sort_column, lm.similar_setup.sort_direction, ViewWrapper.Hint.SIMILAR, -1); |
2065 | sideTree.addSideItem(sideTree.playlists_iter, null, vw, _("Similar"), ViewWrapper.Hint.SIMILAR); |
2066 | mainViews.pack_start(vw, true, true, 0); |
2067 | - |
2068 | + |
2069 | vw = new ViewWrapper(lm, this, lm.queue(), lm.queue_setup.sort_column, lm.queue_setup.sort_direction, ViewWrapper.Hint.QUEUE, -1); |
2070 | sideTree.addSideItem(sideTree.playlists_iter, null, vw, _("Queue"), ViewWrapper.Hint.QUEUE); |
2071 | mainViews.pack_start(vw, true, true, 0); |
2072 | - |
2073 | + |
2074 | vw = new ViewWrapper(lm, this, lm.already_played(), lm.history_setup.sort_column, lm.history_setup.sort_direction, ViewWrapper.Hint.HISTORY, -1); |
2075 | sideTree.addSideItem(sideTree.playlists_iter, null, vw, _("History"), ViewWrapper.Hint.HISTORY); |
2076 | mainViews.pack_start(vw, true, true, 0); |
2077 | - |
2078 | + |
2079 | vw = new ViewWrapper(lm, this, lm.media_ids(), lm.music_setup.sort_column, lm.music_setup.sort_direction, ViewWrapper.Hint.MUSIC, -1); |
2080 | sideTree.addSideItem(sideTree.library_iter, null, vw, _("Music"), ViewWrapper.Hint.MUSIC); |
2081 | mainViews.pack_start(vw, true, true, 0); |
2082 | - |
2083 | + |
2084 | vw = new ViewWrapper(lm, this, lm.podcast_ids(), lm.podcast_setup.sort_column, lm.podcast_setup.sort_direction, ViewWrapper.Hint.PODCAST, -1); |
2085 | sideTree.addSideItem(sideTree.library_iter, null, vw, _("Podcasts"), ViewWrapper.Hint.PODCAST); |
2086 | mainViews.pack_start(vw, true, true, 0); |
2087 | - |
2088 | + |
2089 | vw = new ViewWrapper(lm, this, lm.station_ids(), lm.station_setup.sort_column, lm.station_setup.sort_direction, ViewWrapper.Hint.STATION, -1); |
2090 | sideTree.addSideItem(sideTree.network_iter, null, vw, _("Internet Radio"), ViewWrapper.Hint.STATION); |
2091 | mainViews.pack_start(vw, true, true, 0); |
2092 | - |
2093 | + |
2094 | if(BeatBox.Beatbox.enableStore) { |
2095 | Store.StoreView storeView = new Store.StoreView(lm, this); |
2096 | sideTree.addSideItem(sideTree.network_iter, null, storeView, _("Music Store"), ViewWrapper.Hint.NONE); |
2097 | mainViews.pack_start(storeView, true, true, 0); |
2098 | } |
2099 | - |
2100 | - |
2101 | + |
2102 | // load smart playlists |
2103 | foreach(SmartPlaylist p in lm.smart_playlists()) { |
2104 | addSideListItem(p); |
2105 | } |
2106 | - |
2107 | + |
2108 | // load playlists |
2109 | foreach(Playlist p in lm.playlists()) { |
2110 | addSideListItem(p); |
2111 | } |
2112 | } |
2113 | - |
2114 | + |
2115 | public void addSideListItem(GLib.Object o) { |
2116 | TreeIter item = sideTree.library_music_iter; //just a default |
2117 | ViewWrapper vw = null; |
2118 | - |
2119 | + |
2120 | if(o is Playlist) { |
2121 | Playlist p = (Playlist)o; |
2122 | - |
2123 | + |
2124 | vw = new ViewWrapper(lm, this, lm.medias_from_playlist(p.rowid), p.tvs.sort_column, p.tvs.sort_direction, ViewWrapper.Hint.PLAYLIST, p.rowid); |
2125 | item = sideTree.addSideItem(sideTree.playlists_iter, p, vw, p.name, ViewWrapper.Hint.PLAYLIST); |
2126 | mainViews.pack_start(vw, true, true, 0); |
2127 | } |
2128 | else if(o is SmartPlaylist) { |
2129 | SmartPlaylist p = (SmartPlaylist)o; |
2130 | - |
2131 | + |
2132 | vw = new ViewWrapper(lm, this, lm.medias_from_smart_playlist(p.rowid), p.tvs.sort_column, p.tvs.sort_direction, ViewWrapper.Hint.SMART_PLAYLIST, p.rowid); |
2133 | item = sideTree.addSideItem(sideTree.playlists_iter, p, vw, p.name, ViewWrapper.Hint.SMART_PLAYLIST); |
2134 | mainViews.pack_start(vw, true, true, 0); |
2135 | } |
2136 | else if(o is Device) { |
2137 | Device d = (Device)o; |
2138 | - |
2139 | + |
2140 | if(d.getContentType() == "cdrom") { |
2141 | vw = new DeviceViewWrapper(lm, this, d.get_medias(), "Track", Gtk.SortType.ASCENDING, ViewWrapper.Hint.CDROM, -1, d); |
2142 | item = sideTree.addSideItem(sideTree.devices_iter, d, vw, d.getDisplayName(), ViewWrapper.Hint.CDROM); |
2143 | @@ -558,13 +554,13 @@ |
2144 | mainViews.pack_start(dv, true, true, 0); |
2145 | } |
2146 | } |
2147 | - |
2148 | + |
2149 | if(vw == null || vw.list == null || vw.albumView == null) |
2150 | return; |
2151 | - |
2152 | + |
2153 | if(!initializationFinished) |
2154 | return; |
2155 | - |
2156 | + |
2157 | vw.show_all(); |
2158 | if(viewSelector.selected == 0) { |
2159 | vw.albumView.show(); |
2160 | @@ -575,27 +571,27 @@ |
2161 | vw.albumView.hide(); |
2162 | } |
2163 | } |
2164 | - |
2165 | + |
2166 | public void updateSensitivities() { |
2167 | if(!initializationFinished) |
2168 | return; |
2169 | - |
2170 | + |
2171 | bool folderSet = (lm.settings.getMusicFolder() != ""); |
2172 | bool haveMedias = lm.media_count() > 0; |
2173 | bool haveSongs = lm.song_ids().size > 0; |
2174 | bool doingOps = lm.doing_file_operations(); |
2175 | bool nullMedia = (lm.media_info.media == null); |
2176 | bool showMore = lm.settings.getMoreVisible(); |
2177 | - |
2178 | + |
2179 | bool showingMediaList = (sideTree.getSelectedWidget() is ViewWrapper); |
2180 | bool songsInList = showingMediaList ? (((ViewWrapper)sideTree.getSelectedWidget()).media_count > 0) : false; |
2181 | bool showingMusicList = sideTree.convertToChild(sideTree.getSelectedIter()) == sideTree.library_music_iter; |
2182 | bool showMainViews = (haveSongs || (haveMedias &&!showingMusicList)); |
2183 | - |
2184 | + |
2185 | fileSetMusicFolder.set_sensitive(!doingOps); |
2186 | fileImportMusic.set_sensitive(!doingOps && folderSet); |
2187 | fileRescanMusicFolder.set_sensitive(!doingOps && folderSet); |
2188 | - |
2189 | + |
2190 | if(doingOps) |
2191 | topDisplay.show_progressbar(); |
2192 | else if(!nullMedia && lm.media_info.media.mediatype == 3) { |
2193 | @@ -603,91 +599,91 @@ |
2194 | } |
2195 | else |
2196 | topDisplay.show_scale(); |
2197 | - |
2198 | + |
2199 | sourcesToMedias.set_visible(viewSelector.selected != 3); |
2200 | videoArea.set_visible(viewSelector.selected == 3); |
2201 | - |
2202 | + |
2203 | topDisplay.set_visible(!nullMedia || doingOps); |
2204 | topDisplay.set_scale_sensitivity(!nullMedia); |
2205 | - |
2206 | + |
2207 | previousButton.set_sensitive(!nullMedia || songsInList); |
2208 | playButton.set_sensitive(!nullMedia || songsInList); |
2209 | nextButton.set_sensitive(!nullMedia || songsInList); |
2210 | searchField.set_sensitive(showingMediaList && songsInList && showMainViews); |
2211 | viewSelector.set_sensitive(showingMediaList); |
2212 | - |
2213 | + |
2214 | mainViews.set_visible(showMainViews); |
2215 | miller.set_visible((showMainViews) && viewSelector.selected == 2 && showingMediaList); |
2216 | welcomeScreen.set_visible(!showMainViews); |
2217 | millerPane.set_visible(showMainViews); |
2218 | - |
2219 | + |
2220 | welcomeScreen.set_sensitivity(0, !doingOps); |
2221 | foreach(int key in welcome_screen_keys.keys) |
2222 | welcomeScreen.set_sensitivity(key, !doingOps); |
2223 | - |
2224 | + |
2225 | statusBar.set_visible(showMainViews && showingMediaList); |
2226 | - |
2227 | + |
2228 | infoPanel.set_visible(showMainViews && showMore && !nullMedia); |
2229 | infoPanelChooser.set_visible(showMainViews && !nullMedia); |
2230 | coverArt.set_visible(!nullMedia); |
2231 | - |
2232 | + |
2233 | // hide playlists when media list is empty |
2234 | sideTree.setVisibility(sideTree.playlists_iter, haveMedias); |
2235 | - |
2236 | + |
2237 | if(lm.media_info.media == null || haveMedias && !lm.playing) { |
2238 | playButton.set_stock_id(Gtk.Stock.MEDIA_PLAY); |
2239 | } |
2240 | } |
2241 | - |
2242 | + |
2243 | public virtual void progressNotification(string? message, double progress) { |
2244 | if(message != null && progress >= 0.0 && progress <= 1.0) |
2245 | topDisplay.set_label_markup(message); |
2246 | - |
2247 | + |
2248 | topDisplay.set_progress_value(progress); |
2249 | } |
2250 | - |
2251 | + |
2252 | public bool updateCurrentMedia() { |
2253 | //loop through all musictreeviews and call updatecurrentmedia |
2254 | - |
2255 | + |
2256 | if(lm.media_info.media != null) { |
2257 | if(lm.get_album_art(lm.media_info.media.rowid) != null) |
2258 | coverArt.set_from_pixbuf(lm.get_album_art(lm.media_info.media.rowid)); |
2259 | else { |
2260 | - coverArt.set_from_pixbuf(lm.icons.drop_album.render(null, null)); |
2261 | + coverArt.set_from_pixbuf(Icons.DROP_ALBUM_PIXBUF); |
2262 | } |
2263 | - |
2264 | + |
2265 | coverArt.update_allocated_space(sourcesToMedias.position); |
2266 | } |
2267 | - |
2268 | + |
2269 | return false; |
2270 | } |
2271 | - |
2272 | + |
2273 | public void updateInfoLabel() { |
2274 | if(lm.doing_file_operations()) { |
2275 | stdout.printf("doing file operations, returning null in updateInfoLabel\n"); |
2276 | return; |
2277 | } |
2278 | - |
2279 | + |
2280 | if(lm.media_info.media == null) { |
2281 | topDisplay.set_label_markup(""); |
2282 | stdout.printf("setting info label as ''\n"); |
2283 | return; |
2284 | } |
2285 | - |
2286 | + |
2287 | string beg = ""; |
2288 | if(lm.media_info.media.mediatype == 3) // radio |
2289 | beg = "<b>" + lm.media_info.media.album_artist.replace("\n", "") + "</b>\n"; |
2290 | - |
2291 | + |
2292 | //set the title |
2293 | Media s = lm.media_info.media; |
2294 | var title = "<b>" + s.title.replace("&", "&") + "</b>"; |
2295 | var artist = ((s.artist != "" && s.artist != _("Unknown Artist")) ? (_(" by ") + "<b>" + s.artist.replace("&", "&") + "</b>") : ""); |
2296 | var album = ((s.album != "" && s.album != _("Unknown Album")) ? (_(" on ") + "<b>" + s.album.replace("&", "&") + "</b>") : ""); |
2297 | - |
2298 | + |
2299 | var media_label = beg + title + artist + album; |
2300 | topDisplay.set_label_markup(media_label); |
2301 | } |
2302 | - |
2303 | + |
2304 | /** This should be used whenever a call to play a new media is made |
2305 | * @param s The media that is now playing |
2306 | */ |
2307 | @@ -695,22 +691,22 @@ |
2308 | /*if(old == -2 && i != -2) { // -2 is id reserved for previews |
2309 | Media s = settings.getLastMediaPlaying(); |
2310 | s = lm.media_from_name(s.title, s.artist); |
2311 | - |
2312 | + |
2313 | if(s.rowid != 0) { |
2314 | lm.playMedia(s.rowid); |
2315 | int position = (int)settings.getLastMediaPosition(); |
2316 | topDisplay.change_value(ScrollType.NONE, position); |
2317 | } |
2318 | - |
2319 | + |
2320 | return; |
2321 | }*/ |
2322 | - |
2323 | + |
2324 | updateInfoLabel(); |
2325 | - |
2326 | + |
2327 | //reset the media position |
2328 | topDisplay.set_scale_sensitivity(true); |
2329 | topDisplay.set_scale_range(0.0, lm.media_info.media.length); |
2330 | - |
2331 | + |
2332 | if(lm.media_from_id(i).mediatype == 1 || lm.media_from_id(i).mediatype == 2) { |
2333 | /*stdout.printf("setting position to resume_pos which is %d\n", lm.media_from_id(i).resume_pos ); |
2334 | Timeout.add(250, () => { |
2335 | @@ -721,34 +717,34 @@ |
2336 | else { |
2337 | topDisplay.change_value(ScrollType.NONE, 0); |
2338 | } |
2339 | - |
2340 | + |
2341 | //if(!mediaPosition.get_sensitive()) |
2342 | // mediaPosition.set_sensitive(true); |
2343 | - |
2344 | + |
2345 | //reset some booleans |
2346 | tested_for_video = false; |
2347 | queriedlastfm = false; |
2348 | media_considered_played = false; |
2349 | added_to_play_count = false; |
2350 | scrobbled_track = false; |
2351 | - |
2352 | + |
2353 | if(!lm.media_info.media.isPreview) { |
2354 | updateCurrentMedia(); |
2355 | - |
2356 | + |
2357 | infoPanel.updateMedia(lm.media_info.media.rowid); |
2358 | if(settings.getMoreVisible()) |
2359 | infoPanel.set_visible(true); |
2360 | - |
2361 | + |
2362 | updateMillerColumns(); |
2363 | } |
2364 | - |
2365 | + |
2366 | updateSensitivities(); |
2367 | - |
2368 | + |
2369 | // if radio, we can't depend on current_position_update. do that stuff now. |
2370 | if(lm.media_info.media.mediatype == 3) { |
2371 | queriedlastfm = true; |
2372 | similarMedias.queryForSimilar(lm.media_info.media); |
2373 | - |
2374 | + |
2375 | try { |
2376 | Thread.create<void*>(lastfm_track_thread_function, false); |
2377 | Thread.create<void*>(lastfm_album_thread_function, false); |
2378 | @@ -758,101 +754,101 @@ |
2379 | catch(GLib.ThreadError err) { |
2380 | stdout.printf("ERROR: Could not create last fm thread: %s \n", err.message); |
2381 | } |
2382 | - |
2383 | + |
2384 | // always show notifications for the radio, since user likely does not know media |
2385 | mkl.showNotification(lm.media_info.media.rowid); |
2386 | } |
2387 | } |
2388 | - |
2389 | + |
2390 | public virtual void playback_stopped(int was_playing) { |
2391 | //reset some booleans |
2392 | tested_for_video = false; |
2393 | queriedlastfm = false; |
2394 | media_considered_played = false; |
2395 | added_to_play_count = false; |
2396 | - |
2397 | + |
2398 | // this will hide album cover art |
2399 | updateCurrentMedia(); |
2400 | - |
2401 | + |
2402 | updateSensitivities(); |
2403 | - |
2404 | + |
2405 | stdout.printf("stopped\n"); |
2406 | } |
2407 | - |
2408 | + |
2409 | public virtual void medias_updated(Collection<int> ids) { |
2410 | if(lm.media_info.media != null && ids.contains(lm.media_info.media.rowid)) { |
2411 | updateInfoLabel(); |
2412 | } |
2413 | } |
2414 | - |
2415 | + |
2416 | void medias_added(LinkedList<int> ids) { |
2417 | /*var new_songs = new LinkedList<int>(); |
2418 | var new_podcasts = new LinkedList<int>(); |
2419 | - |
2420 | + |
2421 | foreach(int i in ids) { |
2422 | if(lm.media_from_id(i).mediatype == 0) |
2423 | new_songs.add(i); |
2424 | else if(lm.media_from_id(i).mediatype == 1) |
2425 | new_podcasts.add(i); |
2426 | } |
2427 | - |
2428 | + |
2429 | stdout.printf("appending...\n"); |
2430 | ViewWrapper vw = (ViewWrapper)sideTree.getWidget(sideTree.library_music_iter); |
2431 | vw.add_medias(new_songs); |
2432 | - |
2433 | + |
2434 | vw = (ViewWrapper)sideTree.getWidget(sideTree.library_podcasts_iter); |
2435 | vw.add_medias(new_podcasts); |
2436 | stdout.printf("appended\n");*/ |
2437 | - |
2438 | + |
2439 | var w = sideTree.getSelectedWidget(); |
2440 | if(w is ViewWrapper) { |
2441 | miller.populateColumns("", ((ViewWrapper)w).get_media_ids()); |
2442 | } |
2443 | - |
2444 | + |
2445 | updateSensitivities(); |
2446 | } |
2447 | - |
2448 | + |
2449 | public void* lastfm_track_thread_function () { |
2450 | LastFM.TrackInfo track = new LastFM.TrackInfo.basic(); |
2451 | - |
2452 | + |
2453 | string artist_s = lm.media_info.media.artist; |
2454 | string track_s = lm.media_info.media.title; |
2455 | - |
2456 | + |
2457 | /* first fetch track info since that is most likely to change */ |
2458 | if(!lm.track_info_exists(track_s + " by " + artist_s)) { |
2459 | track = new LastFM.TrackInfo.with_info(artist_s, track_s); |
2460 | - |
2461 | + |
2462 | if(track != null) |
2463 | lm.save_track(track); |
2464 | - |
2465 | + |
2466 | if(track_s == lm.media_info.media.title && artist_s == lm.media_info.media.artist) |
2467 | lm.media_info.track = track; |
2468 | } |
2469 | - |
2470 | + |
2471 | return null; |
2472 | } |
2473 | - |
2474 | + |
2475 | public void* lastfm_album_thread_function () { |
2476 | LastFM.AlbumInfo album = new LastFM.AlbumInfo.basic(); |
2477 | - |
2478 | + |
2479 | string artist_s = lm.media_info.media.artist; |
2480 | string album_s = lm.media_info.media.album; |
2481 | - |
2482 | + |
2483 | /* fetch album info now. only save if still on current media */ |
2484 | if(!lm.album_info_exists(album_s + " by " + artist_s) || lm.get_album_art(lm.media_info.media.rowid) == null) { |
2485 | album = new LastFM.AlbumInfo.with_info(artist_s, album_s); |
2486 | - |
2487 | + |
2488 | if(album != null) |
2489 | lm.save_album(album); |
2490 | - |
2491 | + |
2492 | /* make sure we save image to right location (user hasn't changed medias) */ |
2493 | if(lm.media_info.media != null && album != null && album_s == lm.media_info.media.album && |
2494 | artist_s == lm.media_info.media.artist && lm.media_info.media.getAlbumArtPath().contains("media-audio.png")) { |
2495 | lm.media_info.album = album; |
2496 | - |
2497 | + |
2498 | if (album.url_image.url != null && lm.settings.getUpdateFolderHierarchy()) { |
2499 | lm.save_album_locally(lm.media_info.media.rowid, album.url_image.url); |
2500 | - |
2501 | + |
2502 | // start thread to load all the medias pixbuf's |
2503 | try { |
2504 | Thread.create<void*>(lm.fetch_thread_function, false); |
2505 | @@ -866,66 +862,66 @@ |
2506 | return null; |
2507 | } |
2508 | } |
2509 | - |
2510 | + |
2511 | Idle.add(updateCurrentMedia); |
2512 | - |
2513 | + |
2514 | return null; |
2515 | } |
2516 | - |
2517 | + |
2518 | public void* lastfm_artist_thread_function () { |
2519 | LastFM.ArtistInfo artist = new LastFM.ArtistInfo.basic(); |
2520 | - |
2521 | + |
2522 | string artist_s = lm.media_info.media.artist; |
2523 | - |
2524 | + |
2525 | /* fetch artist info now. save only if still on current media */ |
2526 | if(!lm.artist_info_exists(artist_s)) { |
2527 | artist = new LastFM.ArtistInfo.with_artist(artist_s); |
2528 | - |
2529 | + |
2530 | if(artist != null) |
2531 | lm.save_artist(artist); |
2532 | - |
2533 | + |
2534 | //try to save artist art locally |
2535 | if(lm.media_info.media != null && artist != null && artist_s == lm.media_info.media.artist && |
2536 | !File.new_for_path(lm.media_info.media.getArtistImagePath()).query_exists()) { |
2537 | lm.media_info.artist = artist; |
2538 | - |
2539 | + |
2540 | } |
2541 | else { |
2542 | return null; |
2543 | } |
2544 | } |
2545 | - |
2546 | + |
2547 | Idle.add( () => { infoPanel.updateArtistImage(true); return false;}); |
2548 | - |
2549 | + |
2550 | return null; |
2551 | } |
2552 | - |
2553 | + |
2554 | public void* lastfm_update_nowplaying_thread_function() { |
2555 | if(lm.media_info.media != null) { |
2556 | lm.lfm.updateNowPlaying(lm.media_info.media.title, lm.media_info.media.artist); |
2557 | } |
2558 | - |
2559 | + |
2560 | return null; |
2561 | } |
2562 | - |
2563 | + |
2564 | public void* lastfm_scrobble_thread_function () { |
2565 | if(lm.media_info.media != null) { |
2566 | lm.lfm.scrobbleTrack(lm.media_info.media.title, lm.media_info.media.artist); |
2567 | } |
2568 | - |
2569 | + |
2570 | return null; |
2571 | } |
2572 | - |
2573 | + |
2574 | public bool updateMediaInfo() { |
2575 | infoPanel.updateMedia(lm.media_info.media.rowid); |
2576 | - |
2577 | + |
2578 | return false; |
2579 | } |
2580 | - |
2581 | + |
2582 | public virtual void previousClicked () { |
2583 | if(lm.player.getPosition() < 5000000000 || (lm.media_info.media != null && lm.media_info.media.mediatype == 3)) { |
2584 | int prev_id = lm.getPrevious(true); |
2585 | - |
2586 | + |
2587 | /* test to stop playback/reached end */ |
2588 | if(prev_id == 0) { |
2589 | lm.player.pause(); |
2590 | @@ -937,7 +933,7 @@ |
2591 | else |
2592 | topDisplay.change_value(ScrollType.NONE, 0); |
2593 | } |
2594 | - |
2595 | + |
2596 | public virtual void playClicked () { |
2597 | if(lm.media_info.media == null) { |
2598 | stdout.printf("No media is currently playing. Starting from the top\n"); |
2599 | @@ -950,9 +946,9 @@ |
2600 | w = sideTree.getWidget(sideTree.library_music_iter); |
2601 | ((ViewWrapper)w).list.set_as_current_list(1, true); |
2602 | } |
2603 | - |
2604 | + |
2605 | lm.getNext(true); |
2606 | - |
2607 | + |
2608 | lm.playing = true; |
2609 | playButton.set_stock_id(Gtk.Stock.MEDIA_PAUSE); |
2610 | lm.player.play(); |
2611 | @@ -961,7 +957,7 @@ |
2612 | if(lm.playing) { |
2613 | lm.playing = false; |
2614 | lm.player.pause(); |
2615 | - |
2616 | + |
2617 | playButton.set_stock_id(Gtk.Stock.MEDIA_PLAY); |
2618 | } |
2619 | else { |
2620 | @@ -970,19 +966,19 @@ |
2621 | playButton.set_stock_id(Gtk.Stock.MEDIA_PAUSE); |
2622 | } |
2623 | } |
2624 | - |
2625 | + |
2626 | playPauseChanged(); |
2627 | } |
2628 | - |
2629 | + |
2630 | public virtual void nextClicked() { |
2631 | // if not 90% done, skip it |
2632 | if(!added_to_play_count) { |
2633 | lm.media_info.media.skip_count++; |
2634 | - |
2635 | + |
2636 | // don't update, it will be updated eventually |
2637 | //lm.update_media(lm.media_info.media, false, false); |
2638 | } |
2639 | - |
2640 | + |
2641 | int next_id; |
2642 | if(lm.next_gapless_id != 0) { |
2643 | next_id = lm.next_gapless_id; |
2644 | @@ -990,7 +986,7 @@ |
2645 | } |
2646 | else |
2647 | next_id = lm.getNext(true); |
2648 | - |
2649 | + |
2650 | /* test to stop playback/reached end */ |
2651 | if(next_id == 0) { |
2652 | lm.player.pause(); |
2653 | @@ -999,34 +995,34 @@ |
2654 | return; |
2655 | } |
2656 | } |
2657 | - |
2658 | + |
2659 | public virtual void loveButtonClicked() { |
2660 | lm.lfm.loveTrack(lm.media_info.media.title, lm.media_info.media.artist); |
2661 | } |
2662 | - |
2663 | + |
2664 | public virtual void banButtonClicked() { |
2665 | lm.lfm.banTrack(lm.media_info.media.title, lm.media_info.media.artist); |
2666 | } |
2667 | - |
2668 | + |
2669 | public virtual void searchFieldIconPressed(EntryIconPosition p0, Gdk.Event p1) { |
2670 | Widget w = sideTree.getSelectedWidget(); |
2671 | w.focus(DirectionType.UP); |
2672 | } |
2673 | - |
2674 | + |
2675 | public virtual void millerResized(Allocation rectangle) { |
2676 | if(viewSelector.selected == 2) { |
2677 | settings.setMillerHeight(rectangle.height); |
2678 | } |
2679 | } |
2680 | - |
2681 | + |
2682 | public virtual void sourcesToMediasHandleSet(Allocation rectangle) { |
2683 | updateCurrentMedia(); |
2684 | - |
2685 | + |
2686 | if(settings.getSidebarWidth() != rectangle.width) { |
2687 | settings.setSidebarWidth(rectangle.width); |
2688 | } |
2689 | } |
2690 | - |
2691 | + |
2692 | public virtual void on_resize() { |
2693 | int width; |
2694 | int height; |
2695 | @@ -1034,7 +1030,7 @@ |
2696 | settings.setWindowWidth(width); |
2697 | settings.setWindowHeight(height); |
2698 | } |
2699 | - |
2700 | + |
2701 | public virtual void on_quit() { |
2702 | lm.settings.setLastMediaPosition((int)((double)lm.player.getPosition()/1000000000)); |
2703 | if(lm.media_info.media != null) { |
2704 | @@ -1043,36 +1039,36 @@ |
2705 | } |
2706 | lm.player.pause(); |
2707 | } |
2708 | - |
2709 | + |
2710 | public virtual void fileImportMusicClick() { |
2711 | if(!lm.doing_file_operations()) { |
2712 | /*if(!(GLib.File.new_for_path(lm.settings.getMusicFolder()).query_exists() && lm.settings.getCopyImportedMusic())) { |
2713 | - var dialog = new MessageDialog(this, DialogFlags.DESTROY_WITH_PARENT, MessageType.ERROR, ButtonsType.OK, |
2714 | + var dialog = new MessageDialog(this, DialogFlags.DESTROY_WITH_PARENT, MessageType.ERROR, ButtonsType.OK, |
2715 | "Before importing, you must mount your music folder."); |
2716 | - |
2717 | + |
2718 | var result = dialog.run(); |
2719 | dialog.destroy(); |
2720 | - |
2721 | + |
2722 | return; |
2723 | }*/ |
2724 | - |
2725 | + |
2726 | string folder = ""; |
2727 | var file_chooser = new FileChooserDialog (_("Import Music"), this, |
2728 | FileChooserAction.SELECT_FOLDER, |
2729 | Gtk.Stock.CANCEL, ResponseType.CANCEL, |
2730 | Gtk.Stock.OPEN, ResponseType.ACCEPT); |
2731 | file_chooser.set_local_only(true); |
2732 | - |
2733 | + |
2734 | if (file_chooser.run () == ResponseType.ACCEPT) { |
2735 | folder = file_chooser.get_filename(); |
2736 | } |
2737 | file_chooser.destroy (); |
2738 | - |
2739 | + |
2740 | if(folder != "" && folder != settings.getMusicFolder()) { |
2741 | if(GLib.File.new_for_path(lm.settings.getMusicFolder()).query_exists()) { |
2742 | topDisplay.set_label_markup(_("<b>Importing</b> music from <b>%s</b> to library.").printf(folder)); |
2743 | topDisplay.show_progressbar(); |
2744 | - |
2745 | + |
2746 | lm.add_folder_to_library(folder); |
2747 | updateSensitivities(); |
2748 | } |
2749 | @@ -1082,13 +1078,13 @@ |
2750 | stdout.printf("Can't add to library.. already doing file operations\n"); |
2751 | } |
2752 | } |
2753 | - |
2754 | + |
2755 | public virtual void fileRescanMusicFolderClick() { |
2756 | if(!lm.doing_file_operations()) { |
2757 | if(GLib.File.new_for_path(this.settings.getMusicFolder()).query_exists()) { |
2758 | topDisplay.set_label_markup("<b>" + _("Rescanning music folder for changes") + "</b>"); |
2759 | topDisplay.show_progressbar(); |
2760 | - |
2761 | + |
2762 | lm.rescan_music_folder(); |
2763 | updateSensitivities(); |
2764 | } |
2765 | @@ -1100,10 +1096,10 @@ |
2766 | stdout.printf("Can't rescan.. doing file operations already\n"); |
2767 | } |
2768 | } |
2769 | - |
2770 | + |
2771 | public void resetSideTree(bool clear_views) { |
2772 | sideTree.resetView(); |
2773 | - |
2774 | + |
2775 | // clear all other playlists, reset to Music, populate music |
2776 | if(clear_views) { |
2777 | stdout.printf("clearing all views...\n"); |
2778 | @@ -1121,51 +1117,50 @@ |
2779 | ViewWrapper vw = (ViewWrapper)sideTree.getWidget(sideTree.library_music_iter); |
2780 | vw.doUpdate(vw.currentView, lm.song_ids(), true, true, false); |
2781 | miller.populateColumns("", lm.song_ids()); |
2782 | - |
2783 | + |
2784 | vw = (ViewWrapper)sideTree.getWidget(sideTree.library_podcasts_iter); |
2785 | vw.doUpdate(vw.currentView, lm.podcast_ids(), true, true, false); |
2786 | - |
2787 | + |
2788 | //vw = (ViewWrapper)sideTree.getWidget(sideTree.library_audiobooks_iter); |
2789 | //vw.doUpdate(vw.currentView, lm.audiobook_ids(), true, true, false); |
2790 | - |
2791 | + |
2792 | vw = (ViewWrapper)sideTree.getWidget(sideTree.network_radio_iter); |
2793 | vw.doUpdate(vw.currentView, lm.station_ids(), true, true, false); |
2794 | } |
2795 | } |
2796 | - |
2797 | + |
2798 | public virtual void musicCounted(int count) { |
2799 | stdout.printf("found %d medias, importing.\n", count); |
2800 | } |
2801 | - |
2802 | + |
2803 | /* this is after setting the music library */ |
2804 | public virtual void musicAdded(LinkedList<string> not_imported) { |
2805 | - |
2806 | + |
2807 | if(lm.media_info.media != null) { |
2808 | updateInfoLabel(); |
2809 | } |
2810 | else |
2811 | topDisplay.set_label_text(""); |
2812 | - |
2813 | + |
2814 | //resetSideTree(false); |
2815 | //var init = searchField.get_text(); |
2816 | //searchField.set_text("up"); |
2817 | - |
2818 | + |
2819 | if(not_imported.size > 0) { |
2820 | NotImportedWindow nim = new NotImportedWindow(this, not_imported, lm.settings.getMusicFolder()); |
2821 | nim.show(); |
2822 | } |
2823 | - |
2824 | + |
2825 | updateSensitivities(); |
2826 | - |
2827 | + |
2828 | //now notify user |
2829 | try { |
2830 | notification.close(); |
2831 | if(!has_toplevel_focus) { |
2832 | notification.update(_("Import Complete"), _("BeatBox has imported your library."), "beatbox"); |
2833 | - |
2834 | - var beatbox_icon = lm.icons.beatbox_icon.render (IconSize.DIALOG, null); |
2835 | - notification.set_image_from_pixbuf(beatbox_icon); |
2836 | - |
2837 | + |
2838 | + notification.set_image_from_pixbuf(Icons.BEATBOX_DIALOG_PIXBUF); |
2839 | + |
2840 | notification.show(); |
2841 | notification.set_timeout(5000); |
2842 | } |
2843 | @@ -1174,55 +1169,55 @@ |
2844 | stderr.printf("Could not show notification: %s\n", err.message); |
2845 | } |
2846 | } |
2847 | - |
2848 | + |
2849 | /* this is when you import music from a foreign location into the library */ |
2850 | public virtual void musicImported(LinkedList<Media> new_medias, LinkedList<string> not_imported) { |
2851 | if(lm.media_info.media != null) { |
2852 | - updateInfoLabel(); |
2853 | + updateInfoLabel(); |
2854 | } |
2855 | else |
2856 | topDisplay.set_label_text(""); |
2857 | - |
2858 | + |
2859 | resetSideTree(false); |
2860 | //searchField.changed(); |
2861 | - |
2862 | + |
2863 | updateSensitivities(); |
2864 | } |
2865 | - |
2866 | + |
2867 | public virtual void musicRescanned(LinkedList<Media> new_medias, LinkedList<string> not_imported) { |
2868 | if(lm.media_info.media != null) { |
2869 | updateInfoLabel(); |
2870 | } |
2871 | else |
2872 | topDisplay.set_label_text(""); |
2873 | - |
2874 | + |
2875 | resetSideTree(false); |
2876 | //searchField.changed(); |
2877 | stdout.printf("music Rescanned\n"); |
2878 | updateSensitivities(); |
2879 | } |
2880 | - |
2881 | + |
2882 | public virtual void medias_removed(LinkedList<int> removed) { |
2883 | updateSensitivities(); |
2884 | } |
2885 | - |
2886 | + |
2887 | public void editEqualizerClick() { |
2888 | EqualizerWindow ew = new EqualizerWindow(lm, this); |
2889 | ew.show(); |
2890 | } |
2891 | - |
2892 | + |
2893 | public void editPreferencesClick() { |
2894 | PreferencesWindow pw = new PreferencesWindow(lm, this); |
2895 | - |
2896 | + |
2897 | pw.changed.connect( (folder) => { |
2898 | setMusicFolder(folder); |
2899 | }); |
2900 | } |
2901 | - |
2902 | + |
2903 | public void setMusicFolder(string folder) { |
2904 | if(lm.doing_file_operations()) |
2905 | return; |
2906 | - |
2907 | + |
2908 | if(lm.song_ids().size > 0 || lm.playlist_count() > 0) { |
2909 | var smfc = new SetMusicFolderConfirmation(lm, this, folder); |
2910 | smfc.finished.connect( (cont) => { |
2911 | @@ -1235,33 +1230,33 @@ |
2912 | lm.set_music_folder(folder); |
2913 | } |
2914 | } |
2915 | - |
2916 | + |
2917 | public virtual void end_of_stream() { |
2918 | nextClicked(); |
2919 | } |
2920 | - |
2921 | + |
2922 | public virtual void current_position_update(int64 position) { |
2923 | if(lm.media_info.media != null && lm.media_info.media.rowid == -2) // is preview |
2924 | return; |
2925 | - |
2926 | + |
2927 | double sec = 0.0; |
2928 | if(lm.media_info.media != null) { |
2929 | sec = ((double)position/1000000000); |
2930 | - |
2931 | + |
2932 | if(lm.player.set_resume_pos) { |
2933 | lm.media_info.media.resume_pos = (int)sec; |
2934 | } |
2935 | - |
2936 | + |
2937 | // at about 3 seconds, update last fm. we wait to avoid excessive querying last.fm for info |
2938 | if(position > 3000000000 && !queriedlastfm) { |
2939 | queriedlastfm = true; |
2940 | - |
2941 | + |
2942 | ViewWrapper vw = (ViewWrapper)sideTree.getWidget(sideTree.playlists_similar_iter); |
2943 | if(!vw.list.get_is_current()) { |
2944 | vw.show_retrieving_similars(); |
2945 | similarMedias.queryForSimilar(lm.media_info.media); |
2946 | } |
2947 | - |
2948 | + |
2949 | try { |
2950 | Thread.create<void*>(lastfm_track_thread_function, false); |
2951 | Thread.create<void*>(lastfm_album_thread_function, false); |
2952 | @@ -1272,22 +1267,22 @@ |
2953 | stdout.printf("ERROR: Could not create last fm thread: %s \n", err.message); |
2954 | } |
2955 | } |
2956 | - |
2957 | + |
2958 | //at 30 seconds in, we consider the media as played |
2959 | if(position > 30000000000 && !media_considered_played) { |
2960 | media_considered_played = true; |
2961 | - |
2962 | + |
2963 | lm.media_info.media.last_played = (int)time_t(); |
2964 | if(lm.media_info.media.mediatype == 1) { //podcast |
2965 | added_to_play_count = true; |
2966 | ++lm.media_info.media.play_count; |
2967 | } |
2968 | lm.update_media(lm.media_info.media, false, false); |
2969 | - |
2970 | + |
2971 | // add to the already played list |
2972 | lm.add_already_played(lm.media_info.media.rowid); |
2973 | sideTree.updateAlreadyPlayed(); |
2974 | - |
2975 | + |
2976 | #if HAVE_ZEITGEIST |
2977 | var event = new Zeitgeist.Event.full(Zeitgeist.ZG_ACCESS_EVENT, |
2978 | Zeitgeist.ZG_SCHEDULED_ACTIVITY, "app://beatbox.desktop", |
2979 | @@ -1298,7 +1293,7 @@ |
2980 | new Zeitgeist.Log ().insert_events_no_reply(event); |
2981 | #endif |
2982 | } |
2983 | - |
2984 | + |
2985 | // at halfway, scrobble |
2986 | if((double)(sec/(double)lm.media_info.media.length) > 0.50 && !scrobbled_track) { |
2987 | scrobbled_track = true; |
2988 | @@ -1309,43 +1304,43 @@ |
2989 | stdout.printf("ERROR: Could not create last fm thread: %s \n", err.message); |
2990 | } |
2991 | } |
2992 | - |
2993 | + |
2994 | // at 90% done with media, add 1 to play count |
2995 | if((double)(sec/(double)lm.media_info.media.length) > 0.90 && !added_to_play_count) { |
2996 | added_to_play_count = true; |
2997 | lm.media_info.media.play_count++; |
2998 | lm.update_media(lm.media_info.media, false, false); |
2999 | } |
3000 | - |
3001 | + |
3002 | } |
3003 | else { |
3004 | - |
3005 | + |
3006 | } |
3007 | } |
3008 | - |
3009 | + |
3010 | public void media_not_found(int id) { |
3011 | var not_found = new FileNotFoundDialog(lm, this, id); |
3012 | not_found.show(); |
3013 | } |
3014 | - |
3015 | + |
3016 | public virtual void similarRetrieved(LinkedList<int> similarIDs, LinkedList<Media> similarDont) { |
3017 | Widget w = sideTree.getWidget(sideTree.playlists_similar_iter); |
3018 | - |
3019 | + |
3020 | ((ViewWrapper)w).similarsFetched = true; |
3021 | ((ViewWrapper)w).doUpdate(((ViewWrapper)w).currentView, similarIDs, true, true, false); |
3022 | - |
3023 | + |
3024 | infoPanel.updateMediaList(similarDont); |
3025 | - |
3026 | + |
3027 | if(((ViewWrapper)w).isCurrentView && !((ViewWrapper)w).list.get_is_current()) { |
3028 | miller.populateColumns("", ((ViewWrapper)w).list.get_medias()); |
3029 | updateMillerColumns(); |
3030 | } |
3031 | } |
3032 | - |
3033 | + |
3034 | public void set_statusbar_text(string text) { |
3035 | statusBarLabel.set_text(text); |
3036 | } |
3037 | - |
3038 | + |
3039 | public void welcomeScreenActivated(int index) { |
3040 | if(index == 0) { |
3041 | if(!lm.doing_file_operations()) { |
3042 | @@ -1359,7 +1354,7 @@ |
3043 | folder = file_chooser.get_filename(); |
3044 | } |
3045 | file_chooser.destroy (); |
3046 | - |
3047 | + |
3048 | if(folder != "" && (folder != settings.getMusicFolder() || lm.media_count() == 0)) { |
3049 | setMusicFolder(folder); |
3050 | } |
3051 | @@ -1368,18 +1363,18 @@ |
3052 | else { |
3053 | if(lm.doing_file_operations()) |
3054 | return; |
3055 | - |
3056 | + |
3057 | Device d = welcome_screen_keys.get(index); |
3058 | - |
3059 | + |
3060 | if(d.getContentType() == "cdrom") { |
3061 | sideTree.expandItem(sideTree.convertToFilter(sideTree.devices_iter), true); |
3062 | sideTree.setSelectedIter(sideTree.convertToFilter(sideTree.devices_cdrom_iter)); |
3063 | sideTree.sideListSelectionChange(); |
3064 | - |
3065 | + |
3066 | var to_transfer = new LinkedList<int>(); |
3067 | foreach(int i in d.get_medias()) |
3068 | to_transfer.add(i); |
3069 | - |
3070 | + |
3071 | d.transfer_to_library(to_transfer); |
3072 | } |
3073 | else { |
3074 | @@ -1390,21 +1385,21 @@ |
3075 | if(lm.media_from_id(i).isTemporary) |
3076 | externals.add(i); |
3077 | } |
3078 | - |
3079 | + |
3080 | TransferFromDeviceDialog tfdd = new TransferFromDeviceDialog(this, d, externals); |
3081 | tfdd.show(); |
3082 | } |
3083 | } |
3084 | } |
3085 | } |
3086 | - |
3087 | + |
3088 | public virtual void infoPanelResized(Allocation rectangle) { |
3089 | int height, width; |
3090 | get_size(out width, out height); |
3091 | - |
3092 | + |
3093 | if(sourcesToMedias.get_position() > height/2) |
3094 | return; |
3095 | - |
3096 | + |
3097 | if(mediasToInfo.get_position() < (lm.settings.getWindowWidth() - lm.settings.getSidebarWidth()) - 300) { // this is max size |
3098 | mediasToInfo.set_position((lm.settings.getWindowWidth() - lm.settings.getSidebarWidth()) - 300); |
3099 | return; |
3100 | @@ -1413,15 +1408,15 @@ |
3101 | mediasToInfo.set_position((lm.settings.getWindowWidth() - lm.settings.getSidebarWidth()) - 150); |
3102 | return; |
3103 | } |
3104 | - |
3105 | + |
3106 | if(lm.settings.getMoreWidth() != rectangle.width) { |
3107 | lm.settings.setMoreWidth(rectangle.width); |
3108 | } |
3109 | } |
3110 | - |
3111 | + |
3112 | public virtual void repeatChooserOptionChanged(int val) { |
3113 | lm.settings.setRepeatMode(val); |
3114 | - |
3115 | + |
3116 | if(val == 0) |
3117 | lm.repeat = LibraryManager.Repeat.OFF; |
3118 | else if(val == 1) |
3119 | @@ -1433,42 +1428,42 @@ |
3120 | else if(val == 4) |
3121 | lm.repeat = LibraryManager.Repeat.ALL; |
3122 | } |
3123 | - |
3124 | + |
3125 | public virtual void shuffleChooserOptionChanged(int val) { |
3126 | if(val == 0) |
3127 | lm.setShuffleMode(LibraryManager.Shuffle.OFF, true); |
3128 | else if(val == 1) |
3129 | lm.setShuffleMode(LibraryManager.Shuffle.ALL, true); |
3130 | } |
3131 | - |
3132 | + |
3133 | public virtual void infoPanelChooserOptionChanged(int val) { |
3134 | infoPanel.set_visible(val == 1); |
3135 | lm.settings.setMoreVisible(val == 1); |
3136 | } |
3137 | - |
3138 | + |
3139 | public void updateMillerColumns() { |
3140 | if(viewSelector.selected != 3) |
3141 | settings.setViewMode(viewSelector.selected); |
3142 | - |
3143 | - bool similarcheck = sideTree.getSelectedWidget() is ViewWrapper && |
3144 | - ((ViewWrapper)sideTree.getSelectedWidget()).errorBox != null && |
3145 | + |
3146 | + bool similarcheck = sideTree.getSelectedWidget() is ViewWrapper && |
3147 | + ((ViewWrapper)sideTree.getSelectedWidget()).errorBox != null && |
3148 | ((ViewWrapper)sideTree.getSelectedWidget()).errorBox.visible; |
3149 | bool isCdrom = sideTree.getSelectedObject() is Device && ((Device)sideTree.getSelectedObject()).getContentType() == "cdrom"; |
3150 | bool isDeviceView = sideTree.getSelectedWidget() is DeviceView/* && ((DeviceView)sideTree.getSelectedWidget()).currentViewIndex() == 0*/; |
3151 | bool storecheck = (sideTree.getSelectedWidget() is Store.StoreView); |
3152 | bool haveMedias = (lm.media_count() != 0); |
3153 | - |
3154 | + |
3155 | miller.set_visible(viewSelector.selected == 2 && !similarcheck && !storecheck && !isCdrom && !isDeviceView && haveMedias); |
3156 | millerVisible = (viewSelector.selected == 0); // used for when an album is clicked from icon view |
3157 | - |
3158 | + |
3159 | // populate if selected == 2 (miller columns) |
3160 | /*if(initializationFinished && viewSelector.selected == 2 && sideTree.getSelectedWidget() is ViewWrapper && miller.visible) { |
3161 | ViewWrapper vw = (ViewWrapper)sideTree.getSelectedWidget(); |
3162 | - |
3163 | + |
3164 | miller.populateColumns("", vw.medias); |
3165 | }*/ |
3166 | } |
3167 | - |
3168 | + |
3169 | // create a thread to update ALL non-visible views |
3170 | void searchFieldChanged() { |
3171 | if(initializationFinished && searchField.get_text().length != 1) { |
3172 | @@ -1476,7 +1471,7 @@ |
3173 | Thread.create<void*>(lm.update_views_thread, false); |
3174 | } |
3175 | catch(GLib.ThreadError err) { |
3176 | - |
3177 | + |
3178 | } |
3179 | } |
3180 | } |
3181 | @@ -1487,7 +1482,7 @@ |
3182 | Thread.create<void*>(lm.update_views_thread, false); |
3183 | } |
3184 | catch(GLib.ThreadError err) { |
3185 | - |
3186 | + |
3187 | } |
3188 | } |
3189 | } |
3190 | @@ -1498,50 +1493,50 @@ |
3191 | vw.doUpdate(vw.currentView, vw.medias, false, false, true); |
3192 | } |
3193 | }); |
3194 | - |
3195 | - return null; |
3196 | + |
3197 | + return null; |
3198 | }*/ |
3199 | - |
3200 | + |
3201 | public void searchFieldActivate() { |
3202 | Widget w = sideTree.getSelectedWidget(); |
3203 | - |
3204 | + |
3205 | if(w is ViewWrapper) { |
3206 | ViewWrapper vw = (ViewWrapper)w; |
3207 | - |
3208 | + |
3209 | vw.list.set_as_current_list(1, !vw.list.get_is_current()); |
3210 | lm.current_index = 0; |
3211 | lm.playMedia(lm.mediaFromCurrentIndex(0), false); |
3212 | - |
3213 | + |
3214 | if(!lm.playing) |
3215 | playClicked(); |
3216 | } |
3217 | } |
3218 | - |
3219 | + |
3220 | public virtual void dragReceived(Gdk.DragContext context, int x, int y, Gtk.SelectionData data, uint info, uint timestamp) { |
3221 | if(dragging_from_music) |
3222 | return; |
3223 | - |
3224 | + |
3225 | var files_dragged = new LinkedList<string>(); |
3226 | stdout.printf("dragged\n"); |
3227 | foreach (string uri in data.get_uris ()) { |
3228 | files_dragged.add(File.new_for_uri(uri).get_path()); |
3229 | } |
3230 | - |
3231 | + |
3232 | lm.add_files_to_library(files_dragged); |
3233 | } |
3234 | - |
3235 | + |
3236 | public void doAlert(string title, string message) { |
3237 | - var dialog = new MessageDialog(this, DialogFlags.MODAL, MessageType.ERROR, ButtonsType.OK, |
3238 | + var dialog = new MessageDialog(this, DialogFlags.MODAL, MessageType.ERROR, ButtonsType.OK, |
3239 | title); |
3240 | - |
3241 | + |
3242 | dialog.title = "BeatBox"; |
3243 | dialog.secondary_text = message; |
3244 | dialog.secondary_use_markup = true; |
3245 | - |
3246 | + |
3247 | dialog.run(); |
3248 | dialog.destroy(); |
3249 | } |
3250 | - |
3251 | + |
3252 | /* device stuff for welcome screen */ |
3253 | public void device_added(Device d) { |
3254 | // add option to import in welcome screen |
3255 | @@ -1549,7 +1544,7 @@ |
3256 | int key = welcomeScreen.append_with_image( new Image.from_gicon(d.get_icon(), Gtk.IconSize.DIALOG), d.getDisplayName(), secondary); |
3257 | welcome_screen_keys.set(key, d); |
3258 | } |
3259 | - |
3260 | + |
3261 | public void device_removed(Device d) { |
3262 | // remove option to import from welcome screen |
3263 | int key = 0; |
3264 | @@ -1559,10 +1554,11 @@ |
3265 | break; |
3266 | } |
3267 | } |
3268 | - |
3269 | + |
3270 | if(key != 0) { |
3271 | welcome_screen_keys.unset(key); |
3272 | welcomeScreen.remove_with_key(key); |
3273 | } |
3274 | } |
3275 | } |
3276 | + |
3277 | |
3278 | === modified file 'src/Objects/EqualizerPreset.vala' |
3279 | --- src/Objects/EqualizerPreset.vala 2011-11-22 03:08:33 +0000 |
3280 | +++ src/Objects/EqualizerPreset.vala 2012-01-31 01:07:25 +0000 |
3281 | @@ -27,16 +27,7 @@ |
3282 | public string name; |
3283 | public ArrayList<int> gains; |
3284 | |
3285 | - private bool _default_preset = false; |
3286 | - |
3287 | - public bool is_default { |
3288 | - get { |
3289 | - return _default_preset; |
3290 | - } |
3291 | - set { |
3292 | - _default_preset = value; |
3293 | - } |
3294 | - } |
3295 | + public bool is_default { get; set;} |
3296 | |
3297 | public EqualizerPreset.basic(string name) { |
3298 | this.name = name; |
3299 | |
3300 | === added file 'src/Objects/Icon.vala' |
3301 | --- src/Objects/Icon.vala 1970-01-01 00:00:00 +0000 |
3302 | +++ src/Objects/Icon.vala 2012-01-31 01:07:25 +0000 |
3303 | @@ -0,0 +1,222 @@ |
3304 | +/*- |
3305 | + * Copyright (c) 2011 Scott Ringwelski <sgringwe@mtu.edu> |
3306 | + * |
3307 | + * Originally Written by Scott Ringwelski and Victor Eduardo for |
3308 | + * BeatBox Music Player: http://www.launchpad.net/beat-box |
3309 | + * |
3310 | + * This library is free software; you can redistribute it and/or |
3311 | + * modify it under the terms of the GNU Library General Public |
3312 | + * License as published by the Free Software Foundation; either |
3313 | + * version 2 of the License, or (at your option) any later version. |
3314 | + * |
3315 | + * This library is distributed in the hope that it will be useful, |
3316 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3317 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3318 | + * Library General Public License for more details. |
3319 | + * |
3320 | + * You should have received a copy of the GNU Library General Public |
3321 | + * License along with this library; if not, write to the |
3322 | + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
3323 | + * Boston, MA 02111-1307, USA. |
3324 | + */ |
3325 | + |
3326 | +/* |
3327 | + * TODO: |
3328 | + * - Add built-in icons. |
3329 | + * - Improve code in some areas |
3330 | + */ |
3331 | + |
3332 | +using Gtk; |
3333 | + |
3334 | +public class BeatBox.Icon : GLib.Object { |
3335 | + |
3336 | + public string name {get; private set;} |
3337 | + |
3338 | + public bool has_backup { |
3339 | + get { |
3340 | + return (this.backup != null); |
3341 | + } |
3342 | + } |
3343 | + |
3344 | + private string? backup; |
3345 | + private int? size; |
3346 | + private Icons.Type? type; |
3347 | + private Icons.FileType? file_type; |
3348 | + |
3349 | + public Icon (string name, int? size, Icons.Type? type, Icons.FileType? file_type, bool has_backup) { |
3350 | + |
3351 | + this.name = name; |
3352 | + this.size = size; |
3353 | + this.type = type; |
3354 | + this.file_type = file_type; |
3355 | + |
3356 | + /** |
3357 | + * The following code creates a backup path for the icon. |
3358 | + * This ensures consistency in the way we store icons in the |
3359 | + * 'images' folder. |
3360 | + **/ |
3361 | + if (has_backup && type != null && size != null) { |
3362 | + string size_folder, type_folder, actual_icon_name; |
3363 | + |
3364 | + if (size != null) |
3365 | + size_folder = size.to_string() + "x" + size.to_string(); |
3366 | + else |
3367 | + size_folder = ""; |
3368 | + |
3369 | + switch (type) |
3370 | + { |
3371 | + case Icons.Type.MIMETYPE: |
3372 | + type_folder = Icons.MIMETYPES_FOLDER; |
3373 | + break; |
3374 | + case Icons.Type.ACTION: |
3375 | + type_folder = Icons.ACTIONS_FOLDER; |
3376 | + break; |
3377 | + case Icons.Type.STATUS: |
3378 | + type_folder = Icons.STATUS_FOLDER; |
3379 | + break; |
3380 | + case Icons.Type.APP: |
3381 | + type_folder = Icons.APPS_FOLDER; |
3382 | + break; |
3383 | + default: |
3384 | + type_folder = ""; |
3385 | + break; |
3386 | + } |
3387 | + |
3388 | + if (file_type != null) { |
3389 | + switch (file_type) |
3390 | + { |
3391 | + case Icons.FileType.SVG: |
3392 | + actual_icon_name = this.name + Icons.SVG_EXT; |
3393 | + break; |
3394 | + case Icons.FileType.PNG: |
3395 | + actual_icon_name = this.name + Icons.PNG_EXT; |
3396 | + break; |
3397 | + default: |
3398 | + actual_icon_name = this.name + Icons.SVG_EXT; |
3399 | + break; |
3400 | + } |
3401 | + } |
3402 | + else { |
3403 | + actual_icon_name = name + Icons.SVG_EXT; |
3404 | + } |
3405 | + |
3406 | + var icon_path = GLib.Path.build_path("/", Build.ICON_FOLDER, size_folder, type_folder); |
3407 | + IconTheme.get_default().append_search_path (icon_path); |
3408 | + this.backup = GLib.Path.build_filename("/", Build.ICON_FOLDER, size_folder, type_folder, actual_icon_name); |
3409 | + } |
3410 | + else { |
3411 | + this.backup = null; |
3412 | + } |
3413 | + } |
3414 | + |
3415 | + public GLib.Icon get_gicon () { |
3416 | + return new GLib.ThemedIcon.with_default_fallbacks (this.name); |
3417 | + } |
3418 | + |
3419 | + public Gtk.IconInfo? get_icon_info (int size) { |
3420 | + var icon_theme = IconTheme.get_default(); |
3421 | + var lookup_flags = Gtk.IconLookupFlags.GENERIC_FALLBACK; |
3422 | + return icon_theme.lookup_by_gicon (get_gicon(), size, lookup_flags); |
3423 | + } |
3424 | + |
3425 | + public Gdk.Pixbuf? render (Gtk.IconSize? size, StyleContext? context = null, int px_size = 0) { |
3426 | + Gdk.Pixbuf? rv = null; |
3427 | + int width = 16, height = 16; |
3428 | + |
3429 | + // Don't load image as a regular icon if it's a PNG and belongs |
3430 | + // to the project's folder. |
3431 | + if (file_type == Icons.FileType.PNG && backup != null && size == null) { |
3432 | + try { |
3433 | + rv = new Gdk.Pixbuf.from_file(backup); |
3434 | + } |
3435 | + catch(Error err) { |
3436 | + warning ("Could not load PNG image: %s\n", err.message); |
3437 | + } |
3438 | + |
3439 | + return rv; |
3440 | + } |
3441 | + |
3442 | + // If a null size was passed, use original size |
3443 | + if (size != null) { |
3444 | + icon_size_lookup (size, out width, out height); |
3445 | + } |
3446 | + else if (px_size > 0) { |
3447 | + width = px_size; |
3448 | + height = px_size; |
3449 | + } |
3450 | + else if (this.size != null) { |
3451 | + width = this.size; |
3452 | + height = width; |
3453 | + } |
3454 | + |
3455 | + // Try to load icon from theme |
3456 | + if (IconTheme.get_default().has_icon(this.name)) { |
3457 | + try { |
3458 | + var icon_info = get_icon_info (height); |
3459 | + if (icon_info != null) { |
3460 | + if (context != null) |
3461 | + rv = icon_info.load_symbolic_for_context (context); |
3462 | + else |
3463 | + rv = icon_info.load_icon (); |
3464 | + } |
3465 | + } |
3466 | + catch (Error err) { |
3467 | + warning ("%s, falling back to BeatBox default.", err.message); |
3468 | + } |
3469 | + } |
3470 | + |
3471 | + // If the above failed, use available backup |
3472 | + if (rv == null && this.backup != null) { |
3473 | + try { |
3474 | + warning ("Loading backup icon for %s", this.name); |
3475 | + rv = new Gdk.Pixbuf.from_file_at_size (this.backup, width, height); |
3476 | + } |
3477 | + catch (Error err) { |
3478 | + warning ("Couldn't load backup icon: %s", err.message); |
3479 | + } |
3480 | + } |
3481 | + |
3482 | + return rv; |
3483 | + } |
3484 | + |
3485 | + /** |
3486 | + * Use this method for loading symbolic icons. They will follow every state. |
3487 | + **/ |
3488 | + public Gtk.Image? render_image (Gtk.IconSize? size, Gtk.StyleContext? ctx = null, int px_size = 0) { |
3489 | + Gtk.Image? rv = null; |
3490 | + int width = 16, height = 16; |
3491 | + |
3492 | + // If a null size was passed, use original size |
3493 | + if (size != null) { |
3494 | + icon_size_lookup (size, out width, out height); |
3495 | + } |
3496 | + else if (px_size > 0) { |
3497 | + width = px_size; |
3498 | + height = px_size; |
3499 | + } |
3500 | + else if (this.size != null) { |
3501 | + width = this.size; |
3502 | + height = width; |
3503 | + } |
3504 | + |
3505 | + if (IconTheme.get_default().has_icon (this.name) && size != null) { |
3506 | + // Try to load icon from theme |
3507 | + rv = new Image.from_icon_name (this.name, size); |
3508 | + } else if (this.backup != null) { |
3509 | + // If the icon theme doesn't contain the icon, load backup |
3510 | + warning ("Loading %s from backup", this.name); |
3511 | + rv = new Image.from_file (this.backup); |
3512 | + } else { |
3513 | + // And if there was no backup, use the default method |
3514 | + warning ("Loading %s using default method", this.name); |
3515 | + rv = new Image.from_pixbuf (this.render (size, ctx)); |
3516 | + } |
3517 | + |
3518 | + // Resize image if necessary |
3519 | + if (rv.get_pixel_size () != height) |
3520 | + rv.set_pixel_size (height); |
3521 | + |
3522 | + return rv; |
3523 | + } |
3524 | +} |
3525 | + |
3526 | |
3527 | === removed file 'src/Objects/Icons.vala' |
3528 | --- src/Objects/Icons.vala 2012-01-28 04:23:58 +0000 |
3529 | +++ src/Objects/Icons.vala 1970-01-01 00:00:00 +0000 |
3530 | @@ -1,272 +0,0 @@ |
3531 | -/*- |
3532 | - * Copyright (c) 2011 Scott Ringwelski <sgringwe@mtu.edu> |
3533 | - * |
3534 | - * Originally Written by Scott Ringwelski and Victor Eduardo for |
3535 | - * BeatBox Music Player: http://www.launchpad.net/beat-box |
3536 | - * |
3537 | - * This library is free software; you can redistribute it and/or |
3538 | - * modify it under the terms of the GNU Library General Public |
3539 | - * License as published by the Free Software Foundation; either |
3540 | - * version 2 of the License, or (at your option) any later version. |
3541 | - * |
3542 | - * This library is distributed in the hope that it will be useful, |
3543 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3544 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3545 | - * Library General Public License for more details. |
3546 | - * |
3547 | - * You should have received a copy of the GNU Library General Public |
3548 | - * License along with this library; if not, write to the |
3549 | - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
3550 | - * Boston, MA 02111-1307, USA. |
3551 | - */ |
3552 | - |
3553 | -using Gtk; |
3554 | - |
3555 | -public class BeatBox.Icon : GLib.Object { |
3556 | - |
3557 | - public enum IconType { |
3558 | - MIMETYPE, |
3559 | - ACTION, |
3560 | - STATUS, |
3561 | - APP |
3562 | - } |
3563 | - |
3564 | - private const string MIMETYPES_FOLDER = "mimetypes"; |
3565 | - private const string ACTIONS_FOLDER = "actions"; |
3566 | - private const string STATUS_FOLDER = "status"; |
3567 | - private const string APPS_FOLDER = "apps"; |
3568 | - |
3569 | - public enum IconFileType { |
3570 | - SVG, |
3571 | - PNG |
3572 | - } |
3573 | - |
3574 | - public string icon_name { |
3575 | - get { |
3576 | - return this.name; |
3577 | - } |
3578 | - } |
3579 | - |
3580 | - public bool has_backup { |
3581 | - get { |
3582 | - return (this.backup != null); |
3583 | - } |
3584 | - } |
3585 | - |
3586 | - private string name; |
3587 | - private string? backup; |
3588 | - private int? size; |
3589 | - private IconType? type; |
3590 | - private IconFileType? file_type; |
3591 | - |
3592 | - public Icon (string name, int? size, IconType? type, IconFileType? file_type, bool has_backup) { |
3593 | - |
3594 | - this.name = name; |
3595 | - this.size = size; |
3596 | - this.type = type; |
3597 | - this.file_type = file_type; |
3598 | - |
3599 | - /** |
3600 | - * The following code creates a backup path for the icon. |
3601 | - * This ensures consistency in the way we store icons in the |
3602 | - * 'images' folder. |
3603 | - **/ |
3604 | - if (has_backup && type != null && size != null) { |
3605 | - string size_folder, type_folder, actual_icon_name; |
3606 | - |
3607 | - if (size != null) |
3608 | - size_folder = size.to_string() + "x" + size.to_string(); |
3609 | - else |
3610 | - size_folder = ""; |
3611 | - |
3612 | - switch (type) |
3613 | - { |
3614 | - case IconType.MIMETYPE: |
3615 | - type_folder = MIMETYPES_FOLDER; |
3616 | - break; |
3617 | - case IconType.ACTION: |
3618 | - type_folder = ACTIONS_FOLDER; |
3619 | - break; |
3620 | - case IconType.STATUS: |
3621 | - type_folder = STATUS_FOLDER; |
3622 | - break; |
3623 | - case IconType.APP: |
3624 | - type_folder = APPS_FOLDER; |
3625 | - break; |
3626 | - default: |
3627 | - type_folder = ""; |
3628 | - break; |
3629 | - } |
3630 | - |
3631 | - if (file_type != null) { |
3632 | - switch (file_type) |
3633 | - { |
3634 | - case IconFileType.SVG: |
3635 | - actual_icon_name = this.name + ".svg"; |
3636 | - break; |
3637 | - case IconFileType.PNG: |
3638 | - actual_icon_name = this.name + ".png"; |
3639 | - break; |
3640 | - default: |
3641 | - actual_icon_name = this.name + ".svg"; |
3642 | - break; |
3643 | - } |
3644 | - } |
3645 | - else { |
3646 | - actual_icon_name = name + ".svg"; |
3647 | - } |
3648 | - |
3649 | - var icon_path = GLib.Path.build_path("/", Build.ICON_FOLDER, "hicolor", size_folder, type_folder); |
3650 | - IconTheme.get_default().append_search_path (icon_path); |
3651 | - this.backup = GLib.Path.build_filename("/", Build.ICON_FOLDER, "hicolor", size_folder, type_folder, actual_icon_name); |
3652 | - } |
3653 | - else { |
3654 | - this.backup = null; |
3655 | - } |
3656 | - } |
3657 | - |
3658 | - public Gdk.Pixbuf? render (Gtk.IconSize? size, StyleContext? context) { |
3659 | - Gdk.Pixbuf? rv = null; |
3660 | - int width = 16, height = 16; |
3661 | - |
3662 | - // Don't load the image as a regular icon if it's a PNG and belongs |
3663 | - // to the project's folder. |
3664 | - if (file_type == IconFileType.PNG && backup != null && size == null) { |
3665 | - try { |
3666 | - rv = new Gdk.Pixbuf.from_file(backup); |
3667 | - } |
3668 | - catch(Error err) { |
3669 | - stdout.printf("Could not load PNG image: %s\n", err.message); |
3670 | - } |
3671 | - |
3672 | - return rv; |
3673 | - } |
3674 | - |
3675 | - // If a null size was passed, use the original size |
3676 | - if (this.size != null) { |
3677 | - width = this.size; |
3678 | - height = this.size; |
3679 | - } |
3680 | - |
3681 | - if (size != null) |
3682 | - icon_size_lookup (size, out width, out height); |
3683 | - |
3684 | - // Try to load the icon from the icon theme |
3685 | - if (IconTheme.get_default().has_icon(this.name)) { |
3686 | - try { |
3687 | - var themed_icon = new GLib.ThemedIcon.with_default_fallbacks (this.name); |
3688 | - Gtk.IconInfo? icon_info = IconTheme.get_default().lookup_by_gicon (themed_icon as GLib.Icon, height, Gtk.IconLookupFlags.GENERIC_FALLBACK); |
3689 | - if (icon_info != null) { |
3690 | - if (context != null) |
3691 | - rv = icon_info.load_symbolic_for_context (context); |
3692 | - else |
3693 | - rv = icon_info.load_icon (); |
3694 | - } |
3695 | - } |
3696 | - catch (Error err) { |
3697 | - warning ("%s, falling back to BeatBox default.", err.message); |
3698 | - } |
3699 | - } |
3700 | - |
3701 | - if (rv == null && this.backup != null) { |
3702 | - try { |
3703 | - rv = new Gdk.Pixbuf.from_file_at_size (this.backup, width, height); |
3704 | - } |
3705 | - catch (Error err) { |
3706 | - warning ("Couldn't load backup icon: %s", err.message); |
3707 | - } |
3708 | - } |
3709 | - |
3710 | - return rv; |
3711 | - } |
3712 | -} |
3713 | - |
3714 | -public class BeatBox.Icons : GLib.Object { |
3715 | - LibraryManager lm; |
3716 | - LibraryWindow lw; |
3717 | - |
3718 | - public Icon default_album_art; |
3719 | - public Icon drop_album; |
3720 | - |
3721 | - public Icon music_folder; |
3722 | - |
3723 | - public Icon beatbox_icon; |
3724 | - public Icon radio_icon; |
3725 | - public Icon music_icon; |
3726 | - public Icon podcast_icon; |
3727 | - public Icon audiobook_icon; |
3728 | - public Icon history_icon; |
3729 | - public Icon playlist_icon; |
3730 | - public Icon smart_playlist_icon; |
3731 | - public Icon lastfm_love_icon; |
3732 | - public Icon lastfm_ban_icon; |
3733 | - public Icon starred_icon; |
3734 | - public Icon not_starred_icon; |
3735 | - public Icon info_icon; |
3736 | - public Icon new_podcast_icon; |
3737 | - public Icon ok_icon; |
3738 | - |
3739 | - /** Symbolic icons **/ |
3740 | - public Icon now_playing_icon; |
3741 | - public Icon process_stop_icon; |
3742 | - public Icon process_completed_icon; |
3743 | - public Icon process_error_icon; |
3744 | - public Icon shuffle_on_icon; |
3745 | - public Icon shuffle_off_icon; |
3746 | - public Icon repeat_on_icon; |
3747 | - public Icon repeat_once_icon; |
3748 | - public Icon repeat_off_icon; |
3749 | - public Icon view_column_icon; |
3750 | - public Icon view_details_icon; |
3751 | - public Icon view_icons_icon; |
3752 | - public Icon view_video_icon; |
3753 | - |
3754 | - public Icons (LibraryManager lm, LibraryWindow lw) { |
3755 | - this.lm = lm; |
3756 | - this.lw = lw; |
3757 | - } |
3758 | - |
3759 | - public void load_icons () { |
3760 | - |
3761 | - // 128 x 128 |
3762 | - default_album_art = new Icon ("media-audio", 128, Icon.IconType.MIMETYPE, Icon.IconFileType.PNG, true); |
3763 | - drop_album = new Icon ("drop-album", 128, Icon.IconType.MIMETYPE, null, true); |
3764 | - music_folder = new Icon ("folder-music", 128, Icon.IconType.MIMETYPE, null, true); |
3765 | - |
3766 | - // 22 x 22 |
3767 | - history_icon = new Icon ("document-open-recent", 22, Icon.IconType.ACTION, null, true); |
3768 | - |
3769 | - // 16 x 16 |
3770 | - beatbox_icon = new Icon ("beatbox", 16, Icon.IconType.APP, null, true); |
3771 | - radio_icon = new Icon ("internet-radio", 16, Icon.IconType.MIMETYPE, null, true); |
3772 | - music_icon = new Icon ("library-music", 16, Icon.IconType.MIMETYPE, null, true); |
3773 | - podcast_icon = new Icon ("library-podcast", 16, Icon.IconType.MIMETYPE, null, true); |
3774 | - //audiobook_icon = new Icon ("library-audiobook", 16, Icon.IconType.MIMETYPE, null, true); |
3775 | - playlist_icon = new Icon ("playlist", 16, Icon.IconType.MIMETYPE, null, true); |
3776 | - smart_playlist_icon = new Icon ("playlist-automatic", 16, Icon.IconType.MIMETYPE, null, true); |
3777 | - lastfm_love_icon = new Icon ("lastfm-love", 16, Icon.IconType.ACTION, null, true); |
3778 | - lastfm_ban_icon = new Icon ("lastfm-ban", 16, Icon.IconType.ACTION, null, true); |
3779 | - starred_icon = new Icon ("starred", 16, Icon.IconType.STATUS, null, true); |
3780 | - not_starred_icon = new Icon ("not-starred", 16, Icon.IconType.STATUS, null, true); |
3781 | - info_icon = new Icon ("help-info", 16, Icon.IconType.STATUS, null, true); |
3782 | - new_podcast_icon = new Icon ("podcast-new", 16, Icon.IconType.STATUS, null, true); |
3783 | - |
3784 | - ok_icon = new Icon ("dialog-ok", 16, Icon.IconType.ACTION, null, false); |
3785 | - |
3786 | - // SYMBOLIC ICONS |
3787 | - process_completed_icon = new Icon ("process-completed-symbolic", 16, Icon.IconType.STATUS, null, true); |
3788 | - process_error_icon = new Icon ("process-error-symbolic", 16, Icon.IconType.STATUS, null, true); |
3789 | - now_playing_icon = new Icon ("audio-volume-high-symbolic", 16, Icon.IconType.STATUS, null, true); |
3790 | - process_stop_icon = new Icon ("process-stop-symbolic", 16, Icon.IconType.ACTION, null, true); |
3791 | - shuffle_on_icon = new Icon ("media-playlist-shuffle-symbolic", 16, Icon.IconType.STATUS, null, true); |
3792 | - shuffle_off_icon = new Icon ("media-playlist-no-shuffle-symbolic", 16, Icon.IconType.STATUS, null, true); |
3793 | - repeat_on_icon = new Icon ("media-playlist-repeat-symbolic", 16, Icon.IconType.STATUS, null, true); |
3794 | - repeat_once_icon = new Icon ("media-playlist-repeat-one-symbolic", 16, Icon.IconType.STATUS, null, true); |
3795 | - repeat_off_icon = new Icon ("media-playlist-no-repeat-symbolic", 16, Icon.IconType.STATUS, null, true); |
3796 | - view_column_icon = new Icon ("view-list-column-symbolic", 16, Icon.IconType.ACTION, null, true); |
3797 | - view_details_icon =new Icon ("view-list-details-symbolic", 16, Icon.IconType.ACTION, null, true); |
3798 | - view_icons_icon = new Icon ("view-list-icons-symbolic", 16, Icon.IconType.ACTION, null, true); |
3799 | - view_video_icon = new Icon ("view-list-video-symbolic", 16, Icon.IconType.ACTION, null, true); |
3800 | - } |
3801 | -} |
3802 | - |
3803 | |
3804 | === modified file 'src/Views/AlbumView/AlbumIconView.vala' |
3805 | --- src/Views/AlbumView/AlbumIconView.vala 2012-01-28 04:23:58 +0000 |
3806 | +++ src/Views/AlbumView/AlbumIconView.vala 2012-01-31 01:07:25 +0000 |
3807 | @@ -20,6 +20,9 @@ |
3808 | bool _is_current_view; |
3809 | bool needsUpdate; |
3810 | |
3811 | + private const int BORDER_WIDTH = 6; |
3812 | + private const int ITEM_WIDTH = Icons.ALBUM_VIEW_IMAGE_SIZE + BORDER_WIDTH; |
3813 | + |
3814 | public signal void itemClicked(string artist, string album); |
3815 | |
3816 | /* medias should be mutable, as we will be sorting it */ |
3817 | @@ -42,9 +45,9 @@ |
3818 | _showing_medias = new HashMap<string, LinkedList<int>>(); |
3819 | last_search = ""; |
3820 | timeout_search = new LinkedList<string>(); |
3821 | - |
3822 | - defaultPix = lm.icons.default_album_art.render (null, null); |
3823 | - |
3824 | + |
3825 | + defaultPix = Icons.DEFAULT_ALBUM_ART_PIXBUF; |
3826 | + |
3827 | buildUI(); |
3828 | |
3829 | lm.medias_removed.connect(medias_removed); |
3830 | @@ -58,7 +61,7 @@ |
3831 | |
3832 | icons.set_pixbuf_column(0); |
3833 | icons.set_markup_column(1); |
3834 | - icons.set_item_width(134); |
3835 | + icons.set_item_width(ITEM_WIDTH); |
3836 | icons.item_padding = 0; |
3837 | icons.spacing = 2; |
3838 | icons.margin = 20; |
3839 | |
3840 | === modified file 'src/Views/AlbumView/AlbumListView.vala' |
3841 | --- src/Views/AlbumView/AlbumListView.vala 2012-01-28 03:27:32 +0000 |
3842 | +++ src/Views/AlbumView/AlbumListView.vala 2012-01-31 01:07:25 +0000 |
3843 | @@ -1,77 +1,101 @@ |
3844 | +/*- |
3845 | + * Copyright (c) 2011 Scott Ringwelski <sgringwe@mtu.edu> |
3846 | + * |
3847 | + * Originally Written by Scott Ringwelski for BeatBox Music Player |
3848 | + * BeatBox Music Player: http://www.launchpad.net/beat-box |
3849 | + * |
3850 | + * This library is free software; you can redistribute it and/or |
3851 | + * modify it under the terms of the GNU Library General Public |
3852 | + * License as published by the Free Software Foundation; either |
3853 | + * version 2 of the License, or (at your option) any later version. |
3854 | + * |
3855 | + * This library is distributed in the hope that it will be useful, |
3856 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3857 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3858 | + * Library General Public License for more details. |
3859 | + * |
3860 | + * You should have received a copy of the GNU Library General Public |
3861 | + * License along with this library; if not, write to the |
3862 | + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
3863 | + * Boston, MA 02111-1307, USA. |
3864 | + */ |
3865 | + |
3866 | using Gee; |
3867 | using Gtk; |
3868 | |
3869 | +/* TODO: Make the entire window draggable */ |
3870 | + |
3871 | public class BeatBox.AlbumListView : Window { |
3872 | LibraryManager lm; |
3873 | - |
3874 | + |
3875 | Label album_label; |
3876 | Label artist_label; |
3877 | RatingWidget rating; |
3878 | MusicTreeView mtv; |
3879 | bool setting_songs; |
3880 | - |
3881 | + |
3882 | private const string WIDGET_STYLESHEET = """ |
3883 | - .AlbumListDialogBase { |
3884 | + .AlbumListDialogBase { |
3885 | background-color: none; |
3886 | - background-image: -gtk-gradient (radial, center center, 0, |
3887 | + background-image: -gtk-gradient (radial, center center, 0, |
3888 | center center, 1, |
3889 | - from (shade (#404040, 1.0)), |
3890 | - to (shade (#232323, 1.0))); |
3891 | - border-width: 0; |
3892 | - border-style: none; |
3893 | - border-radius: 0; |
3894 | - padding: 0; |
3895 | - } |
3896 | - |
3897 | - .label { |
3898 | + from (shade (#404040, 1.0)), |
3899 | + to (shade (#232323, 1.0))); |
3900 | + border-width: 0; |
3901 | + border-style: none; |
3902 | + border-radius: 0; |
3903 | + padding: 0; |
3904 | + } |
3905 | + |
3906 | + *, .label { |
3907 | color: #ffffff; |
3908 | } |
3909 | - |
3910 | - GtkTreeView { |
3911 | + |
3912 | + GtkTreeView { |
3913 | color: #ffffff; |
3914 | background-color: #3a3a3a; |
3915 | } |
3916 | - |
3917 | - GtkTreeView row { |
3918 | + |
3919 | + GtkTreeView row { |
3920 | border-width: 0; |
3921 | - border-style: none; |
3922 | - border-radius: 0; |
3923 | - padding: 0; |
3924 | + border-style: none; |
3925 | + border-radius: 0; |
3926 | + padding: 0; |
3927 | } |
3928 | - |
3929 | + |
3930 | GtkTreeView row:selected { |
3931 | - background-image: -gtk-gradient (linear, |
3932 | - left top, |
3933 | - left bottom, |
3934 | - from (shade (@selected_bg_color, 1.30)), |
3935 | - to (shade (@selected_bg_color, 0.98))); |
3936 | + background-image: -gtk-gradient (linear, |
3937 | + left top, |
3938 | + left bottom, |
3939 | + from (shade (@selected_bg_color, 1.30)), |
3940 | + to (shade (@selected_bg_color, 0.98))); |
3941 | } |
3942 | - |
3943 | - GtkTreeView row:nth-child(even) { |
3944 | + |
3945 | + GtkTreeView row:nth-child(even) { |
3946 | background-color: #3a3a3a; |
3947 | - } |
3948 | - |
3949 | - GtkTreeView row:nth-child(odd) { |
3950 | - background-color: #4D4D4D; |
3951 | - } |
3952 | - |
3953 | + } |
3954 | + |
3955 | + GtkTreeView row:nth-child(odd) { |
3956 | + background-color: #4D4D4D; |
3957 | + } |
3958 | + |
3959 | .AlbumListDialogClose { |
3960 | background-image: -gtk-gradient (linear, |
3961 | left top, |
3962 | left bottom, |
3963 | from (shade (@bg_color, 1.15)), |
3964 | to (shade (@bg_color, 1.03))); |
3965 | - |
3966 | + |
3967 | -unico-border-gradient: -gtk-gradient (linear, |
3968 | left top, left bottom, |
3969 | from (shade (@bg_color, 0.78)), |
3970 | to (shade (@bg_color, 0.60))); |
3971 | } |
3972 | - """; |
3973 | - |
3974 | + """; |
3975 | + |
3976 | public AlbumListView(LibraryManager lm) { |
3977 | this.lm = lm; |
3978 | - |
3979 | + |
3980 | set_transient_for(lm.lw); |
3981 | window_position = Gtk.WindowPosition.CENTER_ON_PARENT; |
3982 | //set_keep_above(true); |
3983 | @@ -83,28 +107,28 @@ |
3984 | set_title("Album List"); |
3985 | set_size_request(350, 400); |
3986 | set_default_size(350, 400); |
3987 | - |
3988 | + |
3989 | // apply css styling |
3990 | var style_provider = new CssProvider(); |
3991 | |
3992 | - try { |
3993 | - style_provider.load_from_data (WIDGET_STYLESHEET, -1); |
3994 | - } catch (Error e) { |
3995 | - stderr.printf ("\nAlbumListView: Couldn't load style provider.\n"); |
3996 | - } |
3997 | - |
3998 | - get_style_context().add_class("AlbumListDialogBase"); |
3999 | - get_style_context().add_provider(style_provider, STYLE_PROVIDER_PRIORITY_APPLICATION); |
4000 | - |
4001 | + try { |
4002 | + style_provider.load_from_data (WIDGET_STYLESHEET, -1); |
4003 | + } catch (Error e) { |
4004 | + stderr.printf ("\nAlbumListView: Couldn't load style provider.\n"); |
4005 | + } |
4006 | + |
4007 | + get_style_context().add_class("AlbumListDialogBase"); |
4008 | + get_style_context().add_provider(style_provider, STYLE_PROVIDER_PRIORITY_APPLICATION); |
4009 | + |
4010 | // add close button |
4011 | var close = new Gtk.Button (); |
4012 | - close.set_image (new Gtk.Image.from_stock ("gtk-close", Gtk.IconSize.MENU)); |
4013 | - close.get_style_context().add_class("AlbumListDialogClose"); |
4014 | + close.set_image (Icons.render_image ("gtk-close", Gtk.IconSize.MENU)); |
4015 | + close.get_style_context().add_class("AlbumListDialogClose"); |
4016 | close.hexpand = close.vexpand = false; |
4017 | close.halign = Gtk.Align.START; |
4018 | close.set_relief(Gtk.ReliefStyle.NONE); |
4019 | close.clicked.connect( () => { this.hide(); }); |
4020 | - |
4021 | + |
4022 | // add album artist/album labels |
4023 | album_label = new Label("Album"); |
4024 | artist_label = new Label("Artist"); |
4025 | @@ -118,33 +142,34 @@ |
4026 | mtv.apply_style_to_view(style_provider); |
4027 | //mtv.get_style_context().add_class("ListView"); |
4028 | mtv.vexpand = true; |
4029 | - |
4030 | + |
4031 | // add rating |
4032 | - rating = new RatingWidget(null, true, IconSize.BUTTON); |
4033 | - |
4034 | + rating = new RatingWidget(get_style_context(), true, IconSize.BUTTON, true); |
4035 | + rating.set_transparent (true); |
4036 | + |
4037 | var all_area = new Box(Orientation.VERTICAL, 0); |
4038 | all_area.pack_start(close, false, false, 0); |
4039 | all_area.pack_start(album_label, false, true, 0); |
4040 | all_area.pack_start(artist_label, false, true, 3); |
4041 | - all_area.pack_start(mtv, true, true, 6); |
4042 | - all_area.pack_start(rating, false, true, 12); |
4043 | - |
4044 | - add(all_area); |
4045 | - |
4046 | - rating.rating_changed.connect(rating_changed); |
4047 | - this.focus_out_event.connect(focus_out); |
4048 | + all_area.pack_start(mtv, true, true, 6); |
4049 | + all_area.pack_start(rating, false, true, 12); |
4050 | + |
4051 | + add(all_area); |
4052 | + |
4053 | + rating.rating_changed.connect(rating_changed); |
4054 | + this.focus_out_event.connect(focus_out); |
4055 | } |
4056 | - |
4057 | + |
4058 | public void set_songs_from_media(Media m) { |
4059 | setting_songs = true; |
4060 | album_label.set_markup("<span size=\"large\" color=\"#ffffff\"><b>" + m.album.replace("&", "&") + "</b></span>"); |
4061 | artist_label.set_markup("<span color=\"#ffffff\"><b>" + m.album_artist.replace("&", "&") + "</b></span>"); |
4062 | - |
4063 | + |
4064 | var songs = new LinkedList<int>(); |
4065 | var albums = new LinkedList<int>(); |
4066 | - lm.do_search("", ((ViewWrapper)lm.lw.sideTree.getSelectedWidget()).hint, "All Genres", m.album_artist, m.album, ((ViewWrapper)lm.lw.sideTree.getSelectedWidget()).get_media_ids(), ref songs, ref albums); |
4067 | - |
4068 | - // decide rating. unless all are equal, show 0. |
4069 | + lm.do_search("", ((ViewWrapper)lm.lw.sideTree.getSelectedWidget()).hint, "All Genres", m.album_artist, m.album, ((ViewWrapper)lm.lw.sideTree.getSelectedWidget()).get_media_ids(), ref songs, ref albums); |
4070 | + |
4071 | + // decide rating. unless all are equal, show 0. |
4072 | int overall_rating = -1; |
4073 | foreach(int i in songs) { |
4074 | if(overall_rating == -1) |
4075 | @@ -155,28 +180,28 @@ |
4076 | } |
4077 | } |
4078 | rating.set_rating(overall_rating); |
4079 | - |
4080 | + |
4081 | mtv.set_show_next(songs); |
4082 | mtv.populate_view(); |
4083 | setting_songs = false; |
4084 | } |
4085 | - |
4086 | + |
4087 | void rating_changed(int new_rating) { |
4088 | if(setting_songs) |
4089 | return; |
4090 | - |
4091 | + |
4092 | var updated = new LinkedList<Media>(); |
4093 | foreach(int i in mtv.get_medias()) { |
4094 | lm.media_from_id(i).rating = new_rating; |
4095 | updated.add(lm.media_from_id(i)); |
4096 | } |
4097 | - |
4098 | + |
4099 | lm.update_medias(updated, false, true); |
4100 | } |
4101 | - |
4102 | + |
4103 | bool focus_out(Gdk.EventFocus event) { |
4104 | //this.hide(); |
4105 | - |
4106 | + |
4107 | return false; |
4108 | } |
4109 | } |
4110 | |
4111 | === modified file 'src/Views/AlbumView/AlbumViewModel.vala' |
4112 | --- src/Views/AlbumView/AlbumViewModel.vala 2012-01-24 20:37:29 +0000 |
4113 | +++ src/Views/AlbumView/AlbumViewModel.vala 2012-01-31 01:07:25 +0000 |
4114 | @@ -50,7 +50,7 @@ |
4115 | /** Initialize data storage, columns, etc. **/ |
4116 | public AlbumViewModel(LibraryManager lm, Gdk.Pixbuf defaultImage) { |
4117 | this.lm = lm; |
4118 | - this.defaultImage = lm.get_cover_shadow(defaultImage); |
4119 | + this.defaultImage = Icons.get_pixbuf_shadow(defaultImage); |
4120 | removing_medias = false; |
4121 | |
4122 | rows = new Sequence<Media>(); |
4123 | |
4124 | === modified file 'src/Views/CellDataFunctionHelper.vala' |
4125 | --- src/Views/CellDataFunctionHelper.vala 2012-01-02 16:12:39 +0000 |
4126 | +++ src/Views/CellDataFunctionHelper.vala 2012-01-31 01:07:25 +0000 |
4127 | @@ -29,8 +29,8 @@ |
4128 | private Pixbuf starred; |
4129 | |
4130 | public CellDataFunctionHelper(LibraryManager lm) { |
4131 | - this.starred = lm.icons.starred_icon.render (IconSize.MENU, null); |
4132 | - this.not_starred = lm.icons.not_starred_icon.render (IconSize.MENU, null); |
4133 | + this.starred = Icons.STARRED_ICON.render (IconSize.MENU, null); |
4134 | + this.not_starred = Icons.NOT_STARRED_ICON.render (IconSize.MENU, null); |
4135 | |
4136 | _canvas = new Gdk.Pixbuf(Gdk.Colorspace.RGB, true, 8, starred.width * 5, starred.height); |
4137 | } |
4138 | |
4139 | === modified file 'src/Views/DeviceSummaryWidget.vala' |
4140 | --- src/Views/DeviceSummaryWidget.vala 2012-01-28 19:50:35 +0000 |
4141 | +++ src/Views/DeviceSummaryWidget.vala 2012-01-31 01:07:25 +0000 |
4142 | @@ -319,11 +319,11 @@ |
4143 | |
4144 | /* add entire library options */ |
4145 | musicList.append(out iter); |
4146 | - musicList.set(iter, 0, null, 1, "All Music", 2, lm.icons.music_icon.render(IconSize.MENU, musicDropdown.get_style_context())); |
4147 | + musicList.set(iter, 0, null, 1, "All Music", 2, Icons.MUSIC_ICON.render(IconSize.MENU)); |
4148 | podcastList.append(out iter); |
4149 | - podcastList.set(iter, 0, null, 1, "All Podcasts", 2, lm.icons.podcast_icon.render(IconSize.MENU, podcastDropdown.get_style_context())); |
4150 | + podcastList.set(iter, 0, null, 1, "All Podcasts", 2, Icons.PODCAST_ICON.render(IconSize.MENU)); |
4151 | //audiobookList.append(out iter); |
4152 | - //audiobookList.set(iter, 0, null, 1, "All Audiobooks");//, 2, lm.icons.audiobook_icon.render(IconSize.MENU, audiobookDropdown.get_style_context())); |
4153 | + //audiobookList.set(iter, 0, null, 1, "All Audiobooks");//, 2, Icons.audiobook_icon.render(IconSize.MENU, audiobookDropdown.get_style_context())); |
4154 | |
4155 | /* add separator */ |
4156 | musicList.append(out iter); |
4157 | @@ -334,8 +334,8 @@ |
4158 | //audiobookList.set(iter, 0, null, 1, "<separator_item_unique_name>"); |
4159 | |
4160 | /* add all playlists */ |
4161 | - var smart_playlist_pix = lm.icons.smart_playlist_icon.render(IconSize.MENU, musicDropdown.get_style_context()); |
4162 | - var playlist_pix = lm.icons.playlist_icon.render(IconSize.MENU, musicDropdown.get_style_context()); |
4163 | + var smart_playlist_pix = Icons.SMART_PLAYLIST_ICON.render(IconSize.MENU, null); |
4164 | + var playlist_pix = Icons.PLAYLIST_ICON.render(IconSize.MENU, null); |
4165 | foreach(var p in lm.smart_playlists()) { |
4166 | //bool music, podcasts, audiobooks; |
4167 | //test_media_types(lm.medias_from_smart_playlist(p.rowid), out music, out podcasts, out audiobooks); |
4168 | |
4169 | === modified file 'src/Views/ListView/MusicTreeModel.vala' |
4170 | --- src/Views/ListView/MusicTreeModel.vala 2012-01-25 02:40:53 +0000 |
4171 | +++ src/Views/ListView/MusicTreeModel.vala 2012-01-31 01:07:25 +0000 |
4172 | @@ -1,5 +1,5 @@ |
4173 | /*- |
4174 | - * Copyright (c) 2011 Scott Ringwelski <sgringwe@mtu.edu> |
4175 | + * Copyright (c) 2011 Scott Ringwelski <sgringwe@mtu.edu> |
4176 | * |
4177 | * Originally Written by Scott Ringwelski for BeatBox Music Player |
4178 | * BeatBox Music Player: http://www.launchpad.net/beat-box |
4179 | @@ -26,7 +26,7 @@ |
4180 | |
4181 | public class BeatBox.CompareFuncHolder : GLib.Object { |
4182 | public unowned TreeIterCompareFunc sort_func; |
4183 | - |
4184 | + |
4185 | public CompareFuncHolder(TreeIterCompareFunc func) { |
4186 | sort_func = func; |
4187 | } |
4188 | @@ -35,53 +35,55 @@ |
4189 | public class BeatBox.MusicTreeModel : GLib.Object, TreeModel, TreeSortable { |
4190 | LibraryManager lm; |
4191 | int stamp; // all iters must match this |
4192 | - Gdk.Pixbuf _playing; |
4193 | - Gdk.Pixbuf _completed; |
4194 | - Gdk.Pixbuf _saved_locally; |
4195 | - Gdk.Pixbuf _new_podcast; |
4196 | + GLib.Icon _playing; |
4197 | + GLib.Icon _completed; |
4198 | + GLib.Icon _saved_locally; |
4199 | + GLib.Icon _new_podcast; |
4200 | ViewWrapper.Hint hint; |
4201 | public bool is_current; |
4202 | - |
4203 | - /* data storage variables */ |
4204 | - Sequence<int> rows; |
4205 | - private LinkedList<string> _columns; |
4206 | - |
4207 | - /* treesortable stuff */ |
4208 | - private int sort_column_id; |
4209 | - private SortType sort_direction; |
4210 | - private unowned TreeIterCompareFunc default_sort_func; |
4211 | - private HashMap<int, CompareFuncHolder> column_sorts; |
4212 | - bool removing_medias; |
4213 | - |
4214 | - /* custom signals for custom treeview. for speed */ |
4215 | - public signal void rows_changed(LinkedList<TreePath> paths, LinkedList<TreeIter?> iters); |
4216 | - public signal void rows_deleted (LinkedList<TreePath> paths); |
4217 | + |
4218 | + /* data storage variables */ |
4219 | + Sequence<int> rows; |
4220 | + private LinkedList<string> _columns; |
4221 | + |
4222 | + /* treesortable stuff */ |
4223 | + private int sort_column_id; |
4224 | + private SortType sort_direction; |
4225 | + private unowned TreeIterCompareFunc default_sort_func; |
4226 | + private HashMap<int, CompareFuncHolder> column_sorts; |
4227 | + bool removing_medias; |
4228 | + |
4229 | + /* custom signals for custom treeview. for speed */ |
4230 | + public signal void rows_changed(LinkedList<TreePath> paths, LinkedList<TreeIter?> iters); |
4231 | + public signal void rows_deleted (LinkedList<TreePath> paths); |
4232 | public signal void rows_inserted (LinkedList<TreePath> paths, LinkedList<TreeIter?> iters); |
4233 | - |
4234 | + |
4235 | /** Initialize data storage, columns, etc. **/ |
4236 | - public MusicTreeModel(LibraryManager lm, LinkedList<string> column_types, Gdk.Pixbuf playing, ViewWrapper.Hint hint, TreeView parent) { |
4237 | + public MusicTreeModel(LibraryManager lm, LinkedList<string> column_types, ViewWrapper.Hint hint) { |
4238 | this.lm = lm; |
4239 | _columns = column_types; |
4240 | - _playing = playing; |
4241 | - _completed = lm.icons.process_completed_icon.render(Gtk.IconSize.MENU, parent.get_style_context()); |
4242 | - _saved_locally = lm.lw.render_icon(Gtk.Stock.SAVE, IconSize.MENU, null); |
4243 | - _new_podcast = lm.icons.new_podcast_icon.render(IconSize.MENU, parent.get_style_context()); |
4244 | + |
4245 | + _playing = Icons.MEDIA_PLAY_SYMBOLIC.get_gicon (); |
4246 | + _completed = Icons.PROCESS_COMPLETED_ICON.get_gicon (); |
4247 | + _saved_locally = new GLib.ThemedIcon.with_default_fallbacks (Gtk.Stock.SAVE); |
4248 | + _new_podcast = Icons.NEW_PODCAST_ICON.get_gicon (); |
4249 | + |
4250 | this.hint = hint; |
4251 | removing_medias = false; |
4252 | |
4253 | rows = new Sequence<int>(); |
4254 | - |
4255 | - sort_column_id = -2; |
4256 | - sort_direction = SortType.ASCENDING; |
4257 | - column_sorts = new HashMap<int, CompareFuncHolder>(); |
4258 | - |
4259 | - stamp = (int)GLib.Random.next_int(); |
4260 | + |
4261 | + sort_column_id = -2; |
4262 | + sort_direction = SortType.ASCENDING; |
4263 | + column_sorts = new HashMap<int, CompareFuncHolder>(); |
4264 | + |
4265 | + stamp = (int)GLib.Random.next_int(); |
4266 | } |
4267 | - |
4268 | + |
4269 | /** Returns Type of column at index_ **/ |
4270 | public Type get_column_type (int col) { |
4271 | if(_columns[col] == " ") { |
4272 | - return typeof(Gdk.Pixbuf); |
4273 | + return typeof(GLib.Icon); |
4274 | } |
4275 | else if(_columns[col] == "Title" || _columns[col] == "Artist" || _columns[col] == "Album" || _columns[col] == "Genre") { |
4276 | return typeof(string); |
4277 | @@ -100,20 +102,20 @@ |
4278 | public bool get_iter (out TreeIter iter, TreePath path) { |
4279 | iter = TreeIter(); |
4280 | int path_index = path.get_indices()[0]; |
4281 | - |
4282 | + |
4283 | if(rows.get_length() == 0 || path_index < 0 || path_index >= rows.get_length()) |
4284 | return false; |
4285 | - |
4286 | - var seq_iter = rows.get_iter_at_pos(path_index); |
4287 | - if(seq_iter == null) |
4288 | + |
4289 | + var seq_iter = rows.get_iter_at_pos(path_index); |
4290 | + if(seq_iter == null) |
4291 | return false; |
4292 | - |
4293 | + |
4294 | iter.stamp = this.stamp; |
4295 | iter.user_data = seq_iter; |
4296 | - |
4297 | + |
4298 | return true; |
4299 | } |
4300 | - |
4301 | + |
4302 | /** Returns the number of columns supported by tree_model. **/ |
4303 | public int get_n_columns () { |
4304 | return _columns.size; |
4305 | @@ -129,12 +131,12 @@ |
4306 | val = Value(get_column_type(column)); |
4307 | if(iter.stamp != this.stamp || column < 0 || column >= _columns.size || removing_medias) |
4308 | return; |
4309 | - |
4310 | + |
4311 | if(!((SequenceIter<ValueArray>)iter.user_data).is_end()) { |
4312 | Media s = lm.media_from_id(rows.get(((SequenceIter<int>)iter.user_data))); |
4313 | if(s == null) |
4314 | return; |
4315 | - |
4316 | + |
4317 | if(column == 0) |
4318 | val = s.rowid; |
4319 | else if(column == 1) { |
4320 | @@ -149,7 +151,7 @@ |
4321 | else if(s.mediatype == 1 && !s.uri.has_prefix("http://")) |
4322 | val = _saved_locally; |
4323 | else |
4324 | - val = Value(typeof(Gdk.Pixbuf)); |
4325 | + val = Value(typeof(GLib.Icon)); |
4326 | } |
4327 | else if(column == 2) |
4328 | val = ((SequenceIter<int>)iter.user_data).get_position() + 1; |
4329 | @@ -194,7 +196,7 @@ |
4330 | |
4331 | /** Returns true if iter has children, false otherwise. **/ |
4332 | public bool iter_has_child (TreeIter iter) { |
4333 | - |
4334 | + |
4335 | return false; |
4336 | } |
4337 | |
4338 | @@ -202,7 +204,7 @@ |
4339 | public int iter_n_children (TreeIter? iter) { |
4340 | if(iter == null) |
4341 | return rows.get_length(); |
4342 | - |
4343 | + |
4344 | return 0; |
4345 | } |
4346 | |
4347 | @@ -210,32 +212,32 @@ |
4348 | public bool iter_next (ref TreeIter iter) { |
4349 | if(iter.stamp != this.stamp) |
4350 | return false; |
4351 | - |
4352 | + |
4353 | iter.user_data = ((SequenceIter)iter.user_data).next(); |
4354 | - |
4355 | + |
4356 | if(((SequenceIter)iter.user_data).is_end()) |
4357 | return false; |
4358 | - |
4359 | + |
4360 | return true; |
4361 | } |
4362 | |
4363 | /** Sets iter to be the child of parent, using the given index. **/ |
4364 | public bool iter_nth_child (out TreeIter iter, TreeIter? parent, int n) { |
4365 | iter = TreeIter(); |
4366 | - |
4367 | + |
4368 | if(n < 0 || n >= rows.get_length() || parent != null) |
4369 | return false; |
4370 | - |
4371 | + |
4372 | iter.stamp = this.stamp; |
4373 | iter.user_data = rows.get_iter_at_pos(n); |
4374 | - |
4375 | + |
4376 | return true; |
4377 | } |
4378 | |
4379 | /** Sets iter to be the parent of child. **/ |
4380 | public bool iter_parent (out TreeIter iter, TreeIter child) { |
4381 | iter = TreeIter(); |
4382 | - |
4383 | + |
4384 | return false; |
4385 | } |
4386 | |
4387 | @@ -244,132 +246,132 @@ |
4388 | |
4389 | /** Lets the tree unref the node. **/ |
4390 | public void unref_node (TreeIter iter) {} |
4391 | - |
4392 | - /** Some actual functions to use this model **/ |
4393 | - public TreeIter? getIterFromRowid(int id) { |
4394 | + |
4395 | + /** Some actual functions to use this model **/ |
4396 | + public TreeIter? getIterFromRowid(int id) { |
4397 | SequenceIter s_iter = rows.get_begin_iter(); |
4398 | - |
4399 | + |
4400 | for(int index = 0; index < rows.get_length(); ++index) { |
4401 | s_iter = rows.get_iter_at_pos(index); |
4402 | - |
4403 | + |
4404 | if(id == rows.get(s_iter)) { |
4405 | TreeIter iter = TreeIter(); |
4406 | iter.stamp = this.stamp; |
4407 | iter.user_data = s_iter; |
4408 | - |
4409 | + |
4410 | return iter; |
4411 | } |
4412 | } |
4413 | - |
4414 | + |
4415 | return null; |
4416 | } |
4417 | - |
4418 | + |
4419 | public int getRowidFromIter(TreeIter iter) { |
4420 | if(iter.stamp != this.stamp || ((SequenceIter)iter.user_data).is_end()) |
4421 | return 0; |
4422 | - |
4423 | + |
4424 | return rows.get(((SequenceIter<int>)iter.user_data)); |
4425 | } |
4426 | - |
4427 | - public int getRowidFromPath(string path) { |
4428 | + |
4429 | + public int getRowidFromPath(string path) { |
4430 | if(int.parse(path) < 0 || int.parse(path) >= rows.get_length()) |
4431 | return 0; |
4432 | - |
4433 | + |
4434 | SequenceIter s_iter = rows.get_iter_at_pos(int.parse(path)); |
4435 | - |
4436 | + |
4437 | if(s_iter.is_end()) |
4438 | return 0; |
4439 | - |
4440 | + |
4441 | return rows.get(s_iter); |
4442 | } |
4443 | - |
4444 | - /** simply adds iter to the model **/ |
4445 | - public void append(out TreeIter iter) { |
4446 | + |
4447 | + /** simply adds iter to the model **/ |
4448 | + public void append(out TreeIter iter) { |
4449 | iter = TreeIter(); |
4450 | - |
4451 | + |
4452 | SequenceIter<int> added = rows.append(0); |
4453 | iter.stamp = this.stamp; |
4454 | iter.user_data = added; |
4455 | } |
4456 | - |
4457 | + |
4458 | /** convenience method to insert medias into the model. No iters returned. **/ |
4459 | - public void append_medias(Collection<int> medias, bool emit) { |
4460 | + public void append_medias(Collection<int> medias, bool emit) { |
4461 | foreach(int id in medias) { |
4462 | SequenceIter<int> added = rows.append(id); |
4463 | - |
4464 | + |
4465 | if(emit) { |
4466 | TreePath path = new TreePath.from_string(added.get_position().to_string()); |
4467 | - |
4468 | + |
4469 | TreeIter iter = TreeIter(); |
4470 | iter.stamp = this.stamp; |
4471 | iter.user_data = added; |
4472 | - |
4473 | + |
4474 | row_inserted(path, iter); |
4475 | } |
4476 | } |
4477 | } |
4478 | - |
4479 | + |
4480 | public void turnOffPixbuf(int id) { |
4481 | SequenceIter s_iter = rows.get_begin_iter(); |
4482 | - |
4483 | + |
4484 | for(int index = 0; index < rows.get_length(); ++index) { |
4485 | s_iter = rows.get_iter_at_pos(index); |
4486 | - |
4487 | + |
4488 | if(id == rows.get(s_iter)) { |
4489 | TreePath path = new TreePath.from_string(s_iter.get_position().to_string()); |
4490 | - |
4491 | + |
4492 | TreeIter iter = TreeIter(); |
4493 | iter.stamp = this.stamp; |
4494 | iter.user_data = s_iter; |
4495 | - |
4496 | + |
4497 | row_changed(path, iter); |
4498 | return; |
4499 | } |
4500 | } |
4501 | } |
4502 | - |
4503 | + |
4504 | // just a convenience function |
4505 | public void updateMedia(int id, bool is_current) { |
4506 | ArrayList<int> temp = new ArrayList<int>(); |
4507 | temp.add(id); |
4508 | updateMedias(temp, is_current); |
4509 | } |
4510 | - |
4511 | + |
4512 | public void updateMedias(owned Collection<int> rowids, bool is_current) { |
4513 | SequenceIter s_iter = rows.get_begin_iter(); |
4514 | - |
4515 | + |
4516 | for(int index = 0; index < rows.get_length(); ++index) { |
4517 | s_iter = rows.get_iter_at_pos(index); |
4518 | - |
4519 | + |
4520 | if(rowids.contains(rows.get(s_iter))) { |
4521 | TreePath path = new TreePath.from_string(s_iter.get_position().to_string()); |
4522 | - |
4523 | + |
4524 | TreeIter iter = TreeIter(); |
4525 | iter.stamp = this.stamp; |
4526 | iter.user_data = s_iter; |
4527 | - |
4528 | + |
4529 | row_changed(path, iter); |
4530 | - |
4531 | + |
4532 | // can't do this. rowids must be read only |
4533 | //rowids.remove(rows.get(s_iter)); |
4534 | } |
4535 | - |
4536 | + |
4537 | if(rowids.size <= 0) |
4538 | return; |
4539 | } |
4540 | } |
4541 | - |
4542 | + |
4543 | public new void set(TreeIter iter, ...) { |
4544 | if(iter.stamp != this.stamp) |
4545 | return; |
4546 | - |
4547 | + |
4548 | var args = va_list(); // now call args.arg() to poll |
4549 | - |
4550 | + |
4551 | while(true) { |
4552 | int col = args.arg(); |
4553 | if(col < 0 || col >= _columns.size) |
4554 | return; |
4555 | - |
4556 | + |
4557 | /*else if(_columns[col] == " ") { |
4558 | stdout.printf("set oh hi3\n"); |
4559 | Gdk.Pixbuf val = args.arg(); |
4560 | @@ -387,127 +389,127 @@ |
4561 | }*/ |
4562 | } |
4563 | } |
4564 | - |
4565 | + |
4566 | public void remove(TreeIter iter) { |
4567 | if(iter.stamp != this.stamp) |
4568 | return; |
4569 | - |
4570 | + |
4571 | var path = new TreePath.from_string(((SequenceIter)iter.user_data).get_position().to_string()); |
4572 | rows.remove((SequenceIter<int>)iter.user_data); |
4573 | row_deleted(path); |
4574 | } |
4575 | - |
4576 | + |
4577 | /*public void remove_iters(Collection<TreeIter?> iters, bool emit) { |
4578 | foreach(TreeIter iter in iters) { |
4579 | if(iter.stamp != this.stamp) |
4580 | return; |
4581 | - |
4582 | + |
4583 | var path = new TreePath.from_string(((SequenceIter)iter.user_data).get_position().to_string()); |
4584 | rows.remove((SequenceIter<int>)iter.user_data); |
4585 | - |
4586 | + |
4587 | if(emit) |
4588 | row_deleted(path); |
4589 | } |
4590 | }*/ |
4591 | - |
4592 | + |
4593 | public void removeMedias(Collection<int> rowids) { |
4594 | removing_medias = true; |
4595 | SequenceIter s_iter = rows.get_begin_iter(); |
4596 | - |
4597 | + |
4598 | for(int index = 0; index < rows.get_length(); ++index) { |
4599 | s_iter = rows.get_iter_at_pos(index); |
4600 | - |
4601 | + |
4602 | if(rowids.contains(rows.get(s_iter))) { |
4603 | int rowid = rows.get(s_iter); |
4604 | TreePath path = new TreePath.from_string(s_iter.get_position().to_string()); |
4605 | - |
4606 | + |
4607 | rows.remove(s_iter); |
4608 | - |
4609 | + |
4610 | row_deleted(path); |
4611 | rowids.remove(rowid); |
4612 | --index; |
4613 | } |
4614 | - |
4615 | + |
4616 | if(rowids.size <= 0) { |
4617 | removing_medias = false; |
4618 | return; |
4619 | } |
4620 | } |
4621 | - |
4622 | + |
4623 | removing_medias = false; |
4624 | } |
4625 | - |
4626 | + |
4627 | public LinkedList<int> getOrderedMedias() { |
4628 | var rv = new LinkedList<int>(); |
4629 | SequenceIter s_iter = rows.get_begin_iter(); |
4630 | - |
4631 | + |
4632 | for(int index = 0; index < rows.get_length(); ++index) { |
4633 | s_iter = rows.get_iter_at_pos(index); |
4634 | - |
4635 | + |
4636 | int rowid = rows.get(s_iter); |
4637 | - |
4638 | + |
4639 | rv.add(rowid); |
4640 | } |
4641 | - |
4642 | + |
4643 | return rv; |
4644 | } |
4645 | - |
4646 | + |
4647 | /** Fills in sort_column_id and order with the current sort column and the order. **/ |
4648 | public bool get_sort_column_id(out int sort_column_id, out SortType order) { |
4649 | sort_column_id = this.sort_column_id; |
4650 | order = sort_direction; |
4651 | - |
4652 | + |
4653 | return true; |
4654 | } |
4655 | - |
4656 | + |
4657 | /** Returns true if the model has a default sort function. **/ |
4658 | public bool has_default_sort_func() { |
4659 | return (default_sort_func != null); |
4660 | } |
4661 | - |
4662 | + |
4663 | /** Sets the default comparison function used when sorting to be sort_func. **/ |
4664 | public void set_default_sort_func(owned TreeIterCompareFunc sort_func) { |
4665 | default_sort_func = sort_func; |
4666 | } |
4667 | - |
4668 | + |
4669 | /** Sets the current sort column to be sort_column_id. **/ |
4670 | public void set_sort_column_id(int sort_column_id, SortType order) { |
4671 | bool changed = (this.sort_column_id != sort_column_id || order != sort_direction); |
4672 | - |
4673 | + |
4674 | this.sort_column_id = sort_column_id; |
4675 | sort_direction = order; |
4676 | - |
4677 | + |
4678 | if(changed && sort_column_id >= 0) { |
4679 | /* do the sort for reals */ |
4680 | rows.sort_iter(sequenceIterCompareFunc); |
4681 | - |
4682 | + |
4683 | sort_column_changed(); |
4684 | } |
4685 | } |
4686 | - |
4687 | + |
4688 | public void resort() { |
4689 | rows.sort_iter(sequenceIterCompareFunc); |
4690 | sort_column_changed(); |
4691 | } |
4692 | - |
4693 | + |
4694 | /** Sets the comparison function used when sorting to be sort_func. **/ |
4695 | public void set_sort_func(int sort_column_id, owned TreeIterCompareFunc sort_func) { |
4696 | column_sorts.set(sort_column_id, new CompareFuncHolder(sort_func)); |
4697 | } |
4698 | - |
4699 | + |
4700 | /** Custom function to use built in sort in GLib.Sequence to our advantage **/ |
4701 | public int sequenceIterCompareFunc(SequenceIter<int> a, SequenceIter<int> b) { |
4702 | int rv; |
4703 | - |
4704 | + |
4705 | if(sort_column_id < 0) |
4706 | return 0; |
4707 | - |
4708 | + |
4709 | Media a_media = lm.media_from_id(rows.get(a)); |
4710 | Media b_media = lm.media_from_id(rows.get(b)); |
4711 | - |
4712 | + |
4713 | if(a_media == null || b_media == null) |
4714 | return 1; |
4715 | - |
4716 | + |
4717 | if(_columns.get(sort_column_id) == "Artist") { |
4718 | if(a_media.album_artist.down() == b_media.album_artist.down()) { |
4719 | if(a_media.album.down() == b_media.album.down()) { |
4720 | @@ -528,7 +530,7 @@ |
4721 | rv = (int)((sort_direction == SortType.ASCENDING) ? (int)(a_media.track - b_media.track) : (int)(b_media.track - a_media.track)); |
4722 | else |
4723 | rv = (int)((int)a_media.album_number - (int)b_media.album_number); |
4724 | - |
4725 | + |
4726 | } |
4727 | else { |
4728 | if(a_media.album == "") |
4729 | @@ -579,19 +581,19 @@ |
4730 | else { |
4731 | rv = 1; |
4732 | } |
4733 | - |
4734 | + |
4735 | if(sort_direction == SortType.DESCENDING) |
4736 | rv = (rv > 0) ? -1 : 1; |
4737 | - |
4738 | + |
4739 | return rv; |
4740 | } |
4741 | - |
4742 | + |
4743 | private int advancedStringCompare(string a, string b) { |
4744 | if(a == "" && b != "") |
4745 | return 1; |
4746 | else if(a != "" && b == "") |
4747 | return -1; |
4748 | - |
4749 | + |
4750 | return (a > b) ? 1 : -1; |
4751 | } |
4752 | } |
4753 | |
4754 | === modified file 'src/Views/ListView/MusicTreeView.vala' |
4755 | --- src/Views/ListView/MusicTreeView.vala 2012-01-27 04:55:46 +0000 |
4756 | +++ src/Views/ListView/MusicTreeView.vala 2012-01-31 01:07:25 +0000 |
4757 | @@ -28,30 +28,30 @@ |
4758 | public BeatBox.LibraryWindow lw; |
4759 | TreeView view; |
4760 | MusicTreeModel music_model; |
4761 | - |
4762 | + |
4763 | Collection<int> _show_next; // these are populated if necessary when user opens this view. |
4764 | //private Collection<int> _medias; |
4765 | Collection<int> _showing_medias; |
4766 | LinkedList<string> _columns; |
4767 | - |
4768 | - int relative_id;// if playlist, smart playlist, etc. |
4769 | + |
4770 | + int relative_id;// if playlist, smart playlist, etc. |
4771 | ViewWrapper.Hint hint; // playlist, queue, smart_playlist, etc. changes how it behaves. |
4772 | string sort_column; |
4773 | SortType sort_direction; |
4774 | bool removing_medias; |
4775 | - |
4776 | + |
4777 | bool _is_current_view; |
4778 | bool _is_current; |
4779 | bool dragging; |
4780 | - |
4781 | + |
4782 | LinkedList<string> timeout_search;//stops from doing useless search (timeout) |
4783 | string last_search;//stops from searching same thing multiple times |
4784 | bool showing_all; // stops from searching unnecesarilly when changing b/w 0 words and search ViewWrapper.Hint, etc. |
4785 | - |
4786 | + |
4787 | bool scrolled_recently; |
4788 | - |
4789 | + |
4790 | CellDataFunctionHelper cellHelper; |
4791 | - |
4792 | + |
4793 | //for header column chooser |
4794 | Gtk.Menu columnChooserMenu; |
4795 | CheckMenuItem columnNumber; |
4796 | @@ -69,7 +69,7 @@ |
4797 | CheckMenuItem columnDateAdded; |
4798 | CheckMenuItem columnLastPlayed; |
4799 | CheckMenuItem columnBPM; |
4800 | - |
4801 | + |
4802 | //for media list right click |
4803 | Gtk.Menu mediaMenuActionMenu; |
4804 | Gtk.MenuItem mediaEditMedia; |
4805 | @@ -82,7 +82,7 @@ |
4806 | RatingWidgetMenu rating_item; |
4807 | Gtk.MenuItem mediaRemove; |
4808 | Gtk.MenuItem importToLibrary; |
4809 | - |
4810 | + |
4811 | // for editing cells in-treeview |
4812 | CellRendererText cellTrack; |
4813 | CellRendererText cellTitle; |
4814 | @@ -95,189 +95,188 @@ |
4815 | CellRendererText cellSkips; |
4816 | CellRendererText cellPlays; |
4817 | CellRendererText cellBitrate; |
4818 | - |
4819 | + |
4820 | /** |
4821 | * for sort_id use 0+ for normal, -1 for auto, -2 for none |
4822 | */ |
4823 | public MusicTreeView(BeatBox.LibraryManager lmm, BeatBox.LibraryWindow lww, string sort, Gtk.SortType dir, ViewWrapper.Hint the_hint, int id) { |
4824 | lm = lmm; |
4825 | lw = lww; |
4826 | - |
4827 | + |
4828 | //_medias = new LinkedList<int>(); |
4829 | _showing_medias = new LinkedList<int>(); |
4830 | _columns = new LinkedList<string>(); |
4831 | - |
4832 | + |
4833 | last_search = ""; |
4834 | timeout_search = new LinkedList<string>(); |
4835 | showing_all = true; |
4836 | removing_medias = false; |
4837 | - |
4838 | + |
4839 | sort_column = sort; |
4840 | sort_direction = dir; |
4841 | hint = the_hint; |
4842 | relative_id = id; |
4843 | - |
4844 | + |
4845 | cellHelper = new CellDataFunctionHelper(lm); |
4846 | - |
4847 | + |
4848 | lm.medias_updated.connect(medias_updated); |
4849 | lm.medias_removed.connect(medias_removed); |
4850 | lm.media_played.connect(media_played); |
4851 | lm.playback_stopped.connect(playback_stopped); |
4852 | lm.current_cleared.connect(current_cleared); |
4853 | - |
4854 | + |
4855 | buildUI(); |
4856 | } |
4857 | - |
4858 | + |
4859 | /* interface functions */ |
4860 | public void set_is_current(bool val) { |
4861 | _is_current = val; |
4862 | music_model.is_current = val; |
4863 | } |
4864 | - |
4865 | + |
4866 | public bool get_is_current() { |
4867 | return _is_current; |
4868 | } |
4869 | - |
4870 | + |
4871 | public void set_is_current_view(bool val) { |
4872 | _is_current_view = val; |
4873 | } |
4874 | - |
4875 | + |
4876 | public bool get_is_current_view() { |
4877 | return _is_current_view; |
4878 | } |
4879 | - |
4880 | + |
4881 | public void set_hint(ViewWrapper.Hint the_hint) { |
4882 | hint = the_hint; |
4883 | updateSensitivities(); |
4884 | } |
4885 | - |
4886 | + |
4887 | public ViewWrapper.Hint get_hint() { |
4888 | return hint; |
4889 | } |
4890 | - |
4891 | + |
4892 | public void set_relative_id(int id) { |
4893 | relative_id = id; |
4894 | } |
4895 | - |
4896 | + |
4897 | public int get_relative_id() { |
4898 | return relative_id; |
4899 | } |
4900 | - |
4901 | + |
4902 | public void set_show_next(Collection<int> medias) { |
4903 | _show_next = medias; |
4904 | } |
4905 | - |
4906 | + |
4907 | public Collection<int> get_medias() { |
4908 | return music_model.getOrderedMedias(); |
4909 | } |
4910 | - |
4911 | + |
4912 | public void set_as_current_list(int media_id, bool is_initial) { |
4913 | var ordered_songs = music_model.getOrderedMedias(); |
4914 | stdout.printf("there are %d ordered songs\n", ordered_songs.size); |
4915 | - |
4916 | + |
4917 | bool shuffle = (lm.shuffle == LibraryManager.Shuffle.ALL); |
4918 | - |
4919 | + |
4920 | lm.clearCurrent(); |
4921 | int i = 0; |
4922 | lm.current_index = 0; |
4923 | foreach(int id in ordered_songs) { |
4924 | lm.addToCurrent(id); |
4925 | - |
4926 | + |
4927 | if(!shuffle && lm.media_info.media != null && lm.media_info.media.rowid == id && media_id == 0) |
4928 | lm.current_index = i; |
4929 | else if(!shuffle && lm.media_info.media != null && media_id == id) |
4930 | lm.current_index = i; |
4931 | - |
4932 | + |
4933 | ++i; |
4934 | } |
4935 | - |
4936 | + |
4937 | set_is_current(true); |
4938 | - |
4939 | + |
4940 | if(lm.media_info.media != null) |
4941 | music_model.updateMedia(lm.media_info.media.rowid, get_is_current()); |
4942 | stdout.printf("current list is %d and index %d\n", lm.current_medias().size, lm.current_index); |
4943 | lm.setShuffleMode(lm.shuffle, shuffle && is_initial); |
4944 | } |
4945 | - |
4946 | + |
4947 | public void append_medias(Collection<int> new_medias) { |
4948 | var all_medias = new LinkedList<int>(); |
4949 | all_medias.add_all(_showing_medias); |
4950 | all_medias.add_all(new_medias); |
4951 | _showing_medias = all_medias; |
4952 | - |
4953 | + |
4954 | music_model.append_medias(new_medias, true); |
4955 | music_model.resort(); |
4956 | if(visible) queue_draw(); |
4957 | } |
4958 | - |
4959 | + |
4960 | public void remove_medias(Collection<int> to_remove) { |
4961 | var all_medias = new LinkedList<int>(); |
4962 | all_medias.add_all(_showing_medias); |
4963 | all_medias.remove_all(to_remove); |
4964 | _showing_medias = all_medias; |
4965 | - |
4966 | + |
4967 | music_model.removeMedias(to_remove); |
4968 | if(visible) queue_draw(); |
4969 | } |
4970 | - |
4971 | + |
4972 | public void populate_view() { |
4973 | /** NOTE: This could have a bad effect if user coincidentally |
4974 | - * searches for something that has same number of results as |
4975 | + * searches for something that has same number of results as |
4976 | * a different search. However, this cuts lots of unecessary |
4977 | * loading of lists/icon lists */ |
4978 | /*if(lw.searchField.get_text() == "" && _showing_medias.size == medias.size && ViewWrapper.Hint != ViewWrapper.Hint.HISTORY && ViewWrapper.Hint != ViewWrapper.Hint.QUEUE && !force) { |
4979 | return; |
4980 | }*/ |
4981 | - |
4982 | + |
4983 | if(_show_next == _showing_medias) |
4984 | return; |
4985 | - |
4986 | + |
4987 | _showing_medias = _show_next; |
4988 | - |
4989 | + |
4990 | view.freeze_child_notify(); |
4991 | view.set_model(null); |
4992 | - |
4993 | + |
4994 | int sort_col; |
4995 | SortType sort_dir; |
4996 | music_model.get_sort_column_id(out sort_col, out sort_dir); |
4997 | - |
4998 | - var now_playing_icon = lm.icons.now_playing_icon.render (IconSize.MENU, view.get_style_context()); |
4999 | - music_model = new MusicTreeModel(lm, get_column_strings(), now_playing_icon, get_hint(), view); |
5000 | + |
The diff has been truncated for viewing.
Looks good. There is one issue though, where I get a warning about GIcon and Pixbuf's.
[WARN 13:34:45.984354] [GLib-GObject] unable to set property `pixbuf' of type `GdkPixbuf' from value of type `GIcon'
It is merged though, so that can be picked up in trunk if you'd like (might be easier). Don't forget to mark fixed bugs as fix-released :).