diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2024-11-01 17:04:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-01 17:04:37 +0200 |
commit | 76ff2e0bbc6a209addfa0f427459e7877d87938d (patch) | |
tree | 84b820df072b858d4dc2ccede6a80bc24dc0e76c /indra | |
parent | 5bbee82ee4978298cd0769ea47e16578631eca9b (diff) |
#2938 show confirmation before closing Conference chat
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterimsession.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterimsessiontab.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llfloaterimsessiontab.h | 24 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 16 |
4 files changed, 48 insertions, 12 deletions
diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index e85aac3810..84e51fe6c5 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -142,7 +142,7 @@ void LLFloaterIMSession::onClickCloseBtn(bool app_qutting) { if (app_qutting) { - LLFloaterIMSessionTab::onClickCloseBtn(); + LLFloaterIMSessionTab::onClickCloseBtn(app_qutting); return; } diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 0855a628fb..4b1d3da630 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -47,6 +47,7 @@ #include "llfloaterimnearbychat.h" #include "llgroupiconctrl.h" #include "lllayoutstack.h" +#include "llnotificationsutil.h" #include "llpanelemojicomplete.h" #include "lltoolbarview.h" @@ -1440,3 +1441,20 @@ bool LLFloaterIMSessionTab::handleKeyHere(KEY key, MASK mask ) } return handled; } + +void LLFloaterIMSessionTab::onClickCloseBtn(bool app_quitting) +{ + bool is_ad_hoc = (mSession ? mSession->isAdHocSessionType() : false); + if (is_ad_hoc && !app_quitting) + { + LLNotificationsUtil::add("ConfirmLeaveAdhoc", LLSD(), LLSD(), [this](const LLSD& notification, const LLSD& response) + { + if (0 == LLNotificationsUtil::getSelectedOption(notification, response)) + closeFloater(); + }); + } + else + { + closeFloater(); + } +} diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h index 890c920bbe..4087ced73d 100644 --- a/indra/newview/llfloaterimsessiontab.h +++ b/indra/newview/llfloaterimsessiontab.h @@ -76,13 +76,15 @@ public: bool isNearbyChat() {return mIsNearbyChat;} // LLFloater overrides - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ bool postBuild(); - /*virtual*/ void draw(); - /*virtual*/ void setVisible(bool visible); - /*virtual*/ void setFocus(bool focus); - /*virtual*/ void closeFloater(bool app_quitting = false); - /*virtual*/ void deleteAllChildren(); + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ bool postBuild() override; + /*virtual*/ void draw() override; + /*virtual*/ void setVisible(bool visible) override; + /*virtual*/ void setFocus(bool focus) override; + /*virtual*/ void closeFloater(bool app_quitting = false) override; + /*virtual*/ void deleteAllChildren() override; + + virtual void onClickCloseBtn(bool app_quitting = false) override; // Handle the left hand participant list widgets void addConversationViewParticipant(LLConversationItem* item, bool update_view = true); @@ -98,7 +100,7 @@ public: virtual void updateMessages() {} LLConversationItem* getCurSelectedViewModelItem(); void forceReshape(); - virtual bool handleKeyHere( KEY key, MASK mask ); + virtual bool handleKeyHere( KEY key, MASK mask ) override; bool isMessagePaneExpanded(){return mMessagePaneExpanded;} void setMessagePaneExpanded(bool expanded){mMessagePaneExpanded = expanded;} void restoreFloater(); @@ -139,8 +141,8 @@ protected: virtual void enableDisableCallBtn(); // process focus events to set a currently active session - /* virtual */ void onFocusReceived(); - /* virtual */ void onFocusLost(); + /* virtual */ void onFocusReceived() override; + /* virtual */ void onFocusLost() override; // prepare chat's params and out one message to chatHistory void appendMessage(const LLChat& chat, const LLSD& args = LLSD()); @@ -212,7 +214,7 @@ private: void getSelectedUUIDs(uuid_vec_t& selected_uuids); /// Refreshes the floater at a constant rate. - virtual void refresh() = 0; + virtual void refresh() override = 0; /** * Adjusts chat history height to fit vertically with input chat field diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index cbc0f7ceae..526be61207 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -9597,6 +9597,22 @@ Are you sure you want to leave this call? <notification icon="alertmodal.tga" + name="ConfirmLeaveAdhoc" + type="alertmodal"> +Are you sure you want to leave this conference chat? + <tag>confirm</tag> + <tag>voice</tag> + <usetemplate + ignoretext="Confirm before I leave conference chat" + name="okcancelignore" + notext="No" + yestext="Yes"> + <unique/> + </usetemplate> + </notification> + + <notification + icon="alertmodal.tga" name="ConfirmMuteAll" type="alert"> You have selected to mute all participants in a group call. |