Commits

Paul ProductEngine committed 0aa6293

EXP-1586 FIXED (Nearby chat window no longer persists between viewer startups)

- Visibility state of chat floater is saved between sessions
- Also visibility state of chat history in nearby chat floater is saved too

  • Participants
  • Parent commits b2c3505

Comments (0)

Files changed (3)

File indra/newview/llnearbychatbar.cpp

 	mOutputMonitor = getChild<LLOutputMonitorCtrl>("chat_zone_indicator");
 	mOutputMonitor->setVisible(FALSE);
 
+	gSavedSettings.declareBOOL("nearbychat_history_visibility", mNearbyChat->getVisible(), "Visibility state of nearby chat history", TRUE);
+
+	// If mVisibilityControl is not empty it means that the visibility state of floater is saved between sessions,
+	// i.e. save_visibility="true" for this floater.
+	// So if we need to restore visibility state of floater we also need to restore visibility state of nearby chat history.
+	if (!mVisibilityControl.empty())
+	{
+		// restore visibility of nearby chat history
+		mNearbyChat->setVisible(gSavedSettings.getBOOL("nearbychat_history_visibility"));
+	}
+
 	// Register for font change notifications
 	LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1));
 
 	return rect_controlled;
 }
 
+void LLNearbyChatBar::saveChatHistoryVisibility()
+{
+	// save visibility state of nearby chat history panel if
+	// visibility of nearby chat floater is saved, i.e. save_visisbility="true"
+	// (if save_visisbility="true", mVisibilityControl == "floater_vis_chat_bar")
+	if (mVisibilityControl.size() > 1)
+	{
+		// save visibility of nearby chat history
+		gSavedSettings.setBOOL("nearbychat_history_visibility", mNearbyChat->getVisible());
+	}
+}
+
 void LLNearbyChatBar::onChatFontChange(LLFontGL* fontp)
 {
 	// Update things with the new font whohoo
 		enableResizeCtrls(true);
 		storeRectControl();
 	}
+
+	saveChatHistoryVisibility();
 }
 
 void LLNearbyChatBar::setMinimized(BOOL b)

File indra/newview/llnearbychatbar.h

 	LLLocalSpeakerMgr*		mSpeakerMgr;
 
 	S32 mExpandedHeight;
+private:
+
+	// Saves visibility of chat history panel
+	// if save_visibility="true"
+	void saveChatHistoryVisibility();
 };
 
 #endif

File indra/newview/skins/default/xui/en/floater_chat_bar.xml

  single_instance="true"
  title="NEARBY CHAT"
  save_rect="true"
+ save_visibility="true"
  can_close="true"
  can_minimize="true"
  help_topic="chat_bar"