From d44056f6d5430e4c8d139ae49783a554c4eee982 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 18 Feb 2012 01:03:43 -0700 Subject: Removed google translate since the service is no longer available --- linden/indra/newview/app_settings/settings.xml | 11 --- linden/indra/newview/llfloaterchat.cpp | 22 ------ linden/indra/newview/llfloaterchat.h | 2 - linden/indra/newview/llprefschat.cpp | 4 -- linden/indra/newview/llviewercontrol.cpp | 14 ---- linden/indra/newview/llviewermessage.cpp | 71 +------------------ linden/indra/newview/llviewermessage.h | 1 - linden/indra/newview/llwldaycycle.cpp | 6 +- .../default/xui/en-us/floater_chat_history.xml | 3 - .../default/xui/en-us/panel_preferences_chat.xml | 82 +--------------------- 10 files changed, 7 insertions(+), 209 deletions(-) diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 439459c..2ec4832 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -7901,17 +7901,6 @@ Value default - TranslateChat - - Comment - Translate incoming chat messages - Persist - 1 - Type - Boolean - Value - 0 - LastFeatureVersion Comment diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index 1142e5c..2cca8ce 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp @@ -115,8 +115,6 @@ LLFloaterChat::LLFloaterChat(const LLSD& seed) LLUICtrlFactory::getInstance()->buildFloater(this,"floater_chat_history.xml",&getFactoryMap(),no_open); childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes - childSetCommitCallback("translate chat",onClickToggleTranslateChat,this); - childSetValue("translate chat", gSavedSettings.getBOOL("TranslateChat")); childSetVisible("Chat History Editor with mute",FALSE); childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this); setDefaultBtn("Chat"); @@ -446,26 +444,6 @@ void LLFloaterChat::onClickToggleShowMute(LLUICtrl* caller, void *data) } } -// Update the "TranslateChat" pref after "translate chat" checkbox is toggled in -// the "Local Chat" floater. -//static -void LLFloaterChat::onClickToggleTranslateChat(LLUICtrl* caller, void *data) -{ - LLFloaterChat* floater = (LLFloaterChat*)data; - - BOOL translate_chat = floater->getChild("translate chat")->get(); - gSavedSettings.setBOOL("TranslateChat", translate_chat); -} - -// Update the "translate chat" checkbox after the "TranslateChat" pref is set in -// some other place (e.g. prefs dialog). -//static -void LLFloaterChat::updateSettings() -{ - BOOL translate_chat = gSavedSettings.getBOOL("TranslateChat"); - LLFloaterChat::getInstance(LLSD())->getChild("translate chat")->set(translate_chat); -} - BOOL checkStringInText(const std::string &text_line, std::string textToMatch) { boost::smatch what; diff --git a/linden/indra/newview/llfloaterchat.h b/linden/indra/newview/llfloaterchat.h index f8683b9..14c2242 100644 --- a/linden/indra/newview/llfloaterchat.h +++ b/linden/indra/newview/llfloaterchat.h @@ -66,7 +66,6 @@ public: virtual void onVisibilityChange(BOOL cur_visibility); virtual void setMinimized(BOOL); void updateConsoleVisibility(); - void updateSettings(); static void setHistoryCursorAndScrollToEnd(); @@ -82,7 +81,6 @@ public: static void onClickMute(void *data); static void onClickToggleShowMute(LLUICtrl* caller, void *data); - static void onClickToggleTranslateChat(LLUICtrl* caller, void *data); static void onClickToggleActiveSpeakers(void* userdata); static void chatFromLogFile(LLLogChat::ELogLineType type,std::string line, void* userdata); static void loadHistory(); diff --git a/linden/indra/newview/llprefschat.cpp b/linden/indra/newview/llprefschat.cpp index 1cdab46..dd4df42 100644 --- a/linden/indra/newview/llprefschat.cpp +++ b/linden/indra/newview/llprefschat.cpp @@ -111,8 +111,6 @@ BOOL LLPrefsChatImpl::postBuild() childSetValue("toggle_channel_control", gSavedSettings.getBOOL("ChatChannelSelect")); childSetValue("console_opacity", gSavedSettings.getF32("ConsoleBackgroundOpacity")); childSetValue("bubble_chat_opacity", gSavedSettings.getF32("ChatBubbleOpacity")); - childSetValue("translate_language_combobox", gSavedSettings.getString("TranslateLanguage")); - childSetValue("translate_chat", gSavedSettings.getBOOL("TranslateChat")); mChatChannel = gSavedSettings.getBOOL("ChatChannelSelect"); @@ -205,8 +203,6 @@ void LLPrefsChatImpl::apply() gSavedSettings.setF32("ConsoleBackgroundOpacity", childGetValue("console_opacity").asReal()); gSavedSettings.setF32("ChatBubbleOpacity", childGetValue("bubble_chat_opacity").asReal()); - gSavedSettings.setString("TranslateLanguage", childGetValue("translate_language_combobox")); - gSavedSettings.setBOOL("TranslateChat", childGetValue("translate_chat")); bool chan_check = childGetValue("toggle_channel_control"); gSavedSettings.setBOOL("ChatChannelSelect", chan_check); diff --git a/linden/indra/newview/llviewercontrol.cpp b/linden/indra/newview/llviewercontrol.cpp index 59d766f..016646e 100644 --- a/linden/indra/newview/llviewercontrol.cpp +++ b/linden/indra/newview/llviewercontrol.cpp @@ -511,19 +511,6 @@ bool handleVoiceClientPrefsChanged(const LLSD& newvalue) return true; } -bool handleTranslateChatPrefsChanged(const LLSD& newvalue) -{ - LLFloaterChat* floaterp = LLFloaterChat::getInstance(); - - if(floaterp) - { - // update "translate chat" pref in "Local Chat" floater - floaterp->updateSettings(); - } - return true; -} - - bool handleSliderScrollWheelMultiplierChanged(const LLSD& newvalue) { LLSlider::setScrollWheelMultiplier( newvalue.asInteger() ); @@ -675,7 +662,6 @@ void settings_setup_listeners() gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); gSavedSettings.getControl("SliderScrollWheelMultiplier")->getSignal()->connect(boost::bind(&handleSliderScrollWheelMultiplierChanged, _1)); - gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1)); } template <> eControlType get_control_type(const U32& in, LLSD& out) diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index cbcfb86..f0c7c0c 100755 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -139,7 +139,6 @@ #include "llfloaterworldmap.h" #include "llviewerdisplay.h" #include "llkeythrottle.h" -#include "lltranslate.h" #include "panelradarentry.h" @@ -2805,52 +2804,6 @@ void process_decline_callingcard(LLMessageSystem* msg, void**) LLNotifications::instance().add("CallingCardDeclined"); } -class ChatTranslationReceiver : public LLTranslate::TranslationReceiver -{ -public : - ChatTranslationReceiver(const std::string &fromLang, const std::string &toLang, const LLChat &chat, - const std::string &orig_mesg, const BOOL history) - : LLTranslate::TranslationReceiver(fromLang, toLang), - m_chat(chat), - m_origMesg(orig_mesg), - m_history(history) - { - } - - static boost::intrusive_ptr build(const std::string &fromLang, const std::string &toLang, const LLChat &chat, const std::string &orig_mesg, const BOOL history) - { - return boost::intrusive_ptr(new ChatTranslationReceiver(fromLang, toLang, chat, orig_mesg, history)); - } - -protected: - void handleResponse(const std::string &translation, const std::string &detected_language) - { - // filter out non-interesting responeses - if ( !translation.empty() - && (m_toLang != detected_language) - && (LLStringUtil::compareInsensitive(translation, m_origMesg) != 0) ) - { - m_chat.mText += " (" + translation + ")"; - } - - add_floater_chat(m_chat, m_history); - } - - void handleFailure() - { - LLTranslate::TranslationReceiver::handleFailure(); - - m_chat.mText += " (?)"; - - add_floater_chat(m_chat, m_history); - } - -private: - LLChat m_chat; - std::string m_origMesg; - const BOOL m_history; -}; - void add_floater_chat(const LLChat &chat, const BOOL history) { if (history) @@ -2865,26 +2818,6 @@ void add_floater_chat(const LLChat &chat, const BOOL history) } } -void check_translate_chat(const std::string &mesg, const LLChat &chat, const BOOL history) -{ - const bool translate = gSavedSettings.getBOOL("TranslateChat"); - - if (translate && chat.mSourceType != CHAT_SOURCE_SYSTEM) - { - // fromLang hardcoded to "" (autodetection) pending implementation of - // SVC-4879 - const std::string &fromLang = ""; - const std::string &toLang = LLTranslate::getTranslateLanguage(); - - LLHTTPClient::ResponderPtr result = ChatTranslationReceiver::build(fromLang, toLang, chat, mesg, history); - LLTranslate::translateMessage(result, fromLang, toLang, mesg); - } - else - { - add_floater_chat(chat, history); - } -} - void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) { LLChat chat; @@ -3304,12 +3237,12 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) && (is_linden || !is_busy || is_owned_by_me)) { // show on screen and add to history - check_translate_chat(mesg, chat, FALSE); + add_floater_chat(chat, FALSE); } else { // just add to chat history - check_translate_chat(mesg, chat, TRUE); + add_floater_chat(chat, TRUE); } } } diff --git a/linden/indra/newview/llviewermessage.h b/linden/indra/newview/llviewermessage.h index 11a3554..0201ce4 100644 --- a/linden/indra/newview/llviewermessage.h +++ b/linden/indra/newview/llviewermessage.h @@ -76,7 +76,6 @@ void process_script_question(LLMessageSystem *msg, void **user_data); void process_chat_from_simulator(LLMessageSystem *mesgsys, void **user_data); void add_floater_chat(const LLChat &chat, const BOOL history); -void check_translate_chat(const std::string &mesg, const LLChat &chat, const BOOL history); //void process_agent_to_new_region(LLMessageSystem *mesgsys, void **user_data); void send_agent_update(BOOL force_send, BOOL send_reliable = FALSE); diff --git a/linden/indra/newview/llwldaycycle.cpp b/linden/indra/newview/llwldaycycle.cpp index 1d17c60..07ac2a4 100644 --- a/linden/indra/newview/llwldaycycle.cpp +++ b/linden/indra/newview/llwldaycycle.cpp @@ -51,9 +51,6 @@ LLWLDayCycle::~LLWLDayCycle() void LLWLDayCycle::loadDayCycle(const std::string & fileName) { - // clear the first few things - mTimeMap.clear(); - // now load the file std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/days", fileName)); @@ -62,6 +59,9 @@ void LLWLDayCycle::loadDayCycle(const std::string & fileName) llifstream day_cycle_xml(pathName); if (day_cycle_xml.is_open()) { + // clear the first few things + mTimeMap.clear(); + // load and parse it LLSD day_data(LLSD::emptyArray()); LLPointer parser = new LLSDXMLParser(); diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_chat_history.xml b/linden/indra/newview/skins/default/xui/en-us/floater_chat_history.xml index e83a930..b0e70b7 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_chat_history.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_chat_history.xml @@ -78,9 +78,6 @@ -