Debian Codegraph @

components/extension/tagedit/config.cpp

raw symbols SCIP
1 /* fre:ac - free audio converter
2 * Copyright (C) 2001-2021 Robert Kausch <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
10 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
12
13 #include "config.h"
14
15 using namespace smooth::GUI::Dialogs;
16
17 const String BoCA::ConfigureTagEdit::ConfigID = "TagEdit";
18
19 BoCA::ConfigureTagEdit::ConfigureTagEdit()
20 {
21 const Config *config = Config::Get();
22 I18n *i18n = I18n::Get();
23
24 i18n->SetContext("Extensions::Tag Editor::Configuration");
25
26 clearAlbumArtist = config->GetIntValue(ConfigID, "ClearAlbumArtist", False);
27
28 /* Create Behavior group.
29 */
30 group_behavior = new GroupBox(i18n->TranslateString("Behavior"), Point(7, 11), Size(420, 41));
31
32 check_behavior_clearAlbumArtist = new CheckBox(i18n->TranslateString("Clear album artist field if it matches track artist"), Point(10, 14), Size(400, 0), &clearAlbumArtist);
33 check_behavior_clearAlbumArtist->SetWidth(check_behavior_clearAlbumArtist->GetUnscaledTextWidth() + 21);
34
35 group_behavior->SetWidth(check_behavior_clearAlbumArtist->GetWidth() + 20);
36
37 group_behavior->Add(check_behavior_clearAlbumArtist);
38
39 Add(group_behavior);
40
41 SetSize(group_behavior->GetSize() + Size(14, 16));
42 }
43
44 BoCA::ConfigureTagEdit::~ConfigureTagEdit()
45 {
46 DeleteObject(group_behavior);
47 DeleteObject(check_behavior_clearAlbumArtist);
48 }
49
50 Int BoCA::ConfigureTagEdit::SaveSettings()
51 {
52 Config *config = Config::Get();
53
54 config->SetIntValue(ConfigID, "ClearAlbumArtist", clearAlbumArtist);
55
56 return Success();
57 }