xref: /haiku/src/add-ons/translators/raw/ConfigView.cpp (revision 95c9effd68127df2dce202d5e254a7c86560010a)
1 /*
2  * Copyright 2005-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Copyright 2009, Maxime Simon, maxime.simon@gmail.com. All rights reserved.
4  * Distributed under the terms of the MIT License.
5  */
6 
7 
8 #include "ConfigView.h"
9 #include "RAWTranslator.h"
10 
11 #include <Catalog.h>
12 #include <CheckBox.h>
13 #include <LayoutBuilder.h>
14 #include <StringView.h>
15 
16 #include <stdio.h>
17 #include <string.h>
18 
19 #undef B_TRANSLATION_CONTEXT
20 #define B_TRANSLATION_CONTEXT "ConfigView"
21 
22 const char* kShortName2 = B_TRANSLATE_MARK("RAWTranslator Settings");
23 
24 
25 ConfigView::ConfigView(uint32 flags)
26 	: BView(kShortName2, flags)
27 {
28 	SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
29 
30 	BStringView *fTitle = new BStringView("title", B_TRANSLATE("RAW image translator"));
31 	fTitle->SetFont(be_bold_font);
32 
33 	char version[256];
34 	sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"),
35 		int(B_TRANSLATION_MAJOR_VERSION(RAW_TRANSLATOR_VERSION)),
36 		int(B_TRANSLATION_MINOR_VERSION(RAW_TRANSLATOR_VERSION)),
37 		int(B_TRANSLATION_REVISION_VERSION(RAW_TRANSLATOR_VERSION)),
38 		__DATE__);
39 	BStringView *fVersion = new BStringView("version", version);
40 
41 	BStringView *fCopyright = new BStringView("copyright",
42 		B_UTF8_COPYRIGHT "2007-2009 Haiku Inc.");
43 
44 	BStringView *fCopyright2 = new BStringView("copyright2",
45 		B_TRANSLATE("Based on Dave Coffin's dcraw 8.63"));
46 
47 	BStringView *fCopyright3 = new BStringView("copyright3",
48 		B_UTF8_COPYRIGHT "1997-2007 Dave Coffin");
49 
50 	// Build the layout
51 	BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
52 		.SetInsets(B_USE_DEFAULT_SPACING)
53 		.Add(fTitle)
54 		.Add(fVersion)
55 		.Add(fCopyright)
56 		.AddGlue()
57 		.Add(fCopyright2)
58 		.Add(fCopyright3);
59 
60 	BFont font;
61 	GetFont(&font);
62 	SetExplicitPreferredSize(BSize((font.Size() * 233)/12, (font.Size() * 200)/12));
63 }
64 
65 
66 ConfigView::~ConfigView()
67 {
68 }
69 
70