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 <GroupLayout.h> 14 #include <GroupLayoutBuilder.h> 15 #include <StringView.h> 16 17 #include <stdio.h> 18 #include <string.h> 19 20 #undef B_TRANSLATE_CONTEXT 21 #define B_TRANSLATE_CONTEXT "ConfigView" 22 23 const char* kShortName2 = B_TRANSLATE_MARK("RAWTranslator Settings"); 24 25 26 ConfigView::ConfigView(uint32 flags) 27 : BView(kShortName2, flags) 28 { 29 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 30 31 BStringView *fTitle = new BStringView("title", B_TRANSLATE("RAW Images")); 32 fTitle->SetFont(be_bold_font); 33 34 char version[256]; 35 sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"), 36 int(B_TRANSLATION_MAJOR_VERSION(RAW_TRANSLATOR_VERSION)), 37 int(B_TRANSLATION_MINOR_VERSION(RAW_TRANSLATOR_VERSION)), 38 int(B_TRANSLATION_REVISION_VERSION(RAW_TRANSLATOR_VERSION)), 39 __DATE__); 40 BStringView *fVersion = new BStringView("version", version); 41 42 BStringView *fCopyright = new BStringView("copyright", 43 B_UTF8_COPYRIGHT "2007-2009 Haiku Inc."); 44 45 BStringView *fCopyright2 = new BStringView("copyright2", 46 B_TRANSLATE("Based on Dave Coffin's dcraw 8.63")); 47 48 BStringView *fCopyright3 = new BStringView("copyright3", 49 B_UTF8_COPYRIGHT "1997-2007 Dave Coffin"); 50 51 // Build the layout 52 SetLayout(new BGroupLayout(B_HORIZONTAL)); 53 54 AddChild(BGroupLayoutBuilder(B_VERTICAL, 7) 55 .Add(fTitle) 56 .AddGlue() 57 .Add(fVersion) 58 .Add(fCopyright) 59 .AddGlue() 60 .Add(fCopyright2) 61 .Add(fCopyright3) 62 .AddGlue() 63 .SetInsets(5, 5, 5, 5) 64 ); 65 66 BFont font; 67 GetFont(&font); 68 SetExplicitPreferredSize(BSize((font.Size() * 233)/12, (font.Size() * 200)/12)); 69 } 70 71 72 ConfigView::~ConfigView() 73 { 74 } 75 76