From 4a3763d8d14d4a737c3d470b8329fb047d4b37f5 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 21 Apr 2014 18:31:41 -0400 Subject: [PATCH] Feature Request/Bug Fix: On login, open Local Chat, Communicate, and Contacts if they were open last session. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llfloaterchat.cpp | 12 +++++------- indra/newview/llfloaterchat.h | 2 +- indra/newview/llfloaterchatterbox.cpp | 8 ++++++++ indra/newview/llfloaterchatterbox.h | 3 ++- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8fd80896c..facc9fa13 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14606,6 +14606,17 @@ This should be as low as possible, but too low may break functionality Value 0 + ShowContacts + + Comment + + Persist + 0 + Type + Boolean + Value + 0 + ShowConsoleWindow Comment diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index eaa563278..348b9235a 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -102,13 +102,6 @@ LLFloaterChat::~LLFloaterChat() // Children all cleaned up by default view destructor. } -void LLFloaterChat::setVisible(BOOL visible) -{ - LLFloater::setVisible( visible ); - - gSavedSettings.setBOOL("ShowChatHistory", visible); -} - void LLFloaterChat::draw() { // enable say and shout only when text available @@ -140,6 +133,11 @@ BOOL LLFloaterChat::postBuild() return TRUE; } +void LLFloaterChat::onOpen() +{ + gSavedSettings.setBOOL("ShowChatHistory", true); +} + // public virtual void LLFloaterChat::onClose(bool app_quitting) { diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h index 7eaab1b16..dcad5f632 100644 --- a/indra/newview/llfloaterchat.h +++ b/indra/newview/llfloaterchat.h @@ -59,9 +59,9 @@ public: LLFloaterChat(const LLSD& seed); ~LLFloaterChat(); - virtual void setVisible( BOOL b ); virtual void draw(); virtual BOOL postBuild(); + virtual void onOpen(); virtual void onClose(bool app_quitting); virtual void onFocusReceived(); virtual void handleVisibilityChange(BOOL cur_visibility); diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp index c491f07fe..ce047c2cb 100644 --- a/indra/newview/llfloaterchatterbox.cpp +++ b/indra/newview/llfloaterchatterbox.cpp @@ -78,9 +78,14 @@ BOOL LLFloaterMyFriends::postBuild() return TRUE; } +void LLFloaterMyFriends::onOpen() +{ + gSavedSettings.setBOOL("ShowContacts", true); +} void LLFloaterMyFriends::onClose(bool app_quitting) { + if (!app_quitting) gSavedSettings.setBOOL("ShowContacts", false); setVisible(FALSE); } @@ -113,6 +118,7 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox_wolf.xml", NULL, FALSE); } + if (gSavedSettings.getBOOL("ShowCommunicate")) open(); if (gSavedSettings.getBOOL("ContactsTornOff")) { @@ -122,6 +128,7 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : removeFloater(floater_contacts); // reparent to floater view gFloaterView->addChild(floater_contacts); + if (gSavedSettings.getBOOL("ShowContacts")) floater_contacts->open(); } else { @@ -136,6 +143,7 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : removeFloater(floater_chat); // reparent to floater view gFloaterView->addChild(floater_chat); + if (gSavedSettings.getBOOL("ShowChatHistory")) floater_chat->open(); } else { diff --git a/indra/newview/llfloaterchatterbox.h b/indra/newview/llfloaterchatterbox.h index d3b45576a..70f6314fe 100644 --- a/indra/newview/llfloaterchatterbox.h +++ b/indra/newview/llfloaterchatterbox.h @@ -126,7 +126,8 @@ public: virtual BOOL postBuild(); - void onClose(bool app_quitting); + virtual void onOpen(); + virtual void onClose(bool app_quitting); static void* createFriendsPanel(void* data); static void* createGroupsPanel(void* data);