vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / translators / rtf / ConfigView.cpp
blobc0571aaa6b596a849fd7f84fc38d2dd676d7c39f
1 /*
2 * Copyright 2004-2006, 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 "RTFTranslator.h"
10 #include <Catalog.h>
11 #include <LayoutBuilder.h>
12 #include <StringView.h>
14 #include <stdio.h>
16 #undef B_TRANSLATION_CONTEXT
17 #define B_TRANSLATION_CONTEXT "ConfigView"
20 ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags)
21 : BView(frame, B_TRANSLATE("RTF-Translator Settings"), resize, flags)
23 SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
25 BStringView *titleView = new BStringView("title",
26 B_TRANSLATE("Rich Text Format (RTF) translator"));
27 titleView->SetFont(be_bold_font);
30 char version[256];
31 snprintf(version, sizeof(version), B_TRANSLATE("Version %d.%d.%d, %s"),
32 static_cast<int>(B_TRANSLATION_MAJOR_VERSION(RTF_TRANSLATOR_VERSION)),
33 static_cast<int>(B_TRANSLATION_MINOR_VERSION(RTF_TRANSLATOR_VERSION)),
34 static_cast<int>(B_TRANSLATION_REVISION_VERSION(
35 RTF_TRANSLATOR_VERSION)), __DATE__);
36 BStringView *versionView = new BStringView("version", version);
37 BStringView *copyrightView = new BStringView(
38 "Copyright", B_UTF8_COPYRIGHT "2004-2006 Haiku Inc.");
39 BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
40 .SetInsets(B_USE_DEFAULT_SPACING)
41 .Add(titleView)
42 .Add(versionView)
43 .Add(copyrightView)
44 .AddGlue();
48 ConfigView::~ConfigView()