From e44677ee79a38741d641fae74ba661b7e6b59794 Mon Sep 17 00:00:00 2001 From: maximbproductengine Date: Mon, 14 Jan 2013 21:48:37 +0200 Subject: CHUI-662 (Multi select across conversations can result in (???) (???) in the conversation list) --- indra/newview/llfloaterimcontainer.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index a17b89af0d..f825e253d4 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -893,7 +893,18 @@ void LLFloaterIMContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids) for (; it != it_end; ++it) { conversationItem = static_cast((*it)->getViewModelItem()); - selected_uuids.push_back(conversationItem->getUUID()); + + //When a one-on-one conversation exists, retrieve the participant id from the conversation floater + if(conversationItem->getType() == LLConversationItem::CONV_SESSION_1_ON_1) + { + LLFloaterIMSession * conversation_floaterp = LLFloaterIMSession::findInstance(conversationItem->getUUID()); + LLUUID participant_id = conversation_floaterp->getOtherParticipantUUID(); + selected_uuids.push_back(participant_id); + } + else + { + selected_uuids.push_back(conversationItem->getUUID()); + } } } @@ -929,17 +940,7 @@ void LLFloaterIMContainer::getParticipantUUIDs(uuid_vec_t& selected_uuids) return; } - if (conversation_item->getType() == LLConversationItem::CONV_PARTICIPANT) - { - getSelectedUUIDs(selected_uuids); - } - //When a one-on-one conversation exists, retrieve the participant id from the conversation floater - else if(conversation_item->getType() == LLConversationItem::CONV_SESSION_1_ON_1) - { - LLFloaterIMSession * conversation_floaterp = LLFloaterIMSession::findInstance(conversation_item->getUUID()); - LLUUID participant_id = conversation_floaterp->getOtherParticipantUUID(); - selected_uuids.push_back(participant_id); - } + getSelectedUUIDs(selected_uuids); } void LLFloaterIMContainer::doToParticipants(const std::string& command, uuid_vec_t& selectedIDS) -- cgit v1.2.3 From cefcdd445b6bad0e2382d848cd73b20a1a51cc01 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 14 Jan 2013 15:26:59 -0800 Subject: CHUI-458 : WIP : Allow change of the general conversations panel when the selected conversation needs it (e.g. P2P is typing) --- indra/newview/llfloaterimcontainer.cpp | 6 ++++++ indra/newview/llfloaterimcontainer.h | 1 + indra/newview/llfloaterimsession.cpp | 2 +- indra/newview/llfloaterimsession.h | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index f825e253d4..cf81a2b046 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -238,6 +238,9 @@ BOOL LLFloaterIMContainer::postBuild() // Init the sort order now that the root had been created setSortOrder(LLConversationSort(gSavedSettings.getU32("ConversationSortOrder"))); + // Keep the xml set title around for when we have to overwrite it + mGeneralTitle = getTitle(); + mInitialized = true; // Add callbacks: @@ -515,6 +518,9 @@ void LLFloaterIMContainer::draw() current_participant_model++; } + // is P2P? Test if we can change the title + LLFloaterIMSession * conversation_floaterp = LLFloaterIMSession::findInstance(current_session->getUUID()); + setTitle(conversation_floaterp && conversation_floaterp->hasSpecialTitle() ? conversation_floaterp->getSpecialTitle() : mGeneralTitle); } LLFloater::draw(); diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 85d950c58b..06af6c7b51 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -169,6 +169,7 @@ private: bool mInitialized; LLUUID mSelectedSession; + std::string mGeneralTitle; // Conversation list implementation public: diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index d36b138c21..931ee0dc66 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -705,7 +705,7 @@ BOOL LLFloaterIMSession::getVisible() // getVisible() returns TRUE when Tabbed IM window is minimized. visible = is_active && !im_container->isMinimized() && im_container->getVisible(); - } + } } else { diff --git a/indra/newview/llfloaterimsession.h b/indra/newview/llfloaterimsession.h index 6a2f4b29eb..7239481e56 100644 --- a/indra/newview/llfloaterimsession.h +++ b/indra/newview/llfloaterimsession.h @@ -132,6 +132,8 @@ public: static boost::signals2::connection setIMFloaterShowedCallback(const floater_showed_signal_t::slot_type& cb); static floater_showed_signal_t sIMFloaterShowedSignal; + bool hasSpecialTitle() { return mOtherTyping; } + std::string getSpecialTitle() { return getTitle(); } private: /*virtual*/ void refresh(); -- cgit v1.2.3 From a49d3b14254fa5cfac3900e86b2287a016eaf9cc Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Tue, 15 Jan 2013 14:07:55 +0200 Subject: CHUI-567 FIXED "Translate chat", "Translation settings..." menu items are added. --- indra/newview/app_settings/settings_per_account.xml | 13 ++++++++++++- indra/newview/llfloaterimsessiontab.cpp | 20 ++++++++++++++++++++ indra/newview/llfloaterimsessiontab.h | 4 ++++ indra/newview/llfloatertranslationsettings.cpp | 18 +++++++++++++----- indra/newview/llfloatertranslationsettings.h | 1 + .../default/xui/en/menu_im_session_showmodes.xml | 20 ++++++++++++++++++-- 6 files changed, 68 insertions(+), 8 deletions(-) diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 4ff494fbfb..6864328339 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -270,7 +270,18 @@ Value 0 - ShowFavoritesOnLogin + TranslatingEnabled + + Comment + Translation prefs are set + Persist + 1 + Type + Boolean + Value + 0 + + ShowFavoritesOnLogin Comment Determines whether favorites of last logged in user will be saved on exit from viewer and shown on login screen diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index d4eb03f95d..06a79836db 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -72,6 +72,12 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) boost::bind(&LLFloaterIMSessionTab::onIMShowModesMenuItemCheck, this, _2)); mEnableCallbackRegistrar.add("IMSession.Menu.ShowModes.Enable", boost::bind(&LLFloaterIMSessionTab::onIMShowModesMenuItemEnable, this, _2)); + mEnableCallbackRegistrar.add("Translating.Enabled", + boost::bind(&LLFloaterIMSessionTab::isTranslatingEnabled, this, _2)); + mEnableCallbackRegistrar.add("Translating.On", + boost::bind(&LLFloaterIMSessionTab::isTranslationOn, this, _2)); + mCommitCallbackRegistrar.add("Translating.Toggle", + boost::bind(&LLFloaterIMSessionTab::toggleTranslation, this, _2)); // Right click menu handling mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLFloaterIMSessionTab::checkContextMenuItem, this, _2)); @@ -552,6 +558,10 @@ void LLFloaterIMSessionTab::onIMSessionMenuItemClicked(const LLSD& userdata) LLFloaterIMSessionTab::processChatHistoryStyleUpdate(); } +void LLFloaterIMSessionTab::toggleTranslation(const LLSD& userdata) +{ + gSavedSettings.setBOOL("TranslateChat", !gSavedSettings.getBOOL("TranslateChat")); +} bool LLFloaterIMSessionTab::onIMCompactExpandedMenuItemCheck(const LLSD& userdata) { @@ -576,6 +586,16 @@ bool LLFloaterIMSessionTab::onIMShowModesMenuItemEnable(const LLSD& userdata) return (plain_text && (is_not_names || mIsP2PChat)); } +bool LLFloaterIMSessionTab::isTranslatingEnabled(const LLSD& userdata) +{ + return gSavedPerAccountSettings.getBOOL("TranslatingEnabled"); +} + +bool LLFloaterIMSessionTab::isTranslationOn(const LLSD& userdata) +{ + return gSavedSettings.getBOOL("TranslateChat"); +} + void LLFloaterIMSessionTab::hideOrShowTitle() { const LLFloater::Params& default_params = LLFloater::getDefaultParams(); diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h index 0fa99a46be..05da0f98bc 100644 --- a/indra/newview/llfloaterimsessiontab.h +++ b/indra/newview/llfloaterimsessiontab.h @@ -109,8 +109,12 @@ protected: // bool onIMShowModesMenuItemCheck(const LLSD& userdata); bool onIMShowModesMenuItemEnable(const LLSD& userdata); + bool isTranslatingEnabled(const LLSD& userdata); + bool isTranslationOn(const LLSD& userdata); static void onSlide(LLFloaterIMSessionTab *self); + void toggleTranslation(const LLSD& userdata); + // refresh a visual state of the Call button void updateCallBtnState(bool callIsActive); diff --git a/indra/newview/llfloatertranslationsettings.cpp b/indra/newview/llfloatertranslationsettings.cpp index 6a9236ce0c..33f2c35239 100644 --- a/indra/newview/llfloatertranslationsettings.cpp +++ b/indra/newview/llfloatertranslationsettings.cpp @@ -225,11 +225,10 @@ void LLFloaterTranslationSettings::updateControlsEnabledState() mGoogleVerifyBtn->setEnabled(on && google_selected && !mGoogleKeyVerified && !getEnteredGoogleKey().empty()); - mOKBtn->setEnabled( - !on || ( - (bing_selected && mBingKeyVerified) || - (google_selected && mGoogleKeyVerified) - )); + bool service_verified = (bing_selected && mBingKeyVerified) || (google_selected && mGoogleKeyVerified); + gSavedPerAccountSettings.setBOOL("TranslatingEnabled", service_verified); + + mOKBtn->setEnabled(!on || service_verified); } void LLFloaterTranslationSettings::verifyKey(int service, const std::string& key, bool alert) @@ -285,7 +284,16 @@ void LLFloaterTranslationSettings::onBtnGoogleVerify() verifyKey(LLTranslate::SERVICE_GOOGLE, key); } } +void LLFloaterTranslationSettings::onClose(bool app_quitting) +{ + std::string service = gSavedSettings.getString("TranslationService"); + bool bing_selected = service == "bing"; + bool google_selected = service == "google"; + + bool service_verified = (bing_selected && mBingKeyVerified) || (google_selected && mGoogleKeyVerified); + gSavedPerAccountSettings.setBOOL("TranslatingEnabled", service_verified); +} void LLFloaterTranslationSettings::onBtnOK() { gSavedSettings.setBOOL("TranslateChat", mMachineTranslationCB->getValue().asBoolean()); diff --git a/indra/newview/llfloatertranslationsettings.h b/indra/newview/llfloatertranslationsettings.h index 9b47ad72ed..b9bfd6265a 100644 --- a/indra/newview/llfloatertranslationsettings.h +++ b/indra/newview/llfloatertranslationsettings.h @@ -44,6 +44,7 @@ public: void setBingVerified(bool ok, bool alert); void setGoogleVerified(bool ok, bool alert); + void onClose(bool app_quitting); private: std::string getSelectedService() const; diff --git a/indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml b/indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml index 483f24afd0..f2a8b39b04 100644 --- a/indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml +++ b/indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml @@ -44,7 +44,23 @@ parameter="IMShowNamesForP2PConv" /> - + parameter="IMShowNamesForP2PConv" /> + + + + + + + + + + -- cgit v1.2.3 From 235a3477364c6747d7724a090ca61adbcbeac272 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 15 Jan 2013 14:13:36 -0800 Subject: CHUI-458 : Fixed : Tidy up the title overwrite by the selected conversation --- indra/newview/llfloaterimcontainer.cpp | 6 +++--- indra/newview/llfloaterimsession.cpp | 2 ++ indra/newview/llfloaterimsession.h | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index cf81a2b046..8264a90325 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -505,10 +505,10 @@ void LLFloaterIMContainer::draw() collapseMessagesPane(true); } - //Update moderator options visibility const LLConversationItem *current_session = getCurSelectedViewModelItem(); if (current_session) { + // Update moderator options visibility LLFolderViewModelItemCommon::child_list_t::const_iterator current_participant_model = current_session->getChildrenBegin(); LLFolderViewModelItemCommon::child_list_t::const_iterator end_participant_model = current_session->getChildrenEnd(); while (current_participant_model != end_participant_model) @@ -518,9 +518,9 @@ void LLFloaterIMContainer::draw() current_participant_model++; } - // is P2P? Test if we can change the title + // Update floater's title as required by the currently selected session or use the default title LLFloaterIMSession * conversation_floaterp = LLFloaterIMSession::findInstance(current_session->getUUID()); - setTitle(conversation_floaterp && conversation_floaterp->hasSpecialTitle() ? conversation_floaterp->getSpecialTitle() : mGeneralTitle); + setTitle(conversation_floaterp && conversation_floaterp->needsTitleOverwrite() ? conversation_floaterp->getTitle() : mGeneralTitle); } LLFloater::draw(); diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index 931ee0dc66..a09dc1914f 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -70,6 +70,7 @@ LLFloaterIMSession::LLFloaterIMSession(const LLUUID& session_id) mShouldSendTypingState(false), mMeTyping(false), mOtherTyping(false), + mSessionNameUpdatedForTyping(false), mTypingTimer(), mTypingTimeoutTimer(), mPositioned(false), @@ -556,6 +557,7 @@ void LLFloaterIMSession::updateSessionName(const std::string& name) LLFloaterIMSessionTab::updateSessionName(name); mTypingStart.setArg("[NAME]", name); setTitle (mOtherTyping ? mTypingStart.getString() : name); + mSessionNameUpdatedForTyping = mOtherTyping; } } diff --git a/indra/newview/llfloaterimsession.h b/indra/newview/llfloaterimsession.h index 7239481e56..2049cedfd7 100644 --- a/indra/newview/llfloaterimsession.h +++ b/indra/newview/llfloaterimsession.h @@ -132,8 +132,7 @@ public: static boost::signals2::connection setIMFloaterShowedCallback(const floater_showed_signal_t::slot_type& cb); static floater_showed_signal_t sIMFloaterShowedSignal; - bool hasSpecialTitle() { return mOtherTyping; } - std::string getSpecialTitle() { return getTitle(); } + bool needsTitleOverwrite() { return mSessionNameUpdatedForTyping && mOtherTyping; } private: /*virtual*/ void refresh(); @@ -184,6 +183,7 @@ private: bool mShouldSendTypingState; LLFrameTimer mTypingTimer; LLFrameTimer mTypingTimeoutTimer; + bool mSessionNameUpdatedForTyping; bool mSessionInitialized; LLSD mQueuedMsgsForInit; -- cgit v1.2.3