author | mickeyl <mickeyl> | 2003-09-27 11:29:26 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-09-27 11:29:26 (UTC) |
commit | 651b6c612db4e809c506973996f2580c4158ac3a (patch) (unidiff) | |
tree | 8c8edc86e4b206dd4542a6b556ad1a319d6698ab /inputmethods/dasher/DasherSettingsInterface.cpp | |
parent | d1a11b45e805fe7771ea05944757d767c3c4c8ea (diff) | |
download | opie-651b6c612db4e809c506973996f2580c4158ac3a.zip opie-651b6c612db4e809c506973996f2580c4158ac3a.tar.gz opie-651b6c612db4e809c506973996f2580c4158ac3a.tar.bz2 |
merge dasher which has been introduced in BRANCH first (wtf?) into HEAD
Diffstat (limited to 'inputmethods/dasher/DasherSettingsInterface.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/dasher/DasherSettingsInterface.cpp | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/inputmethods/dasher/DasherSettingsInterface.cpp b/inputmethods/dasher/DasherSettingsInterface.cpp new file mode 100644 index 0000000..6e7f7da --- a/dev/null +++ b/inputmethods/dasher/DasherSettingsInterface.cpp | |||
@@ -0,0 +1,126 @@ | |||
1 | // DasherSettingsInterface.cpp | ||
2 | // | ||
3 | ///////////////////////////////////////////////////////////////////////////// | ||
4 | // | ||
5 | // Copyright (c) 2002 Iain Murray | ||
6 | // | ||
7 | ///////////////////////////////////////////////////////////////////////////// | ||
8 | |||
9 | #include <iostream> | ||
10 | |||
11 | #include "DasherSettingsInterface.h" | ||
12 | |||
13 | namespace Dasher{ | ||
14 | namespace Keys { | ||
15 | // Standard Option strings. You are encouraged to use these constants. | ||
16 | // ------------------------------------------------------------------- | ||
17 | |||
18 | // bool options | ||
19 | const std::string TIME_STAMP = "TimeStampNewFiles"; | ||
20 | const std::string SHOW_TOOLBAR = "ViewToolbar"; | ||
21 | const std::string SHOW_TOOLBAR_TEXT = "ShowToolbarText"; | ||
22 | const std::string SHOW_LARGE_ICONS = "ShowLargeIcons"; | ||
23 | const std::string FIX_LAYOUT = "FixLayout"; | ||
24 | const std::string SHOW_SLIDER = "ShowSpeedSlider"; | ||
25 | const std::string COPY_ALL_ON_STOP = "CopyAllOnStop"; | ||
26 | const std::string DRAW_MOUSE = "DrawMouse"; | ||
27 | const std::string START_MOUSE = "StartOnLeft"; | ||
28 | const std::string START_SPACE = "StartOnSpace"; | ||
29 | const std::string KEY_CONTROL = "KeyControl"; | ||
30 | const std::string WINDOW_PAUSE = "PauseOutsideWindow"; | ||
31 | |||
32 | // long options | ||
33 | const std::string FILE_ENCODING = "FileEncodingFormat"; | ||
34 | const std::string MAX_BITRATE_TIMES100 = "MaxBitRateTimes100"; | ||
35 | const std::string SCREEN_ORIENTATION = "ScreenOrientation"; | ||
36 | const std::string VIEW_ID = "ViewID"; | ||
37 | const std::string LANGUAGE_MODEL_ID = "LanguageModelID"; | ||
38 | const std::string EDIT_FONT_SIZE = "EditFontSize"; | ||
39 | const std::string EDIT_HEIGHT = "EditHeight"; | ||
40 | const std::string SCREEN_WIDTH = "ScreenWidth"; | ||
41 | const std::string SCREEN_HEIGHT = "ScreenHeight"; | ||
42 | const std::string DASHER_FONTSIZE = "DasherFontSize"; | ||
43 | const std::string DASHER_DIMENSIONS = "NumberDimensions"; | ||
44 | |||
45 | // string options | ||
46 | const std::string ALPHABET_ID = "AlphabetID"; | ||
47 | const std::string DASHER_FONT = "DasherFont"; | ||
48 | const std::string EDIT_FONT = "EditFont"; | ||
49 | } | ||
50 | } | ||
51 | |||
52 | |||
53 | void Dasher::CDasherSettingsInterface::SettingsDefaults(CSettingsStore* Store) | ||
54 | { | ||
55 | using namespace Dasher; | ||
56 | using namespace Keys; | ||
57 | using namespace Opts; | ||
58 | |||
59 | Store->SetLongDefault(MAX_BITRATE_TIMES100, 150); | ||
60 | this->ChangeMaxBitRate(Store->GetLongOption(MAX_BITRATE_TIMES100)/100.0); | ||
61 | |||
62 | Store->SetBoolDefault(TIME_STAMP, true); | ||
63 | this->TimeStampNewFiles(Store->GetBoolOption(TIME_STAMP)); | ||
64 | Store->SetBoolDefault(COPY_ALL_ON_STOP, false); | ||
65 | this->CopyAllOnStop(Store->GetBoolOption(COPY_ALL_ON_STOP)); | ||
66 | |||
67 | Store->SetBoolDefault(DRAW_MOUSE, false); | ||
68 | this->DrawMouse(Store->GetBoolOption(DRAW_MOUSE)); | ||
69 | |||
70 | Store->SetLongDefault(FILE_ENCODING, AlphabetDefault); | ||
71 | this->SetFileEncoding((FileEncodingFormats) Store->GetLongOption(FILE_ENCODING)); | ||
72 | |||
73 | Store->SetBoolDefault(SHOW_SLIDER, true); | ||
74 | this->ShowSpeedSlider(Store->GetBoolOption(SHOW_SLIDER)); | ||
75 | Store->SetBoolDefault(FIX_LAYOUT, false); | ||
76 | this->FixLayout(Store->GetBoolOption(FIX_LAYOUT)); | ||
77 | |||
78 | // Toolbar defaults | ||
79 | Store->SetBoolDefault(SHOW_TOOLBAR_TEXT, true); | ||
80 | this->ShowToolbarText(Store->GetBoolOption(SHOW_TOOLBAR_TEXT)); | ||
81 | Store->SetBoolDefault(SHOW_LARGE_ICONS, true); | ||
82 | this->ShowToolbarLargeIcons(Store->GetBoolOption(SHOW_LARGE_ICONS)); | ||
83 | |||
84 | Store->SetBoolDefault(SHOW_TOOLBAR, true); | ||
85 | this->ShowToolbar(Store->GetBoolOption(SHOW_TOOLBAR)); | ||
86 | |||
87 | Store->SetLongDefault(SCREEN_ORIENTATION, Opts::LeftToRight); | ||
88 | this->ChangeOrientation((ScreenOrientations) Store->GetLongOption(SCREEN_ORIENTATION)); | ||
89 | |||
90 | Store->SetBoolDefault(START_MOUSE, true); | ||
91 | this->StartOnLeft(Store->GetBoolOption(START_MOUSE)); | ||
92 | |||
93 | Store->SetBoolDefault(START_SPACE, false); | ||
94 | this->StartOnSpace(Store->GetBoolOption(START_SPACE)); | ||
95 | |||
96 | Store->SetBoolDefault(KEY_CONTROL, false); | ||
97 | this->KeyControl(Store->GetBoolOption(KEY_CONTROL)); | ||
98 | |||
99 | Store->SetBoolDefault(DASHER_DIMENSIONS, false); | ||
100 | this->SetDasherDimensions(Store->GetBoolOption(DASHER_DIMENSIONS)); | ||
101 | |||
102 | Store->SetBoolDefault(WINDOW_PAUSE, false); | ||
103 | this->WindowPause(Store->GetBoolOption(WINDOW_PAUSE)); | ||
104 | |||
105 | // The following standard options don't have sensible cross-platform or cross-language defaults. | ||
106 | // "" or 0 will have to mean "do something sensible for this user and platform" | ||
107 | // The user may have saved a preference for some of these options though: | ||
108 | |||
109 | this->ChangeAlphabet(Store->GetStringOption(ALPHABET_ID)); | ||
110 | |||
111 | // FIXME - need to work out why this breaks stuff | ||
112 | //this->ChangeLanguageModel(Store->GetLongOption(LANGUAGE_MODEL_ID)); | ||
113 | this->ChangeView(Store->GetLongOption(VIEW_ID)); | ||
114 | |||
115 | // Fonts | ||
116 | this->SetEditFont(Store->GetStringOption(EDIT_FONT), Store->GetLongOption(EDIT_FONT_SIZE)); | ||
117 | this->SetDasherFont(Store->GetStringOption(DASHER_FONT)); | ||
118 | this->SetDasherFontSize(Dasher::Opts::FontSize(Store->GetLongOption(DASHER_FONTSIZE))); | ||
119 | |||
120 | // Window Geometry | ||
121 | this->SetEditHeight(Store->GetLongOption(EDIT_HEIGHT)); | ||
122 | this->SetScreenSize(Store->GetLongOption(SCREEN_WIDTH), Store->GetLongOption(SCREEN_HEIGHT)); | ||
123 | } | ||
124 | |||
125 | |||
126 | |||