diff options
author | Jacek Antonelli | 2010-08-31 05:54:55 -0500 |
---|---|---|
committer | Jacek Antonelli | 2010-09-10 18:50:13 -0500 |
commit | c4cf3766e12cf652cece9f1957b55bf3acb28146 (patch) | |
tree | 3fa221c7d6aa0ed1d89d4c2057452b46799063cb /linden/indra/newview/impprefsfonts.cpp | |
parent | Switched main viewer font to DejaVu Sans Condensed. (diff) | |
download | meta-impy-c4cf3766e12cf652cece9f1957b55bf3acb28146.zip meta-impy-c4cf3766e12cf652cece9f1957b55bf3acb28146.tar.gz meta-impy-c4cf3766e12cf652cece9f1957b55bf3acb28146.tar.bz2 meta-impy-c4cf3766e12cf652cece9f1957b55bf3acb28146.tar.xz |
Added Preferences > Fonts tab, with basic font chooser.
Choosing a font sets FontChoice setting, but no real effect yet.
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/impprefsfonts.cpp | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/linden/indra/newview/impprefsfonts.cpp b/linden/indra/newview/impprefsfonts.cpp new file mode 100644 index 0000000..3ce71eb --- /dev/null +++ b/linden/indra/newview/impprefsfonts.cpp | |||
@@ -0,0 +1,86 @@ | |||
1 | /** | ||
2 | * @file impprefsfonts.cpp | ||
3 | * @brief Font preferences panel | ||
4 | * | ||
5 | * Copyright (c) 2010, Jacek Antonelli | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided to you | ||
8 | * under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in | ||
10 | * this distribution, or online at | ||
11 | * http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
12 | * | ||
13 | * There are special exceptions to the terms and conditions of the GPL as | ||
14 | * it is applied to this Source Code. View the full text of the exception | ||
15 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
16 | * online at | ||
17 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | |||
29 | #include "llviewerprecompiledheaders.h" | ||
30 | #include "impprefsfonts.h" | ||
31 | |||
32 | #include "llradiogroup.h" | ||
33 | #include "lluictrlfactory.h" | ||
34 | |||
35 | #include "llviewercontrol.h" | ||
36 | #include "llviewerwindow.h" | ||
37 | |||
38 | |||
39 | ImpPrefsFonts::ImpPrefsFonts() | ||
40 | { | ||
41 | LLUICtrlFactory::getInstance()-> | ||
42 | buildPanel(this, "panel_preferences_fonts.xml"); | ||
43 | } | ||
44 | |||
45 | ImpPrefsFonts::~ImpPrefsFonts() | ||
46 | { | ||
47 | } | ||
48 | |||
49 | |||
50 | BOOL ImpPrefsFonts::postBuild() | ||
51 | { | ||
52 | refresh(); | ||
53 | return true; | ||
54 | } | ||
55 | |||
56 | |||
57 | void ImpPrefsFonts::refresh() | ||
58 | { | ||
59 | LLRadioGroup* fonts = getChild<LLRadioGroup>("fonts"); | ||
60 | if (fonts) | ||
61 | { | ||
62 | fonts->setValue( gSavedSettings.getString("FontChoice") ); | ||
63 | } | ||
64 | } | ||
65 | |||
66 | void ImpPrefsFonts::apply() | ||
67 | { | ||
68 | LLRadioGroup* fonts = getChild<LLRadioGroup>("fonts"); | ||
69 | |||
70 | if (fonts) | ||
71 | { | ||
72 | std::string font_choice = fonts->getValue().asString(); | ||
73 | |||
74 | if (font_choice != gSavedSettings.getString("FontChoice") && | ||
75 | !font_choice.empty()) | ||
76 | { | ||
77 | gSavedSettings.setString("FontChoice", font_choice); | ||
78 | LLNotifications::instance().add("ChangeFont"); | ||
79 | refresh(); | ||
80 | } | ||
81 | } | ||
82 | } | ||
83 | |||
84 | void ImpPrefsFonts::cancel() | ||
85 | { | ||
86 | } | ||