From cf38d67b47f15c375574a202da3f2e554296b528 Mon Sep 17 00:00:00 2001 From: Liny Date: Tue, 31 Jan 2012 08:35:56 -0800 Subject: [PATCH] Backed out changeset: 0c99a89542b0 --- indra/newview/llappviewer.cpp | 24 ++++++++++++++++++++++++ indra/newview/llfloatersidetraytab.cpp | 2 +- indra/newview/llsidetray.cpp | 19 ++++++++++++++----- indra/newview/llsidetray.h | 2 +- indra/newview/llsidetraytab.h | 4 ++-- 5 files changed, 42 insertions(+), 9 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a28e5dc1fe..41221f606e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3722,6 +3722,16 @@ void LLAppViewer::requestQuit() { sendLogoutRequest(); } + else if(LLStartUp::getStartupState() == STATE_STARTED) // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off + { + if (gFloaterView) + { + // application is quitting + gFloaterView->closeAllChildren(true); + } + + LLSideTray::getInstance()->notifyChildren(LLSD().with("request","quit")); + } // ~LO // Quit immediately forceQuit(); @@ -4231,6 +4241,13 @@ bool finish_disconnect(const LLSD& notification, const LLSD& response) if (1 == option) { + if (gFloaterView) + { + // application is quitting + gFloaterView->closeAllChildren(true); + } + + LLSideTray::getInstance()->notifyChildren(LLSD().with("request","quit")); LLAppViewer::instance()->forceQuit(); } return false; @@ -4239,6 +4256,13 @@ bool finish_disconnect(const LLSD& notification, const LLSD& response) // Callback from an early disconnect dialog, force an exit bool finish_forced_disconnect(const LLSD& notification, const LLSD& response) { + if (gFloaterView) + { + // application is quitting + gFloaterView->closeAllChildren(true); + } + + LLSideTray::getInstance()->notifyChildren(LLSD().with("request","quit")); LLAppViewer::instance()->forceQuit(); return false; } diff --git a/indra/newview/llfloatersidetraytab.cpp b/indra/newview/llfloatersidetraytab.cpp index 9f15e62d84..d5a5753b4a 100644 --- a/indra/newview/llfloatersidetraytab.cpp +++ b/indra/newview/llfloatersidetraytab.cpp @@ -48,5 +48,5 @@ LLFloaterSideTrayTab::~LLFloaterSideTrayTab() void LLFloaterSideTrayTab::onClose(bool app_quitting) { // The floater is already being closed, so don't toggle it once more (that may crash viewer). - LLSideTray::getInstance()->setTabDocked(getName(), /* dock = */ true, /* toggle_floater = */ false); + LLSideTray::getInstance()->setTabDocked(getName(), /* dock = */ true, /* app_quitting = */ app_quitting, /* toggle_floater = */ false); // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off } diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index a8dbe306fa..682427b372 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -383,7 +383,7 @@ void LLSideTrayTab::minimizeTab() ////} } -void LLSideTrayTab::toggleTabDocked(bool toggle_floater /* = true */) +void LLSideTrayTab::toggleTabDocked(bool app_quitting /* = false */, bool toggle_floater /* = true */) // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off { // *FIX: Calling this method twice per frame would crash the viewer. @@ -418,7 +418,7 @@ void LLSideTrayTab::toggleTabDocked(bool toggle_floater /* = true */) if (docking) { - dock(floater_tab); + dock(app_quitting, floater_tab); // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off } else { @@ -481,7 +481,7 @@ BOOL LLSideTrayTab::handleScrollWheel(S32 x, S32 y, S32 clicks) return TRUE; } -void LLSideTrayTab::dock(LLFloater* floater_tab) +void LLSideTrayTab::dock(bool app_quitting, LLFloater* floater_tab) // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off { LLSideTray* side_tray = getSideTray(); if (!side_tray) return; @@ -503,7 +503,16 @@ void LLSideTrayTab::dock(LLFloater* floater_tab) if (side_tray->getCollapsed()) { - side_tray->expandSideBar(false); + // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off + if(app_quitting) + { + side_tray->expandSideBar(false); + } + else + { + side_tray->collapseSideBar(); + } + // ~LO } } @@ -1614,7 +1623,7 @@ bool LLSideTray::isPanelActive(const std::string& panel_name) return (panel->getName() == panel_name); } -void LLSideTray::setTabDocked(const std::string& tab_name, bool dock, bool toggle_floater /* = true*/) +void LLSideTray::setTabDocked(const std::string& tab_name, bool dock, bool app_quitting, bool toggle_floater /* = true*/) // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off { // Lookup tab by name. LLSideTrayTab* tab = getTab(tab_name); diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 61f4dd608d..d9a6309b78 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -130,7 +130,7 @@ public: std::string getActivePanelName (); bool isPanelActive (const std::string& panel_name); - void setTabDocked(const std::string& tab_name, bool dock, bool toggle_floater = true); + void setTabDocked(const std::string& tab_name, bool dock, bool app_quitting, bool toggle_floater = true); // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off /* * get the panel of given type T (don't show it or do anything else with it) diff --git a/indra/newview/llsidetraytab.h b/indra/newview/llsidetraytab.h index 0a92f75946..d2e03f6f5e 100644 --- a/indra/newview/llsidetraytab.h +++ b/indra/newview/llsidetraytab.h @@ -66,7 +66,7 @@ public: protected: LLSideTrayTab(const Params& params); - void dock(LLFloater* floater_tab); + void dock(bool app_quitting, LLFloater* floater_tab); // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off void undock(LLFloater* floater_tab); LLSideTray* getSideTray(); @@ -87,7 +87,7 @@ public: const std::string& getTabTitle() const { return mTabTitle;} void onOpen (const LLSD& key); - void toggleTabDocked(bool toggle_floater = true); + void toggleTabDocked(bool app_quitting = false, bool toggle_floater = true); // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off void setDocked(bool dock); bool isDocked() const; void minimizeTab();