From 9adb105999b25f239e4fc92daa249cc9a686790f Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 26 Mar 2013 15:02:34 +0200 Subject: CHUI-862 FIXED Save collapsed state for nearby chat. --- indra/newview/app_settings/settings_per_account.xml | 11 +++++++++++ indra/newview/llfloaterimsessiontab.cpp | 20 ++++++++++++++++++-- indra/newview/llfloaterimsessiontab.h | 1 + 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index ada374f892..590f41283b 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -292,6 +292,17 @@ Value 1 + NearbyChatIsNotCollapsed + + Comment + Saving expanded/collapsed state of the nearby chat between sessions + Persist + 1 + Type + Boolean + Value + 0 + ShowFavoritesOnLogin Comment diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index d15c73a4a3..64c1f50074 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -132,6 +132,12 @@ void LLFloaterIMSessionTab::setVisible(BOOL visible) LLFloaterReg::getTypedInstance("im_container")->setVisible(true); } LLFloaterIMSessionTab::addToHost(mSessionID); + LLFloaterIMSessionTab* conversp = LLFloaterIMSessionTab::getConversation(mSessionID); + + if (conversp && conversp->isNearbyChat() && gSavedPerAccountSettings.getBOOL("NearbyChatIsNotCollapsed")) + { + onCollapseToLine(this); + } mInputButtonPanel->setVisible(isTornOff()); } @@ -356,7 +362,7 @@ void LLFloaterIMSessionTab::draw() // Restart the refresh timer mRefreshTimer->setTimerExpirySec(REFRESH_INTERVAL); } - + LLTransientDockableFloater::draw(); } @@ -866,7 +872,7 @@ void LLFloaterIMSessionTab::reshapeFloater(bool collapse) enableResizeCtrls(true, true, true); } - + saveCollapsedState(); setShape(floater_rect, true); mBodyStack->updateLayout(); @@ -876,6 +882,7 @@ void LLFloaterIMSessionTab::restoreFloater() { if(checkIfTornOff() && !isMessagePaneExpanded()) { + if(isMinimized()) { setMinimized(false); @@ -888,6 +895,7 @@ void LLFloaterIMSessionTab::restoreFloater() mBodyStack->updateLayout(); mExpandCollapseLineBtn->setImageOverlay(getString("expandline_icon")); setMessagePaneExpanded(true); + saveCollapsedState(); enableResizeCtrls(true, true, true); } } @@ -1063,6 +1071,14 @@ LLConversationItem* LLFloaterIMSessionTab::getCurSelectedViewModelItem() return conversationItem; } +void LLFloaterIMSessionTab::saveCollapsedState() +{ + LLFloaterIMSessionTab* conversp = LLFloaterIMSessionTab::getConversation(mSessionID); + if(conversp->isNearbyChat()) + { + gSavedPerAccountSettings.setBOOL("NearbyChatIsNotCollapsed", isMessagePaneExpanded()); + } +} BOOL LLFloaterIMSessionTab::handleKeyHere(KEY key, MASK mask ) { if(mask == MASK_ALT) diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h index f0899a3c09..c7e73bd70d 100644 --- a/indra/newview/llfloaterimsessiontab.h +++ b/indra/newview/llfloaterimsessiontab.h @@ -101,6 +101,7 @@ public: bool isMessagePaneExpanded(){return mMessagePaneExpanded;} void setMessagePaneExpanded(bool expanded){mMessagePaneExpanded = expanded;} void restoreFloater(); + void saveCollapsedState(); protected: -- cgit v1.2.3