BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / poorman / PoorManLoggingView.cpp
blobae9c7901f033df871fa5f53628bb23f0b1f8ca4d
1 /* PoorManLoggingView.cpp
3 * Philip Harrison
4 * Started: 5/12/2004
5 * Version: 0.1
6 */
8 #include <Box.h>
9 #include <Catalog.h>
10 #include <LayoutBuilder.h>
11 #include <Locale.h>
13 #include "constants.h"
14 #include "PoorManWindow.h"
15 #include "PoorManApplication.h"
16 #include "PoorManLoggingView.h"
19 #undef B_TRANSLATION_CONTEXT
20 #define B_TRANSLATION_CONTEXT "PoorMan"
23 PoorManLoggingView::PoorManLoggingView(const char* name)
25 BView(name, B_WILL_DRAW, NULL)
27 PoorManWindow* win;
28 win = ((PoorManApplication*)be_app)->GetPoorManWindow();
30 BBox* consoleLogging = new BBox(B_TRANSLATE("Console Logging"));
31 consoleLogging->SetLabel(STR_BBX_CONSOLE_LOGGING);
33 // File Logging BBox
34 BBox* fileLogging = new BBox(B_TRANSLATE("File Logging"));
35 fileLogging->SetLabel(STR_BBX_FILE_LOGGING);
37 // Console Logging
38 fLogConsole = new BCheckBox(B_TRANSLATE("Log To Console"),
39 STR_CBX_LOG_CONSOLE, new BMessage(MSG_PREF_LOG_CBX_CONSOLE));
40 // set the checkbox to the value the program has
41 SetLogConsoleValue(win->LogConsoleFlag());
43 // File Logging
44 fLogFile = new BCheckBox(B_TRANSLATE("Log To File"), STR_CBX_LOG_FILE,
45 new BMessage(MSG_PREF_LOG_CBX_FILE));
46 // set the checkbox to the value the program has
47 SetLogFileValue(win->LogFileFlag());
49 // File Name
50 fLogFileName = new BTextControl(B_TRANSLATE("File Name"),
51 STR_TXT_LOG_FILE_NAME, NULL, NULL);
52 SetLogFileName(win->LogPath());
54 // Create Log File
55 fCreateLogFile = new BButton(B_TRANSLATE("Create Log File"),
56 STR_BTN_CREATE_LOG_FILE, new BMessage(MSG_PREF_LOG_BTN_CREATE_FILE));
58 BGroupLayout* consoleLoggingLayout = new BGroupLayout(B_VERTICAL, 0);
59 consoleLogging->SetLayout(consoleLoggingLayout);
61 BGroupLayout* fileLoggingLayout = new BGroupLayout(B_VERTICAL,
62 B_USE_SMALL_SPACING);
63 fileLogging->SetLayout(fileLoggingLayout);
65 BLayoutBuilder::Group<>(this, B_VERTICAL)
66 .SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
67 B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING)
68 .AddGroup(consoleLoggingLayout)
69 .SetInsets(B_USE_ITEM_INSETS)
70 .AddGroup(B_HORIZONTAL)
71 .SetInsets(0, B_USE_ITEM_INSETS, 0, 0)
72 .Add(fLogConsole)
73 .AddGlue()
74 .End()
75 .End()
76 .AddGroup(fileLoggingLayout)
77 .SetInsets(B_USE_ITEM_INSETS)
78 .AddGrid(B_USE_SMALL_SPACING, B_USE_SMALL_SPACING)
79 .SetInsets(0, B_USE_ITEM_INSETS, 0, 0)
80 .Add(fLogFile, 0, 0)
81 .AddTextControl(fLogFileName, 0, 1, B_ALIGN_LEFT, 1, 2)
82 .Add(fCreateLogFile, 2, 2);