From 5cae8140f4dfbdd9c4b3237a0d47248753180913 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Wed, 17 Mar 2010 13:25:18 +0200 Subject: fixed EXT-6284 ([HARD CODED] - Menu Einstellungen, Tab Erweitert: "MiddleMouse" needs to be localized) Control value is preserved, it is being localized on presentation Reviewed by Richard at https://codereview.productengine.com/secondlife/r/24/ --HG-- branch : product-engine --- indra/newview/llfloaterpreference.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 8bffe9bf57..e998d10fcc 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -110,6 +110,9 @@ const F32 MAX_USER_FAR_CLIP = 512.f; const F32 MIN_USER_FAR_CLIP = 64.f; +//control value for middle mouse as talk2push button +const static std::string MIDDLE_MOUSE_CV = "MiddleMouse"; + class LLVoiceSetKeyDialog : public LLModalDialog { public: @@ -1008,9 +1011,17 @@ void LLFloaterPreference::setKey(KEY key) void LLFloaterPreference::onClickSetMiddleMouse() { - childSetValue("modifier_combo", "MiddleMouse"); + LLUICtrl* p2t_line_editor = getChild("modifier_combo"); + // update the control right away since we no longer wait for apply - getChild("modifier_combo")->onCommit(); + p2t_line_editor->setControlValue(MIDDLE_MOUSE_CV); + + //push2talk button "middle mouse" control value is in English, need to localize it for presentation + LLPanel* advanced_preferences = dynamic_cast(p2t_line_editor->getParent()); + if (advanced_preferences) + { + p2t_line_editor->setValue(advanced_preferences->getString("middle_mouse")); + } } /* void LLFloaterPreference::onClickSkipDialogs() @@ -1302,6 +1313,16 @@ BOOL LLPanelPreference::postBuild() getChild("voice_call_friends_only_check")->setCommitCallback(boost::bind(&showFriendsOnlyWarning, _1, _2)); } + // Panel Advanced + if (hasChild("modifier_combo")) + { + //localizing if push2talk button is set to middle mouse + if (MIDDLE_MOUSE_CV == childGetValue("modifier_combo").asString()) + { + childSetValue("modifier_combo", getString("middle_mouse")); + } + } + apply(); return true; } -- cgit v1.2.3 From 0c1ff8e8769a569c2551a2be04a18cc854cfc5d4 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Thu, 18 Mar 2010 17:59:14 -0700 Subject: Fix for EXT-6304: Shared media cookies cannot be deleted via Preferences Added static member functions to LLViewerMedia: clearAllCookies(), clearAllCaches(), setCookiesEnabled(), and setProxyConfig(). These iterate through all loaded instances and send appropriate messages. Also added a hack to clearAllCookies() to delete cookie files for all accounts, which should serve until we centralize cookie storage. Made LLViewerMedia set the proxy config properly when creating new instances. Callum is adding code to do something similar with the cookies enabled flag in a separate commit. Removed get_web_media from llfloaterpreference.cpp and reworked everything that used it to use the new LLViewerMedia functions instead. Reviewed by Callum at http://codereview.lindenlab.com/838003. --- indra/newview/llfloaterpreference.cpp | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index e998d10fcc..3487f52f35 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -183,7 +183,6 @@ void LLVoiceSetKeyDialog::onCancel(void* user_data) // a static member and update all our static callbacks void handleNameTagOptionChanged(const LLSD& newvalue); -viewer_media_t get_web_media(); bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response); //bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater); @@ -191,23 +190,14 @@ bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator); -viewer_media_t get_web_media() -{ - viewer_media_t media_source = LLViewerMedia::newMediaImpl(LLUUID::null); - media_source->initializeMedia("text/html"); - return media_source; -} - - bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( option == 0 ) // YES { // clean web - viewer_media_t media_source = get_web_media(); - if (media_source && media_source->hasMedia()) - media_source->getMediaPlugin()->clear_cache(); + LLViewerMedia::clearAllCaches(); + LLViewerMedia::clearAllCookies(); // clean nav bar history LLNavigationBar::getInstance()->clearHistoryCache(); @@ -429,17 +419,14 @@ void LLFloaterPreference::apply() std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); childSetText("cache_location", cache_location); - viewer_media_t media_source = get_web_media(); - if (media_source && media_source->hasMedia()) + LLViewerMedia::setCookiesEnabled(childGetValue("cookies_enabled")); + + if(hasChild("web_proxy_enabled") &&hasChild("web_proxy_editor") && hasChild("web_proxy_port")) { - media_source->getMediaPlugin()->enable_cookies(childGetValue("cookies_enabled")); - if(hasChild("web_proxy_enabled") &&hasChild("web_proxy_editor") && hasChild("web_proxy_port")) - { - bool proxy_enable = childGetValue("web_proxy_enabled"); - std::string proxy_address = childGetValue("web_proxy_editor"); - int proxy_port = childGetValue("web_proxy_port"); - media_source->getMediaPlugin()->proxy_setup(proxy_enable, proxy_address, proxy_port); - } + bool proxy_enable = childGetValue("web_proxy_enabled"); + std::string proxy_address = childGetValue("web_proxy_editor"); + int proxy_port = childGetValue("web_proxy_port"); + LLViewerMedia::setProxyConfig(proxy_enable, proxy_address, proxy_port); } // LLWString busy_response = utf8str_to_wstring(getChild("busy_response")->getValue().asString()); -- cgit v1.2.3