Commit 05ee24c5 authored by Cinder's avatar Cinder
Browse files

Fix in-panel group notices

parent ea548fcd
......@@ -33,6 +33,7 @@
#include "llaccordionctrltab.h"
#include "llaccordionctrl.h"
#include "llbutton.h"
#include "llfloaterreg.h"
#include "lltrans.h"
// Viewer includes
......@@ -52,6 +53,17 @@
static LLPanelInjector<LLPanelGroup> t_panel_group("panel_group_info_sidetray");
LLPanelGroup* get_group_panel(LLUUID const& group_id)
{
auto floater = LLFloaterReg::findInstance("group_profile", LLSD(group_id));
if (floater)
{
LLPanelGroup* panel = floater->findChild<LLPanelGroup>("panel_group_info_sidetray");
if (panel) return panel;
}
return nullptr;
}
LLPanelGroupTab::LLPanelGroupTab()
: LLPanel(),
mAllowEdit(TRUE),
......@@ -514,8 +526,7 @@ void LLPanelGroup::refreshNotices()
bool LLPanelGroup::apply()
{
bool applied = false;
applied = apply(findChild<LLPanelGroupTab>("group_general_tab_panel"));
bool applied = apply(findChild<LLPanelGroupTab>("group_general_tab_panel"));
LL_DEBUGS() << "Applied changes to group_general_tab_panel? " << (applied ? "yes" : "no") << LL_ENDL;
applied = apply(findChild<LLPanelGroupTab>("group_roles_tab_panel"));
LL_DEBUGS() << "Applied changes to group_roles_tab_panel? " << (applied ? "yes" : "no") << LL_ENDL;
......@@ -608,7 +619,7 @@ void LLPanelGroup::showNotice(const std::string& subject,
//static
void LLPanelGroup::refreshCreatedGroup(const LLUUID& group_id)
{
LLPanelGroup* panel = LLFloaterSidePanelContainer::getPanel<LLPanelGroup>("people", "panel_group_info_sidetray");
LLPanelGroup* panel = get_group_panel(group_id);
if(!panel)
return;
panel->setGroupID(group_id);
......@@ -622,12 +633,8 @@ void LLPanelGroup::showNotice(const std::string& subject,
const std::string& inventory_name,
LLOfferInfo* inventory_offer)
{
LLPanelGroup* panel = LLFloaterSidePanelContainer::getPanel<LLPanelGroup>("people", "panel_group_info_sidetray");
if(!panel)
return;
if(panel->getID() != group_id)//???? only for current group_id or switch panels? FIXME
return;
LLPanelGroup* panel = get_group_panel(group_id);
if(!panel || panel->getID() != group_id) return;
panel->showNotice(subject,message,has_inventory,inventory_name,inventory_offer);
}
......
......@@ -52,13 +52,10 @@ class LLPanelGroup : public LLPanel,
public:
LLPanelGroup();
virtual ~LLPanelGroup();
BOOL postBuild() override;
void setGroupID(const LLUUID& group_id);
void draw() override;
void onOpen(const LLSD& key) override;
// Group manager observer trigger.
......@@ -66,7 +63,7 @@ public:
// Implements LLVoiceClientStatusObserver::onChange() to enable the call
// button when voice is available
/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal) override;
void onChange(EStatusType status, const std::string &channelURI, bool proximal) override;
void showNotice(const std::string& subject,
const std::string& message,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment