Skip to content

Commit 76ff2e0

Browse files
#2938 show confirmation before closing Conference chat
1 parent 5bbee82 commit 76ff2e0

File tree

4 files changed

+48
-12
lines changed

4 files changed

+48
-12
lines changed

indra/newview/llfloaterimsession.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void LLFloaterIMSession::onClickCloseBtn(bool app_qutting)
142142
{
143143
if (app_qutting)
144144
{
145-
LLFloaterIMSessionTab::onClickCloseBtn();
145+
LLFloaterIMSessionTab::onClickCloseBtn(app_qutting);
146146
return;
147147
}
148148

indra/newview/llfloaterimsessiontab.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "llfloaterimnearbychat.h"
4848
#include "llgroupiconctrl.h"
4949
#include "lllayoutstack.h"
50+
#include "llnotificationsutil.h"
5051
#include "llpanelemojicomplete.h"
5152
#include "lltoolbarview.h"
5253

@@ -1440,3 +1441,20 @@ bool LLFloaterIMSessionTab::handleKeyHere(KEY key, MASK mask )
14401441
}
14411442
return handled;
14421443
}
1444+
1445+
void LLFloaterIMSessionTab::onClickCloseBtn(bool app_quitting)
1446+
{
1447+
bool is_ad_hoc = (mSession ? mSession->isAdHocSessionType() : false);
1448+
if (is_ad_hoc && !app_quitting)
1449+
{
1450+
LLNotificationsUtil::add("ConfirmLeaveAdhoc", LLSD(), LLSD(), [this](const LLSD& notification, const LLSD& response)
1451+
{
1452+
if (0 == LLNotificationsUtil::getSelectedOption(notification, response))
1453+
closeFloater();
1454+
});
1455+
}
1456+
else
1457+
{
1458+
closeFloater();
1459+
}
1460+
}

indra/newview/llfloaterimsessiontab.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,15 @@ class LLFloaterIMSessionTab
7676
bool isNearbyChat() {return mIsNearbyChat;}
7777

7878
// LLFloater overrides
79-
/*virtual*/ void onOpen(const LLSD& key);
80-
/*virtual*/ bool postBuild();
81-
/*virtual*/ void draw();
82-
/*virtual*/ void setVisible(bool visible);
83-
/*virtual*/ void setFocus(bool focus);
84-
/*virtual*/ void closeFloater(bool app_quitting = false);
85-
/*virtual*/ void deleteAllChildren();
79+
/*virtual*/ void onOpen(const LLSD& key) override;
80+
/*virtual*/ bool postBuild() override;
81+
/*virtual*/ void draw() override;
82+
/*virtual*/ void setVisible(bool visible) override;
83+
/*virtual*/ void setFocus(bool focus) override;
84+
/*virtual*/ void closeFloater(bool app_quitting = false) override;
85+
/*virtual*/ void deleteAllChildren() override;
86+
87+
virtual void onClickCloseBtn(bool app_quitting = false) override;
8688

8789
// Handle the left hand participant list widgets
8890
void addConversationViewParticipant(LLConversationItem* item, bool update_view = true);
@@ -98,7 +100,7 @@ class LLFloaterIMSessionTab
98100
virtual void updateMessages() {}
99101
LLConversationItem* getCurSelectedViewModelItem();
100102
void forceReshape();
101-
virtual bool handleKeyHere( KEY key, MASK mask );
103+
virtual bool handleKeyHere( KEY key, MASK mask ) override;
102104
bool isMessagePaneExpanded(){return mMessagePaneExpanded;}
103105
void setMessagePaneExpanded(bool expanded){mMessagePaneExpanded = expanded;}
104106
void restoreFloater();
@@ -139,8 +141,8 @@ class LLFloaterIMSessionTab
139141
virtual void enableDisableCallBtn();
140142

141143
// process focus events to set a currently active session
142-
/* virtual */ void onFocusReceived();
143-
/* virtual */ void onFocusLost();
144+
/* virtual */ void onFocusReceived() override;
145+
/* virtual */ void onFocusLost() override;
144146

145147
// prepare chat's params and out one message to chatHistory
146148
void appendMessage(const LLChat& chat, const LLSD& args = LLSD());
@@ -212,7 +214,7 @@ class LLFloaterIMSessionTab
212214
void getSelectedUUIDs(uuid_vec_t& selected_uuids);
213215

214216
/// Refreshes the floater at a constant rate.
215-
virtual void refresh() = 0;
217+
virtual void refresh() override = 0;
216218

217219
/**
218220
* Adjusts chat history height to fit vertically with input chat field

indra/newview/skins/default/xui/en/notifications.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9595,6 +9595,22 @@ Are you sure you want to leave this call?
95959595
</usetemplate>
95969596
</notification>
95979597

9598+
<notification
9599+
icon="alertmodal.tga"
9600+
name="ConfirmLeaveAdhoc"
9601+
type="alertmodal">
9602+
Are you sure you want to leave this conference chat?
9603+
<tag>confirm</tag>
9604+
<tag>voice</tag>
9605+
<usetemplate
9606+
ignoretext="Confirm before I leave conference chat"
9607+
name="okcancelignore"
9608+
notext="No"
9609+
yestext="Yes">
9610+
<unique/>
9611+
</usetemplate>
9612+
</notification>
9613+
95989614
<notification
95999615
icon="alertmodal.tga"
96009616
name="ConfirmMuteAll"

0 commit comments

Comments
 (0)