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 <StringView.h> 12 #include <CheckBox.h> 13 #include <GroupLayout.h> 14 #include <GroupLayoutBuilder.h> 15 16 #include <stdio.h> 17 #include <string.h> 18 19 20 ConfigView::ConfigView(uint32 flags) 21 : BView("RAWTranslator Settings", flags) 22 { 23 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 24 25 BStringView *fTitle = new BStringView("title", "RAW Images"); 26 fTitle->SetFont(be_bold_font); 27 28 char version[256]; 29 sprintf(version, "Version %d.%d.%d, %s", 30 int(B_TRANSLATION_MAJOR_VERSION(RAW_TRANSLATOR_VERSION)), 31 int(B_TRANSLATION_MINOR_VERSION(RAW_TRANSLATOR_VERSION)), 32 int(B_TRANSLATION_REVISION_VERSION(RAW_TRANSLATOR_VERSION)), 33 __DATE__); 34 BStringView *fVersion = new BStringView("version", version); 35 36 BStringView *fCopyright = new BStringView("copyright", 37 B_UTF8_COPYRIGHT "2007-2009 Haiku Inc."); 38 39 BStringView *fCopyright2 = new BStringView("copyright2", 40 "Based on Dave Coffin's dcraw 8.63"); 41 42 BStringView *fCopyright3 = new BStringView("copyright3", 43 B_UTF8_COPYRIGHT "1997-2007 Dave Coffin"); 44 45 // Build the layout 46 SetLayout(new BGroupLayout(B_HORIZONTAL)); 47 48 AddChild(BGroupLayoutBuilder(B_VERTICAL, 7) 49 .Add(fTitle) 50 .AddGlue() 51 .Add(fVersion) 52 .Add(fCopyright) 53 .AddGlue() 54 .Add(fCopyright2) 55 .Add(fCopyright3) 56 .AddGlue() 57 .SetInsets(5, 5, 5, 5) 58 ); 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