2
// AlbumArtWriterService.cs
5
// Kevin Anthony <Kevin.S.Anthony@gmail.com>
7
// Copyright (C) 2011 Kevin Anthony
9
// Permission is hereby granted, free of charge, to any person obtaining
10
// a copy of this software and associated documentation files (the
11
// "Software"), to deal in the Software without restriction, including
12
// without limitation the rights to use, copy, modify, merge, publish,
13
// distribute, sublicense, and/or sell copies of the Software, and to
14
// permit persons to whom the Software is furnished to do so, subject to
15
// the following conditions:
17
// The above copyright notice and this permission notice shall be
18
// included in all copies or substantial portions of the Software.
20
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34
using Banshee.Gui.Dialogs;
36
namespace Banshee.AlbumArtWriter
38
public class ConfigurationDialog : BansheeDialog
40
private AlbumArtWriterService service;
41
private Entry artname_entry;
42
private RadioButton jpg;
43
private RadioButton png;
45
public ConfigurationDialog (AlbumArtWriterService service) : base (AddinManager.CurrentLocalizer.GetString ("Album Art Writer Configuration"))
47
this.service = service;
49
Frame artframe = new Frame("artbox_frame");
50
artframe.Label = AddinManager.CurrentLocalizer.GetString("Output File Name (No Extension)");
51
HBox artname_box = new HBox ();
52
artname_box.PackStart (new Label (AddinManager.CurrentLocalizer.GetString ("File Name:")), false, false, 0);
53
artname_entry = new Entry ();
54
artname_box.PackStart (artname_entry, true, true, 3);
56
artframe.Add(artname_box);
57
artframe.ShadowType = (ShadowType) 4;
59
VBox.PackStart( artframe,false,false,3);
61
Frame fileframe = new Frame("artbox_frame");
62
fileframe.Label = AddinManager.CurrentLocalizer.GetString("Output File type");
63
HBox image_radio_button_h_box = new HBox ();
64
jpg = new RadioButton (null, "JPG File");
65
png = new RadioButton (jpg, "PNG File");
66
image_radio_button_h_box.PackStart(jpg, false, false, 3);
67
image_radio_button_h_box.PackStart(png, false, false, 3);
68
fileframe.Add(image_radio_button_h_box);
69
fileframe.ShadowType = (ShadowType) 4;
70
VBox.PackStart (fileframe, false, false, 3);
71
AddDefaultCloseButton ();
75
artname_entry.Text = service.ArtName;
78
} else if (service.PNG) {
82
// attach change handlers
83
artname_entry.Changed += new EventHandler (on_ArtName_Changed);
84
jpg.Toggled += new EventHandler(on_Radio_Clicked);
85
png.Toggled += new EventHandler(on_Radio_Clicked);
88
private void on_ArtName_Changed (object source, System.EventArgs args)
90
service.ArtName = artname_entry.Text;
92
private void on_Radio_Clicked (object source, System.EventArgs args)
94
service.JPG = jpg.Active;
95
service.PNG = png.Active;