summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatersidepanelcontainer.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-07-18 07:38:36 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-07-18 14:07:01 +0300
commitace506cc8aec370b739b40ab2afa7c1fef4cc030 (patch)
tree0de895a9769f9d4ab735ef3c8d158940a8dea99b /indra/newview/llfloatersidepanelcontainer.cpp
parent87b5ecf565e78ca49b2c90478eb2c26d537e4831 (diff)
viewer#1997 Warn user if closing appearance with unsaved changes
Diffstat (limited to 'indra/newview/llfloatersidepanelcontainer.cpp')
-rw-r--r--indra/newview/llfloatersidepanelcontainer.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp
index 48547852c4..6c5d2570f2 100644
--- a/indra/newview/llfloatersidepanelcontainer.cpp
+++ b/indra/newview/llfloatersidepanelcontainer.cpp
@@ -28,6 +28,7 @@
#include "llfloaterreg.h"
#include "llfloatersidepanelcontainer.h"
+#include "llnotificationsutil.h"
#include "llpaneleditwearable.h"
// newview includes
@@ -90,6 +91,46 @@ void LLFloaterSidePanelContainer::closeFloater(bool app_quitting)
}
}
+void LLFloaterSidePanelContainer::onClickCloseBtn(bool app_quitting)
+{
+ if (!app_quitting)
+ {
+ LLPanelOutfitEdit* panel_outfit_edit =
+ dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::findPanel("appearance", "panel_outfit_edit"));
+ if (panel_outfit_edit)
+ {
+ LLFloater* parent = gFloaterView->getParentFloater(panel_outfit_edit);
+ if (parent == this)
+ {
+ LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance"));
+ if (panel_appearance)
+ {
+ LLPanelEditWearable* edit_wearable_ptr = panel_appearance->getWearable();
+ if (edit_wearable_ptr && edit_wearable_ptr->getVisible() && edit_wearable_ptr->isDirty())
+ {
+ LLNotificationsUtil::add("UsavedWearableChanges", LLSD(), LLSD(), [this](const LLSD& notification, const LLSD& response)
+ {
+ onCloseMsgCallback(notification, response);
+ });
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ closeFloater();
+}
+
+void LLFloaterSidePanelContainer::onCloseMsgCallback(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (0 == option)
+ {
+ closeFloater();
+ }
+}
+
LLFloater* LLFloaterSidePanelContainer::getTopmostInventoryFloater()
{
LLFloater* topmost_floater = NULL;