aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/llui.cpp')
-rw-r--r--linden/indra/llui/llui.cpp31
1 files changed, 13 insertions, 18 deletions
diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp
index 11889be..1fc9244 100644
--- a/linden/indra/llui/llui.cpp
+++ b/linden/indra/llui/llui.cpp
@@ -41,25 +41,19 @@
41#include "audioengine.h" 41#include "audioengine.h"
42#include "v2math.h" 42#include "v2math.h"
43#include "v4color.h" 43#include "v4color.h"
44#include "llgl.h"
45#include "llrender.h" 44#include "llrender.h"
46#include "llrect.h" 45#include "llrect.h"
47#include "llimagegl.h" 46#include "llimagegl.h"
48//#include "llviewerimage.h"
49#include "lldir.h" 47#include "lldir.h"
50#include "llfontgl.h" 48#include "llfontgl.h"
51 49
52// Project includes 50// Project includes
53//#include "audioengine.h"
54#include "llcontrol.h" 51#include "llcontrol.h"
55//#include "llstartup.h"
56#include "llui.h" 52#include "llui.h"
57#include "llview.h" 53#include "llview.h"
58#include "lllineeditor.h" 54#include "lllineeditor.h"
59#include "llwindow.h" 55#include "llwindow.h"
60 56
61#include "llglheaders.h"
62
63// 57//
64// Globals 58// Globals
65// 59//
@@ -69,8 +63,8 @@ const LLColor4 UI_VERTEX_COLOR(1.f, 1.f, 1.f, 1.f);
69BOOL gShowTextEditCursor = TRUE; 63BOOL gShowTextEditCursor = TRUE;
70 64
71// Language for UI construction 65// Language for UI construction
72std::map<LLString, LLString> gTranslation; 66std::map<std::string, std::string> gTranslation;
73std::list<LLString> gUntranslated; 67std::list<std::string> gUntranslated;
74 68
75LLControlGroup* LLUI::sConfigGroup = NULL; 69LLControlGroup* LLUI::sConfigGroup = NULL;
76LLControlGroup* LLUI::sColorsGroup = NULL; 70LLControlGroup* LLUI::sColorsGroup = NULL;
@@ -86,8 +80,9 @@ BOOL LLUI::sQAMode = FALSE;
86// 80//
87// Functions 81// Functions
88// 82//
89void make_ui_sound(const LLString& name) 83void make_ui_sound(const char* namep)
90{ 84{
85 std::string name = ll_safe_string(namep);
91 if (!LLUI::sConfigGroup->controlExists(name)) 86 if (!LLUI::sConfigGroup->controlExists(name))
92 { 87 {
93 llwarns << "tried to make ui sound for unknown sound name: " << name << llendl; 88 llwarns << "tried to make ui sound for unknown sound name: " << name << llendl;
@@ -1563,7 +1558,7 @@ void LLUI::initClass(LLControlGroup* config,
1563 LLImageProviderInterface* image_provider, 1558 LLImageProviderInterface* image_provider,
1564 LLUIAudioCallback audio_callback, 1559 LLUIAudioCallback audio_callback,
1565 const LLVector2* scale_factor, 1560 const LLVector2* scale_factor,
1566 const LLString& language) 1561 const std::string& language)
1567{ 1562{
1568 sConfigGroup = config; 1563 sConfigGroup = config;
1569 sColorsGroup = colors; 1564 sColorsGroup = colors;
@@ -1653,10 +1648,10 @@ void LLUI::setCursorPositionLocal(const LLView* viewp, S32 x, S32 y)
1653} 1648}
1654 1649
1655//static 1650//static
1656LLString LLUI::locateSkin(const LLString& filename) 1651std::string LLUI::locateSkin(const std::string& filename)
1657{ 1652{
1658 LLString slash = gDirUtilp->getDirDelimiter(); 1653 std::string slash = gDirUtilp->getDirDelimiter();
1659 LLString found_file = filename; 1654 std::string found_file = filename;
1660 if (!gDirUtilp->fileExists(found_file)) 1655 if (!gDirUtilp->fileExists(found_file))
1661 { 1656 {
1662 found_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); // Should be CUSTOM_SKINS? 1657 found_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); // Should be CUSTOM_SKINS?
@@ -1665,18 +1660,18 @@ LLString LLUI::locateSkin(const LLString& filename)
1665 { 1660 {
1666 if (!gDirUtilp->fileExists(found_file)) 1661 if (!gDirUtilp->fileExists(found_file))
1667 { 1662 {
1668 LLString localization(sConfigGroup->getString("Language")); 1663 std::string localization(sConfigGroup->getString("Language"));
1669 if(localization == "default") 1664 if(localization == "default")
1670 { 1665 {
1671 localization = sConfigGroup->getString("SystemLanguage"); 1666 localization = sConfigGroup->getString("SystemLanguage");
1672 } 1667 }
1673 LLString local_skin = "xui" + slash + localization + slash + filename; 1668 std::string local_skin = "xui" + slash + localization + slash + filename;
1674 found_file = gDirUtilp->findSkinnedFilename(local_skin); 1669 found_file = gDirUtilp->findSkinnedFilename(local_skin);
1675 } 1670 }
1676 } 1671 }
1677 if (!gDirUtilp->fileExists(found_file)) 1672 if (!gDirUtilp->fileExists(found_file))
1678 { 1673 {
1679 LLString local_skin = "xui" + slash + "en-us" + slash + filename; 1674 std::string local_skin = "xui" + slash + "en-us" + slash + filename;
1680 found_file = gDirUtilp->findSkinnedFilename(local_skin); 1675 found_file = gDirUtilp->findSkinnedFilename(local_skin);
1681 } 1676 }
1682 if (!gDirUtilp->fileExists(found_file)) 1677 if (!gDirUtilp->fileExists(found_file))
@@ -1724,7 +1719,7 @@ void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen)
1724} 1719}
1725 1720
1726//static 1721//static
1727LLUIImage* LLUI::getUIImage(const LLString& name) 1722LLUIImage* LLUI::getUIImage(const std::string& name)
1728{ 1723{
1729 if (!name.empty()) 1724 if (!name.empty())
1730 return sImageProvider->getUIImage(name); 1725 return sImageProvider->getUIImage(name);
@@ -1812,7 +1807,7 @@ LLLocalClipRect::LLLocalClipRect(const LLRect &rect, BOOL enabled)
1812// LLUIImage 1807// LLUIImage
1813// 1808//
1814 1809
1815LLUIImage::LLUIImage(const LLString& name, LLPointer<LLImageGL> image) : 1810LLUIImage::LLUIImage(const std::string& name, LLPointer<LLImageGL> image) :
1816 mName(name), 1811 mName(name),
1817 mImage(image), 1812 mImage(image),
1818 mScaleRegion(0.f, 1.f, 1.f, 0.f), 1813 mScaleRegion(0.f, 1.f, 1.f, 0.f),