vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / translators / ico / ConfigView.cpp
blob44eb650e23389278e29d40053130bc91556472ee
1 /*
2 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
7 #include "ConfigView.h"
8 #include "ICOTranslator.h"
10 #include <Catalog.h>
11 #include <CheckBox.h>
12 #include <ControlLook.h>
13 #include <LayoutBuilder.h>
14 #include <StringView.h>
16 #include <stdio.h>
17 #include <string.h>
19 #undef B_TRANSLATION_CONTEXT
20 #define B_TRANSLATION_CONTEXT "ConfigView"
23 ConfigView::ConfigView()
25 BGroupView(B_TRANSLATE("ICOTranslator Settings"), B_VERTICAL, 0)
27 BStringView* titleView = new BStringView("title",
28 B_TRANSLATE("Windows icon translator"));
29 titleView->SetFont(be_bold_font);
31 char version[256];
32 sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"),
33 int(B_TRANSLATION_MAJOR_VERSION(ICO_TRANSLATOR_VERSION)),
34 int(B_TRANSLATION_MINOR_VERSION(ICO_TRANSLATOR_VERSION)),
35 int(B_TRANSLATION_REVISION_VERSION(ICO_TRANSLATOR_VERSION)),
36 __DATE__);
38 BStringView* versionView = new BStringView("version", version);
40 BStringView *copyrightView = new BStringView("copyright",
41 B_UTF8_COPYRIGHT "2005-2006 Haiku Inc.");
43 BCheckBox *colorCheckBox = new BCheckBox("color",
44 B_TRANSLATE("Write 32 bit images on true color input"), NULL);
46 BCheckBox *sizeCheckBox = new BCheckBox("size",
47 B_TRANSLATE("Enforce valid icon sizes"), NULL);
48 sizeCheckBox->SetValue(1);
50 BStringView* infoView = new BStringView("valid1",
51 B_TRANSLATE("Valid icon sizes are 16, 32, or 48"));
53 BStringView* info2View = new BStringView("valid2",
54 B_TRANSLATE("pixels in either direction."));
56 BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
57 .SetInsets(B_USE_DEFAULT_SPACING)
58 .Add(titleView)
59 .Add(versionView)
60 .Add(copyrightView)
61 .AddGlue()
62 .Add(colorCheckBox)
63 .Add(sizeCheckBox)
64 .Add(infoView)
65 .Add(info2View)
66 .AddGlue();
68 SetExplicitPreferredSize(GroupLayout()->MinSize());
72 ConfigView::~ConfigView()