diff options
author | Jacek Antonelli | 2010-08-31 05:54:55 -0500 |
---|---|---|
committer | McCabe Maxsted | 2010-09-10 19:23:06 -0700 |
commit | 7460b677c3979b9ec5b913dee3abfcd4272bd297 (patch) | |
tree | 406bc0c3ce68962090fe2ca4a29cd3b9b4d002d3 /linden/indra/newview | |
parent | Changed the 'bundle identifier' to org.imprudenceviewer.viewer. (diff) | |
download | meta-impy-7460b677c3979b9ec5b913dee3abfcd4272bd297.zip meta-impy-7460b677c3979b9ec5b913dee3abfcd4272bd297.tar.gz meta-impy-7460b677c3979b9ec5b913dee3abfcd4272bd297.tar.bz2 meta-impy-7460b677c3979b9ec5b913dee3abfcd4272bd297.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/CMakeLists.txt | 2 | ||||
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | linden/indra/newview/impprefsfonts.cpp | 86 | ||||
-rw-r--r-- | linden/indra/newview/impprefsfonts.h | 45 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterpreference.cpp | 15 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterpreference.h | 2 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/fonts.xml | 14 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/notifications.xml | 7 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/panel_preferences_fonts.xml | 33 |
9 files changed, 214 insertions, 1 deletions
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index 313ed9f..1691095 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt | |||
@@ -87,6 +87,7 @@ set(viewer_SOURCE_FILES | |||
87 | hippoGridManager.cpp | 87 | hippoGridManager.cpp |
88 | hippoLimits.cpp | 88 | hippoLimits.cpp |
89 | hippoRestRequest.cpp | 89 | hippoRestRequest.cpp |
90 | impprefsfonts.cpp | ||
90 | jcfloater_animation_list.cpp | 91 | jcfloater_animation_list.cpp |
91 | jcfloaterareasearch.cpp | 92 | jcfloaterareasearch.cpp |
92 | lightshare.cpp | 93 | lightshare.cpp |
@@ -525,6 +526,7 @@ set(viewer_HEADER_FILES | |||
525 | hippoGridManager.h | 526 | hippoGridManager.h |
526 | hippoLimits.h | 527 | hippoLimits.h |
527 | hippoRestRequest.h | 528 | hippoRestRequest.h |
529 | impprefsfonts.h | ||
528 | jcfloater_animation_list.h | 530 | jcfloater_animation_list.h |
529 | jcfloaterareasearch.h | 531 | jcfloaterareasearch.h |
530 | lightshare.h | 532 | lightshare.h |
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 75f37df..270bd58 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -336,6 +336,17 @@ | |||
336 | <integer>0</integer> | 336 | <integer>0</integer> |
337 | </array> | 337 | </array> |
338 | </map> | 338 | </map> |
339 | <key>FontChoice</key> | ||
340 | <map> | ||
341 | <key>Comment</key> | ||
342 | <string>User's font choice (Liberation or DejaVu)</string> | ||
343 | <key>Persist</key> | ||
344 | <integer>1</integer> | ||
345 | <key>Type</key> | ||
346 | <string>String</string> | ||
347 | <key>Value</key> | ||
348 | <string>DejaVu</string> | ||
349 | </map> | ||
339 | <key>GoAction</key> | 350 | <key>GoAction</key> |
340 | <map> | 351 | <map> |
341 | <key>Comment</key> | 352 | <key>Comment</key> |
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 | } | ||
diff --git a/linden/indra/newview/impprefsfonts.h b/linden/indra/newview/impprefsfonts.h new file mode 100644 index 0000000..12aa0bb --- /dev/null +++ b/linden/indra/newview/impprefsfonts.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /** | ||
2 | * @file impprefsfonts.h | ||
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 | #ifndef IMP_PREFSFONTS_H | ||
29 | #define IMP_PREFSFONTS_H | ||
30 | |||
31 | #include "llpanel.h" | ||
32 | |||
33 | class ImpPrefsFonts : public LLPanel | ||
34 | { | ||
35 | public: | ||
36 | ImpPrefsFonts(); | ||
37 | virtual ~ImpPrefsFonts(); | ||
38 | |||
39 | virtual BOOL postBuild(); | ||
40 | void refresh(); | ||
41 | void apply(); | ||
42 | void cancel(); | ||
43 | }; | ||
44 | |||
45 | #endif // IMP_PREFSFONTS_H | ||
diff --git a/linden/indra/newview/llfloaterpreference.cpp b/linden/indra/newview/llfloaterpreference.cpp index 744c179..09336cb 100644 --- a/linden/indra/newview/llfloaterpreference.cpp +++ b/linden/indra/newview/llfloaterpreference.cpp | |||
@@ -48,6 +48,7 @@ | |||
48 | #include "llspinctrl.h" | 48 | #include "llspinctrl.h" |
49 | #include "message.h" | 49 | #include "message.h" |
50 | 50 | ||
51 | #include "impprefsfonts.h" | ||
51 | #include "llcommandhandler.h" | 52 | #include "llcommandhandler.h" |
52 | #include "llfloaterpreference.h" | 53 | #include "llfloaterpreference.h" |
53 | #include "llpanelnetwork.h" | 54 | #include "llpanelnetwork.h" |
@@ -133,7 +134,8 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * def | |||
133 | mMsgPanel(NULL), | 134 | mMsgPanel(NULL), |
134 | mSkinsPanel(NULL), | 135 | mSkinsPanel(NULL), |
135 | mLCDPanel(NULL), | 136 | mLCDPanel(NULL), |
136 | mPrefsAdvanced(NULL) | 137 | mPrefsAdvanced(NULL), |
138 | mPrefsFonts(NULL) | ||
137 | { | 139 | { |
138 | mGeneralPanel = new LLPanelGeneral(); | 140 | mGeneralPanel = new LLPanelGeneral(); |
139 | mTabContainer->addTabPanel(mGeneralPanel, mGeneralPanel->getLabel(), FALSE, onTabChanged, mTabContainer); | 141 | mTabContainer->addTabPanel(mGeneralPanel, mGeneralPanel->getLabel(), FALSE, onTabChanged, mTabContainer); |
@@ -197,6 +199,10 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * def | |||
197 | mTabContainer->addTabPanel(mPrefsAdvanced, mPrefsAdvanced->getLabel(), FALSE, onTabChanged, mTabContainer); | 199 | mTabContainer->addTabPanel(mPrefsAdvanced, mPrefsAdvanced->getLabel(), FALSE, onTabChanged, mTabContainer); |
198 | mPrefsAdvanced->setDefaultBtn(default_btn); | 200 | mPrefsAdvanced->setDefaultBtn(default_btn); |
199 | 201 | ||
202 | mPrefsFonts = new ImpPrefsFonts(); | ||
203 | mTabContainer->addTabPanel(mPrefsFonts, mPrefsFonts->getLabel(), FALSE, onTabChanged, mTabContainer); | ||
204 | mPrefsFonts->setDefaultBtn(default_btn); | ||
205 | |||
200 | if (!mTabContainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) | 206 | if (!mTabContainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) |
201 | { | 207 | { |
202 | mTabContainer->selectFirstTab(); | 208 | mTabContainer->selectFirstTab(); |
@@ -261,6 +267,11 @@ LLPreferenceCore::~LLPreferenceCore() | |||
261 | delete mPrefsAdvanced; | 267 | delete mPrefsAdvanced; |
262 | mPrefsAdvanced = NULL; | 268 | mPrefsAdvanced = NULL; |
263 | } | 269 | } |
270 | if (mPrefsFonts) | ||
271 | { | ||
272 | delete mPrefsFonts; | ||
273 | mPrefsFonts = NULL; | ||
274 | } | ||
264 | 275 | ||
265 | } | 276 | } |
266 | 277 | ||
@@ -278,6 +289,7 @@ void LLPreferenceCore::apply() | |||
278 | mMsgPanel->apply(); | 289 | mMsgPanel->apply(); |
279 | mSkinsPanel->apply(); | 290 | mSkinsPanel->apply(); |
280 | mPrefsAdvanced->apply(); | 291 | mPrefsAdvanced->apply(); |
292 | mPrefsFonts->apply(); | ||
281 | 293 | ||
282 | // hardware menu apply | 294 | // hardware menu apply |
283 | LLFloaterHardwareSettings::instance()->apply(); | 295 | LLFloaterHardwareSettings::instance()->apply(); |
@@ -307,6 +319,7 @@ void LLPreferenceCore::cancel() | |||
307 | mMsgPanel->cancel(); | 319 | mMsgPanel->cancel(); |
308 | mSkinsPanel->cancel(); | 320 | mSkinsPanel->cancel(); |
309 | mPrefsAdvanced->cancel(); | 321 | mPrefsAdvanced->cancel(); |
322 | mPrefsFonts->cancel(); | ||
310 | 323 | ||
311 | // cancel hardware menu | 324 | // cancel hardware menu |
312 | LLFloaterHardwareSettings::instance()->cancel(); | 325 | LLFloaterHardwareSettings::instance()->cancel(); |
diff --git a/linden/indra/newview/llfloaterpreference.h b/linden/indra/newview/llfloaterpreference.h index 1878280..e98c45c 100644 --- a/linden/indra/newview/llfloaterpreference.h +++ b/linden/indra/newview/llfloaterpreference.h | |||
@@ -56,6 +56,7 @@ class LLPrefsIM; | |||
56 | class LLPanelMsgs; | 56 | class LLPanelMsgs; |
57 | class LLPanelSkins; | 57 | class LLPanelSkins; |
58 | class LLPrefsAdvanced; | 58 | class LLPrefsAdvanced; |
59 | class ImpPrefsFonts; | ||
59 | class LLScrollListCtrl; | 60 | class LLScrollListCtrl; |
60 | 61 | ||
61 | class LLPreferenceCore | 62 | class LLPreferenceCore |
@@ -93,6 +94,7 @@ private: | |||
93 | LLPanelMsgs *mMsgPanel; | 94 | LLPanelMsgs *mMsgPanel; |
94 | LLPanelLCD *mLCDPanel; | 95 | LLPanelLCD *mLCDPanel; |
95 | LLPrefsAdvanced *mPrefsAdvanced; | 96 | LLPrefsAdvanced *mPrefsAdvanced; |
97 | ImpPrefsFonts* mPrefsFonts; | ||
96 | }; | 98 | }; |
97 | 99 | ||
98 | // Floater to control preferences (display, audio, bandwidth, general. | 100 | // Floater to control preferences (display, audio, bandwidth, general. |
diff --git a/linden/indra/newview/skins/default/xui/en-us/fonts.xml b/linden/indra/newview/skins/default/xui/en-us/fonts.xml index 95070ed..5d831c6 100644 --- a/linden/indra/newview/skins/default/xui/en-us/fonts.xml +++ b/linden/indra/newview/skins/default/xui/en-us/fonts.xml | |||
@@ -33,6 +33,7 @@ | |||
33 | <file>VeraMono.ttf</file> | 33 | <file>VeraMono.ttf</file> |
34 | </font> | 34 | </font> |
35 | 35 | ||
36 | |||
36 | <font name="DejaVu" | 37 | <font name="DejaVu" |
37 | comment="Name of DejaVu font"> | 38 | comment="Name of DejaVu font"> |
38 | <file>DejaVuSansCondensed.ttf</file> | 39 | <file>DejaVuSansCondensed.ttf</file> |
@@ -56,6 +57,19 @@ | |||
56 | <file>DejaVuSansCondensed-BoldOblique.ttf</file> | 57 | <file>DejaVuSansCondensed-BoldOblique.ttf</file> |
57 | </font> | 58 | </font> |
58 | 59 | ||
60 | |||
61 | <font name="Liberation" | ||
62 | comment="Name of Liberation font"> | ||
63 | <file>LiberationSans-Regular.ttf</file> | ||
64 | </font> | ||
65 | |||
66 | <font name="Liberation" | ||
67 | comment="Name of Liberation font (bold)" | ||
68 | font_style="BOLD"> | ||
69 | <file>LiberationSans-Bold.ttf</file> | ||
70 | </font> | ||
71 | |||
72 | |||
59 | <font name="Helvetica" | 73 | <font name="Helvetica" |
60 | comment="Name of Helvetica font"> | 74 | comment="Name of Helvetica font"> |
61 | <file>arial.ttf</file> | 75 | <file>arial.ttf</file> |
diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml index 0de1df5..eced647 100644 --- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml | |||
@@ -7084,6 +7084,13 @@ Apply this region's settings? ("Ignore" will ignore all region setting | |||
7084 | </form> | 7084 | </form> |
7085 | </notification> | 7085 | </notification> |
7086 | 7086 | ||
7087 | <notification | ||
7088 | name="ChangeFont" | ||
7089 | icon="alertmodal.tga" | ||
7090 | type="alertmodal"> | ||
7091 | The new font will appear after you restart [VIEWER_NAME]. | ||
7092 | </notification> | ||
7093 | |||
7087 | 7094 | ||
7088 | <!--End Imprudence notifications--> | 7095 | <!--End Imprudence notifications--> |
7089 | <!-- [KITTY VIEWER] --> | 7096 | <!-- [KITTY VIEWER] --> |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_fonts.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_fonts.xml new file mode 100644 index 0000000..e55981b --- /dev/null +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_fonts.xml | |||
@@ -0,0 +1,33 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> | ||
2 | |||
3 | <panel name="font_panel" label="Fonts" | ||
4 | bottom="-409" left="102" height="408" width="517" | ||
5 | border="true" follows="left|top|right|bottom"> | ||
6 | |||
7 | <text bottom="-25" left="10" height="15" width="300"> | ||
8 | User interface font (requires restart): | ||
9 | </text> | ||
10 | |||
11 | <radio_group name="fonts" draw_border="false" | ||
12 | top="-30" left="20" bottom="0" right="-20" | ||
13 | follows="top|left|bottom|right"> | ||
14 | |||
15 | <radio_item name="DejaVu" bottom="-20" left="0" height="20"> | ||
16 | DejaVu Sans Condensed | ||
17 | </radio_item> | ||
18 | |||
19 | <radio_item name="Liberation" bottom="-70" left="0" height="20"> | ||
20 | Liberation Sans (classic Imprudence font) | ||
21 | </radio_item> | ||
22 | |||
23 | </radio_group> | ||
24 | |||
25 | <text name="dejavu_preview" font="DejaVuMedium" top="-55" left="60"> | ||
26 | Preview: The quick brown fox jumped over the lazy dog. :) | ||
27 | </text> | ||
28 | |||
29 | <text name="lib_preview" font="LiberationMedium" top="-105" left="60"> | ||
30 | Preview: The quick brown fox jumped over the lazy dog. :) | ||
31 | </text> | ||
32 | |||
33 | </panel> | ||