Merge viewer-vob

master
Ansariel 2016-09-07 21:42:28 +02:00
commit 788bd9e477
14 changed files with 130 additions and 43 deletions

View File

@ -85,4 +85,3 @@ EDU_viewer_channel_suffix = "edu"
# environment variable 'email' to a space-separated list of email addresses

View File

@ -2477,19 +2477,10 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
void LLFloaterView::restoreAll()
{
// make sure all subwindows aren't minimized
for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
child_list_t child_list = *(getChildList());
for (child_list_const_iter_t child_it = child_list.begin(); child_it != child_list.end(); ++child_it)
{
LLFloater* floaterp = NULL;
try
{
floaterp = dynamic_cast<LLFloater*>(*child_it);
}
catch (std::exception e) // See MAINT-6511
{
LL_WARNS() << "Caught exception: " << e.what() << LL_ENDL;
continue;
}
LLFloater* floaterp = dynamic_cast<LLFloater*>(*child_it);
if (floaterp)
{
floaterp->setMinimized(FALSE);

View File

@ -1571,6 +1571,17 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>AdvanceOutfitSnapshot</key>
<map>
<key>Comment</key>
<string>Display advanced parameter settings in outfit snaphot interface</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>AgentPause</key>
<map>
<key>Comment</key>

View File

@ -3359,6 +3359,16 @@ void LLAppearanceMgr::updateIsDirty()
gInventory.collectDescendentsIf(base_outfit, outfit_cats, outfit_items,
LLInventoryModel::EXCLUDE_TRASH, collector);
for (U32 i = 0; i < outfit_items.size(); ++i)
{
LLViewerInventoryItem* linked_item = outfit_items.at(i)->getLinkedItem();
if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE)
{
outfit_items.erase(outfit_items.begin() + i);
break;
}
}
// <FS:TS> FIRE-3018: Ignore the bridge when checking for dirty.
for (LLInventoryModel::item_array_t::iterator i = cof_items.begin(); i != cof_items.end(); ++i)
{
@ -3519,6 +3529,14 @@ void appearance_mgr_update_dirty_state()
{
if (LLAppearanceMgr::instanceExists())
{
LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance();
LLUUID image_id = app_mgr.getOutfitImage();
if(image_id.notNull())
{
LLPointer<LLInventoryCallback> cb = NULL;
link_inventory_object(app_mgr.getBaseOutfitUUID(), image_id, cb);
}
LLAppearanceMgr::getInstance()->updateIsDirty();
LLAppearanceMgr::getInstance()->setOutfitLocked(false);
gAgentWearables.notifyLoadingFinished();
@ -3528,7 +3546,21 @@ void appearance_mgr_update_dirty_state()
void update_base_outfit_after_ordering()
{
LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance();
LLInventoryModel::cat_array_t sub_cat_array;
LLInventoryModel::item_array_t outfit_item_array;
gInventory.collectDescendents(app_mgr.getBaseOutfitUUID(),
sub_cat_array,
outfit_item_array,
LLInventoryModel::EXCLUDE_TRASH);
BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array)
{
LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem();
if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE)
{
app_mgr.setOutfitImage(linked_item->getLinkedUUID());
}
}
LLPointer<LLInventoryCallback> dirty_state_updater =
new LLBoostFuncInventoryCallback(no_op_inventory_func, appearance_mgr_update_dirty_state);

View File

@ -196,6 +196,9 @@ public:
void wearBaseOutfit();
void setOutfitImage(const LLUUID& image_id) {mCOFImageID = image_id;}
LLUUID getOutfitImage() {return mCOFImageID;}
// Overrides the base outfit with the content from COF
// @return false if there is no base outfit
bool updateBaseOutfit();
@ -294,6 +297,8 @@ private:
LLTimer mInFlightTimer;
static bool mActive;
LLUUID mCOFImageID;
std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
// Set of temp attachment UUIDs that should be removed

View File

@ -249,6 +249,8 @@ BOOL LLFloaterOutfitSnapshot::postBuild()
getChild<LLUICtrl>("auto_snapshot_check")->setValue(gSavedSettings.getBOOL("AutoSnapshot"));
childSetCommitCallback("auto_snapshot_check", ImplBase::onClickAutoSnap, this);
getChild<LLButton>("retract_btn")->setCommitCallback(boost::bind(&LLFloaterOutfitSnapshot::onExtendFloater, this));
getChild<LLButton>("extend_btn")->setCommitCallback(boost::bind(&LLFloaterOutfitSnapshot::onExtendFloater, this));
// Filters
LLComboBox* filterbox = getChild<LLComboBox>("filters_combobox");
@ -280,6 +282,7 @@ BOOL LLFloaterOutfitSnapshot::postBuild()
impl->mPreviewHandle = previewp->getHandle();
previewp->setContainer(this);
impl->updateControls(this);
impl->setAdvanced(gSavedSettings.getBOOL("AdvanceOutfitSnapshot"));
impl->updateLayout(this);
previewp->mKeepAspectRatio = FALSE;
@ -303,6 +306,7 @@ void LLFloaterOutfitSnapshot::onOpen(const LLSD& key)
gSnapshotFloaterView->adjustToFitScreen(this, FALSE);
impl->updateControls(this);
impl->setAdvanced(gSavedSettings.getBOOL("AdvanceOutfitSnapshot"));
impl->updateLayout(this);
LLPanel* snapshot_panel = getChild<LLPanel>("panel_outfit_snapshot_inventory");
@ -311,6 +315,11 @@ void LLFloaterOutfitSnapshot::onOpen(const LLSD& key)
}
void LLFloaterOutfitSnapshot::onExtendFloater()
{
impl->setAdvanced(gSavedSettings.getBOOL("AdvanceOutfitSnapshot"));
}
// static
void LLFloaterOutfitSnapshot::update()
{

View File

@ -50,6 +50,8 @@ public:
static void update();
void onExtendFloater();
static LLFloaterOutfitSnapshot* getInstance();
static LLFloaterOutfitSnapshot* findInstance();
/*virtual*/ void saveTexture();

View File

@ -168,8 +168,6 @@ void LLFloaterSnapshotBase::ImplBase::updateLayout(LLFloaterSnapshotBase* floate
{
LLSnapshotLivePreview* previewp = getPreviewView();
BOOL advanced = gSavedSettings.getBOOL("AdvanceSnapshot");
//BD - Automatically calculate the size of our snapshot window to enlarge
// the snapshot preview to its maximum size, this is especially helpfull
// for pretty much every aspect ratio other than 1:1.
@ -185,14 +183,14 @@ void LLFloaterSnapshotBase::ImplBase::updateLayout(LLFloaterSnapshotBase* floate
}
S32 floater_width = 224;
if(advanced)
if(mAdvanced)
{
floater_width = floater_width + panel_width;
}
// <FS:Ansariel> Show miniature thumbnail on collapsed snapshot panel
//LLUICtrl* thumbnail_placeholder = floaterp->getChild<LLUICtrl>("thumbnail_placeholder");
//thumbnail_placeholder->setVisible(advanced);
//thumbnail_placeholder->setVisible(mAdvanced);
//thumbnail_placeholder->reshape(panel_width, thumbnail_placeholder->getRect().getHeight());
//floaterp->getChild<LLUICtrl>("image_res_text")->setVisible(advanced);
//floaterp->getChild<LLUICtrl>("file_size_label")->setVisible(advanced);
@ -203,12 +201,12 @@ void LLFloaterSnapshotBase::ImplBase::updateLayout(LLFloaterSnapshotBase* floate
previewp->setFixedThumbnailSize(panel_width, 400);
LLUICtrl* thumbnail_placeholder = floaterp->getChild<LLUICtrl>("thumbnail_placeholder");
floaterp->getChild<LLUICtrl>("image_res_text")->setVisible(advanced);
floaterp->getChild<LLUICtrl>("file_size_label")->setVisible(advanced);
floaterp->getChild<LLUICtrl>("image_res_text")->setVisible(mAdvanced);
floaterp->getChild<LLUICtrl>("file_size_label")->setVisible(mAdvanced);
if(!floaterp->isMinimized())
{
LLView* controls_container = floaterp->getChild<LLView>("controls_container");
if (advanced)
if (mAdvanced)
{
LLRect cc_rect = controls_container->getRect();
@ -1123,7 +1121,9 @@ BOOL LLFloaterSnapshot::postBuild()
getChild<LLUICtrl>("auto_snapshot_check")->setValue(gSavedSettings.getBOOL("AutoSnapshot"));
childSetCommitCallback("auto_snapshot_check", ImplBase::onClickAutoSnap, this);
getChild<LLButton>("retract_btn")->setCommitCallback(boost::bind(&LLFloaterSnapshot::onExtendFloater, this));
getChild<LLButton>("extend_btn")->setCommitCallback(boost::bind(&LLFloaterSnapshot::onExtendFloater, this));
// Filters
LLComboBox* filterbox = getChild<LLComboBox>("filters_combobox");
@ -1167,6 +1167,7 @@ BOOL LLFloaterSnapshot::postBuild()
impl->mPreviewHandle = previewp->getHandle();
previewp->setContainer(this);
impl->updateControls(this);
impl->setAdvanced(gSavedSettings.getBOOL("AdvanceSnapshot"));
impl->updateLayout(this);
@ -1239,6 +1240,7 @@ void LLFloaterSnapshot::onOpen(const LLSD& key)
gSnapshotFloaterView->adjustToFitScreen(this, FALSE);
impl->updateControls(this);
impl->setAdvanced(gSavedSettings.getBOOL("AdvanceSnapshot"));
impl->updateLayout(this);
// <FS:Ansariel> FIRE-16145: CTRL-SHIFT-S doesn't update the snapshot anymore
@ -1288,6 +1290,11 @@ void LLFloaterSnapshot::onOpen(const LLSD& key)
// </FS:CR>
}
void LLFloaterSnapshot::onExtendFloater()
{
impl->setAdvanced(gSavedSettings.getBOOL("AdvanceSnapshot"));
}
// <FS:Ansariel> FIRE-16043: Remember last used snapshot option
//virtual
void LLFloaterSnapshot::onClose(bool app_quitting)
@ -1414,14 +1421,14 @@ S32 LLFloaterSnapshot::notify(const LLSD& info)
return 0;
}
void LLFloaterSnapshotBase::ImplBase::updateLivePreview()
BOOL LLFloaterSnapshotBase::ImplBase::updatePreviewList(bool initialized)
{
LLFloaterFacebook* floater_facebook = LLFloaterReg::findTypedInstance<LLFloaterFacebook>("facebook");
LLFloaterFlickr* floater_flickr = LLFloaterReg::findTypedInstance<LLFloaterFlickr>("flickr");
LLFloaterTwitter* floater_twitter = LLFloaterReg::findTypedInstance<LLFloaterTwitter>("twitter");
if (!mFloater && !floater_facebook && !floater_flickr && !floater_twitter)
return;
if (!initialized && !floater_facebook && !floater_flickr && !floater_twitter)
return FALSE;
BOOL changed = FALSE;
LL_DEBUGS() << "npreviews: " << LLSnapshotLivePreview::sList.size() << LL_ENDL;
@ -1430,8 +1437,13 @@ void LLFloaterSnapshotBase::ImplBase::updateLivePreview()
{
changed |= LLSnapshotLivePreview::onIdle(*iter);
}
return changed;
}
if (mFloater && changed)
void LLFloaterSnapshotBase::ImplBase::updateLivePreview()
{
if (ImplBase::updatePreviewList(true) && mFloater)
{
LL_DEBUGS() << "changed" << LL_ENDL;
updateControls(mFloater);
@ -1446,6 +1458,10 @@ void LLFloaterSnapshot::update()
{
inst->impl->updateLivePreview();
}
else
{
ImplBase::updatePreviewList(false);
}
}
// static

View File

@ -118,6 +118,10 @@ public:
virtual EStatus getStatus() const { return mStatus; }
virtual void setNeedRefresh(bool need);
static BOOL updatePreviewList(bool initialized);
void setAdvanced(bool advanced) { mAdvanced = advanced; }
virtual LLSnapshotModel::ESnapshotLayerType getLayerType(LLFloaterSnapshotBase* floater) = 0;
virtual void checkAutoSnapshot(LLSnapshotLivePreview* floater, BOOL update_thumbnail = FALSE);
void setWorking(bool working);
@ -131,6 +135,7 @@ public:
LLHandle<LLView> mPreviewHandle;
bool mAspectRatioCheckOff;
bool mNeedRefresh;
bool mAdvanced;
EStatus mStatus;
};
@ -149,6 +154,8 @@ public:
static void update();
void onExtendFloater();
static LLFloaterSnapshot* getInstance();
static LLFloaterSnapshot* findInstance();
/*virtual*/ void saveTexture();

View File

@ -118,7 +118,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)
mSavedFolderState(NULL),
mFilterText(""),
mMenuGearDefault(NULL),
mMenuAdd(NULL),
mMenuAddHandle(),
mNeedUploadCost(true)
{
// Menu Callbacks (non contex menus)
@ -323,10 +323,15 @@ BOOL LLPanelMainInventory::postBuild()
}
// </FS:AW opensim currency support>
mMenuAdd->getChild<LLMenuItemGL>("Upload Image")->setLabelArg("[COST]", upload_cost);
mMenuAdd->getChild<LLMenuItemGL>("Upload Sound")->setLabelArg("[COST]", upload_cost);
mMenuAdd->getChild<LLMenuItemGL>("Upload Animation")->setLabelArg("[COST]", upload_cost);
mMenuAdd->getChild<LLMenuItemGL>("Bulk Upload")->setLabelArg("[COST]", upload_cost);
LLMenuGL* menu = (LLMenuGL*)mMenuAddHandle.get();
if (menu)
{
menu->getChild<LLMenuItemGL>("Upload Image")->setLabelArg("[COST]", upload_cost);
menu->getChild<LLMenuItemGL>("Upload Sound")->setLabelArg("[COST]", upload_cost);
menu->getChild<LLMenuItemGL>("Upload Animation")->setLabelArg("[COST]", upload_cost);
menu->getChild<LLMenuItemGL>("Bulk Upload")->setLabelArg("[COST]", upload_cost);
}
// Trigger callback for focus received so we can deselect items in inbox/outbox
LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMainInventory::onFocusReceived, this));
@ -1344,7 +1349,8 @@ void LLPanelMainInventory::initListCommandsHandlers()
mEnableCallbackRegistrar.add("Inventory.GearDefault.Enable", boost::bind(&LLPanelMainInventory::isActionEnabled, this, _2));
mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
mGearMenuButton->setMenu(mMenuGearDefault);
mMenuAdd = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
mMenuAddHandle = menu->getHandle();
// Update the trash button when selected item(s) get worn or taken off.
LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLPanelMainInventory::updateListCommands, this));
@ -1362,11 +1368,15 @@ void LLPanelMainInventory::onAddButtonClick()
// Gray out the "New Folder" option when the Recent tab is active as new folders will not be displayed
// unless "Always show folders" is checked in the filter options.
bool recent_active = ("Recent Items" == mActivePanel->getName());
mMenuAdd->getChild<LLMenuItemGL>("New Folder")->setEnabled(!recent_active);
LLMenuGL* menu = (LLMenuGL*)mMenuAddHandle.get();
if (menu)
{
menu->getChild<LLMenuItemGL>("New Folder")->setEnabled(!recent_active);
setUploadCostIfNeeded();
setUploadCostIfNeeded();
showActionMenu(mMenuAdd,"add_btn");
showActionMenu(menu,"add_btn");
}
}
void LLPanelMainInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name)
@ -1547,7 +1557,11 @@ void LLPanelMainInventory::onVisibilityChange( BOOL new_visibility )
{
if(!new_visibility)
{
mMenuAdd->setVisible(FALSE);
LLMenuGL* menu = (LLMenuGL*)mMenuAddHandle.get();
if (menu)
{
menu->setVisible(FALSE);
}
getActivePanel()->getRootFolder()->finishRenamingItem();
}
}
@ -1776,9 +1790,10 @@ void LLPanelMainInventory::setUploadCostIfNeeded()
// have two instances of Inventory panel at the moment(and two instances of context menu),
// call to gMenuHolder->childSetLabelArg() sets upload cost only for one of the instances.
if(mNeedUploadCost && mMenuAdd)
LLMenuGL* menu = (LLMenuGL*)mMenuAddHandle.get();
if(mNeedUploadCost && menu)
{
LLMenuItemBranchGL* upload_menu = mMenuAdd->findChild<LLMenuItemBranchGL>("upload");
LLMenuItemBranchGL* upload_menu = menu->findChild<LLMenuItemBranchGL>("upload");
if(upload_menu)
{
// <FS:AW opensim currency support>

View File

@ -192,8 +192,8 @@ protected:
private:
LLDragAndDropButton* mTrashButton;
LLToggleableMenu* mMenuGearDefault;
LLMenuGL* mMenuAdd;
LLMenuButton* mGearMenuButton;
LLHandle<LLView> mMenuAddHandle;
// <FS:Zi> Inventory Collapse and Expand Buttons
LLButton* mCollapseBtn;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 KiB

After

Width:  |  Height:  |  Size: 376 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 322 KiB

After

Width:  |  Height:  |  Size: 332 KiB

View File

@ -59,8 +59,8 @@
width="167" />
<button
follows="left|top"
control_name="AdvanceSnapshot"
invisibility_control="AdvanceSnapshot"
control_name="AdvanceOutfitSnapshot"
invisibility_control="AdvanceOutfitSnapshot"
height="25"
is_toggle="true"
layout="topleft"
@ -74,8 +74,8 @@
width="31" />
<button
follows="left|top"
control_name="AdvanceSnapshot"
visibility_control="AdvanceSnapshot"
control_name="AdvanceOutfitSnapshot"
visibility_control="AdvanceOutfitSnapshot"
height="25"
is_toggle="true"
layout="topleft"