aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview')
-rw-r--r--linden/indra/newview/CMakeLists.txt2
-rw-r--r--linden/indra/newview/app_settings/settings.xml11
-rw-r--r--linden/indra/newview/impprefsfonts.cpp86
-rw-r--r--linden/indra/newview/impprefsfonts.h45
-rw-r--r--linden/indra/newview/llfloaterpreference.cpp15
-rw-r--r--linden/indra/newview/llfloaterpreference.h2
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/fonts.xml14
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/notifications.xml7
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_fonts.xml33
9 files changed, 214 insertions, 1 deletions
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 7dfe3d2..ba715ca 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -76,6 +76,7 @@ set(viewer_SOURCE_FILES
76 hippoGridManager.cpp 76 hippoGridManager.cpp
77 hippoLimits.cpp 77 hippoLimits.cpp
78 hippoRestRequest.cpp 78 hippoRestRequest.cpp
79 impprefsfonts.cpp
79 jcfloater_animation_list.cpp 80 jcfloater_animation_list.cpp
80 jcfloaterareasearch.cpp 81 jcfloaterareasearch.cpp
81 lightshare.cpp 82 lightshare.cpp
@@ -509,6 +510,7 @@ set(viewer_HEADER_FILES
509 hippoGridManager.h 510 hippoGridManager.h
510 hippoLimits.h 511 hippoLimits.h
511 hippoRestRequest.h 512 hippoRestRequest.h
513 impprefsfonts.h
512 jcfloater_animation_list.h 514 jcfloater_animation_list.h
513 jcfloaterareasearch.h 515 jcfloaterareasearch.h
514 lightshare.h 516 lightshare.h
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index f101396..cf5f33f 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -255,6 +255,17 @@
255 <integer>0</integer> 255 <integer>0</integer>
256 </array> 256 </array>
257 </map> 257 </map>
258 <key>FontChoice</key>
259 <map>
260 <key>Comment</key>
261 <string>User's font choice (Liberation or DejaVu)</string>
262 <key>Persist</key>
263 <integer>1</integer>
264 <key>Type</key>
265 <string>String</string>
266 <key>Value</key>
267 <string>DejaVu</string>
268 </map>
258 <key>GoAction</key> 269 <key>GoAction</key>
259 <map> 270 <map>
260 <key>Comment</key> 271 <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
39ImpPrefsFonts::ImpPrefsFonts()
40{
41 LLUICtrlFactory::getInstance()->
42 buildPanel(this, "panel_preferences_fonts.xml");
43}
44
45ImpPrefsFonts::~ImpPrefsFonts()
46{
47}
48
49
50BOOL ImpPrefsFonts::postBuild()
51{
52 refresh();
53 return true;
54}
55
56
57void ImpPrefsFonts::refresh()
58{
59 LLRadioGroup* fonts = getChild<LLRadioGroup>("fonts");
60 if (fonts)
61 {
62 fonts->setValue( gSavedSettings.getString("FontChoice") );
63 }
64}
65
66void 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
84void 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
33class ImpPrefsFonts : public LLPanel
34{
35public:
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;
56class LLPanelMsgs; 56class LLPanelMsgs;
57class LLPanelSkins; 57class LLPanelSkins;
58class LLPrefsAdvanced; 58class LLPrefsAdvanced;
59class ImpPrefsFonts;
59class LLScrollListCtrl; 60class LLScrollListCtrl;
60 61
61class LLPreferenceCore 62class 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 a490af1..58d5f19 100644
--- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml
@@ -7052,6 +7052,13 @@ Apply this region's settings? (&quot;Ignore&quot; will ignore all region setting
7052 </form> 7052 </form>
7053</notification> 7053</notification>
7054 7054
7055<notification
7056 name="ChangeFont"
7057 icon="alertmodal.tga"
7058 type="alertmodal">
7059The new font will appear after you restart [VIEWER_NAME].
7060</notification>
7061
7055 7062
7056<!--End Imprudence notifications--> 7063<!--End Imprudence notifications-->
7057 7064
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>