SL-17925 Fix SLURL based creation of picks and classifieds
parent
dd4156251b
commit
c4335939d9
|
|
@ -63,12 +63,14 @@
|
|||
#include "llnotificationsutil.h" // for LLNotificationsUtil
|
||||
#include "llpaneloutfitedit.h"
|
||||
#include "llpanelprofile.h"
|
||||
#include "llparcel.h"
|
||||
#include "llrecentpeople.h"
|
||||
#include "lltrans.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewerobjectlist.h"
|
||||
#include "llviewermessage.h" // for handle_lure
|
||||
#include "llviewernetwork.h" //LLGridManager
|
||||
#include "llviewerparcelmgr.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "lltrans.h"
|
||||
#include "llcallingcard.h"
|
||||
|
|
@ -366,6 +368,34 @@ void LLAvatarActions::showPick(const LLUUID& avatar_id, const LLUUID& pick_id)
|
|||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLAvatarActions::createPick()
|
||||
{
|
||||
LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgent.getID())));
|
||||
LLViewerRegion* region = gAgent.getRegion();
|
||||
if (profilefloater && region)
|
||||
{
|
||||
LLPickData data;
|
||||
data.pos_global = gAgent.getPositionGlobal();
|
||||
data.sim_name = region->getName();
|
||||
|
||||
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
|
||||
if (parcel)
|
||||
{
|
||||
data.name = parcel->getName();
|
||||
data.desc = parcel->getDesc();
|
||||
data.snapshot_id = parcel->getSnapshotID();
|
||||
data.parcel_id = parcel->getID();
|
||||
}
|
||||
else
|
||||
{
|
||||
data.name = region->getName();
|
||||
}
|
||||
|
||||
profilefloater->createPick(data);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLAvatarActions::isPickTabSelected(const LLUUID& avatar_id)
|
||||
{
|
||||
|
|
@ -406,6 +436,16 @@ void LLAvatarActions::showClassified(const LLUUID& avatar_id, const LLUUID& clas
|
|||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLAvatarActions::createClassified()
|
||||
{
|
||||
LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgent.getID())));
|
||||
if (profilefloater)
|
||||
{
|
||||
profilefloater->createClassified();
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
bool LLAvatarActions::profileVisible(const LLUUID& avatar_id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -99,8 +99,10 @@ public:
|
|||
static void showProfile(const LLUUID& avatar_id);
|
||||
static void showPicks(const LLUUID& avatar_id);
|
||||
static void showPick(const LLUUID& avatar_id, const LLUUID& pick_id);
|
||||
static void createPick();
|
||||
static void showClassifieds(const LLUUID& avatar_id);
|
||||
static void showClassified(const LLUUID& avatar_id, const LLUUID& classified_id, bool edit = false);
|
||||
static void createClassified();
|
||||
static void hideProfile(const LLUUID& avatar_id);
|
||||
static bool profileVisible(const LLUUID& avatar_id);
|
||||
static bool isPickTabSelected(const LLUUID& avatar_id);
|
||||
|
|
|
|||
|
|
@ -156,6 +156,11 @@ void LLFloaterProfile::showClassified(const LLUUID& classified_id, bool edit)
|
|||
mPanelProfile->showClassified(classified_id, edit);
|
||||
}
|
||||
|
||||
void LLFloaterProfile::createClassified()
|
||||
{
|
||||
mPanelProfile->createClassified();
|
||||
}
|
||||
|
||||
void LLFloaterProfile::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
|
||||
{
|
||||
mNameCallbackConnection.disconnect();
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ public:
|
|||
void refreshName();
|
||||
|
||||
void showClassified(const LLUUID& classified_id = LLUUID::null, bool edit = false);
|
||||
void createClassified();
|
||||
|
||||
private:
|
||||
LLAvatarNameCache::callback_connection_t mNameCallbackConnection;
|
||||
|
|
|
|||
|
|
@ -2646,5 +2646,9 @@ void LLPanelProfile::showClassified(const LLUUID& classified_id, bool edit)
|
|||
mTabContainer->selectTabPanel(mPanelClassifieds);
|
||||
}
|
||||
|
||||
|
||||
void LLPanelProfile::createClassified()
|
||||
{
|
||||
mPanelClassifieds->createClassified();
|
||||
mTabContainer->selectTabPanel(mPanelClassifieds);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -382,6 +382,7 @@ public:
|
|||
void commitUnsavedChanges() override;
|
||||
|
||||
void showClassified(const LLUUID& classified_id = LLUUID::null, bool edit = false);
|
||||
void createClassified();
|
||||
|
||||
LLAvatarData getAvatarData() { return mAvatarData; };
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public:
|
|||
// handle app/classified/create urls first
|
||||
if (params.size() == 1 && params[0].asString() == "create")
|
||||
{
|
||||
LLAvatarActions::showClassifieds(gAgent.getID());
|
||||
LLAvatarActions::createClassified();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -199,6 +199,7 @@ LLPanelProfileClassifieds::LLPanelProfileClassifieds()
|
|||
: LLPanelProfilePropertiesProcessorTab()
|
||||
, mClassifiedToSelectOnLoad(LLUUID::null)
|
||||
, mClassifiedEditOnLoad(false)
|
||||
, mSheduledClassifiedCreation(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -254,6 +255,26 @@ void LLPanelProfileClassifieds::selectClassified(const LLUUID& classified_id, bo
|
|||
}
|
||||
}
|
||||
|
||||
void LLPanelProfileClassifieds::createClassified()
|
||||
{
|
||||
if (getIsLoaded())
|
||||
{
|
||||
mNoItemsLabel->setVisible(FALSE);
|
||||
LLPanelProfileClassified* classified_panel = LLPanelProfileClassified::create();
|
||||
classified_panel->onOpen(LLSD());
|
||||
mTabContainer->addTabPanel(
|
||||
LLTabContainer::TabPanelParams().
|
||||
panel(classified_panel).
|
||||
select_tab(true).
|
||||
label(classified_panel->getClassifiedName()));
|
||||
updateButtons();
|
||||
}
|
||||
else
|
||||
{
|
||||
mSheduledClassifiedCreation = true;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL LLPanelProfileClassifieds::postBuild()
|
||||
{
|
||||
mTabContainer = getChild<LLTabContainer>("tab_classifieds");
|
||||
|
|
@ -335,6 +356,7 @@ void LLPanelProfileClassifieds::processProperties(void* data, EAvatarProcessorTy
|
|||
// do not clear classified list in case we will receive two or more data packets.
|
||||
// list has been cleared in updateData(). (fix for EXT-6436)
|
||||
LLUUID selected_id = mClassifiedToSelectOnLoad;
|
||||
bool has_selection = false;
|
||||
|
||||
LLAvatarClassifieds::classifieds_list_t::const_iterator it = c_info->classifieds_list.begin();
|
||||
for (; c_info->classifieds_list.end() != it; ++it)
|
||||
|
|
@ -359,11 +381,27 @@ void LLPanelProfileClassifieds::processProperties(void* data, EAvatarProcessorTy
|
|||
|
||||
if (selected_id == c_data.classified_id)
|
||||
{
|
||||
mClassifiedToSelectOnLoad = LLUUID::null;
|
||||
mClassifiedEditOnLoad = false;
|
||||
has_selection = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (mSheduledClassifiedCreation)
|
||||
{
|
||||
LLPanelProfileClassified* classified_panel = LLPanelProfileClassified::create();
|
||||
classified_panel->onOpen(LLSD());
|
||||
mTabContainer->addTabPanel(
|
||||
LLTabContainer::TabPanelParams().
|
||||
panel(classified_panel).
|
||||
select_tab(!has_selection).
|
||||
label(classified_panel->getClassifiedName()));
|
||||
has_selection = true;
|
||||
}
|
||||
|
||||
// reset 'do on load' values
|
||||
mClassifiedToSelectOnLoad = LLUUID::null;
|
||||
mClassifiedEditOnLoad = false;
|
||||
mSheduledClassifiedCreation = false;
|
||||
|
||||
// set even if not visible, user might delete own
|
||||
// calassified and this string will need to be shown
|
||||
if (getSelfProfile())
|
||||
|
|
@ -377,7 +415,7 @@ void LLPanelProfileClassifieds::processProperties(void* data, EAvatarProcessorTy
|
|||
|
||||
bool has_data = mTabContainer->getTabCount() > 0;
|
||||
mNoItemsLabel->setVisible(!has_data);
|
||||
if (has_data && selected_id.isNull())
|
||||
if (has_data && !has_selection)
|
||||
{
|
||||
mTabContainer->selectFirstTab();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@ public:
|
|||
|
||||
void selectClassified(const LLUUID& classified_id, bool edit);
|
||||
|
||||
void createClassified();
|
||||
|
||||
void processProperties(void* data, EAvatarProcessorType type) override;
|
||||
|
||||
void resetData() override;
|
||||
|
|
@ -108,6 +110,7 @@ private:
|
|||
|
||||
LLUUID mClassifiedToSelectOnLoad;
|
||||
bool mClassifiedEditOnLoad;
|
||||
bool mSheduledClassifiedCreation;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -77,10 +77,10 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
// handle app/classified/create urls first
|
||||
// handle app/pick/create urls first
|
||||
if (params.size() == 1 && params[0].asString() == "create")
|
||||
{
|
||||
LLAvatarActions::showPicks(gAgent.getID());
|
||||
LLAvatarActions::createPick();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -317,7 +317,6 @@ void LLPanelProfilePicks::processProperties(const LLAvatarPicks* avatar_picks)
|
|||
|
||||
if (selected_id == pick_id)
|
||||
{
|
||||
mPickToSelectOnLoad = LLUUID::null;
|
||||
has_selection = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -340,6 +339,8 @@ void LLPanelProfilePicks::processProperties(const LLAvatarPicks* avatar_picks)
|
|||
has_selection = true;
|
||||
}
|
||||
|
||||
// reset 'do on load' values
|
||||
mPickToSelectOnLoad = LLUUID::null;
|
||||
mSheduledPickCreation.clear();
|
||||
|
||||
if (getSelfProfile())
|
||||
|
|
|
|||
Loading…
Reference in New Issue