Remove weblinks.
[gmpc.git] / src / Tools / gmpc-metadata-appearance.vala
blobb8946dac6fe15f2d4e4b10ad9267c4000c02ce7a
1 /* Gnome Music Player Client (GMPC)
2 * Copyright (C) 2004-2012 Qball Cow <qball@gmpclient.org>
3 * Project homepage: http://gmpclient.org/
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 /**
21 * This plugin offers the refinement of metadata appearances
24 using Config;
25 using Gtk;
26 using Gmpc;
28 private const bool use_transition_tma = Gmpc.use_transition;
29 private const string some_unique_name_tma = Config.VERSION;
32 public class Gmpc.Tools.MetadataAppearance : Gmpc.Plugin.Base, Gmpc.Plugin.PreferencesIface {
34 private const int[] version = {0,0,0};
35 public override unowned int[] get_version() {
36 return this.version;
39 public override unowned string get_name() {
40 return "Metadata Appearance";
43 construct {
44 /* Mark the plugin as an internal and dummy */
45 this.plugin_type = 8+4;
48 /* preferences pane */
49 public static void
50 on_checkbutton_show_lyrics_toggled(CheckButton source)
52 config.set_int("MetaData", "show-lyrics", (int)source.get_active());
55 public static void
56 on_checkbutton_show_artist_information_toggled(CheckButton source)
58 config.set_int("MetaData", "show-artist-information", (int)source.get_active());
61 public static void
62 on_checkbutton_show_similar_artists_toggled(CheckButton source)
64 config.set_int("MetaData", "show-similar-artist", (int)source.get_active());
67 public static void
68 on_checkbutton_show_similar_songs_toggled(CheckButton source)
70 config.set_int("MetaData", "show-similar-songs", (int)source.get_active());
73 public static void
74 on_checkbutton_show_guitar_tabs_toggled(CheckButton source)
76 config.set_int("MetaData", "show-guitar-tabs", (int)source.get_active());
79 public static void
80 on_checkbutton_show_songs_from_album_toggled(CheckButton source)
82 config.set_int("MetaData", "show-songs-from-album", (int)source.get_active());
85 public void
86 preferences_pane_construct(Gtk.Container container)
88 try {
89 var builder = new Builder();
90 string preferences_ui_file = Gmpc.data_path("preferences-metadata-appearance.ui");
91 builder.add_from_file(preferences_ui_file);
92 builder.connect_signals(null);
93 Widget builderWidget = builder.get_object("frame_metadata_appearance_settings") as Frame;
94 container.add(builderWidget);
95 builderWidget.show_all();
97 builderWidget = builder.get_object("checkbutton_show_lyrics") as CheckButton;
98 ((CheckButton)builderWidget).set_active((bool)config.get_int_with_default("MetaData", "show-lyrics", 1));
100 builderWidget = builder.get_object("checkbutton_show_artist_information") as CheckButton;
101 ((CheckButton)builderWidget).set_active((bool)config.get_int_with_default("MetaData", "show-artist-information", 1));
103 builderWidget = builder.get_object("checkbutton_show_similar_artists") as CheckButton;
104 ((CheckButton)builderWidget).set_active((bool)config.get_int_with_default("MetaData", "show-similar-artist", 1));
106 builderWidget = builder.get_object("checkbutton_show_similar_songs") as CheckButton;
107 ((CheckButton)builderWidget).set_active((bool)config.get_int_with_default("MetaData", "show-similar-songs", 1));
109 builderWidget = builder.get_object("checkbutton_show_guitar_tabs") as CheckButton;
110 ((CheckButton)builderWidget).set_active((bool)config.get_int_with_default("MetaData", "show-guitar-tabs", 1));
112 builderWidget = builder.get_object("checkbutton_show_songs_from_album") as CheckButton;
113 ((CheckButton)builderWidget).set_active((bool)config.get_int_with_default("MetaData", "show-songs-from-album", 1));
114 } catch (Error e) {
115 stderr.printf("Could not load UI: %s\n", e.message);
119 public void
120 preferences_pane_destroy(Gtk.Container container)
122 foreach(Gtk.Widget child in container.get_children())
124 container.remove(child);