master
Brad Payne (Vir Linden) 2011-11-28 10:13:34 -05:00
commit 5374e544ed
388 changed files with 6477 additions and 3700 deletions

14
.hgtags
View File

@ -213,4 +213,18 @@ e440cd1dfbd128d7d5467019e497f7f803640ad6 3.2.0-beta1
9bcc2b7176634254e501e3fb4c5b56c1f637852e 3.2.0-beta2
2a13d30ee50ccfed50268238e36bb90d738ccc9e DRTVWR-98_3.2.0-beta3
2a13d30ee50ccfed50268238e36bb90d738ccc9e 3.2.0-beta3
3150219d229d628f0c15e58e8a51511cbd97e58d DRTVWR-94_3.2.0-release
3150219d229d628f0c15e58e8a51511cbd97e58d 3.2.0-release
c4911ec8cd81e676dfd2af438b3e065407a94a7a 3.2.1-start
3150219d229d628f0c15e58e8a51511cbd97e58d DRTVWR-94_3.2.0-release
3150219d229d628f0c15e58e8a51511cbd97e58d 3.2.0-release
40b46edba007d15d0059c80864b708b99c1da368 3.2.2-start
3150219d229d628f0c15e58e8a51511cbd97e58d DRTVWR-94_3.2.0-release
3150219d229d628f0c15e58e8a51511cbd97e58d 3.2.0-release
9e390d76807fa70d356b8716fb83b8ce42a629ef DRTVWR-100_3.2.1-beta1
9e390d76807fa70d356b8716fb83b8ce42a629ef 3.2.1-beta1
523df3e67378541498d516d52af4402176a26bac DRTVWR-102_3.2.2-beta1
523df3e67378541498d516d52af4402176a26bac 3.2.2-beta1
80f3e30d8aa4d8f674a48bd742aaa6d8e9eae0b5 3.2.3-start
a8c7030d6845186fac7c188be4323a0e887b4184 DRTVWR-99_3.2.1-release
a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release

View File

@ -136,14 +136,6 @@ viewer-mesh.login_channel = "Project Viewer - Mesh"
viewer-mesh.viewer_grid = aditi
viewer-mesh.email = shining@lists.lindenlab.com
# ========================================
# CG
# ========================================
cg_viewer-development_lenny.show_changes_since = 4b140ce7839d
cg_viewer-development_lenny.email = cg@lindenlab.com
# ================
# oz
# ================
@ -151,20 +143,29 @@ cg_viewer-development_lenny.email = cg@lindenlab.com
oz_viewer-devreview.build_debug_release_separately = true
oz_viewer-devreview.codeticket_add_context = false
oz_viewer-devreview.build_enforce_coding_policy = true
oz_viewer-devreview.email = oz@lindenlab.com
oz_project-1.build_debug_release_separately = true
oz_project-1.codeticket_add_context = false
oz_project-1.email = oz@lindenlab.com
oz_project-2.build_debug_release_separately = true
oz_project-2.codeticket_add_context = false
oz_project-2.email = oz@lindenlab.com
oz_project-3.build_debug_release_separately = true
oz_project-3.codeticket_add_context = false
oz_project-3.email = oz@lindenlab.com
oz_project-4.build_debug_release_separately = true
oz_project-4.codeticket_add_context = false
oz_project-4.email = oz@lindenlab.com
oz_project-5.build_debug_release_separately = true
oz_project-5.codeticket_add_context = false
oz_project-5.email = oz@lindenlab.com
oz_viewer-beta-review.build_debug_release_separately = true
oz_viewer-beta-review.codeticket_add_context = false
oz_viewer-beta-review.viewer_channel = "Second Life Beta Viewer"
oz_viewer-beta-review.login_channel = "Second Life Beta Viewer"
oz_viewer-beta-review.email = oz@lindenlab.com
# =================================================================
# asset delivery 2010 projects

View File

@ -1206,9 +1206,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>1b92a69f5eba7cd8b017180659076db5</string>
<string>7108c2443dbcf4c032305814ce65ebb7</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/roxie_3p-llqtwebkit/rev/242182/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20111003.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/244065/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20111028.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@ -1230,9 +1230,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>1e7f24b69b0fc751c7e86efe7c621882</string>
<string>24048a31d7b852774dc3117acbd4a86a</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/roxie_3p-llqtwebkit/rev/242182/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111003.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/244065/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111028.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>

View File

@ -170,6 +170,7 @@ Ansariel Hiller
STORM-1101
VWR-25480
VWR-26150
STORM-1685
Aralara Rajal
Ardy Lay
STORM-859
@ -582,6 +583,12 @@ Jonathan Yap
STORM-1639
STORM-910
STORM-1642
STORM-1105
STORM-1679
STORM-1222
STORM-1659
STORM-1674
STORM-1685
Kadah Coba
STORM-1060
Jondan Lundquist
@ -1111,6 +1118,7 @@ Tofu Buzzard
STORM-546
VWR-24509
SH-2477
STORM-1684
Tony Kembia
Torben Trautman
TouchaHoney Perhaps

View File

@ -1,4 +1,3 @@
# -*- cmake -*-
# cmake_minimum_required should appear before any
@ -70,6 +69,9 @@ if (VIEWER)
add_subdirectory(${LIBS_OPEN_PREFIX}llxuixml)
add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)
# Legacy C++ tests. Build always, run if LL_TESTS is true.
add_subdirectory(${VIEWER_PREFIX}test)
# viewer media plugins
add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)

View File

@ -1821,6 +1821,7 @@ void LLPrivateMemoryPool::LLChunkHashElement::remove(LLPrivateMemoryPool::LLMemo
//class LLPrivateMemoryPoolManager
//--------------------------------------------------------------------
LLPrivateMemoryPoolManager* LLPrivateMemoryPoolManager::sInstance = NULL ;
BOOL LLPrivateMemoryPoolManager::sPrivatePoolEnabled = FALSE ;
std::vector<LLPrivateMemoryPool*> LLPrivateMemoryPoolManager::sDanglingPoolList ;
LLPrivateMemoryPoolManager::LLPrivateMemoryPoolManager(BOOL enabled, U32 max_pool_size)
@ -1832,7 +1833,7 @@ LLPrivateMemoryPoolManager::LLPrivateMemoryPoolManager(BOOL enabled, U32 max_poo
mPoolList[i] = NULL ;
}
mPrivatePoolEnabled = enabled ;
sPrivatePoolEnabled = enabled ;
const U32 MAX_POOL_SIZE = 256 * 1024 * 1024 ; //256 MB
mMaxPrivatePoolSize = llmax(max_pool_size, MAX_POOL_SIZE) ;
@ -1917,7 +1918,7 @@ void LLPrivateMemoryPoolManager::destroyClass()
LLPrivateMemoryPool* LLPrivateMemoryPoolManager::newPool(S32 type)
{
if(!mPrivatePoolEnabled)
if(!sPrivatePoolEnabled)
{
return NULL ;
}
@ -2015,7 +2016,11 @@ void LLPrivateMemoryPoolManager::freeMem(LLPrivateMemoryPool* poolp, void* addr
}
else
{
if(!sInstance) //the private memory manager is destroyed, try the dangling list
if(!sPrivatePoolEnabled)
{
free(addr) ; //private pool is disabled.
}
else if(!sInstance) //the private memory manager is destroyed, try the dangling list
{
for(S32 i = 0 ; i < sDanglingPoolList.size(); i++)
{
@ -2036,12 +2041,13 @@ void LLPrivateMemoryPoolManager::freeMem(LLPrivateMemoryPool* poolp, void* addr
addr = NULL ;
break ;
}
}
}
llassert_always(!addr) ; //addr should be release before hitting here!
}
else
{
llerrs << "private pool is used before initialized.!" << llendl ;
}
llassert_always(!addr) ; //addr should be release before hitting here!
free(addr) ;
}
}

View File

@ -394,12 +394,12 @@ public:
LLPrivateMemoryPool* newPool(S32 type) ;
void deletePool(LLPrivateMemoryPool* pool) ;
private:
static LLPrivateMemoryPoolManager* sInstance ;
std::vector<LLPrivateMemoryPool*> mPoolList ;
BOOL mPrivatePoolEnabled;
private:
std::vector<LLPrivateMemoryPool*> mPoolList ;
U32 mMaxPrivatePoolSize;
static LLPrivateMemoryPoolManager* sInstance ;
static BOOL sPrivatePoolEnabled;
static std::vector<LLPrivateMemoryPool*> sDanglingPoolList ;
public:
//debug and statistics info.

View File

@ -29,7 +29,7 @@
const S32 LL_VERSION_MAJOR = 3;
const S32 LL_VERSION_MINOR = 2;
const S32 LL_VERSION_PATCH = 2;
const S32 LL_VERSION_PATCH = 4;
const S32 LL_VERSION_BUILD = 0;
const char * const LL_CHANNEL = "Second Life Developer";

View File

@ -48,6 +48,31 @@ LLGlobalEconomy::LLGlobalEconomy()
LLGlobalEconomy::~LLGlobalEconomy()
{ }
void LLGlobalEconomy::addObserver(LLEconomyObserver* observer)
{
mObservers.push_back(observer);
}
void LLGlobalEconomy::removeObserver(LLEconomyObserver* observer)
{
std::list<LLEconomyObserver*>::iterator it =
std::find(mObservers.begin(), mObservers.end(), observer);
if (it != mObservers.end())
{
mObservers.erase(it);
}
}
void LLGlobalEconomy::notifyObservers()
{
for (std::list<LLEconomyObserver*>::iterator it = mObservers.begin();
it != mObservers.end();
++it)
{
(*it)->onEconomyDataChange();
}
}
// static
void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data)
{
@ -88,6 +113,8 @@ void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, LLGlobalEconomy*
econ_data->setTeleportPriceExponent(f);
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceGroupCreate, i);
econ_data->setPriceGroupCreate(i);
econ_data->notifyObservers();
}
S32 LLGlobalEconomy::calculateTeleportCost(F32 distance) const

View File

@ -31,6 +31,16 @@
class LLMessageSystem;
class LLVector3;
/**
* Register an observer to be notified of economy data updates coming from server.
*/
class LLEconomyObserver
{
public:
virtual ~LLEconomyObserver() {}
virtual void onEconomyDataChange() = 0;
};
class LLGlobalEconomy
{
public:
@ -46,6 +56,10 @@ public:
virtual void print();
void addObserver(LLEconomyObserver* observer);
void removeObserver(LLEconomyObserver* observer);
void notifyObservers();
static void processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data);
S32 calculateTeleportCost(F32 distance) const;
@ -89,6 +103,8 @@ private:
S32 mTeleportMinPrice;
F32 mTeleportPriceExponent;
S32 mPriceGroupCreate;
std::list<LLEconomyObserver*> mObservers;
};

View File

@ -1239,6 +1239,14 @@ void LLPluginClassMedia::focus(bool focused)
sendMessage(message);
}
void LLPluginClassMedia::set_page_zoom_factor( double factor )
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "set_page_zoom_factor");
message.setValueReal("factor", factor);
sendMessage(message);
}
void LLPluginClassMedia::clear_cache()
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "clear_cache");

View File

@ -202,6 +202,7 @@ public:
bool pluginSupportsMediaBrowser(void);
void focus(bool focused);
void set_page_zoom_factor( double factor );
void clear_cache();
void clear_cookies();
void set_cookies(const std::string &cookies);

View File

@ -82,7 +82,7 @@ BOOL LLDockableFloater::postBuild()
mForceDocking = true;
}
mDockTongue = LLUI::getUIImage("windows/Flyout_Pointer.png");
mDockTongue = LLUI::getUIImage("Flyout_Pointer");
LLFloater::setDocked(true);
return LLView::postBuild();
}
@ -244,13 +244,13 @@ const LLUIImagePtr& LLDockableFloater::getDockTongue(LLDockControl::DocAt dock_s
switch(dock_side)
{
case LLDockControl::LEFT:
mDockTongue = LLUI::getUIImage("windows/Flyout_Left.png");
mDockTongue = LLUI::getUIImage("Flyout_Left");
break;
case LLDockControl::RIGHT:
mDockTongue = LLUI::getUIImage("windows/Flyout_Right.png");
mDockTongue = LLUI::getUIImage("Flyout_Right");
break;
default:
mDockTongue = LLUI::getUIImage("windows/Flyout_Pointer.png");
mDockTongue = LLUI::getUIImage("Flyout_Pointer");
break;
}

View File

@ -51,7 +51,7 @@ public:
* - TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with.
* - DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close.
*/
typedef enum TOKEN_TYPE
enum TOKEN_TYPE
{
WORD,
LINE,

View File

@ -1686,7 +1686,8 @@ LLMenuGL::LLMenuGL(const LLMenuGL::Params& p)
mSpilloverMenu(NULL),
mJumpKey(p.jump_key),
mCreateJumpKeys(p.create_jump_keys),
mNeedsArrange(FALSE),
mNeedsArrange(FALSE),
mResetScrollPositionOnShow(true),
mShortcutPad(p.shortcut_pad)
{
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
@ -3043,7 +3044,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
S32 mouse_x, mouse_y;
// Resetting scrolling position
if (menu->isScrollable())
if (menu->isScrollable() && menu->isScrollPositionOnShowReset())
{
menu->mFirstVisibleItem = NULL;
}

View File

@ -516,6 +516,9 @@ public:
static class LLMenuHolderGL* sMenuContainer;
void resetScrollPositionOnShow(bool reset_scroll_pos) { mResetScrollPositionOnShow = reset_scroll_pos; }
bool isScrollPositionOnShowReset() { return mResetScrollPositionOnShow; }
protected:
void createSpilloverBranch();
void cleanupSpilloverBranch();
@ -565,6 +568,7 @@ private:
KEY mJumpKey;
BOOL mCreateJumpKeys;
S32 mShortcutPad;
bool mResetScrollPositionOnShow;
}; // end class LLMenuGL

View File

@ -36,6 +36,8 @@ static LLInitParam::Parser::parser_write_func_map_t sWriteFuncs;
static LLInitParam::Parser::parser_inspect_func_map_t sInspectFuncs;
static const LLSD NO_VALUE_MARKER;
LLFastTimer::DeclareTimer FTM_SD_PARAM_ADAPTOR("LLSD to LLInitParam conversion");
//
// LLParamSDParser
//

View File

@ -91,6 +91,8 @@ private:
LLSD* mCurWriteSD;
};
extern LLFastTimer::DeclareTimer FTM_SD_PARAM_ADAPTOR;
template<typename T>
class LLSDParamAdapter : public T
{
@ -98,8 +100,11 @@ public:
LLSDParamAdapter() {}
LLSDParamAdapter(const LLSD& sd)
{
LLFastTimer _(FTM_SD_PARAM_ADAPTOR);
LLParamSDParser parser;
parser.readSD(sd, *this);
// don't spam for implicit parsing of LLSD, as we want to allow arbitrary freeform data and ignore most of it
bool parse_silently = true;
parser.readSD(sd, *this, parse_silently);
}
operator LLSD() const

View File

@ -109,6 +109,7 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p)
mPadBetween(p.pad_between),
mMinGirth(p.min_girth),
mPopupMenuHandle(),
mRightMouseTargetButton(NULL),
mStartDragItemCallback(NULL),
mHandleDragItemCallback(NULL),
mHandleDropCallback(NULL),
@ -139,6 +140,7 @@ void LLToolBar::createContextMenu()
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar commit_reg;
commit_reg.add("Toolbars.EnableSetting", boost::bind(&LLToolBar::onSettingEnable, this, _2));
commit_reg.add("Toolbars.RemoveSelectedCommand", boost::bind(&LLToolBar::onRemoveSelectedCommand, this));
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_reg;
enable_reg.add("Toolbars.CheckSetting", boost::bind(&LLToolBar::isSettingChecked, this, _2));
@ -397,6 +399,20 @@ BOOL LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask)
if (handle_it_here)
{
// Determine which button the mouse was over during the click in case the context menu action
// is intended to affect the button.
BOOST_FOREACH(LLToolBarButton* button, mButtons)
{
LLRect button_rect;
button->localRectToOtherView(button->getLocalRect(), &button_rect, this);
if (button_rect.pointInRect(x, y))
{
mRightMouseTargetButton = button;
break;
}
}
createContextMenu();
LLContextMenu * menu = (LLContextMenu *) mPopupMenuHandle.get();
@ -446,6 +462,18 @@ void LLToolBar::onSettingEnable(const LLSD& userdata)
}
}
void LLToolBar::onRemoveSelectedCommand()
{
llassert(!mReadOnly);
if (mRightMouseTargetButton)
{
removeCommand(mRightMouseTargetButton->getCommandId());
mRightMouseTargetButton = NULL;
}
}
void LLToolBar::setButtonType(LLToolBarEnums::ButtonType button_type)
{
bool regenerate_buttons = (mButtonType != button_type);
@ -524,11 +552,11 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
S32 mid_point = (button_rect.mRight + button_rect.mLeft) / 2;
if (button_panel_x < mid_point)
{
mDragx = button_rect.mLeft - mPadLeft;
mDragy = button_rect.mTop + mPadTop;
}
else
{
mDragx = button_rect.mLeft - mPadLeft;
mDragy = button_rect.mTop + mPadTop;
}
else
{
rank++;
mDragx = button_rect.mRight + mPadRight - 1;
mDragy = button_rect.mTop + mPadTop;
@ -555,12 +583,12 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
{
// We hit passed the end of the list so put the insertion point at the end
if (orientation == LLLayoutStack::HORIZONTAL)
{
{
mDragx = button_rect.mRight + mPadRight;
mDragy = button_rect.mTop + mPadTop;
}
else
{
}
else
{
mDragx = button_rect.mLeft - mPadLeft;
mDragy = button_rect.mBottom - mPadBottom;
}
@ -836,6 +864,7 @@ void LLToolBar::createButtons()
}
mButtons.clear();
mButtonMap.clear();
mRightMouseTargetButton = NULL;
BOOST_FOREACH(LLCommandId& command_id, mButtonCommands)
{

View File

@ -63,9 +63,11 @@ public:
BOOL handleMouseDown(S32 x, S32 y, MASK mask);
BOOL handleHover(S32 x, S32 y, MASK mask);
void reshape(S32 width, S32 height, BOOL called_from_parent = true);
void setEnabled(BOOL enabled);
void setCommandId(const LLCommandId& id) { mId = id; }
LLCommandId getCommandId() { return mId; }
void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; }
void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; }
@ -164,7 +166,8 @@ public:
pad_bottom,
pad_between,
min_girth;
// get rid of this
// default command set
Multiple<LLCommandId::Params> commands;
Optional<LLPanel::Params> button_panel;
@ -175,8 +178,6 @@ public:
// virtuals
void draw();
void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
int getRankFromPosition(S32 x, S32 y);
int getRankFromPosition(const LLCommandId& id);
BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
@ -185,15 +186,14 @@ public:
std::string& tooltip_msg);
static const int RANK_NONE = -1;
bool addCommand(const LLCommandId& commandId, int rank = RANK_NONE);
int removeCommand(const LLCommandId& commandId); // Returns the rank the removed command was at, RANK_NONE if not found
bool hasCommand(const LLCommandId& commandId) const;
bool enableCommand(const LLCommandId& commandId, bool enabled);
bool stopCommandInProgress(const LLCommandId& commandId);
bool flashCommand(const LLCommandId& commandId, bool flash);
bool hasCommand(const LLCommandId& commandId) const; // is this command bound to a button in this toolbar
bool enableCommand(const LLCommandId& commandId, bool enabled); // enable/disable button bound to the specified command, if it exists in this toolbar
bool stopCommandInProgress(const LLCommandId& commandId); // stop command if it is currently active
bool flashCommand(const LLCommandId& commandId, bool flash); // flash button associated with given command, if in this toolbar
void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; }
void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } // connects drag and drop behavior to external logic
void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; }
void setHandleDropCallback(tool_handledrop_callback_t cb) { mHandleDropCallback = cb; }
bool isReadOnly() const { return mReadOnly; }
@ -206,18 +206,49 @@ public:
boost::signals2::connection setButtonLeaveCallback(const button_signal_t::slot_type& cb);
boost::signals2::connection setButtonRemoveCallback(const button_signal_t::slot_type& cb);
void setTooltipButtonSuffix(const std::string& suffix) { mButtonTooltipSuffix = suffix; }
// append the specified string to end of tooltip
void setTooltipButtonSuffix(const std::string& suffix) { mButtonTooltipSuffix = suffix; }
LLToolBarEnums::SideType getSideType() const { return mSideType; }
bool hasButtons() const { return !mButtons.empty(); }
bool isModified() const { return mModified; }
protected:
int getRankFromPosition(S32 x, S32 y);
int getRankFromPosition(const LLCommandId& id);
// Methods used in loading and saving toolbar settings
void setButtonType(LLToolBarEnums::ButtonType button_type);
LLToolBarEnums::ButtonType getButtonType() { return mButtonType; }
command_id_list_t& getCommandsList() { return mButtonCommands; }
void clearCommandsList();
private:
friend class LLUICtrlFactory;
LLToolBar(const Params&);
~LLToolBar();
void initFromParams(const Params&);
void createContextMenu();
void updateLayoutAsNeeded();
void createButtons();
void resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row, S32 max_row_girth);
BOOL isSettingChecked(const LLSD& userdata);
void onSettingEnable(const LLSD& userdata);
void onRemoveSelectedCommand();
private:
// static layout state
const bool mReadOnly;
const LLToolBarEnums::SideType mSideType;
const bool mWrap;
const S32 mPadLeft,
mPadRight,
mPadTop,
mPadBottom,
mPadBetween,
mMinGirth;
// drag and drop state
tool_startdrag_callback_t mStartDragItemCallback;
tool_handledrag_callback_t mHandleDragItemCallback;
tool_handledrop_callback_t mHandleDropCallback;
@ -227,49 +258,25 @@ protected:
mDragy,
mDragGirth;
public:
// Methods used in loading and saving toolbar settings
void setButtonType(LLToolBarEnums::ButtonType button_type);
LLToolBarEnums::ButtonType getButtonType() { return mButtonType; }
command_id_list_t& getCommandsList() { return mButtonCommands; }
void clearCommandsList();
private:
void createContextMenu();
void updateLayoutAsNeeded();
void createButtons();
void resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row, S32 max_row_girth);
BOOL isSettingChecked(const LLSD& userdata);
void onSettingEnable(const LLSD& userdata);
const bool mReadOnly;
typedef std::list<LLToolBarButton*> toolbar_button_list;
typedef std::map<LLUUID, LLToolBarButton*> command_id_map;
toolbar_button_list mButtons;
command_id_list_t mButtonCommands;
typedef std::map<LLUUID, LLToolBarButton*> command_id_map;
command_id_map mButtonMap;
LLToolBarEnums::ButtonType mButtonType;
LLLayoutStack* mCenteringStack;
LLLayoutStack* mWrapStack;
LLPanel* mButtonPanel;
LLToolBarEnums::SideType mSideType;
bool mWrap;
bool mNeedsLayout;
bool mModified;
S32 mPadLeft,
mPadRight,
mPadTop,
mPadBottom,
mPadBetween,
mMinGirth;
LLToolBarButton::Params mButtonParams[LLToolBarEnums::BTNTYPE_COUNT];
// related widgets
LLLayoutStack* mCenteringStack;
LLPanel* mButtonPanel;
LLHandle<class LLContextMenu> mPopupMenuHandle;
LLToolBarButton* mRightMouseTargetButton;
bool mNeedsLayout;
bool mModified;
button_signal_t* mButtonAddSignal;
button_signal_t* mButtonEnterSignal;
button_signal_t* mButtonLeaveSignal;

View File

@ -33,28 +33,28 @@
#include "llurlregistry.h"
// global state for the callback functions
void (*LLUrlAction::sOpenURLCallback) (const std::string& url) = NULL;
void (*LLUrlAction::sOpenURLInternalCallback) (const std::string& url) = NULL;
void (*LLUrlAction::sOpenURLExternalCallback) (const std::string& url) = NULL;
bool (*LLUrlAction::sExecuteSLURLCallback) (const std::string& url) = NULL;
LLUrlAction::url_callback_t LLUrlAction::sOpenURLCallback;
LLUrlAction::url_callback_t LLUrlAction::sOpenURLInternalCallback;
LLUrlAction::url_callback_t LLUrlAction::sOpenURLExternalCallback;
LLUrlAction::execute_url_callback_t LLUrlAction::sExecuteSLURLCallback;
void LLUrlAction::setOpenURLCallback(void (*cb) (const std::string& url))
void LLUrlAction::setOpenURLCallback(url_callback_t cb)
{
sOpenURLCallback = cb;
}
void LLUrlAction::setOpenURLInternalCallback(void (*cb) (const std::string& url))
void LLUrlAction::setOpenURLInternalCallback(url_callback_t cb)
{
sOpenURLInternalCallback = cb;
}
void LLUrlAction::setOpenURLExternalCallback(void (*cb) (const std::string& url))
void LLUrlAction::setOpenURLExternalCallback(url_callback_t cb)
{
sOpenURLExternalCallback = cb;
}
void LLUrlAction::setExecuteSLURLCallback(bool (*cb) (const std::string& url))
void LLUrlAction::setExecuteSLURLCallback(execute_url_callback_t cb)
{
sExecuteSLURLCallback = cb;
}
@ -63,7 +63,7 @@ void LLUrlAction::openURL(std::string url)
{
if (sOpenURLCallback)
{
(*sOpenURLCallback)(url);
sOpenURLCallback(url);
}
}
@ -71,7 +71,7 @@ void LLUrlAction::openURLInternal(std::string url)
{
if (sOpenURLInternalCallback)
{
(*sOpenURLInternalCallback)(url);
sOpenURLInternalCallback(url);
}
}
@ -79,7 +79,7 @@ void LLUrlAction::openURLExternal(std::string url)
{
if (sOpenURLExternalCallback)
{
(*sOpenURLExternalCallback)(url);
sOpenURLExternalCallback(url);
}
}
@ -87,18 +87,18 @@ void LLUrlAction::executeSLURL(std::string url)
{
if (sExecuteSLURLCallback)
{
(*sExecuteSLURLCallback)(url);
sExecuteSLURLCallback(url);
}
}
void LLUrlAction::clickAction(std::string url)
{
// Try to handle as SLURL first, then http Url
if ( (sExecuteSLURLCallback) && !(*sExecuteSLURLCallback)(url) )
if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url) )
{
if (sOpenURLCallback)
{
(*sOpenURLCallback)(url);
sOpenURLCallback(url);
}
}
}

View File

@ -29,6 +29,7 @@
#define LL_LLURLACTION_H
#include <string>
#include <boost/function.hpp>
///
/// The LLUrlAction class provides a number of static functions that
@ -77,17 +78,21 @@ public:
static void showProfile(std::string url);
/// specify the callbacks to enable this class's functionality
static void setOpenURLCallback(void (*cb) (const std::string& url));
static void setOpenURLInternalCallback(void (*cb) (const std::string& url));
static void setOpenURLExternalCallback(void (*cb) (const std::string& url));
static void setExecuteSLURLCallback(bool (*cb) (const std::string& url));
typedef boost::function<void (const std::string&)> url_callback_t;
typedef boost::function<bool(const std::string& url)> execute_url_callback_t;
static void setOpenURLCallback(url_callback_t cb);
static void setOpenURLInternalCallback(url_callback_t cb);
static void setOpenURLExternalCallback(url_callback_t cb);
static void setExecuteSLURLCallback(execute_url_callback_t cb);
private:
// callbacks for operations we can perform on Urls
static void (*sOpenURLCallback) (const std::string& url);
static void (*sOpenURLInternalCallback) (const std::string& url);
static void (*sOpenURLExternalCallback) (const std::string& url);
static bool (*sExecuteSLURLCallback) (const std::string& url);
static url_callback_t sOpenURLCallback;
static url_callback_t sOpenURLInternalCallback;
static url_callback_t sOpenURLExternalCallback;
static execute_url_callback_t sExecuteSLURLCallback;
};
#endif

View File

@ -2544,8 +2544,8 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
{
// This is where we would constrain move/resize to a particular screen
const S32 MIN_WIDTH = 320;
const S32 MIN_HEIGHT = 240;
const S32 MIN_WIDTH = 1024;
const S32 MIN_HEIGHT = 768;
Rect currentBounds;
Rect previousBounds;

View File

@ -63,6 +63,9 @@ extern BOOL gDebugWindowProc;
const S32 MAX_NUM_RESOLUTIONS = 200;
const S32 MIN_WINDOW_WIDTH = 1024;
const S32 MIN_WINDOW_HEIGHT = 768;
// static variable for ATI mouse cursor crash work-around:
static bool ATIbug = false;
@ -1842,11 +1845,15 @@ void LLWindowSDL::gatherInput()
break;
case SDL_VIDEORESIZE: // *FIX: handle this?
{
llinfos << "Handling a resize event: " << event.resize.w <<
"x" << event.resize.h << llendl;
S32 width = llmax(event.resize.w, MIN_WINDOW_WIDTH);
S32 height = llmax(event.resize.h, MIN_WINDOW_HEIGHT);
// *FIX: I'm not sure this is necessary!
mWindow = SDL_SetVideoMode(event.resize.w, event.resize.h, 32, mSDLFlags);
mWindow = SDL_SetVideoMode(width, height, 32, mSDLFlags);
if (!mWindow)
{
// *FIX: More informative dialog?
@ -1860,9 +1867,9 @@ void LLWindowSDL::gatherInput()
break;
}
mCallbacks->handleResize(this, event.resize.w, event.resize.h );
mCallbacks->handleResize(this, width, height);
break;
}
case SDL_ACTIVEEVENT:
if (event.active.state & SDL_APPINPUTFOCUS)
{

View File

@ -1032,6 +1032,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
mhInstance,
NULL);
LL_INFOS("Window") << "window is created." << llendl ;
//-----------------------------------------------------------------------
// Create GL drawing context
//-----------------------------------------------------------------------
@ -1121,6 +1123,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
LL_INFOS("Window") << "Drawing context is created." << llendl ;
gGLManager.initWGL();
if (wglChoosePixelFormatARB)
@ -1257,7 +1261,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL;
}
LL_INFOS("Window") << "pixel formats done." << llendl ;
S32 swap_method = 0;
S32 cur_format = num_formats-1;
@ -1307,6 +1311,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
mhInstance,
NULL);
LL_INFOS("Window") << "recreate window done." << llendl ;
if (!(mhDC = GetDC(mWindowHandle)))
{
close();
@ -2401,6 +2407,14 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
return 0;
}
case WM_GETMINMAXINFO:
{
LPMINMAXINFO min_max = (LPMINMAXINFO)l_param;
min_max->ptMinTrackSize.x = 1024;
min_max->ptMinTrackSize.y = 768;
return 0;
}
case WM_SIZE:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_SIZE");

View File

@ -25,12 +25,11 @@
* $/LicenseInfo$
* @endcond
*/
#include "llqtwebkit.h"
#include "linden_common.h"
#include "indra_constants.h" // for indra keyboard codes
#include "lltimer.h"
#include "llgl.h"
#include "llplugininstance.h"
@ -117,15 +116,19 @@ private:
F32 mBackgroundG;
F32 mBackgroundB;
std::string mTarget;
LLTimer mElapsedTime;
VolumeCatcher mVolumeCatcher;
void postDebugMessage( const std::string& msg )
{
if ( mEnableMediaPluginDebugging )
{
std::stringstream str;
str << "@Media Msg> " << "[" << (double)mElapsedTime.getElapsedTimeF32() << "] -- " << msg;
LLPluginMessage debug_message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "debug_message");
debug_message.setValue("message_text", "Media> " + msg);
debug_message.setValue("message_text", str.str());
debug_message.setValue("message_level", "info");
sendMessage(debug_message);
}
@ -323,7 +326,11 @@ private:
LLQtWebKit::getInstance()->enablePlugins( mPluginsEnabled );
// turn on/off Javascript based on what host app tells us
#if LLQTWEBKIT_API_VERSION >= 11
LLQtWebKit::getInstance()->enableJavaScript( mJavascriptEnabled );
#else
LLQtWebKit::getInstance()->enableJavascript( mJavascriptEnabled );
#endif
std::stringstream str;
str << "Cookies enabled = " << mCookiesEnabled << ", plugins enabled = " << mPluginsEnabled << ", Javascript enabled = " << mJavascriptEnabled;
@ -346,7 +353,7 @@ private:
// append details to agent string
LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent );
postDebugMessage( "Updating user agent with " + mUserAgent );
#if !LL_QTWEBKIT_USES_PIXMAPS
// don't flip bitmap
LLQtWebKit::getInstance()->flipWindow( mBrowserWindowId, true );
@ -374,7 +381,17 @@ private:
url << "%22%3E%3C/body%3E%3C/html%3E";
//lldebugs << "data url is: " << url.str() << llendl;
// loading overlay debug screen follows media debugging flag from client for now.
#if LLQTWEBKIT_API_VERSION >= 16
LLQtWebKit::getInstance()->enableLoadingOverlay(mBrowserWindowId, mEnableMediaPluginDebugging);
#else
llwarns << "Ignoring enableLoadingOverlay() call (llqtwebkit version is too old)." << llendl;
#endif
str.clear();
str << "Loading overlay enabled = " << mEnableMediaPluginDebugging << " for mBrowserWindowId = " << mBrowserWindowId;
postDebugMessage( str.str() );
LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, url.str() );
// LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, "about:blank" );
@ -583,6 +600,10 @@ private:
// These could be passed through as well, but aren't really needed.
// message.setValue("uri", event.getEventUri());
// message.setValueBoolean("dead", (event.getIntValue() != 0))
// debug spam
postDebugMessage( "Sending cookie_set message from plugin: " + event.getStringValue() );
sendMessage(message);
}
@ -863,6 +884,8 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_
mPluginsEnabled = true; // default to on
mEnableMediaPluginDebugging = false;
mUserAgent = "LLPluginMedia Web Browser";
mElapsedTime.reset();
}
MediaPluginWebKit::~MediaPluginWebKit()
@ -1210,7 +1233,6 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
{
mEnableMediaPluginDebugging = message_in.getValueBoolean( "enable" );
}
else
if(message_name == "js_enable_object")
{
@ -1298,6 +1320,15 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
mFirstFocus = false;
}
}
else if(message_name == "set_page_zoom_factor")
{
#if LLQTWEBKIT_API_VERSION >= 15
F32 factor = message_in.getValueReal("factor");
LLQtWebKit::getInstance()->setPageZoomFactor(factor);
#else
llwarns << "Ignoring setPageZoomFactor message (llqtwebkit version is too old)." << llendl;
#endif
}
else if(message_name == "clear_cache")
{
LLQtWebKit::getInstance()->clearCache();
@ -1324,6 +1355,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
else if(message_name == "set_cookies")
{
LLQtWebKit::getInstance()->setCookies(message_in.getValue("cookies"));
// debug spam
postDebugMessage( "Plugin setting cookie: " + message_in.getValue("cookies") );
}
else if(message_name == "proxy_setup")
{

View File

@ -207,7 +207,6 @@ set(viewer_SOURCE_FILES
llfloaterland.cpp
llfloaterlandholdings.cpp
llfloatermap.cpp
llfloatermediabrowser.cpp
llfloatermediasettings.cpp
llfloatermemleak.cpp
llfloatermodelpreview.cpp
@ -219,7 +218,6 @@ set(viewer_SOURCE_FILES
llfloateropenobject.cpp
llfloaterpay.cpp
llfloaterperms.cpp
llfloaterpostcard.cpp
llfloaterpostprocess.cpp
llfloaterpreference.cpp
llfloaterproperties.cpp
@ -396,6 +394,12 @@ set(viewer_SOURCE_FILES
llpanelprimmediacontrols.cpp
llpanelprofile.cpp
llpanelprofileview.cpp
llpanelsnapshot.cpp
llpanelsnapshotinventory.cpp
llpanelsnapshotlocal.cpp
llpanelsnapshotoptions.cpp
llpanelsnapshotpostcard.cpp
llpanelsnapshotprofile.cpp
llpanelteleporthistory.cpp
llpaneltiptoast.cpp
llpanelvoiceeffect.cpp
@ -414,6 +418,7 @@ set(viewer_SOURCE_FILES
llpopupview.cpp
llpolymesh.cpp
llpolymorph.cpp
llpostcard.cpp
llpreview.cpp
llpreviewanim.cpp
llpreviewgesture.cpp
@ -599,6 +604,7 @@ set(viewer_SOURCE_FILES
llwearablelist.cpp
llwearabletype.cpp
llweb.cpp
llwebprofile.cpp
llwebsharing.cpp
llwind.cpp
llwindowlistener.cpp
@ -756,7 +762,6 @@ set(viewer_HEADER_FILES
llfloaterland.h
llfloaterlandholdings.h
llfloatermap.h
llfloatermediabrowser.h
llfloatermediasettings.h
llfloatermemleak.h
llfloatermodelpreview.h
@ -768,7 +773,6 @@ set(viewer_HEADER_FILES
llfloateropenobject.h
llfloaterpay.h
llfloaterperms.h
llfloaterpostcard.h
llfloaterpostprocess.h
llfloaterpreference.h
llfloaterproperties.h
@ -939,6 +943,7 @@ set(viewer_HEADER_FILES
llpanelprimmediacontrols.h
llpanelprofile.h
llpanelprofileview.h
llpanelsnapshot.h
llpanelteleporthistory.h
llpaneltiptoast.h
llpanelvoicedevicesettings.h
@ -957,6 +962,7 @@ set(viewer_HEADER_FILES
llpolymesh.h
llpolymorph.h
llpopupview.h
llpostcard.h
llpreview.h
llpreviewanim.h
llpreviewgesture.h
@ -1145,6 +1151,7 @@ set(viewer_HEADER_FILES
llwearablelist.h
llwearabletype.h
llweb.h
llwebprofile.h
llwebsharing.h
llwind.h
llwindowlistener.h

View File

@ -1617,17 +1617,6 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>CloseSnapshotOnKeep</key>
<map>
<key>Comment</key>
<string>Close snapshot window after saving snapshot</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>CmdLineDisableVoice</key>
<map>
<key>Comment</key>
@ -2642,17 +2631,6 @@
<key>Value</key>
<integer>-1</integer>
</map>
<key>DebugToolbarFUI</key>
<map>
<key>Comment</key>
<string>Turn on the FUI Toolbars</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>DebugViews</key>
<map>
<key>Comment</key>
@ -4668,6 +4646,17 @@
<string>0.0.0</string>
</map>
<key>LastSnapshotToProfileHeight</key>
<map>
<key>Comment</key>
<string>The height of the last profile snapshot, in px</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>768</integer>
</map>
<key>LastSnapshotToEmailHeight</key>
<map>
<key>Comment</key>
@ -4679,6 +4668,17 @@
<key>Value</key>
<integer>768</integer>
</map>
<key>LastSnapshotToProfileWidth</key>
<map>
<key>Comment</key>
<string>The width of the last profile snapshot, in px</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>1024</integer>
</map>
<key>LastSnapshotToEmailWidth</key>
<map>
<key>Comment</key>
@ -4734,17 +4734,6 @@
<key>Value</key>
<integer>512</integer>
</map>
<key>LastSnapshotType</key>
<map>
<key>Comment</key>
<string>Select this as next type of snapshot to take (0 = postcard, 1 = texture, 2 = local image)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>LeftClickShowMenu</key>
<map>
<key>Comment</key>
@ -10401,6 +10390,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>SnapshotProfileLastResolution</key>
<map>
<key>Comment</key>
<string>Take next profile snapshot at this resolution</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>SnapshotPostcardLastResolution</key>
<map>
<key>Comment</key>

View File

@ -36,7 +36,7 @@
<key>DisplayDestinationsOnInitialRun</key>
<map>
<key>Comment</key>
<string>Display the destinations guide when a user first launches FUI.</string>
<string>Display the destinations guide when a user first launches Second Life.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>

View File

@ -115,6 +115,7 @@ Var COMMANDLINE ; command line passed to this installer, set in .onInit
Var SHORTCUT_LANG_PARAM ; "--set InstallLanguage de", passes language to viewer
Var SKIP_DIALOGS ; set from command line in .onInit. autoinstall
; GUI and the defaults.
Var DO_UNINSTALL_V2 ; If non-null, path to a previous Viewer 2 installation that will be uninstalled.
;;; Function definitions should go before file includes, because calls to
;;; DLLs like LangDLL trigger an implicit file include, so if that call is at
@ -310,6 +311,29 @@ Function CheckNetworkConnection
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Function CheckWillUninstallV2
;
; If we are being called through auto-update, we need to uninstall any
; existing V2 installation. Otherwise, we wind up with
; SecondLifeViewer2 and SecondLifeViewer installations existing side
; by side no indication which to use.
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function CheckWillUninstallV2
StrCpy $DO_UNINSTALL_V2 ""
StrCmp $SKIP_DIALOGS "true" 0 CHECKV2_DONE
StrCmp $INSTDIR "$PROGRAMFILES\SecondLifeViewer2" CHECKV2_DONE ; don't uninstall our own install dir.
IfFileExists "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" CHECKV2_FOUND CHECKV2_DONE
CHECKV2_FOUND:
StrCpy $DO_UNINSTALL_V2 "true"
CHECKV2_DONE:
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Save user files to temp location
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -334,7 +358,7 @@ Push $2
ExpandEnvStrings $2 $2
CreateDirectory "$TEMP\SecondLifeSettingsBackup\$0"
CopyFiles "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\$0"
CopyFiles /SILENT "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\$0"
CONTINUE:
IntOp $0 $0 + 1
@ -350,7 +374,7 @@ Push $0
ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
StrCmp $0 "" +2
CreateDirectory "$TEMP\SecondLifeSettingsBackup\AllUsers\"
CopyFiles "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\AllUsers\"
CopyFiles /SILENT "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\AllUsers\"
Pop $0
FunctionEnd
@ -377,7 +401,7 @@ Push $2
ExpandEnvStrings $2 $2
CreateDirectory "$2\Application Data\SecondLife\"
CopyFiles "$TEMP\SecondLifeSettingsBackup\$0\*" "$2\Application Data\SecondLife\"
CopyFiles /SILENT "$TEMP\SecondLifeSettingsBackup\$0\*" "$2\Application Data\SecondLife\"
CONTINUE:
IntOp $0 $0 + 1
@ -393,11 +417,53 @@ Push $0
ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
StrCmp $0 "" +2
CreateDirectory "$2\Application Data\SecondLife\"
CopyFiles "$TEMP\SecondLifeSettingsBackup\AllUsers\*" "$2\Application Data\SecondLife\"
CopyFiles /SILENT "$TEMP\SecondLifeSettingsBackup\AllUsers\*" "$2\Application Data\SecondLife\"
Pop $0
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Remove temp dirs
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function RemoveTempUserFiles
Push $0
Push $1
Push $2
StrCpy $0 0 ; Index number used to iterate via EnumRegKey
LOOP:
EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
StrCmp $1 "" DONE ; no more users
ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing
; Required since ProfileImagePath is of type REG_EXPAND_SZ
ExpandEnvStrings $2 $2
RMDir /r "$TEMP\SecondLifeSettingsBackup\$0\*"
CONTINUE:
IntOp $0 $0 + 1
Goto LOOP
DONE:
Pop $2
Pop $1
Pop $0
; Copy files in Documents and Settings\All Users\SecondLife
Push $0
ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
StrCmp $0 "" +2
RMDir /r "$TEMP\SecondLifeSettingsBackup\AllUsers\*"
Pop $0
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Clobber user files - TEST ONLY
; This is here for testing, generally not desirable to call it.
@ -864,9 +930,12 @@ Call CheckIfAdministrator ; Make sure the user can install/uninstall
Call CheckIfAlreadyCurrent ; Make sure that we haven't already installed this version
Call CloseSecondLife ; Make sure we're not running
Call CheckNetworkConnection ; ping secondlife.com
Call CheckWillUninstallV2 ; See if a V2 install exists and will be removed.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Call PreserveUserFiles
StrCmp $DO_UNINSTALL_V2 "" PRESERVE_DONE
Call PreserveUserFiles
PRESERVE_DONE:
;;; Don't remove cache files during a regular install, removing the inventory cache on upgrades results in lots of damage to the servers.
;Call RemoveCacheFiles ; Installing over removes potentially corrupted
@ -951,17 +1020,15 @@ WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" ""
; write out uninstaller
WriteUninstaller "$INSTDIR\uninst.exe"
; Remove existing "Second Life Viewer 2" install if any.
StrCmp $INSTDIR "$PROGRAMFILES\SecondLifeViewer2" SLV2_DONE ; unless that's the install directory
IfFileExists "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" SLV2_FOUND SLV2_DONE
; Uninstall existing "Second Life Viewer 2" install if needed.
StrCmp $DO_UNINSTALL_V2 "" REMOVE_SLV2_DONE
ExecWait '"$PROGRAMFILES\SecondLifeViewer2\uninst.exe" /S _?=$PROGRAMFILES\SecondLifeViewer2'
Delete "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" ; with _? option above, uninst.exe will be left behind.
RMDir "$PROGRAMFILES\SecondLifeViewer2" ; will remove only if empty.
SLV2_FOUND:
ExecWait '"$PROGRAMFILES\SecondLifeViewer2\uninst.exe" /S _?=$PROGRAMFILES\SecondLifeViewer2'
Delete "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" ; with _? option above, uninst.exe will be left behind.
RMDir "$PROGRAMFILES\SecondLifeViewer2" ; will remove only if empty.
SLV2_DONE:
Call RestoreUserFiles
Call RestoreUserFiles
Call RemoveTempUserFiles
REMOVE_SLV2_DONE:
; end of default section
SectionEnd

View File

@ -1101,20 +1101,11 @@ F32 LLAgent::clampPitchToLimits(F32 angle)
LLVector3 skyward = getReferenceUpVector();
F32 look_down_limit;
F32 look_up_limit = 10.f * DEG_TO_RAD;
const F32 look_down_limit = 179.f * DEG_TO_RAD;;
const F32 look_up_limit = 1.f * DEG_TO_RAD;
F32 angle_from_skyward = acos( mFrameAgent.getAtAxis() * skyward );
if (isAgentAvatarValid() && gAgentAvatarp->isSitting())
{
look_down_limit = 130.f * DEG_TO_RAD;
}
else
{
look_down_limit = 170.f * DEG_TO_RAD;
}
// clamp pitch to limits
if ((angle >= 0.f) && (angle_from_skyward + angle > look_down_limit))
{

View File

@ -813,9 +813,9 @@ bool LLAppViewer::init()
LLWeb::initClass(); // do this after LLUI
// Provide the text fields with callbacks for opening Urls
LLUrlAction::setOpenURLCallback(&LLWeb::loadURL);
LLUrlAction::setOpenURLInternalCallback(&LLWeb::loadURLInternal);
LLUrlAction::setOpenURLExternalCallback(&LLWeb::loadURLExternal);
LLUrlAction::setOpenURLCallback(boost::bind(&LLWeb::loadURL, _1, LLStringUtil::null, LLStringUtil::null));
LLUrlAction::setOpenURLInternalCallback(boost::bind(&LLWeb::loadURLInternal, _1, LLStringUtil::null, LLStringUtil::null));
LLUrlAction::setOpenURLExternalCallback(boost::bind(&LLWeb::loadURLExternal, _1, true, LLStringUtil::null));
LLUrlAction::setExecuteSLURLCallback(&LLURLDispatcher::dispatchFromTextEditor);
// Let code in llui access the viewer help floater
@ -1934,6 +1934,8 @@ bool LLAppViewer::initThreads()
static const bool enable_threads = true;
#endif
LLImage::initClass();
LLVFSThread::initClass(enable_threads && false);
LLLFSThread::initClass(enable_threads && false);
@ -1943,8 +1945,7 @@ bool LLAppViewer::initThreads()
LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(),
sImageDecodeThread,
enable_threads && true,
app_metrics_qa_mode);
LLImage::initClass();
app_metrics_qa_mode);
if (LLFastTimer::sLog || LLFastTimer::sMetricLog)
{
@ -3048,6 +3049,8 @@ void LLAppViewer::handleViewerCrash()
llinfos << "Last render pool type: " << LLPipeline::sCurRenderPoolType << llendl ;
LLMemory::logMemoryInfo(true) ;
//print out recorded call stacks if there are any.
LLError::LLCallStacks::print();

View File

@ -403,11 +403,9 @@ bool LLAppViewerWin32::initHardwareTest()
//
if (FALSE == gSavedSettings.getBOOL("NoHardwareProbe"))
{
BOOL vram_only = !gSavedSettings.getBOOL("ProbeHardwareOnStartup");
// per DEV-11631 - disable hardware probing for everything
// but vram.
vram_only = TRUE;
BOOL vram_only = TRUE;
LLSplashScreen::update(LLTrans::getString("StartupDetectingHardware"));

View File

@ -78,6 +78,8 @@ void on_new_single_inventory_upload_complete(
const LLSD& server_response,
S32 upload_price)
{
bool success = false;
if ( upload_price > 0 )
{
// this upload costed us L$, update our balance
@ -152,6 +154,7 @@ void on_new_single_inventory_upload_complete(
gInventory.updateItem(item);
gInventory.notifyObservers();
success = true;
// Show the preview panel for textures and sounds to let
// user know that the image (or snapshot) arrived intact.
@ -175,6 +178,13 @@ void on_new_single_inventory_upload_complete(
// remove the "Uploading..." message
LLUploadDialog::modalUploadFinished();
// Let the Snapshot floater know we have finished uploading a snapshot to inventory.
LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot");
if (asset_type == LLAssetType::AT_TEXTURE && floater_snapshot)
{
floater_snapshot->notify(LLSD().with("set-finished", LLSD().with("ok", success).with("msg", "inventory")));
}
}
LLAssetUploadResponder::LLAssetUploadResponder(const LLSD &post_data,
@ -285,6 +295,11 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content)
{
// remove the "Uploading..." message
LLUploadDialog::modalUploadFinished();
LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot");
if (floater_snapshot)
{
floater_snapshot->notify(LLSD().with("set-finished", LLSD().with("ok", false).with("msg", "inventory")));
}
std::string reason = content["state"];
// deal with L$ errors

View File

@ -599,7 +599,11 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con
if (tool_dad->getSource() == LLToolDragAndDrop::SOURCE_NOTECARD)
{
viewer_item->setType(LLAssetType::AT_LANDMARK);
copy_inventory_from_notecard(tool_dad->getObjectID(), tool_dad->getSourceID(), viewer_item.get(), gInventoryCallbacks.registerCB(cb));
copy_inventory_from_notecard(favorites_id,
tool_dad->getObjectID(),
tool_dad->getSourceID(),
viewer_item.get(),
gInventoryCallbacks.registerCB(cb));
}
else
{
@ -1016,7 +1020,9 @@ void LLFavoritesBarCtrl::addOpenLandmarksMenuItem(LLToggleableMenu* menu)
LLMenuItemCallGL::Params item_params;
item_params.name("open_my_landmarks");
item_params.label(translated ? label_transl: label_untrans);
item_params.on_click.function(boost::bind(&LLFloaterSidePanelContainer::showPanel, "places", LLSD()));
LLSD key;
key["type"] = "open_landmark_tab";
item_params.on_click.function(boost::bind(&LLFloaterSidePanelContainer::showPanel, "places", key));
LLMenuItemCallGL* menu_item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params);
fitLabelWidth(menu_item);
@ -1197,7 +1203,9 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
LLToggleableMenu* menu = (LLToggleableMenu*) mOverflowMenuHandle.get();
if (mRestoreOverflowMenu && menu && !menu->getVisible())
{
menu->resetScrollPositionOnShow(false);
showDropDownMenu();
menu->resetScrollPositionOnShow(true);
}
}

View File

@ -1,5 +1,5 @@
/**
* @file llfloatermediabrowser.h
* @file llfloaterhelpbrowser.h
* @brief HTML Help floater - uses embedded web browser control
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$

View File

@ -433,7 +433,6 @@ BOOL LLPanelLandGeneral::postBuild()
mTextDwell = getChild<LLTextBox>("DwellText");
mBtnBuyLand = getChild<LLButton>("Buy Land...");
mBtnBuyLand->setClickedCallback(onClickBuyLand, (void*)&BUY_PERSONAL_LAND);
@ -696,20 +695,26 @@ void LLPanelLandGeneral::refresh()
S32 area;
S32 claim_price;
S32 rent_price;
F32 dwell;
F32 dwell = DWELL_NAN;
LLViewerParcelMgr::getInstance()->getDisplayInfo(&area,
&claim_price,
&rent_price,
&for_sale,
&dwell);
// Area
LLUIString price = getString("area_size_text");
price.setArg("[AREA]", llformat("%d",area));
mTextPriceLabel->setText(getString("area_text"));
mTextPrice->setText(price.getString());
mTextDwell->setText(llformat("%.0f", dwell));
if (dwell == DWELL_NAN)
{
mTextDwell->setText(LLTrans::getString("LoadingData"));
}
else
{
mTextDwell->setText(llformat("%.0f", dwell));
}
if (for_sale)
{

View File

@ -1,462 +0,0 @@
/**
* @file llfloatermediabrowser.cpp
* @brief media browser floater - uses embedded media browser control
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llfloatermediabrowser.h"
#include "llfloaterreg.h"
#include "llparcel.h"
#include "llpluginclassmedia.h"
#include "lluictrlfactory.h"
#include "llmediactrl.h"
#include "llviewerwindow.h"
#include "llviewercontrol.h"
#include "llviewerparcelmgr.h"
#include "llweb.h"
#include "llui.h"
#include "roles_constants.h"
#include "llurlhistory.h"
#include "llmediactrl.h"
#include "llviewermedia.h"
#include "llviewerparcelmedia.h"
#include "llcombobox.h"
#include "llwindow.h"
#include "lllayoutstack.h"
#include "llcheckboxctrl.h"
#include "llnotifications.h"
// TEMP
#include "llsdutil.h"
LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& key)
: LLFloater(key)
{
}
//static
void LLFloaterMediaBrowser::create(const std::string &url, const std::string& target, const std::string& uuid)
{
lldebugs << "url = " << url << ", target = " << target << ", uuid = " << uuid << llendl;
std::string tag = target;
if(target.empty() || target == "_blank")
{
if(!uuid.empty())
{
tag = uuid;
}
else
{
// create a unique tag for this instance
LLUUID id;
id.generate();
tag = id.asString();
}
}
S32 browser_window_limit = gSavedSettings.getS32("MediaBrowserWindowLimit");
if(LLFloaterReg::findInstance("media_browser", tag) != NULL)
{
// There's already a media browser for this tag, so we won't be opening a new window.
}
else if(browser_window_limit != 0)
{
// showInstance will open a new window. Figure out how many media browsers are already open,
// and close the least recently opened one if this will put us over the limit.
LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList("media_browser");
lldebugs << "total instance count is " << instances.size() << llendl;
for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++)
{
lldebugs << " " << (*iter)->getKey() << llendl;
}
if(instances.size() >= (size_t)browser_window_limit)
{
// Destroy the least recently opened instance
(*instances.begin())->closeFloater();
}
}
LLFloaterMediaBrowser *browser = dynamic_cast<LLFloaterMediaBrowser*> (LLFloaterReg::showInstance("media_browser", tag));
llassert(browser);
if(browser)
{
browser->mUUID = uuid;
// tell the browser instance to load the specified URL
browser->openMedia(url, target);
LLViewerMedia::proxyWindowOpened(target, uuid);
}
}
//static
void LLFloaterMediaBrowser::closeRequest(const std::string &uuid)
{
LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("media_browser");
lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl;
for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
{
LLFloaterMediaBrowser* i = dynamic_cast<LLFloaterMediaBrowser*>(*iter);
lldebugs << " " << i->mUUID << llendl;
if (i && i->mUUID == uuid)
{
i->closeFloater(false);
return;
}
}
}
//static
void LLFloaterMediaBrowser::geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height)
{
LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("media_browser");
lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl;
for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
{
LLFloaterMediaBrowser* i = dynamic_cast<LLFloaterMediaBrowser*>(*iter);
lldebugs << " " << i->mUUID << llendl;
if (i && i->mUUID == uuid)
{
i->geometryChanged(x, y, width, height);
return;
}
}
}
void LLFloaterMediaBrowser::geometryChanged(S32 x, S32 y, S32 width, S32 height)
{
// Make sure the layout of the browser control is updated, so this calculation is correct.
LLLayoutStack::updateClass();
// TODO: need to adjust size and constrain position to make sure floaters aren't moved outside the window view, etc.
LLCoordWindow window_size;
getWindow()->getSize(&window_size);
// Adjust width and height for the size of the chrome on the Media Browser window.
width += getRect().getWidth() - mBrowser->getRect().getWidth();
height += getRect().getHeight() - mBrowser->getRect().getHeight();
LLRect geom;
geom.setOriginAndSize(x, window_size.mY - (y + height), width, height);
lldebugs << "geometry change: " << geom << llendl;
handleReshape(geom,false);
}
void LLFloaterMediaBrowser::draw()
{
getChildView("go")->setEnabled(!mAddressCombo->getValue().asString().empty());
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if(parcel)
{
getChildView("parcel_owner_controls")->setVisible( LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA));
getChildView("assign")->setEnabled(!mAddressCombo->getValue().asString().empty());
}
bool show_time_controls = false;
bool media_playing = false;
if(mBrowser)
{
LLPluginClassMedia* media_plugin = mBrowser->getMediaPlugin();
if(media_plugin)
{
show_time_controls = media_plugin->pluginSupportsMediaTime();
media_playing = media_plugin->getStatus() == LLPluginClassMediaOwner::MEDIA_PLAYING;
}
}
getChildView("rewind")->setVisible( show_time_controls);
getChildView("play")->setVisible( show_time_controls && ! media_playing);
getChildView("pause")->setVisible( show_time_controls && media_playing);
getChildView("stop")->setVisible( show_time_controls);
getChildView("seek")->setVisible( show_time_controls);
getChildView("play")->setEnabled(! media_playing);
getChildView("stop")->setEnabled(media_playing);
getChildView("back")->setEnabled(mBrowser->canNavigateBack());
getChildView("forward")->setEnabled(mBrowser->canNavigateForward());
LLFloater::draw();
}
BOOL LLFloaterMediaBrowser::postBuild()
{
mBrowser = getChild<LLMediaCtrl>("browser");
mBrowser->addObserver(this);
mAddressCombo = getChild<LLComboBox>("address");
mAddressCombo->setCommitCallback(onEnterAddress, this);
mAddressCombo->sortByName();
childSetAction("back", onClickBack, this);
childSetAction("forward", onClickForward, this);
childSetAction("reload", onClickRefresh, this);
childSetAction("rewind", onClickRewind, this);
childSetAction("play", onClickPlay, this);
childSetAction("stop", onClickStop, this);
childSetAction("pause", onClickPlay, this);
childSetAction("seek", onClickSeek, this);
childSetAction("go", onClickGo, this);
childSetAction("close", onClickClose, this);
childSetAction("open_browser", onClickOpenWebBrowser, this);
childSetAction("assign", onClickAssign, this);
buildURLHistory();
return TRUE;
}
void LLFloaterMediaBrowser::buildURLHistory()
{
LLCtrlListInterface* url_list = childGetListInterface("address");
if (url_list)
{
url_list->operateOnAll(LLCtrlListInterface::OP_DELETE);
}
// Get all of the entries in the "browser" collection
LLSD browser_history = LLURLHistory::getURLHistory("browser");
LLSD::array_iterator iter_history =
browser_history.beginArray();
LLSD::array_iterator end_history =
browser_history.endArray();
for(; iter_history != end_history; ++iter_history)
{
std::string url = (*iter_history).asString();
if(! url.empty())
url_list->addSimpleElement(url);
}
// initialize URL history in the plugin
if(mBrowser && mBrowser->getMediaPlugin())
{
mBrowser->getMediaPlugin()->initializeUrlHistory(browser_history);
}
}
std::string LLFloaterMediaBrowser::getSupportURL()
{
return getString("support_page_url");
}
//virtual
void LLFloaterMediaBrowser::onClose(bool app_quitting)
{
LLViewerMedia::proxyWindowClosed(mUUID);
//setVisible(FALSE);
destroy();
}
void LLFloaterMediaBrowser::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
{
if(event == MEDIA_EVENT_LOCATION_CHANGED)
{
setCurrentURL(self->getLocation());
}
else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
{
// This is the event these flags are sent with.
getChildView("back")->setEnabled(self->getHistoryBackAvailable());
getChildView("forward")->setEnabled(self->getHistoryForwardAvailable());
}
else if(event == MEDIA_EVENT_CLOSE_REQUEST)
{
// The browser instance wants its window closed.
closeFloater();
}
else if(event == MEDIA_EVENT_GEOMETRY_CHANGE)
{
geometryChanged(self->getGeometryX(), self->getGeometryY(), self->getGeometryWidth(), self->getGeometryHeight());
}
}
void LLFloaterMediaBrowser::setCurrentURL(const std::string& url)
{
mCurrentURL = url;
mAddressCombo->remove(mCurrentURL);
mAddressCombo->add(mCurrentURL);
mAddressCombo->selectByValue(mCurrentURL);
// Serialize url history
LLURLHistory::removeURL("browser", mCurrentURL);
LLURLHistory::addURL("browser", mCurrentURL);
getChildView("back")->setEnabled(mBrowser->canNavigateBack());
getChildView("forward")->setEnabled(mBrowser->canNavigateForward());
getChildView("reload")->setEnabled(TRUE);
}
//static
void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data)
{
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
self->mBrowser->navigateTo(self->mAddressCombo->getValue().asString());
}
//static
void LLFloaterMediaBrowser::onClickRefresh(void* user_data)
{
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
if( self->mBrowser->getMediaPlugin() && self->mBrowser->getMediaPlugin()->pluginSupportsMediaBrowser())
{
bool ignore_cache = true;
self->mBrowser->getMediaPlugin()->browse_reload( ignore_cache );
}
else
{
self->mBrowser->navigateTo(self->mCurrentURL);
}
}
//static
void LLFloaterMediaBrowser::onClickForward(void* user_data)
{
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
self->mBrowser->navigateForward();
}
//static
void LLFloaterMediaBrowser::onClickBack(void* user_data)
{
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
self->mBrowser->navigateBack();
}
//static
void LLFloaterMediaBrowser::onClickGo(void* user_data)
{
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
self->mBrowser->navigateTo(self->mAddressCombo->getValue().asString());
}
//static
void LLFloaterMediaBrowser::onClickClose(void* user_data)
{
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
self->closeFloater();
}
//static
void LLFloaterMediaBrowser::onClickOpenWebBrowser(void* user_data)
{
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
std::string url = self->mCurrentURL.empty() ?
self->mBrowser->getHomePageUrl() :
self->mCurrentURL;
LLWeb::loadURLExternal(url);
}
void LLFloaterMediaBrowser::onClickAssign(void* user_data)
{
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (!parcel)
{
return;
}
std::string media_url = self->mAddressCombo->getValue().asString();
LLStringUtil::trim(media_url);
if(parcel->getMediaType() != "text/html")
{
parcel->setMediaURL(media_url);
parcel->setMediaCurrentURL(media_url);
parcel->setMediaType(std::string("text/html"));
LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel, true );
LLViewerParcelMedia::sendMediaNavigateMessage(media_url);
LLViewerParcelMedia::stop();
// LLViewerParcelMedia::update( parcel );
}
LLViewerParcelMedia::sendMediaNavigateMessage(media_url);
}
//static
void LLFloaterMediaBrowser::onClickRewind(void* user_data)
{
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
if(self->mBrowser->getMediaPlugin())
self->mBrowser->getMediaPlugin()->start(-2.0f);
}
//static
void LLFloaterMediaBrowser::onClickPlay(void* user_data)
{
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
LLPluginClassMedia* plugin = self->mBrowser->getMediaPlugin();
if(plugin)
{
if(plugin->getStatus() == LLPluginClassMediaOwner::MEDIA_PLAYING)
{
plugin->pause();
}
else
{
plugin->start();
}
}
}
//static
void LLFloaterMediaBrowser::onClickStop(void* user_data)
{
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
if(self->mBrowser->getMediaPlugin())
self->mBrowser->getMediaPlugin()->stop();
}
//static
void LLFloaterMediaBrowser::onClickSeek(void* user_data)
{
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
if(self->mBrowser->getMediaPlugin())
self->mBrowser->getMediaPlugin()->start(2.0f);
}
void LLFloaterMediaBrowser::openMedia(const std::string& media_url, const std::string& target)
{
mBrowser->setHomePageUrl(media_url);
mBrowser->setTarget(target);
mBrowser->navigateTo(media_url);
setCurrentURL(media_url);
}

View File

@ -1,86 +0,0 @@
/**
* @file llfloatermediabrowser.h
* @brief media browser floater - uses embedded media browser control
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_LLFLOATERMEDIABROWSER_H
#define LL_LLFLOATERMEDIABROWSER_H
#include "llfloater.h"
#include "llmediactrl.h"
class LLComboBox;
class LLMediaCtrl;
class LLNotification;
class LLFloaterMediaBrowser :
public LLFloater,
public LLViewerMediaObserver
{
public:
LOG_CLASS(LLFloaterMediaBrowser);
LLFloaterMediaBrowser(const LLSD& key);
static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null);
static void closeRequest(const std::string &uuid);
static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height);
void geometryChanged(S32 x, S32 y, S32 width, S32 height);
/*virtual*/ BOOL postBuild();
/*virtual*/ void onClose(bool app_quitting);
/*virtual*/ void draw();
// inherited from LLViewerMediaObserver
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
void openMedia(const std::string& media_url, const std::string& target);
void buildURLHistory();
std::string getSupportURL();
void setCurrentURL(const std::string& url);
static void onEnterAddress(LLUICtrl* ctrl, void* user_data);
static void onClickRefresh(void* user_data);
static void onClickBack(void* user_data);
static void onClickForward(void* user_data);
static void onClickGo(void* user_data);
static void onClickClose(void* user_data);
static void onClickOpenWebBrowser(void* user_data);
static void onClickAssign(void* user_data);
static void onClickRewind(void* user_data);
static void onClickPlay(void* user_data);
static void onClickStop(void* user_data);
static void onClickSeek(void* user_data);
private:
LLMediaCtrl* mBrowser;
LLComboBox* mAddressCombo;
std::string mCurrentURL;
boost::shared_ptr<LLNotification> mCurNotification;
std::string mUUID;
};
#endif // LL_LLFLOATERMEDIABROWSER_H

23
indra/newview/llfloatermodelpreview.cpp Normal file → Executable file
View File

@ -497,6 +497,11 @@ BOOL LLFloaterModelPreview::postBuild()
{
validate_url = "http://secondlife.com/my/account/mesh.php";
}
else if (current_grid == "damballah")
{
// Staging grid has its own naming scheme.
validate_url = "http://secondlife-staging.com/my/account/mesh.php";
}
else
{
validate_url = llformat("http://secondlife.%s.lindenlab.com/my/account/mesh.php",current_grid.c_str());
@ -745,6 +750,11 @@ void LLFloaterModelPreview::draw()
if (!mModelPreview->mLoading)
{
if ( mModelPreview->getLoadState() == LLModelLoader::ERROR_MATERIALS )
{
childSetTextArg("status", "[STATUS]", getString("status_material_mismatch"));
}
else
if ( mModelPreview->getLoadState() > LLModelLoader::ERROR_PARSING )
{
childSetTextArg("status", "[STATUS]", getString(LLModel::getStatusString(mModelPreview->getLoadState() - LLModelLoader::ERROR_PARSING)));
@ -3305,7 +3315,7 @@ void LLModelPreview::rebuildUploadData()
F32 max_scale = 0.f;
//reorder materials to match mBaseModel
for (U32 i = 0; i < LLModel::NUM_LODS; i++)
for (U32 i = 0; i < LLModel::NUM_LODS-1; i++)
{
if (mBaseModel.size() == mModel[i].size())
{
@ -3317,6 +3327,7 @@ void LLModelPreview::rebuildUploadData()
if ( !mModel[i][j]->matchMaterialOrder(mBaseModel[j], refFaceCnt, modelFaceCnt ) )
{
setLoadState( LLModelLoader::ERROR_MATERIALS );
mFMP->childDisable( "calculate_btn" );
}
}
@ -4368,11 +4379,6 @@ void LLModelPreview::updateStatusMessages()
{
skinAndRigOk = false;
}
else
if ( !isLegacyRigValid() )
{
mFMP->childDisable("calculate_btn");
}
}
if(upload_ok && mModelLoader)
@ -5103,6 +5109,8 @@ BOOL LLModelPreview::render()
if (!mModel[mPreviewLOD].empty())
{
mFMP->childEnable("reset_btn");
bool regen = mVertexBuffer[mPreviewLOD].empty();
if (!regen)
{
@ -5115,7 +5123,7 @@ BOOL LLModelPreview::render()
}
//make sure material lists all match
for (U32 i = 0; i < LLModel::NUM_LODS; i++)
for (U32 i = 0; i < LLModel::NUM_LODS-1; i++)
{
if (mBaseModel.size() == mModel[i].size())
{
@ -5616,6 +5624,7 @@ void LLFloaterModelPreview::onReset(void* user_data)
assert_main_thread();
LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) user_data;
fmp->childDisable("reset_btn");
LLModelPreview* mp = fmp->mModelPreview;
std::string filename = mp->mLODFile[3];

View File

@ -70,7 +70,8 @@ public:
GENERATING_VERTEX_BUFFERS,
GENERATING_LOD,
DONE,
ERROR_PARSING //basically loading failed
ERROR_PARSING, //basically loading failed
ERROR_MATERIALS,
} eLoadState;
U32 mState;

View File

@ -1,384 +0,0 @@
/**
* @file llfloaterpostcard.cpp
* @brief Postcard send floater, allows setting name, e-mail address, etc.
*
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llfloaterpostcard.h"
#include "llfontgl.h"
#include "llsys.h"
#include "llgl.h"
#include "v3dmath.h"
#include "lldir.h"
#include "llagent.h"
#include "llui.h"
#include "lllineeditor.h"
#include "llbutton.h"
#include "lltexteditor.h"
#include "llfloaterreg.h"
#include "llnotificationsutil.h"
#include "llviewercontrol.h"
#include "llviewernetwork.h"
#include "lluictrlfactory.h"
#include "lluploaddialog.h"
#include "llviewerstats.h"
#include "llviewerwindow.h"
#include "llstatusbar.h"
#include "llviewerregion.h"
#include "lleconomy.h"
#include "message.h"
#include "llimagejpeg.h"
#include "llimagej2c.h"
#include "llvfile.h"
#include "llvfs.h"
#include "llviewertexture.h"
#include "llassetuploadresponders.h"
#include "llagentui.h"
#include <boost/regex.hpp> //boost.regex lib
///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs
///----------------------------------------------------------------------------
///----------------------------------------------------------------------------
/// Class LLFloaterPostcard
///----------------------------------------------------------------------------
LLFloaterPostcard::LLFloaterPostcard(const LLSD& key)
: LLFloater(key),
mJPEGImage(NULL),
mViewerImage(NULL),
mHasFirstMsgFocus(false)
{
}
// Destroys the object
LLFloaterPostcard::~LLFloaterPostcard()
{
mJPEGImage = NULL; // deletes image
}
BOOL LLFloaterPostcard::postBuild()
{
// pick up the user's up-to-date email address
gAgent.sendAgentUserInfoRequest();
childSetAction("cancel_btn", onClickCancel, this);
childSetAction("send_btn", onClickSend, this);
getChildView("from_form")->setEnabled(FALSE);
std::string name_string;
LLAgentUI::buildFullname(name_string);
getChild<LLUICtrl>("name_form")->setValue(LLSD(name_string));
// For the first time a user focusess to .the msg box, all text will be selected.
getChild<LLUICtrl>("msg_form")->setFocusChangedCallback(boost::bind(onMsgFormFocusRecieved, _1, this));
getChild<LLUICtrl>("to_form")->setFocus(TRUE);
return TRUE;
}
// static
LLFloaterPostcard* LLFloaterPostcard::showFromSnapshot(LLImageJPEG *jpeg, LLViewerTexture *img, const LLVector2 &image_scale, const LLVector3d& pos_taken_global)
{
// Take the images from the caller
// It's now our job to clean them up
LLFloaterPostcard* instance = LLFloaterReg::showTypedInstance<LLFloaterPostcard>("postcard", LLSD(img->getID()));
if (instance) // may be 0 if we're in mouselook mode
{
instance->mJPEGImage = jpeg;
instance->mViewerImage = img;
instance->mImageScale = image_scale;
instance->mPosTakenGlobal = pos_taken_global;
}
return instance;
}
void LLFloaterPostcard::draw()
{
LLGLSUIDefault gls_ui;
LLFloater::draw();
if(!isMinimized() && mViewerImage.notNull() && mJPEGImage.notNull())
{
// Force the texture to be 100% opaque when the floater is focused.
F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
LLRect rect(getRect());
// first set the max extents of our preview
rect.translate(-rect.mLeft, -rect.mBottom);
rect.mLeft += 320;
rect.mRight -= 10;
rect.mTop -= 27;
rect.mBottom = rect.mTop - 130;
// then fix the aspect ratio
F32 ratio = (F32)mJPEGImage->getWidth() / (F32)mJPEGImage->getHeight();
if ((F32)rect.getWidth() / (F32)rect.getHeight() >= ratio)
{
rect.mRight = LLRect::tCoordType((F32)rect.mLeft + ((F32)rect.getHeight() * ratio));
}
else
{
rect.mBottom = LLRect::tCoordType((F32)rect.mTop - ((F32)rect.getWidth() / ratio));
}
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f) % alpha);
rect.stretch(-1);
}
{
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.pushMatrix();
{
gGL.scalef(mImageScale.mV[VX], mImageScale.mV[VY], 1.f);
gGL.matrixMode(LLRender::MM_MODELVIEW);
gl_draw_scaled_image(rect.mLeft,
rect.mBottom,
rect.getWidth(),
rect.getHeight(),
mViewerImage.get(),
LLColor4::white % alpha);
}
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.popMatrix();
gGL.matrixMode(LLRender::MM_MODELVIEW);
}
}
}
// static
void LLFloaterPostcard::onClickCancel(void* data)
{
if (data)
{
LLFloaterPostcard *self = (LLFloaterPostcard *)data;
self->closeFloater(false);
}
}
class LLSendPostcardResponder : public LLAssetUploadResponder
{
public:
LLSendPostcardResponder(const LLSD &post_data,
const LLUUID& vfile_id,
LLAssetType::EType asset_type):
LLAssetUploadResponder(post_data, vfile_id, asset_type)
{
}
// *TODO define custom uploadFailed here so it's not such a generic message
void uploadComplete(const LLSD& content)
{
// we don't care about what the server returns from this post, just clean up the UI
LLUploadDialog::modalUploadFinished();
}
};
// static
void LLFloaterPostcard::onClickSend(void* data)
{
if (data)
{
LLFloaterPostcard *self = (LLFloaterPostcard *)data;
std::string from(self->getChild<LLUICtrl>("from_form")->getValue().asString());
std::string to(self->getChild<LLUICtrl>("to_form")->getValue().asString());
boost::regex emailFormat("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})*");
if (to.empty() || !boost::regex_match(to, emailFormat))
{
LLNotificationsUtil::add("PromptRecipientEmail");
return;
}
if (from.empty() || !boost::regex_match(from, emailFormat))
{
LLNotificationsUtil::add("PromptSelfEmail");
return;
}
std::string subject(self->getChild<LLUICtrl>("subject_form")->getValue().asString());
if(subject.empty() || !self->mHasFirstMsgFocus)
{
LLNotificationsUtil::add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLFloaterPostcard::missingSubjMsgAlertCallback, self, _1, _2));
return;
}
if (self->mJPEGImage.notNull())
{
self->sendPostcard();
}
else
{
LLNotificationsUtil::add("ErrorProcessingSnapshot");
}
}
}
// static
void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLFloaterPostcard *self = (LLFloaterPostcard *)user_data;
LLUploadDialog::modalUploadFinished();
if (result)
{
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(result));
LLNotificationsUtil::add("ErrorUploadingPostcard", args);
}
else
{
// only create the postcard once the upload succeeds
// request the postcard
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("SendPostcard");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->addUUID("AssetID", self->mAssetID);
msg->addVector3d("PosGlobal", self->mPosTakenGlobal);
msg->addString("To", self->getChild<LLUICtrl>("to_form")->getValue().asString());
msg->addString("From", self->getChild<LLUICtrl>("from_form")->getValue().asString());
msg->addString("Name", self->getChild<LLUICtrl>("name_form")->getValue().asString());
msg->addString("Subject", self->getChild<LLUICtrl>("subject_form")->getValue().asString());
msg->addString("Msg", self->getChild<LLUICtrl>("msg_form")->getValue().asString());
msg->addBOOL("AllowPublish", FALSE);
msg->addBOOL("MaturePublish", FALSE);
gAgent.sendReliableMessage();
}
self->closeFloater();
}
// static
void LLFloaterPostcard::updateUserInfo(const std::string& email)
{
LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("postcard");
for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin();
iter != inst_list.end(); ++iter)
{
LLFloater* instance = *iter;
const std::string& text = instance->getChild<LLUICtrl>("from_form")->getValue().asString();
if (text.empty())
{
// there's no text in this field yet, pre-populate
instance->getChild<LLUICtrl>("from_form")->setValue(LLSD(email));
}
}
}
void LLFloaterPostcard::onMsgFormFocusRecieved(LLFocusableElement* receiver, void* data)
{
LLFloaterPostcard* self = (LLFloaterPostcard *)data;
if(self)
{
LLTextEditor* msgForm = self->getChild<LLTextEditor>("msg_form");
if(msgForm && msgForm == receiver && msgForm->hasFocus() && !(self->mHasFirstMsgFocus))
{
self->mHasFirstMsgFocus = true;
msgForm->setText(LLStringUtil::null);
}
}
}
bool LLFloaterPostcard::missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if(0 == option)
{
// User clicked OK
if((getChild<LLUICtrl>("subject_form")->getValue().asString()).empty())
{
// Stuff the subject back into the form.
getChild<LLUICtrl>("subject_form")->setValue(getString("default_subject"));
}
if(!mHasFirstMsgFocus)
{
// The user never switched focus to the messagee window.
// Using the default string.
getChild<LLUICtrl>("msg_form")->setValue(getString("default_message"));
}
sendPostcard();
}
return false;
}
void LLFloaterPostcard::sendPostcard()
{
mTransactionID.generate();
mAssetID = mTransactionID.makeAssetID(gAgent.getSecureSessionID());
LLVFile::writeFile(mJPEGImage->getData(), mJPEGImage->getDataSize(), gVFS, mAssetID, LLAssetType::AT_IMAGE_JPEG);
// upload the image
std::string url = gAgent.getRegion()->getCapability("SendPostcard");
if(!url.empty())
{
llinfos << "Send Postcard via capability" << llendl;
LLSD body = LLSD::emptyMap();
// the capability already encodes: agent ID, region ID
body["pos-global"] = mPosTakenGlobal.getValue();
body["to"] = getChild<LLUICtrl>("to_form")->getValue().asString();
body["from"] = getChild<LLUICtrl>("from_form")->getValue().asString();
body["name"] = getChild<LLUICtrl>("name_form")->getValue().asString();
body["subject"] = getChild<LLUICtrl>("subject_form")->getValue().asString();
body["msg"] = getChild<LLUICtrl>("msg_form")->getValue().asString();
LLHTTPClient::post(url, body, new LLSendPostcardResponder(body, mAssetID, LLAssetType::AT_IMAGE_JPEG));
}
else
{
gAssetStorage->storeAssetData(mTransactionID, LLAssetType::AT_IMAGE_JPEG, &uploadCallback, (void *)this, FALSE);
}
// give user feedback of the event
gViewerWindow->playSnapshotAnimAndSound();
LLUploadDialog::modalUploadDialog(getString("upload_message"));
// don't destroy the window until the upload is done
// this way we keep the information in the form
setVisible(FALSE);
// also remove any dependency on another floater
// so that we can be sure to outlive it while we
// need to.
LLFloater* dependee = getDependee();
if (dependee)
dependee->removeDependentFloater(this);
}

View File

@ -1,79 +0,0 @@
/**
* @file llfloaterpostcard.h
* @brief Postcard send floater, allows setting name, e-mail address, etc.
*
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_LLFLOATERPOSTCARD_H
#define LL_LLFLOATERPOSTCARD_H
#include "llfloater.h"
#include "llcheckboxctrl.h"
#include "llpointer.h"
class LLTextEditor;
class LLLineEditor;
class LLButton;
class LLViewerTexture;
class LLImageJPEG;
class LLFloaterPostcard
: public LLFloater
{
public:
LLFloaterPostcard(const LLSD& key);
virtual ~LLFloaterPostcard();
virtual BOOL postBuild();
virtual void draw();
static LLFloaterPostcard* showFromSnapshot(LLImageJPEG *jpeg, LLViewerTexture *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global);
static void onClickCancel(void* data);
static void onClickSend(void* data);
static void uploadCallback(const LLUUID& asset_id,
void *user_data,
S32 result, LLExtStat ext_status);
static void updateUserInfo(const std::string& email);
static void onMsgFormFocusRecieved(LLFocusableElement* receiver, void* data);
bool missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response);
void sendPostcard();
private:
LLPointer<LLImageJPEG> mJPEGImage;
LLPointer<LLViewerTexture> mViewerImage;
LLTransactionID mTransactionID;
LLAssetID mAssetID;
LLVector2 mImageScale;
LLVector3d mPosTakenGlobal;
bool mHasFirstMsgFocus;
};
#endif // LL_LLFLOATERPOSTCARD_H

File diff suppressed because it is too large Load Diff

View File

@ -27,11 +27,15 @@
#ifndef LL_LLFLOATERSNAPSHOT_H
#define LL_LLFLOATERSNAPSHOT_H
#include "llimage.h"
#include "llfloater.h"
class LLSpinCtrl;
class LLFloaterSnapshot : public LLFloater
{
LOG_CLASS(LLFloaterSnapshot);
public:
typedef enum e_snapshot_format
{
@ -47,20 +51,31 @@ public:
/*virtual*/ void draw();
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void onClose(bool app_quitting);
/*virtual*/ S32 notify(const LLSD& info);
static void update();
static S32 getUIWinHeightLong() {return sUIWinHeightLong ;}
static S32 getUIWinHeightShort() {return sUIWinHeightShort ;}
static S32 getUIWinWidth() {return sUIWinWidth ;}
// TODO: create a snapshot model instead
static LLFloaterSnapshot* getInstance();
static void saveTexture();
static BOOL saveLocal();
static void preUpdate();
static void postUpdate();
static void postSave();
static void postPanelSwitch();
static LLPointer<LLImageFormatted> getImageData();
static const LLVector3d& getPosTakenGlobal();
static void setAgentEmail(const std::string& email);
static const LLRect& getThumbnailPlaceholderRect() { return sThumbnailPlaceholder->getRect(); }
private:
static LLUICtrl* sThumbnailPlaceholder;
LLUICtrl *mRefreshBtn, *mRefreshLabel;
LLUICtrl *mSucceessLblPanel, *mFailureLblPanel;
class Impl;
Impl& impl;
static S32 sUIWinHeightLong ;
static S32 sUIWinHeightShort ;
static S32 sUIWinWidth ;
};
class LLSnapshotFloaterView : public LLFloaterView

View File

@ -42,6 +42,7 @@ LLFloaterToybox::LLFloaterToybox(const LLSD& key)
, mToolBar(NULL)
{
mCommitCallbackRegistrar.add("Toybox.RestoreDefaults", boost::bind(&LLFloaterToybox::onBtnRestoreDefaults, this));
mCommitCallbackRegistrar.add("Toybox.ClearAll", boost::bind(&LLFloaterToybox::onBtnClearAll, this));
}
LLFloaterToybox::~LLFloaterToybox()
@ -121,15 +122,35 @@ static bool finish_restore_toybox(const LLSD& notification, const LLSD& response
{
LLToolBarView::loadDefaultToolbars();
}
return false;
}
static bool finish_clear_all_toybox(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{
LLToolBarView::clearAllToolbars();
}
return false;
}
static LLNotificationFunctorRegistration finish_restore_toybox_reg("ConfirmRestoreToybox", finish_restore_toybox);
static LLNotificationFunctorRegistration finish_clear_all_toybox_reg("ConfirmClearAllToybox", finish_clear_all_toybox);
void LLFloaterToybox::onBtnRestoreDefaults()
{
LLNotificationsUtil::add("ConfirmRestoreToybox");
}
void LLFloaterToybox::onBtnClearAll()
{
LLNotificationsUtil::add("ConfirmClearAllToybox");
}
BOOL LLFloaterToybox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,

View File

@ -50,6 +50,7 @@ public:
std::string& tooltip_msg);
protected:
void onBtnClearAll();
void onBtnRestoreDefaults();
void onToolBarButtonEnter(LLView* button);

View File

@ -556,6 +556,10 @@ public:
folders_t::const_iterator getFoldersBegin() const { return mFolders.begin(); }
folders_t::const_iterator getFoldersEnd() const { return mFolders.end(); }
folders_t::size_type getFoldersCount() const { return mFolders.size(); }
items_t::const_iterator getItemsBegin() const { return mItems.begin(); }
items_t::const_iterator getItemsEnd() const { return mItems.end(); }
items_t::size_type getItemsCount() const { return mItems.size(); }
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -2027,7 +2027,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
#endif
}
}
if (move_is_into_outbox && !move_is_from_outbox)
else if (move_is_into_outbox && !move_is_from_outbox)
{
dropFolderToOutbox(inv_cat);
}
@ -3544,10 +3544,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
// because they must contain only links to wearable items.
accept = !(move_is_into_current_outfit || move_is_into_outfit);
if(drop)
if(accept && drop)
{
copy_inventory_from_notecard(LLToolDragAndDrop::getInstance()->getObjectID(),
LLToolDragAndDrop::getInstance()->getSourceID(), inv_item);
copy_inventory_from_notecard(mUUID, // Drop to the chosen destination folder
LLToolDragAndDrop::getInstance()->getObjectID(),
LLToolDragAndDrop::getInstance()->getSourceID(),
inv_item);
}
}
else if(LLToolDragAndDrop::SOURCE_LIBRARY == source)

View File

@ -2528,9 +2528,9 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
{
LLPointer<LLViewerInventoryCategory> tfolder = new LLViewerInventoryCategory(gAgent.getID());
tfolder->unpackMessage(msg, _PREHASH_FolderData, i);
//llinfos << "unpaked folder '" << tfolder->getName() << "' ("
// << tfolder->getUUID() << ") in " << tfolder->getParentUUID()
// << llendl;
llinfos << "unpacked folder '" << tfolder->getName() << "' ("
<< tfolder->getUUID() << ") in " << tfolder->getParentUUID()
<< llendl;
if(tfolder->getUUID().notNull())
{
folders.push_back(tfolder);
@ -2570,8 +2570,8 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
{
LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
titem->unpackMessage(msg, _PREHASH_ItemData, i);
//llinfos << "unpaked item '" << titem->getName() << "' in "
// << titem->getParentUUID() << llendl;
llinfos << "unpaked item '" << titem->getName() << "' in "
<< titem->getParentUUID() << llendl;
U32 callback_id;
msg->getU32Fast(_PREHASH_ItemData, _PREHASH_CallbackID, callback_id);
if(titem->getUUID().notNull())

View File

@ -1128,19 +1128,78 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
{
// Make sure the floater is not minimized (STORM-438).
if (active_inv_floaterp && active_inv_floaterp->isMinimized())
{
active_inv_floaterp->setMinimized(FALSE);
}
}
else if (auto_open)
{
floater_inventory->openFloater();
return res;
res = sidepanel_inventory->getActivePanel();
}
// C. If no panels are open and we don't want to force open a panel, then just abort out.
if (!auto_open) return NULL;
// D. Open the inventory side panel floater and use that.
floater_inventory->openFloater();
return sidepanel_inventory->getActivePanel();
return NULL;
return res;
}
//static
void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id)
{
LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open);
if (active_panel)
{
LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL;
LLViewerInventoryItem * item = gInventory.getItem(obj_id);
LLViewerInventoryCategory * cat = gInventory.getCategory(obj_id);
bool in_inbox = false;
bool in_outbox = false;
LLViewerInventoryCategory * parent_cat = NULL;
if (item)
{
parent_cat = gInventory.getCategory(item->getParentUUID());
}
else if (cat)
{
parent_cat = gInventory.getCategory(cat->getParentUUID());
}
if (parent_cat)
{
in_inbox = (LLFolderType::FT_INBOX == parent_cat->getPreferredType());
in_outbox = (LLFolderType::FT_OUTBOX == parent_cat->getPreferredType());
}
if (in_inbox || in_outbox)
{
LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
LLInventoryPanel * inventory_panel = NULL;
if (in_inbox)
{
sidepanel_inventory->openInbox();
inventory_panel = sidepanel_inventory->getInboxPanel();
}
else
{
sidepanel_inventory->openOutbox();
inventory_panel = sidepanel_inventory->getOutboxPanel();
}
if (inventory_panel)
{
inventory_panel->setSelection(obj_id, TAKE_FOCUS_YES);
}
}
else
{
active_panel->setSelection(obj_id, TAKE_FOCUS_YES);
}
}
}
void LLInventoryPanel::addHideFolderType(LLFolderType::EType folder_type)

View File

@ -175,6 +175,8 @@ public:
// Find whichever inventory panel is active / on top.
// "Auto_open" determines if we open an inventory panel if none are open.
static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE);
static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id);
protected:
void openStartFolderOrMyInventory(); // open the first level of inventory

View File

@ -57,7 +57,6 @@
#include "llcheckboxctrl.h"
#include "llnotifications.h"
#include "lllineeditor.h"
#include "llfloatermediabrowser.h"
#include "llfloaterwebcontent.h"
#include "llwindowshade.h"
@ -68,7 +67,6 @@ static LLDefaultChildRegistry::Register<LLMediaCtrl> r("web_browser");
LLMediaCtrl::Params::Params()
: start_url("start_url"),
border_visible("border_visible", true),
ignore_ui_scale("ignore_ui_scale", true),
decouple_texture_size("decouple_texture_size", false),
texture_width("texture_width", 1024),
texture_height("texture_height", 1024),
@ -89,7 +87,6 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
mFrequentUpdates( true ),
mForceUpdate( false ),
mHomePageUrl( "" ),
mIgnoreUIScale( true ),
mAlwaysRefresh( false ),
mMediaSource( 0 ),
mTakeFocusOnClick( p.focus_on_click ),
@ -112,8 +109,6 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
setCaretColor( (unsigned int)color.mV[0], (unsigned int)color.mV[1], (unsigned int)color.mV[2] );
}
setIgnoreUIScale(p.ignore_ui_scale);
setHomePageUrl(p.start_url, p.initial_mime_type);
setBorderVisible(p.border_visible);
@ -124,10 +119,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
if(!getDecoupleTextureSize())
{
S32 screen_width = mIgnoreUIScale ?
llround((F32)getRect().getWidth() * LLUI::sGLScaleFactor.mV[VX]) : getRect().getWidth();
S32 screen_height = mIgnoreUIScale ?
llround((F32)getRect().getHeight() * LLUI::sGLScaleFactor.mV[VY]) : getRect().getHeight();
S32 screen_width = llround((F32)getRect().getWidth() * LLUI::sGLScaleFactor.mV[VX]);
S32 screen_height = llround((F32)getRect().getHeight() * LLUI::sGLScaleFactor.mV[VY]);
setTextureSize(screen_width, screen_height);
}
@ -471,8 +464,8 @@ void LLMediaCtrl::reshape( S32 width, S32 height, BOOL called_from_parent )
{
if(!getDecoupleTextureSize())
{
S32 screen_width = mIgnoreUIScale ? llround((F32)width * LLUI::sGLScaleFactor.mV[VX]) : width;
S32 screen_height = mIgnoreUIScale ? llround((F32)height * LLUI::sGLScaleFactor.mV[VY]) : height;
S32 screen_width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]);
S32 screen_height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]);
// when floater is minimized, these sizes are negative
if ( screen_height > 0 && screen_width > 0 )
@ -689,6 +682,8 @@ bool LLMediaCtrl::ensureMediaSourceExists()
mMediaSource->addObserver( this );
mMediaSource->setBackgroundColor( getBackgroundColor() );
mMediaSource->setTrustedBrowser(mTrusted);
mMediaSource->setPageZoomFactor( LLUI::sGLScaleFactor.mV[ VX ] );
if(mClearCache)
{
mMediaSource->clearCache();
@ -770,15 +765,7 @@ void LLMediaCtrl::draw()
{
gGL.pushUIMatrix();
{
if (mIgnoreUIScale)
{
gGL.loadUIIdentity();
// font system stores true screen origin, need to scale this by UI scale factor
// to get render origin for this view (with unit scale)
gGL.translateUI(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]),
floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]),
LLFontGL::sCurOrigin.mZ);
}
mMediaSource->setPageZoomFactor( LLUI::sGLScaleFactor.mV[ VX ] );
// scale texture to fit the space using texture coords
gGL.getTexUnit(0)->bind(media_texture);
@ -826,14 +813,6 @@ void LLMediaCtrl::draw()
x_offset = (r.getWidth() - width) / 2;
y_offset = (r.getHeight() - height) / 2;
if(mIgnoreUIScale)
{
x_offset = llround((F32)x_offset * LLUI::sGLScaleFactor.mV[VX]);
y_offset = llround((F32)y_offset * LLUI::sGLScaleFactor.mV[VY]);
width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]);
height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]);
}
// draw the browser
gGL.begin( LLRender::QUADS );
if (! media_plugin->getTextureCoordsOpenGL())
@ -900,14 +879,14 @@ void LLMediaCtrl::convertInputCoords(S32& x, S32& y)
coords_opengl = mMediaSource->getMediaPlugin()->getTextureCoordsOpenGL();
}
x = mIgnoreUIScale ? llround((F32)x * LLUI::sGLScaleFactor.mV[VX]) : x;
x = llround((F32)x * LLUI::sGLScaleFactor.mV[VX]);
if ( ! coords_opengl )
{
y = mIgnoreUIScale ? llround((F32)(y) * LLUI::sGLScaleFactor.mV[VY]) : y;
y = llround((F32)(y) * LLUI::sGLScaleFactor.mV[VY]);
}
else
{
y = mIgnoreUIScale ? llround((F32)(getRect().getHeight() - y) * LLUI::sGLScaleFactor.mV[VY]) : getRect().getHeight() - y;
y = llround((F32)(getRect().getHeight() - y) * LLUI::sGLScaleFactor.mV[VY]);
};
}
@ -1102,26 +1081,6 @@ void LLMediaCtrl::onPopup(const LLSD& notification, const LLSD& response)
{
if (response["open"])
{
// name of default floater to open
std::string floater_name = "media_browser";
// look for parent floater name
if ( gFloaterView )
{
if ( gFloaterView->getParentFloater(this) )
{
floater_name = gFloaterView->getParentFloater(this)->getInstanceName();
}
else
{
lldebugs << "No gFloaterView->getParentFloater(this) for onPopuup()" << llendl;
};
}
else
{
lldebugs << "No gFloaterView for onPopuup()" << llendl;
};
LLWeb::loadURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]);
}
else

View File

@ -51,7 +51,6 @@ public:
Optional<std::string> start_url;
Optional<bool> border_visible,
ignore_ui_scale,
hide_loading,
decouple_texture_size,
trusted_content,
@ -125,9 +124,6 @@ public:
bool getFrequentUpdates() { return mFrequentUpdates; };
void setFrequentUpdates( bool frequentUpdatesIn ) { mFrequentUpdates = frequentUpdatesIn; };
void setIgnoreUIScale(bool ignore) { mIgnoreUIScale = ignore; }
bool getIgnoreUIScale() { return mIgnoreUIScale; }
void setAlwaysRefresh(bool refresh) { mAlwaysRefresh = refresh; }
bool getAlwaysRefresh() { return mAlwaysRefresh; }
@ -181,28 +177,29 @@ public:
const S32 mTextureDepthBytes;
LLUUID mMediaTextureID;
LLViewBorder* mBorder;
bool mFrequentUpdates;
bool mForceUpdate;
bool mTrusted;
std::string mHomePageUrl;
std::string mHomePageMimeType;
std::string mCurrentNavUrl;
std::string mErrorPageURL;
std::string mTarget;
bool mIgnoreUIScale;
bool mAlwaysRefresh;
bool mFrequentUpdates,
mForceUpdate,
mTrusted,
mAlwaysRefresh,
mTakeFocusOnClick,
mStretchToFill,
mMaintainAspectRatio,
mHideLoading,
mHidingInitialLoad,
mClearCache,
mHoverTextChanged,
mDecoupleTextureSize;
std::string mHomePageUrl,
mHomePageMimeType,
mCurrentNavUrl,
mErrorPageURL,
mTarget;
viewer_media_t mMediaSource;
bool mTakeFocusOnClick;
bool mStretchToFill;
bool mMaintainAspectRatio;
bool mHideLoading;
bool mHidingInitialLoad;
bool mDecoupleTextureSize;
S32 mTextureWidth;
S32 mTextureHeight;
bool mClearCache;
S32 mTextureWidth,
mTextureHeight;
class LLWindowShade* mWindowShade;
bool mHoverTextChanged;
LLContextMenu* mContextMenu;
};

View File

@ -54,7 +54,6 @@
#include "llworldmapmessage.h"
#include "llappviewer.h"
#include "llviewercontrol.h"
#include "llfloatermediabrowser.h"
#include "llweb.h"
#include "llhints.h"

View File

@ -60,13 +60,9 @@ static const S32 RESIZE_BAR_THICKNESS = 3;
static LLRegisterPanelClassWrapper<LLNearbyChat> t_panel_nearby_chat("panel_nearby_chat");
LLNearbyChat::LLNearbyChat()
: LLPanel()
,mChatHistory(NULL)
{
}
LLNearbyChat::~LLNearbyChat()
LLNearbyChat::LLNearbyChat(const LLNearbyChat::Params& p)
: LLPanel(p),
mChatHistory(NULL)
{
}
@ -178,15 +174,20 @@ bool LLNearbyChat::onNearbyChatCheckContextMenuItem(const LLSD& userdata)
return false;
}
void LLNearbyChat::removeScreenChat()
{
LLNotificationsUI::LLScreenChannelBase* chat_channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID")));
if(chat_channel)
{
chat_channel->removeToastsFromChannel();
}
}
void LLNearbyChat::setVisible(BOOL visible)
{
if(visible)
{
LLNotificationsUI::LLScreenChannelBase* chat_channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID")));
if(chat_channel)
{
chat_channel->removeToastsFromChannel();
}
removeScreenChat();
}
LLPanel::setVisible(visible);

View File

@ -37,8 +37,7 @@ class LLChatHistory;
class LLNearbyChat: public LLPanel
{
public:
LLNearbyChat();
~LLNearbyChat();
LLNearbyChat(const Params& p = LLPanel::getDefaultParams());
BOOL postBuild ();
@ -63,13 +62,14 @@ public:
void loadHistory();
static LLNearbyChat* getInstance();
void removeScreenChat();
private:
void getAllowedRect (LLRect& rect);
void onNearbySpeakers ();
private:
LLHandle<LLView> mPopupMenuHandle;

View File

@ -47,6 +47,7 @@
#include "llviewerwindow.h"
#include "llrootview.h"
#include "llviewerchat.h"
#include "llnearbychat.h"
#include "llresizehandle.h"
@ -401,11 +402,13 @@ void LLNearbyChatBar::onToggleNearbyChatPanel()
void LLNearbyChatBar::setMinimized(BOOL b)
{
if (b != LLFloater::isMinimized())
LLNearbyChat* nearby_chat = getChild<LLNearbyChat>("nearby_chat");
// when unminimizing with nearby chat visible, go ahead and kill off screen chats
if (!b && nearby_chat->getVisible())
{
LLFloater::setMinimized(b);
getChildView("nearby_chat")->setVisible(!b);
nearby_chat->removeScreenChat();
}
LLFloater::setMinimized(b);
}
void LLNearbyChatBar::onChatBoxCommit()

View File

@ -29,6 +29,7 @@
#include "llfloaterreg.h"
#include "llnearbychat.h"
#include "llnearbychatbar.h"
#include "llnotificationhandler.h"
#include "llnotifications.h"
#include "lltoastnotifypanel.h"
@ -93,7 +94,8 @@ bool LLTipHandler::processNotification(const LLSD& notify)
// don't show toast if Nearby Chat is opened
LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
if (nearby_chat->getVisible())
LLNearbyChatBar* nearby_chat_bar = LLNearbyChatBar::getInstance();
if (nearby_chat_bar->getVisible() && nearby_chat->getVisible())
{
return false;
}

View File

@ -1431,7 +1431,7 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg,
LLSD substitution;
// We don't do time zone corrections of the calculated number of seconds
// because we don't have a full time stamp, only a date.
substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%m/%d/%Y", start_date);
substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%Y-%m-%d", start_date);
LLStringUtil::format (time_str, substitution);
text.append(time_str);
@ -1442,7 +1442,7 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg,
text.append(LLTrans::getString("NextStipendDay"));
time_str = date_format_str;
substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%m/%d/%Y", next_stipend_date);
substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%Y-%m-%d", next_stipend_date);
LLStringUtil::format (time_str, substitution);
text.append(time_str);

View File

@ -1399,10 +1399,6 @@ static void filter_list(LLPlacesInventoryPanel* inventory_list, const std::strin
inventory_list->restoreFolderState();
}
// Open the immediate children of the root folder, since those
// are invisible in the UI and thus must always be open.
inventory_list->getRootFolder()->openTopLevelFolders();
if (inventory_list->getFilterSubString().empty() && string.empty())
{
// current filter and new filter empty, do nothing

View File

@ -151,6 +151,20 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const
fresh_item_count++;
}
}
LLFolderViewFolder::items_t::const_iterator items_it = inbox_folder->getItemsBegin();
LLFolderViewFolder::items_t::const_iterator items_end = inbox_folder->getItemsEnd();
for (; items_it != items_end; ++items_it)
{
const LLFolderViewItem * item_view = *items_it;
const LLInboxFolderViewItem * inbox_item_view = dynamic_cast<const LLInboxFolderViewItem*>(item_view);
if (inbox_item_view && inbox_item_view->isFresh())
{
fresh_item_count++;
}
}
}
}
@ -171,6 +185,7 @@ U32 LLPanelMarketplaceInbox::getTotalItemCount() const
if (inbox_folder)
{
item_count += inbox_folder->getFoldersCount();
item_count += inbox_folder->getItemsCount();
}
}

View File

@ -45,6 +45,7 @@
static LLDefaultChildRegistry::Register<LLInboxInventoryPanel> r1("inbox_inventory_panel");
static LLDefaultChildRegistry::Register<LLInboxFolderViewFolder> r2("inbox_folder_view_folder");
static LLDefaultChildRegistry::Register<LLInboxFolderViewItem> r3("inbox_folder_view_item");
//
@ -137,7 +138,7 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge
LLFolderViewItem * LLInboxInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge)
{
LLFolderViewItem::Params params;
LLInboxFolderViewItem::Params params;
params.name = bridge->getDisplayName();
params.icon = bridge->getIcon();
@ -171,10 +172,6 @@ LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p)
#endif
}
LLInboxFolderViewFolder::~LLInboxFolderViewFolder()
{
}
// virtual
void LLInboxFolderViewFolder::draw()
{
@ -190,6 +187,20 @@ void LLInboxFolderViewFolder::draw()
LLFolderViewFolder::draw();
}
void LLInboxFolderViewFolder::selectItem()
{
deFreshify();
LLFolderViewFolder::selectItem();
}
void LLInboxFolderViewFolder::toggleOpen()
{
deFreshify();
LLFolderViewFolder::toggleOpen();
}
void LLInboxFolderViewFolder::computeFreshness()
{
const U32 last_expansion_utc = gSavedPerAccountSettings.getU32("LastInventoryInboxActivity");
@ -218,20 +229,6 @@ void LLInboxFolderViewFolder::deFreshify()
gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected());
}
void LLInboxFolderViewFolder::selectItem()
{
LLFolderViewFolder::selectItem();
deFreshify();
}
void LLInboxFolderViewFolder::toggleOpen()
{
LLFolderViewFolder::toggleOpen();
deFreshify();
}
void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc)
{
mCreationDate = creation_date_utc;
@ -246,9 +243,87 @@ void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc)
// LLInboxFolderViewItem Implementation
//
BOOL LLInboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask)
LLInboxFolderViewItem::LLInboxFolderViewItem(const Params& p)
: LLFolderViewItem(p)
, LLBadgeOwner(getHandle())
, mFresh(false)
{
return TRUE;
#if SUPPORTING_FRESH_ITEM_COUNT
initBadgeParams(p.new_badge());
#endif
}
BOOL LLInboxFolderViewItem::addToFolder(LLFolderViewFolder* folder, LLFolderView* root)
{
BOOL retval = LLFolderViewItem::addToFolder(folder, root);
#if SUPPORTING_FRESH_ITEM_COUNT
// Compute freshness if our parent is the root folder for the inbox
if (mParentFolder == mRoot)
{
computeFreshness();
}
#endif
return retval;
}
BOOL LLInboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask)
{
deFreshify();
return LLFolderViewItem::handleDoubleClick(x, y, mask);
}
// virtual
void LLInboxFolderViewItem::draw()
{
#if SUPPORTING_FRESH_ITEM_COUNT
if (!badgeHasParent())
{
addBadgeToParentPanel();
}
setBadgeVisibility(mFresh);
#endif
LLFolderViewItem::draw();
}
void LLInboxFolderViewItem::selectItem()
{
deFreshify();
LLFolderViewItem::selectItem();
}
void LLInboxFolderViewItem::computeFreshness()
{
const U32 last_expansion_utc = gSavedPerAccountSettings.getU32("LastInventoryInboxActivity");
if (last_expansion_utc > 0)
{
mFresh = (mCreationDate > last_expansion_utc);
#if DEBUGGING_FRESHNESS
if (mFresh)
{
llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << last_expansion_utc << llendl;
}
#endif
}
else
{
mFresh = true;
}
}
void LLInboxFolderViewItem::deFreshify()
{
mFresh = false;
gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected());
}
// eof

View File

@ -69,16 +69,15 @@ public:
};
LLInboxFolderViewFolder(const Params& p);
~LLInboxFolderViewFolder();
void draw();
void computeFreshness();
void deFreshify();
void selectItem();
void toggleOpen();
void computeFreshness();
void deFreshify();
bool isFresh() const { return mFresh; }
protected:
@ -88,15 +87,35 @@ protected:
};
class LLInboxFolderViewItem : public LLFolderViewItem
class LLInboxFolderViewItem : public LLFolderViewItem, public LLBadgeOwner
{
public:
LLInboxFolderViewItem(const Params& p)
: LLFolderViewItem(p)
struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params>
{
}
Optional<LLBadge::Params> new_badge;
Params()
: new_badge("new_badge")
{
}
};
LLInboxFolderViewItem(const Params& p);
BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root);
BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
void draw();
void selectItem();
void computeFreshness();
void deFreshify();
bool isFresh() const { return mFresh; }
protected:
bool mFresh;
};
#endif //LL_INBOXINVENTORYPANEL_H

View File

@ -130,11 +130,14 @@ public:
void createPick()
{
LLSD params;
params["id"] = gAgent.getID();
params["open_tab_name"] = "panel_picks";
params["show_tab_panel"] = "create_pick";
LLFloaterSidePanelContainer::showPanel("my_profile", params);
// open the new pick panel on the Picks floater
LLFloater* picks_floater = LLFloaterReg::showInstance("picks");
LLPanelPicks* picks = picks_floater->findChild<LLPanelPicks>("panel_picks");
if (picks)
{
picks->createNewPick();
}
}
void editPick(LLPickData* pick_info)
@ -147,7 +150,7 @@ public:
params["snapshot_id"] = pick_info->snapshot_id;
params["pick_name"] = pick_info->name;
params["pick_desc"] = pick_info->desc;
LLFloaterSidePanelContainer::showPanel("my_profile", params);
LLFloaterSidePanelContainer::showPanel("picks", params);
}
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type)
@ -247,12 +250,14 @@ public:
void createClassified()
{
// open the new classified panel on the Me > Picks sidetray
LLSD params;
params["id"] = gAgent.getID();
params["open_tab_name"] = "panel_picks";
params["show_tab_panel"] = "create_classified";
LLFloaterSidePanelContainer::showPanel("my_profile", params);
// open the new classified panel on the Picks floater
LLFloater* picks_floater = LLFloaterReg::showInstance("picks");
LLPanelPicks* picks = picks_floater->findChild<LLPanelPicks>("panel_picks");
if (picks)
{
picks->createNewClassified();
}
}
void openClassified(LLAvatarClassifiedInfo* c_info)
@ -270,7 +275,7 @@ public:
params["classified_name"] = c_info->name;
params["classified_desc"] = c_info->description;
params["from_search"] = true;
LLFloaterSidePanelContainer::showPanel("people", "panel_profile_view", params);
LLFloaterSidePanelContainer::showPanel("picks", params);
}
else if (mRequestVerb == "edit")
{

View File

@ -82,6 +82,9 @@ public:
// parent panels failed to work (picks related code was in my profile panel)
void setProfilePanel(LLPanelProfile* profile_panel);
void createNewPick();
void createNewClassified();
protected:
/*virtual*/void updateButtons();
@ -115,9 +118,6 @@ private:
bool onEnableMenuItem(const LLSD& user_data);
void createNewPick();
void createNewClassified();
void openPickInfo();
void openClassifiedInfo();
void openClassifiedInfo(const LLSD& params);

View File

@ -82,6 +82,7 @@ static const std::string CREATE_LANDMARK_INFO_TYPE = "create_landmark";
static const std::string LANDMARK_INFO_TYPE = "landmark";
static const std::string REMOTE_PLACE_INFO_TYPE = "remote_place";
static const std::string TELEPORT_HISTORY_INFO_TYPE = "teleport_history";
static const std::string LANDMARK_TAB_INFO_TYPE = "open_landmark_tab";
// Support for secondlife:///app/parcel/{UUID}/about SLapps
class LLParcelHandler : public LLCommandHandler
@ -365,83 +366,104 @@ void LLPanelPlaces::onOpen(const LLSD& key)
if (key.size() != 0)
{
mFilterEditor->clear();
onFilterEdit("", false);
mPlaceInfoType = key["type"].asString();
mPosGlobal.setZero();
mItem = NULL;
isLandmarkEditModeOn = false;
togglePlaceInfoPanel(TRUE);
if (mPlaceInfoType == AGENT_INFO_TYPE)
std::string key_type = key["type"].asString();
if (key_type == LANDMARK_TAB_INFO_TYPE)
{
mPlaceProfile->setInfoType(LLPanelPlaceInfo::AGENT);
// Small hack: We need to toggle twice. The first toggle moves from the Landmark
// or Teleport History info panel to the Landmark or Teleport History list panel.
// For this first toggle, the mPlaceInfoType should be the one previously used so
// that the state can be corretly set.
// The second toggle forces the list to be set to Landmark.
// This avoids extracting and duplicating all the state logic from togglePlaceInfoPanel()
// here or some specific private method
togglePlaceInfoPanel(FALSE);
mPlaceInfoType = key_type;
togglePlaceInfoPanel(FALSE);
// Update the active tab
onTabSelected();
// Update the buttons at the bottom of the panel
updateVerbs();
}
else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE)
else
{
mLandmarkInfo->setInfoType(LLPanelPlaceInfo::CREATE_LANDMARK);
mFilterEditor->clear();
onFilterEdit("", false);
if (key.has("x") && key.has("y") && key.has("z"))
mPlaceInfoType = key_type;
mPosGlobal.setZero();
mItem = NULL;
isLandmarkEditModeOn = false;
togglePlaceInfoPanel(TRUE);
if (mPlaceInfoType == AGENT_INFO_TYPE)
{
mPosGlobal = LLVector3d(key["x"].asReal(),
key["y"].asReal(),
key["z"].asReal());
mPlaceProfile->setInfoType(LLPanelPlaceInfo::AGENT);
}
else
else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE)
{
mPosGlobal = gAgent.getPositionGlobal();
mLandmarkInfo->setInfoType(LLPanelPlaceInfo::CREATE_LANDMARK);
if (key.has("x") && key.has("y") && key.has("z"))
{
mPosGlobal = LLVector3d(key["x"].asReal(),
key["y"].asReal(),
key["z"].asReal());
}
else
{
mPosGlobal = gAgent.getPositionGlobal();
}
mLandmarkInfo->displayParcelInfo(LLUUID(), mPosGlobal);
mSaveBtn->setEnabled(FALSE);
}
mLandmarkInfo->displayParcelInfo(LLUUID(), mPosGlobal);
mSaveBtn->setEnabled(FALSE);
}
else if (mPlaceInfoType == LANDMARK_INFO_TYPE)
{
mLandmarkInfo->setInfoType(LLPanelPlaceInfo::LANDMARK);
LLInventoryItem* item = gInventory.getItem(key["id"].asUUID());
if (!item)
return;
setItem(item);
}
else if (mPlaceInfoType == REMOTE_PLACE_INFO_TYPE)
{
if (key.has("id"))
else if (mPlaceInfoType == LANDMARK_INFO_TYPE)
{
LLUUID parcel_id = key["id"].asUUID();
mPlaceProfile->setParcelID(parcel_id);
mLandmarkInfo->setInfoType(LLPanelPlaceInfo::LANDMARK);
// query the server to get the global 3D position of this
// parcel - we need this for teleport/mapping functions.
mRemoteParcelObserver->setParcelID(parcel_id);
LLInventoryItem* item = gInventory.getItem(key["id"].asUUID());
if (!item)
return;
setItem(item);
}
else
else if (mPlaceInfoType == REMOTE_PLACE_INFO_TYPE)
{
mPosGlobal = LLVector3d(key["x"].asReal(),
key["y"].asReal(),
key["z"].asReal());
if (key.has("id"))
{
LLUUID parcel_id = key["id"].asUUID();
mPlaceProfile->setParcelID(parcel_id);
// query the server to get the global 3D position of this
// parcel - we need this for teleport/mapping functions.
mRemoteParcelObserver->setParcelID(parcel_id);
}
else
{
mPosGlobal = LLVector3d(key["x"].asReal(),
key["y"].asReal(),
key["z"].asReal());
mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal);
}
mPlaceProfile->setInfoType(LLPanelPlaceInfo::PLACE);
}
else if (mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE)
{
S32 index = key["id"].asInteger();
const LLTeleportHistoryStorage::slurl_list_t& hist_items =
LLTeleportHistoryStorage::getInstance()->getItems();
mPosGlobal = hist_items[index].mGlobalPos;
mPlaceProfile->setInfoType(LLPanelPlaceInfo::TELEPORT_HISTORY);
mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal);
}
mPlaceProfile->setInfoType(LLPanelPlaceInfo::PLACE);
updateVerbs();
}
else if (mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE)
{
S32 index = key["id"].asInteger();
const LLTeleportHistoryStorage::slurl_list_t& hist_items =
LLTeleportHistoryStorage::getInstance()->getItems();
mPosGlobal = hist_items[index].mGlobalPos;
mPlaceProfile->setInfoType(LLPanelPlaceInfo::TELEPORT_HISTORY);
mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal);
}
updateVerbs();
}
LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
@ -942,7 +964,8 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible)
}
}
else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE ||
mPlaceInfoType == LANDMARK_INFO_TYPE)
mPlaceInfoType == LANDMARK_INFO_TYPE ||
mPlaceInfoType == LANDMARK_TAB_INFO_TYPE)
{
mLandmarkInfo->setVisible(visible);
@ -960,13 +983,15 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible)
{
LLLandmarksPanel* landmarks_panel =
dynamic_cast<LLLandmarksPanel*>(mTabContainer->getPanelByName("Landmarks"));
if (landmarks_panel && mItem.notNull())
if (landmarks_panel)
{
// If a landmark info is being closed we open the landmarks tab
// and set this landmark selected.
mTabContainer->selectTabPanel(landmarks_panel);
landmarks_panel->setItemSelected(mItem->getUUID(), TRUE);
if (mItem.notNull())
{
landmarks_panel->setItemSelected(mItem->getUUID(), TRUE);
}
}
}
}
@ -1163,7 +1188,8 @@ LLPanelPlaceInfo* LLPanelPlaces::getCurrentInfoPanel()
return mPlaceProfile;
}
else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE ||
mPlaceInfoType == LANDMARK_INFO_TYPE)
mPlaceInfoType == LANDMARK_INFO_TYPE ||
mPlaceInfoType == LANDMARK_TAB_INFO_TYPE)
{
return mLandmarkInfo;
}

View File

@ -0,0 +1,201 @@
/**
* @file llpanelsnapshot.cpp
* @brief Snapshot panel base class
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llpanelsnapshot.h"
// libs
#include "llcombobox.h"
#include "llsliderctrl.h"
#include "llspinctrl.h"
#include "lltrans.h"
// newview
#include "llsidetraypanelcontainer.h"
#include "llviewercontrol.h" // gSavedSettings
// virtual
BOOL LLPanelSnapshot::postBuild()
{
getChild<LLUICtrl>(getImageSizeComboName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onResolutionComboCommit, this, _1));
getChild<LLUICtrl>(getWidthSpinnerName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onCustomResolutionCommit, this));
getChild<LLUICtrl>(getHeightSpinnerName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onCustomResolutionCommit, this));
getChild<LLUICtrl>(getAspectRatioCBName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onKeepAspectRatioCommit, this, _1));
updateControls(LLSD());
return TRUE;
}
// virtual
void LLPanelSnapshot::onOpen(const LLSD& key)
{
S32 old_format = gSavedSettings.getS32("SnapshotFormat");
S32 new_format = (S32) getImageFormat();
gSavedSettings.setS32("SnapshotFormat", new_format);
setCtrlsEnabled(true);
// Switching panels will likely change image format.
// Not updating preview right away may lead to errors,
// e.g. attempt to send a large BMP image by email.
if (old_format != new_format)
{
LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true));
}
updateCustomResControls();
}
LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshot::getImageFormat() const
{
return LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG;
}
void LLPanelSnapshot::enableControls(BOOL enable)
{
setCtrlsEnabled(enable);
if (enable)
{
// Make sure only relevant controls are enabled/shown.
updateCustomResControls();
}
}
LLSpinCtrl* LLPanelSnapshot::getWidthSpinner()
{
return getChild<LLSpinCtrl>(getWidthSpinnerName());
}
LLSpinCtrl* LLPanelSnapshot::getHeightSpinner()
{
return getChild<LLSpinCtrl>(getHeightSpinnerName());
}
S32 LLPanelSnapshot::getTypedPreviewWidth() const
{
return getChild<LLUICtrl>(getWidthSpinnerName())->getValue().asInteger();
}
S32 LLPanelSnapshot::getTypedPreviewHeight() const
{
return getChild<LLUICtrl>(getHeightSpinnerName())->getValue().asInteger();
}
void LLPanelSnapshot::enableAspectRatioCheckbox(BOOL enable)
{
getChild<LLUICtrl>(getAspectRatioCBName())->setEnabled(enable);
}
LLSideTrayPanelContainer* LLPanelSnapshot::getParentContainer()
{
LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent());
if (!parent)
{
llwarns << "Cannot find panel container" << llendl;
return NULL;
}
return parent;
}
// virtual
void LLPanelSnapshot::updateCustomResControls()
{
// Only show width/height spinners and the aspect ratio checkbox
// when a custom resolution is chosen.
LLComboBox* combo = getChild<LLComboBox>(getImageSizeComboName());
const bool show = combo->getFirstSelectedIndex() == (combo->getItemCount() - 1);
getChild<LLUICtrl>(getImageSizePanelName())->setVisible(show);
}
void LLPanelSnapshot::updateImageQualityLevel()
{
LLSliderCtrl* quality_slider = getChild<LLSliderCtrl>("image_quality_slider");
S32 quality_val = llfloor((F32) quality_slider->getValue().asReal());
std::string quality_lvl;
if (quality_val < 20)
{
quality_lvl = LLTrans::getString("snapshot_quality_very_low");
}
else if (quality_val < 40)
{
quality_lvl = LLTrans::getString("snapshot_quality_low");
}
else if (quality_val < 60)
{
quality_lvl = LLTrans::getString("snapshot_quality_medium");
}
else if (quality_val < 80)
{
quality_lvl = LLTrans::getString("snapshot_quality_high");
}
else
{
quality_lvl = LLTrans::getString("snapshot_quality_very_high");
}
getChild<LLTextBox>("image_quality_level")->setTextArg("[QLVL]", quality_lvl);
}
void LLPanelSnapshot::goBack()
{
LLSideTrayPanelContainer* parent = getParentContainer();
if (parent)
{
parent->openPreviousPanel();
parent->getCurrentPanel()->onOpen(LLSD());
}
}
void LLPanelSnapshot::cancel()
{
goBack();
LLFloaterSnapshot::getInstance()->notify(LLSD().with("set-ready", true));
}
void LLPanelSnapshot::onCustomResolutionCommit()
{
LLSD info;
info["w"] = getChild<LLUICtrl>(getWidthSpinnerName())->getValue().asInteger();
info["h"] = getChild<LLUICtrl>(getHeightSpinnerName())->getValue().asInteger();
LLFloaterSnapshot::getInstance()->notify(LLSD().with("custom-res-change", info));
}
void LLPanelSnapshot::onResolutionComboCommit(LLUICtrl* ctrl)
{
updateCustomResControls();
LLSD info;
info["combo-res-change"]["control-name"] = ctrl->getName();
LLFloaterSnapshot::getInstance()->notify(info);
}
void LLPanelSnapshot::onKeepAspectRatioCommit(LLUICtrl* ctrl)
{
LLFloaterSnapshot::getInstance()->notify(LLSD().with("keep-aspect-change", ctrl->getValue().asBoolean()));
}

View File

@ -0,0 +1,71 @@
/**
* @file llpanelsnapshot.h
* @brief Snapshot panel base class
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_LLPANELSNAPSHOT_H
#define LL_LLPANELSNAPSHOT_H
#include "llfloatersnapshot.h"
class LLSideTrayPanelContainer;
/**
* Snapshot panel base class.
*/
class LLPanelSnapshot: public LLPanel
{
public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
virtual std::string getWidthSpinnerName() const = 0;
virtual std::string getHeightSpinnerName() const = 0;
virtual std::string getAspectRatioCBName() const = 0;
virtual std::string getImageSizeComboName() const = 0;
virtual std::string getImageSizePanelName() const = 0;
virtual S32 getTypedPreviewWidth() const;
virtual S32 getTypedPreviewHeight() const;
virtual LLSpinCtrl* getWidthSpinner();
virtual LLSpinCtrl* getHeightSpinner();
virtual void enableAspectRatioCheckbox(BOOL enable);
virtual LLFloaterSnapshot::ESnapshotFormat getImageFormat() const;
virtual void updateControls(const LLSD& info) = 0; ///< Update controls from saved settings
void enableControls(BOOL enable);
protected:
LLSideTrayPanelContainer* getParentContainer();
virtual void updateCustomResControls();
void updateImageQualityLevel();
void goBack(); ///< Switch to the default (Snapshot Options) panel
void cancel();
// common UI callbacks
void onCustomResolutionCommit();
void onResolutionComboCommit(LLUICtrl* ctrl);
void onKeepAspectRatioCommit(LLUICtrl* ctrl);
};
#endif // LL_LLPANELSNAPSHOT_H

View File

@ -0,0 +1,109 @@
/**
* @file llpanelsnapshotinventory.cpp
* @brief The panel provides UI for saving snapshot as an inventory texture.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llcombobox.h"
#include "lleconomy.h"
#include "llsidetraypanelcontainer.h"
#include "llspinctrl.h"
#include "llfloatersnapshot.h" // FIXME: replace with a snapshot storage model
#include "llpanelsnapshot.h"
#include "llviewercontrol.h" // gSavedSettings
/**
* The panel provides UI for saving snapshot as an inventory texture.
*/
class LLPanelSnapshotInventory
: public LLPanelSnapshot
{
LOG_CLASS(LLPanelSnapshotInventory);
public:
LLPanelSnapshotInventory();
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
private:
/*virtual*/ void updateCustomResControls(); ///< Show/hide custom resolution controls (spinners and checkbox)
/*virtual*/ std::string getWidthSpinnerName() const { return "inventory_snapshot_width"; }
/*virtual*/ std::string getHeightSpinnerName() const { return "inventory_snapshot_height"; }
/*virtual*/ std::string getAspectRatioCBName() const { return "inventory_keep_aspect_check"; }
/*virtual*/ std::string getImageSizeComboName() const { return "texture_size_combo"; }
/*virtual*/ std::string getImageSizePanelName() const { return LLStringUtil::null; }
/*virtual*/ void updateControls(const LLSD& info);
void onSend();
};
static LLRegisterPanelClassWrapper<LLPanelSnapshotInventory> panel_class("llpanelsnapshotinventory");
LLPanelSnapshotInventory::LLPanelSnapshotInventory()
{
mCommitCallbackRegistrar.add("Inventory.Save", boost::bind(&LLPanelSnapshotInventory::onSend, this));
mCommitCallbackRegistrar.add("Inventory.Cancel", boost::bind(&LLPanelSnapshotInventory::cancel, this));
}
// virtual
BOOL LLPanelSnapshotInventory::postBuild()
{
getChild<LLSpinCtrl>(getWidthSpinnerName())->setAllowEdit(FALSE);
getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(FALSE);
getChild<LLUICtrl>(getAspectRatioCBName())->setVisible(FALSE); // we don't keep aspect ratio for inventory textures
return LLPanelSnapshot::postBuild();
}
// virtual
void LLPanelSnapshotInventory::onOpen(const LLSD& key)
{
getChild<LLUICtrl>("hint_lbl")->setTextArg("[UPLOAD_COST]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()));
LLPanelSnapshot::onOpen(key);
}
// virtual
void LLPanelSnapshotInventory::updateCustomResControls()
{
LLComboBox* combo = getChild<LLComboBox>(getImageSizeComboName());
S32 selected_idx = combo->getFirstSelectedIndex();
const bool show = selected_idx == (combo->getItemCount() - 1); // Custom selected
getChild<LLUICtrl>(getWidthSpinnerName())->setVisible(show);
getChild<LLUICtrl>(getHeightSpinnerName())->setVisible(show);
}
// virtual
void LLPanelSnapshotInventory::updateControls(const LLSD& info)
{
const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
getChild<LLUICtrl>("save_btn")->setEnabled(have_snapshot);
}
void LLPanelSnapshotInventory::onSend()
{
LLFloaterSnapshot::saveTexture();
LLFloaterSnapshot::postSave();
}

View File

@ -0,0 +1,168 @@
/**
* @file llpanelsnapshotlocal.cpp
* @brief The panel provides UI for saving snapshot to a local folder.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llcombobox.h"
#include "llsidetraypanelcontainer.h"
#include "llsliderctrl.h"
#include "llspinctrl.h"
#include "llfloatersnapshot.h" // FIXME: replace with a snapshot storage model
#include "llpanelsnapshot.h"
#include "llviewercontrol.h" // gSavedSettings
#include "llviewerwindow.h"
/**
* The panel provides UI for saving snapshot to a local folder.
*/
class LLPanelSnapshotLocal
: public LLPanelSnapshot
{
LOG_CLASS(LLPanelSnapshotLocal);
public:
LLPanelSnapshotLocal();
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
private:
/*virtual*/ std::string getWidthSpinnerName() const { return "local_snapshot_width"; }
/*virtual*/ std::string getHeightSpinnerName() const { return "local_snapshot_height"; }
/*virtual*/ std::string getAspectRatioCBName() const { return "local_keep_aspect_check"; }
/*virtual*/ std::string getImageSizeComboName() const { return "local_size_combo"; }
/*virtual*/ std::string getImageSizePanelName() const { return "local_image_size_lp"; }
/*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const;
/*virtual*/ void updateControls(const LLSD& info);
void onFormatComboCommit(LLUICtrl* ctrl);
void onQualitySliderCommit(LLUICtrl* ctrl);
void onSaveFlyoutCommit(LLUICtrl* ctrl);
};
static LLRegisterPanelClassWrapper<LLPanelSnapshotLocal> panel_class("llpanelsnapshotlocal");
LLPanelSnapshotLocal::LLPanelSnapshotLocal()
{
mCommitCallbackRegistrar.add("Local.Cancel", boost::bind(&LLPanelSnapshotLocal::cancel, this));
}
// virtual
BOOL LLPanelSnapshotLocal::postBuild()
{
getChild<LLUICtrl>("image_quality_slider")->setCommitCallback(boost::bind(&LLPanelSnapshotLocal::onQualitySliderCommit, this, _1));
getChild<LLUICtrl>("local_format_combo")->setCommitCallback(boost::bind(&LLPanelSnapshotLocal::onFormatComboCommit, this, _1));
getChild<LLUICtrl>("save_btn")->setCommitCallback(boost::bind(&LLPanelSnapshotLocal::onSaveFlyoutCommit, this, _1));
return LLPanelSnapshot::postBuild();
}
// virtual
void LLPanelSnapshotLocal::onOpen(const LLSD& key)
{
LLPanelSnapshot::onOpen(key);
}
// virtual
LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshotLocal::getImageFormat() const
{
LLFloaterSnapshot::ESnapshotFormat fmt = LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG;
LLComboBox* local_format_combo = getChild<LLComboBox>("local_format_combo");
const std::string id = local_format_combo->getValue().asString();
if (id == "PNG")
{
fmt = LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG;
}
else if (id == "JPEG")
{
fmt = LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG;
}
else if (id == "BMP")
{
fmt = LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP;
}
return fmt;
}
// virtual
void LLPanelSnapshotLocal::updateControls(const LLSD& info)
{
LLFloaterSnapshot::ESnapshotFormat fmt =
(LLFloaterSnapshot::ESnapshotFormat) gSavedSettings.getS32("SnapshotFormat");
getChild<LLComboBox>("local_format_combo")->selectNthItem((S32) fmt);
const bool show_quality_ctrls = (fmt == LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
getChild<LLUICtrl>("image_quality_slider")->setVisible(show_quality_ctrls);
getChild<LLUICtrl>("image_quality_level")->setVisible(show_quality_ctrls);
getChild<LLUICtrl>("image_quality_slider")->setValue(gSavedSettings.getS32("SnapshotQuality"));
updateImageQualityLevel();
const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
getChild<LLUICtrl>("save_btn")->setEnabled(have_snapshot);
}
void LLPanelSnapshotLocal::onFormatComboCommit(LLUICtrl* ctrl)
{
// will call updateControls()
LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true));
}
void LLPanelSnapshotLocal::onQualitySliderCommit(LLUICtrl* ctrl)
{
updateImageQualityLevel();
LLSliderCtrl* slider = (LLSliderCtrl*)ctrl;
S32 quality_val = llfloor((F32)slider->getValue().asReal());
LLSD info;
info["image-quality-change"] = quality_val;
LLFloaterSnapshot::getInstance()->notify(info);
}
void LLPanelSnapshotLocal::onSaveFlyoutCommit(LLUICtrl* ctrl)
{
if (ctrl->getValue().asString() == "save as")
{
gViewerWindow->resetSnapshotLoc();
}
LLFloaterSnapshot* floater = LLFloaterSnapshot::getInstance();
floater->notify(LLSD().with("set-working", true));
BOOL saved = LLFloaterSnapshot::saveLocal();
if (saved)
{
LLFloaterSnapshot::postSave();
goBack();
floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local")));
}
else
{
cancel();
}
}

View File

@ -0,0 +1,120 @@
/**
* @file llpanelsnapshotoptions.cpp
* @brief Snapshot posting options panel.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "lleconomy.h"
#include "llpanel.h"
#include "llsidetraypanelcontainer.h"
#include "llfloatersnapshot.h" // FIXME: create a snapshot model
/**
* Provides several ways to save a snapshot.
*/
class LLPanelSnapshotOptions
: public LLPanel
, public LLEconomyObserver
{
LOG_CLASS(LLPanelSnapshotOptions);
public:
LLPanelSnapshotOptions();
~LLPanelSnapshotOptions();
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void onEconomyDataChange() { updateUploadCost(); }
private:
void updateUploadCost();
void openPanel(const std::string& panel_name);
void onSaveToProfile();
void onSaveToEmail();
void onSaveToInventory();
void onSaveToComputer();
};
static LLRegisterPanelClassWrapper<LLPanelSnapshotOptions> panel_class("llpanelsnapshotoptions");
LLPanelSnapshotOptions::LLPanelSnapshotOptions()
{
mCommitCallbackRegistrar.add("Snapshot.SaveToProfile", boost::bind(&LLPanelSnapshotOptions::onSaveToProfile, this));
mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this));
mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this));
mCommitCallbackRegistrar.add("Snapshot.SaveToComputer", boost::bind(&LLPanelSnapshotOptions::onSaveToComputer, this));
LLGlobalEconomy::Singleton::getInstance()->addObserver(this);
}
LLPanelSnapshotOptions::~LLPanelSnapshotOptions()
{
LLGlobalEconomy::Singleton::getInstance()->removeObserver(this);
}
// virtual
void LLPanelSnapshotOptions::onOpen(const LLSD& key)
{
updateUploadCost();
}
void LLPanelSnapshotOptions::updateUploadCost()
{
S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
getChild<LLUICtrl>("save_to_inventory_btn")->setLabelArg("[AMOUNT]", llformat("%d", upload_cost));
}
void LLPanelSnapshotOptions::openPanel(const std::string& panel_name)
{
LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent());
if (!parent)
{
llwarns << "Cannot find panel container" << llendl;
return;
}
parent->openPanel(panel_name);
parent->getCurrentPanel()->onOpen(LLSD());
LLFloaterSnapshot::postPanelSwitch();
}
void LLPanelSnapshotOptions::onSaveToProfile()
{
openPanel("panel_snapshot_profile");
}
void LLPanelSnapshotOptions::onSaveToEmail()
{
openPanel("panel_snapshot_postcard");
}
void LLPanelSnapshotOptions::onSaveToInventory()
{
openPanel("panel_snapshot_inventory");
}
void LLPanelSnapshotOptions::onSaveToComputer()
{
openPanel("panel_snapshot_local");
}

View File

@ -0,0 +1,270 @@
/**
* @file llpanelsnapshotpostcard.cpp
* @brief Postcard sending panel.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llcombobox.h"
#include "llnotificationsutil.h"
#include "llsidetraypanelcontainer.h"
#include "llsliderctrl.h"
#include "llspinctrl.h"
#include "lltexteditor.h"
#include "llagent.h"
#include "llagentui.h"
#include "llfloatersnapshot.h" // FIXME: replace with a snapshot storage model
#include "llpanelsnapshot.h"
#include "llpostcard.h"
#include "llviewercontrol.h" // gSavedSettings
#include "llviewerwindow.h"
#include <boost/regex.hpp>
/**
* Sends postcard via email.
*/
class LLPanelSnapshotPostcard
: public LLPanelSnapshot
{
LOG_CLASS(LLPanelSnapshotPostcard);
public:
LLPanelSnapshotPostcard();
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ S32 notify(const LLSD& info);
private:
/*virtual*/ std::string getWidthSpinnerName() const { return "postcard_snapshot_width"; }
/*virtual*/ std::string getHeightSpinnerName() const { return "postcard_snapshot_height"; }
/*virtual*/ std::string getAspectRatioCBName() const { return "postcard_keep_aspect_check"; }
/*virtual*/ std::string getImageSizeComboName() const { return "postcard_size_combo"; }
/*virtual*/ std::string getImageSizePanelName() const { return "postcard_image_size_lp"; }
/*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; }
/*virtual*/ void updateControls(const LLSD& info);
bool missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response);
void sendPostcard();
void onMsgFormFocusRecieved();
void onFormatComboCommit(LLUICtrl* ctrl);
void onQualitySliderCommit(LLUICtrl* ctrl);
void onTabButtonPress(S32 btn_idx);
void onSend();
bool mHasFirstMsgFocus;
std::string mAgentEmail;
};
static LLRegisterPanelClassWrapper<LLPanelSnapshotPostcard> panel_class("llpanelsnapshotpostcard");
LLPanelSnapshotPostcard::LLPanelSnapshotPostcard()
: mHasFirstMsgFocus(false)
{
mCommitCallbackRegistrar.add("Postcard.Send", boost::bind(&LLPanelSnapshotPostcard::onSend, this));
mCommitCallbackRegistrar.add("Postcard.Cancel", boost::bind(&LLPanelSnapshotPostcard::cancel, this));
mCommitCallbackRegistrar.add("Postcard.Message", boost::bind(&LLPanelSnapshotPostcard::onTabButtonPress, this, 0));
mCommitCallbackRegistrar.add("Postcard.Settings", boost::bind(&LLPanelSnapshotPostcard::onTabButtonPress, this, 1));
}
// virtual
BOOL LLPanelSnapshotPostcard::postBuild()
{
// pick up the user's up-to-date email address
gAgent.sendAgentUserInfoRequest();
std::string name_string;
LLAgentUI::buildFullname(name_string);
getChild<LLUICtrl>("name_form")->setValue(LLSD(name_string));
// For the first time a user focuses to .the msg box, all text will be selected.
getChild<LLUICtrl>("msg_form")->setFocusChangedCallback(boost::bind(&LLPanelSnapshotPostcard::onMsgFormFocusRecieved, this));
getChild<LLUICtrl>("to_form")->setFocus(TRUE);
getChild<LLUICtrl>("image_quality_slider")->setCommitCallback(boost::bind(&LLPanelSnapshotPostcard::onQualitySliderCommit, this, _1));
getChild<LLButton>("message_btn")->setToggleState(TRUE);
return LLPanelSnapshot::postBuild();
}
// virtual
void LLPanelSnapshotPostcard::onOpen(const LLSD& key)
{
LLPanelSnapshot::onOpen(key);
}
// virtual
S32 LLPanelSnapshotPostcard::notify(const LLSD& info)
{
if (!info.has("agent-email"))
{
llassert(info.has("agent-email"));
return 0;
}
if (mAgentEmail.empty())
{
mAgentEmail = info["agent-email"].asString();
}
return 1;
}
// virtual
void LLPanelSnapshotPostcard::updateControls(const LLSD& info)
{
getChild<LLUICtrl>("image_quality_slider")->setValue(gSavedSettings.getS32("SnapshotQuality"));
updateImageQualityLevel();
const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
getChild<LLUICtrl>("send_btn")->setEnabled(have_snapshot);
}
bool LLPanelSnapshotPostcard::missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if(0 == option)
{
// User clicked OK
if((getChild<LLUICtrl>("subject_form")->getValue().asString()).empty())
{
// Stuff the subject back into the form.
getChild<LLUICtrl>("subject_form")->setValue(getString("default_subject"));
}
if (!mHasFirstMsgFocus)
{
// The user never switched focus to the message window.
// Using the default string.
getChild<LLUICtrl>("msg_form")->setValue(getString("default_message"));
}
sendPostcard();
}
return false;
}
void LLPanelSnapshotPostcard::sendPostcard()
{
std::string to(getChild<LLUICtrl>("to_form")->getValue().asString());
std::string subject(getChild<LLUICtrl>("subject_form")->getValue().asString());
LLSD postcard = LLSD::emptyMap();
postcard["pos-global"] = LLFloaterSnapshot::getPosTakenGlobal().getValue();
postcard["to"] = to;
postcard["from"] = mAgentEmail;
postcard["name"] = getChild<LLUICtrl>("name_form")->getValue().asString();
postcard["subject"] = subject;
postcard["msg"] = getChild<LLUICtrl>("msg_form")->getValue().asString();
LLPostCard::send(LLFloaterSnapshot::getImageData(), postcard);
// Give user feedback of the event.
gViewerWindow->playSnapshotAnimAndSound();
LLFloaterSnapshot::postSave();
}
void LLPanelSnapshotPostcard::onMsgFormFocusRecieved()
{
LLTextEditor* msg_form = getChild<LLTextEditor>("msg_form");
if (msg_form->hasFocus() && !mHasFirstMsgFocus)
{
mHasFirstMsgFocus = true;
msg_form->setText(LLStringUtil::null);
}
}
void LLPanelSnapshotPostcard::onFormatComboCommit(LLUICtrl* ctrl)
{
// will call updateControls()
LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true));
}
void LLPanelSnapshotPostcard::onQualitySliderCommit(LLUICtrl* ctrl)
{
updateImageQualityLevel();
LLSliderCtrl* slider = (LLSliderCtrl*)ctrl;
S32 quality_val = llfloor((F32)slider->getValue().asReal());
LLSD info;
info["image-quality-change"] = quality_val;
LLFloaterSnapshot::getInstance()->notify(info); // updates the "SnapshotQuality" setting
}
void LLPanelSnapshotPostcard::onTabButtonPress(S32 btn_idx)
{
LLButton* buttons[2] = {
getChild<LLButton>("message_btn"),
getChild<LLButton>("settings_btn"),
};
// Switch between Message and Settings tabs.
LLButton* clicked_btn = buttons[btn_idx];
LLButton* other_btn = buttons[!btn_idx];
LLSideTrayPanelContainer* container =
getChild<LLSideTrayPanelContainer>("postcard_panel_container");
container->selectTab(clicked_btn->getToggleState() ? btn_idx : !btn_idx);
//clicked_btn->setEnabled(FALSE);
other_btn->toggleState();
//other_btn->setEnabled(TRUE);
lldebugs << "Button #" << btn_idx << " (" << clicked_btn->getName() << ") clicked" << llendl;
}
void LLPanelSnapshotPostcard::onSend()
{
// Validate input.
std::string to(getChild<LLUICtrl>("to_form")->getValue().asString());
boost::regex email_format("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})*");
if (to.empty() || !boost::regex_match(to, email_format))
{
LLNotificationsUtil::add("PromptRecipientEmail");
return;
}
if (mAgentEmail.empty() || !boost::regex_match(mAgentEmail, email_format))
{
LLNotificationsUtil::add("PromptSelfEmail");
return;
}
std::string subject(getChild<LLUICtrl>("subject_form")->getValue().asString());
if(subject.empty() || !mHasFirstMsgFocus)
{
LLNotificationsUtil::add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLPanelSnapshotPostcard::missingSubjMsgAlertCallback, this, _1, _2));
return;
}
// Send postcard.
sendPostcard();
}

View File

@ -0,0 +1,101 @@
/**
* @file llpanelsnapshotprofile.cpp
* @brief Posts a snapshot to My Profile feed.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
// libs
#include "llcombobox.h"
#include "llfloaterreg.h"
#include "llpanel.h"
#include "llspinctrl.h"
// newview
#include "llfloatersnapshot.h"
#include "llpanelsnapshot.h"
#include "llsidetraypanelcontainer.h"
#include "llwebprofile.h"
/**
* Posts a snapshot to My Profile feed.
*/
class LLPanelSnapshotProfile
: public LLPanelSnapshot
{
LOG_CLASS(LLPanelSnapshotProfile);
public:
LLPanelSnapshotProfile();
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
private:
/*virtual*/ std::string getWidthSpinnerName() const { return "profile_snapshot_width"; }
/*virtual*/ std::string getHeightSpinnerName() const { return "profile_snapshot_height"; }
/*virtual*/ std::string getAspectRatioCBName() const { return "profile_keep_aspect_check"; }
/*virtual*/ std::string getImageSizeComboName() const { return "profile_size_combo"; }
/*virtual*/ std::string getImageSizePanelName() const { return "profile_image_size_lp"; }
/*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; }
/*virtual*/ void updateControls(const LLSD& info);
void onSend();
};
static LLRegisterPanelClassWrapper<LLPanelSnapshotProfile> panel_class("llpanelsnapshotprofile");
LLPanelSnapshotProfile::LLPanelSnapshotProfile()
{
mCommitCallbackRegistrar.add("PostToProfile.Send", boost::bind(&LLPanelSnapshotProfile::onSend, this));
mCommitCallbackRegistrar.add("PostToProfile.Cancel", boost::bind(&LLPanelSnapshotProfile::cancel, this));
}
// virtual
BOOL LLPanelSnapshotProfile::postBuild()
{
return LLPanelSnapshot::postBuild();
}
// virtual
void LLPanelSnapshotProfile::onOpen(const LLSD& key)
{
LLPanelSnapshot::onOpen(key);
}
// virtual
void LLPanelSnapshotProfile::updateControls(const LLSD& info)
{
const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
getChild<LLUICtrl>("post_btn")->setEnabled(have_snapshot);
}
void LLPanelSnapshotProfile::onSend()
{
std::string caption = getChild<LLUICtrl>("caption")->getValue().asString();
bool add_location = getChild<LLUICtrl>("add_location_cb")->getValue().asBoolean();
LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location);
LLFloaterSnapshot::postSave();
}

View File

@ -0,0 +1,155 @@
/**
* @file llpostcard.cpp
* @brief Sending postcards.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llpostcard.h"
#include "llvfile.h"
#include "llvfs.h"
#include "llviewerregion.h"
#include "message.h"
#include "llagent.h"
#include "llassetuploadresponders.h"
///////////////////////////////////////////////////////////////////////////////
// misc
static void postcard_upload_callback(const LLUUID& asset_id, void *user_data, S32 result, LLExtStat ext_status)
{
LLSD* postcard_data = (LLSD*)user_data;
if (result)
{
// TODO: display the error messages in UI
llwarns << "Failed to send postcard: " << LLAssetStorage::getErrorString(result) << llendl;
LLPostCard::reportPostResult(false);
}
else
{
// only create the postcard once the upload succeeds
// request the postcard
const LLSD& data = *postcard_data;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("SendPostcard");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->addUUID("AssetID", data["asset-id"].asUUID());
msg->addVector3d("PosGlobal", LLVector3d(data["pos-global"]));
msg->addString("To", data["to"]);
msg->addString("From", data["from"]);
msg->addString("Name", data["name"]);
msg->addString("Subject", data["subject"]);
msg->addString("Msg", data["msg"]);
msg->addBOOL("AllowPublish", FALSE);
msg->addBOOL("MaturePublish", FALSE);
gAgent.sendReliableMessage();
LLPostCard::reportPostResult(true);
}
delete postcard_data;
}
///////////////////////////////////////////////////////////////////////////////
// LLPostcardSendResponder
class LLPostcardSendResponder : public LLAssetUploadResponder
{
LOG_CLASS(LLPostcardSendResponder);
public:
LLPostcardSendResponder(const LLSD &post_data,
const LLUUID& vfile_id,
LLAssetType::EType asset_type):
LLAssetUploadResponder(post_data, vfile_id, asset_type)
{
}
/*virtual*/ void uploadComplete(const LLSD& content)
{
llinfos << "Postcard sent" << llendl;
LL_DEBUGS("Snapshots") << "content: " << content << llendl;
LLPostCard::reportPostResult(true);
}
/*virtual*/ void uploadFailure(const LLSD& content)
{
llwarns << "Sending postcard failed: " << content << llendl;
LLPostCard::reportPostResult(false);
}
};
///////////////////////////////////////////////////////////////////////////////
// LLPostCard
LLPostCard::result_callback_t LLPostCard::mResultCallback;
// static
void LLPostCard::send(LLPointer<LLImageFormatted> image, const LLSD& postcard_data)
{
LLTransactionID transaction_id;
LLAssetID asset_id;
transaction_id.generate();
asset_id = transaction_id.makeAssetID(gAgent.getSecureSessionID());
LLVFile::writeFile(image->getData(), image->getDataSize(), gVFS, asset_id, LLAssetType::AT_IMAGE_JPEG);
// upload the image
std::string url = gAgent.getRegion()->getCapability("SendPostcard");
if (!url.empty())
{
llinfos << "Sending postcard via capability" << llendl;
// the capability already encodes: agent ID, region ID
LL_DEBUGS("Snapshots") << "url: " << url << llendl;
LL_DEBUGS("Snapshots") << "body: " << postcard_data << llendl;
LL_DEBUGS("Snapshots") << "data size: " << image->getDataSize() << llendl;
LLHTTPClient::post(url, postcard_data,
new LLPostcardSendResponder(postcard_data, asset_id, LLAssetType::AT_IMAGE_JPEG));
}
else
{
llinfos << "Sending postcard" << llendl;
LLSD* data = new LLSD(postcard_data);
(*data)["asset-id"] = asset_id;
gAssetStorage->storeAssetData(transaction_id, LLAssetType::AT_IMAGE_JPEG,
&postcard_upload_callback, (void *)data, FALSE);
}
}
// static
void LLPostCard::reportPostResult(bool ok)
{
if (mResultCallback)
{
mResultCallback(ok);
}
}

View File

@ -0,0 +1,48 @@
/**
* @file llpostcard.h
* @brief Sending postcards.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_LLPOSTCARD_H
#define LL_LLPOSTCARD_H
#include "llimage.h"
#include "lluuid.h"
class LLPostCard
{
LOG_CLASS(LLPostCard);
public:
typedef boost::function<void(bool ok)> result_callback_t;
static void send(LLPointer<LLImageFormatted> image, const LLSD& postcard_data);
static void setPostResultCallback(result_callback_t cb) { mResultCallback = cb; }
static void reportPostResult(bool ok);
private:
static result_callback_t mResultCallback;
};
#endif // LL_LLPOSTCARD_H

View File

@ -363,8 +363,10 @@ void LLPreview::onBtnCopyToInv(void* userdata)
// Copy to inventory
if (self->mNotecardInventoryID.notNull())
{
copy_inventory_from_notecard(self->mNotecardObjectID,
self->mNotecardInventoryID, item);
copy_inventory_from_notecard(LLUUID::null,
self->mNotecardObjectID,
self->mNotecardInventoryID,
item);
}
else
{

View File

@ -708,6 +708,8 @@ void LLScreenChannel::showToastsTop()
//--------------------------------------------------------------------------
void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer)
{
LLScreenChannelBase::updateRect();
LLRect toast_rect;
LLToast::Params p;
p.lifetime_secs = timer;
@ -730,13 +732,10 @@ void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer)
text_box->setValue(text);
text_box->setVisible(TRUE);
S32 old_height = text_box->getRect().getHeight();
text_box->reshapeToFitText();
text_box->setOrigin(text_box->getRect().mLeft, (wrapper_panel->getRect().getHeight() - text_box->getRect().getHeight())/2);
S32 new_height = text_box->getRect().getHeight();
S32 height_delta = new_height - old_height;
toast_rect.setLeftTopAndSize(0, toast_rect.getHeight() + height_delta +gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_rect.getHeight());
toast_rect.setLeftTopAndSize(0, getRect().getHeight() - gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_rect.getHeight());
mStartUpToastPanel->setRect(toast_rect);
addChild(mStartUpToastPanel);

View File

@ -113,21 +113,13 @@ public:
switch (added_category_type)
{
case LLFolderType::FT_INBOX:
mSidepanelInventory->enableInbox(true);
mSidepanelInventory->observeInboxModifications(added_category->getUUID());
break;
case LLFolderType::FT_OUTBOX:
mSidepanelInventory->enableOutbox(true);
mSidepanelInventory->observeOutboxModifications(added_category->getUUID());
break;
case LLFolderType::FT_NONE:
// HACK until sim update to properly create folder with system type
if (added_category->getName() == "Received Items")
{
mSidepanelInventory->observeInboxModifications(added_category->getUUID());
}
else if (added_category->getName() == "Merchant Outbox")
{
mSidepanelInventory->observeOutboxModifications(added_category->getUUID());
}
default:
break;
}
@ -288,7 +280,6 @@ BOOL LLSidepanelInventory::postBuild()
gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged));
gSavedSettings.getControl("InventoryDisplayOutbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayOutboxChanged));
updateInboxOutbox();
// Update the verbs buttons state.
updateVerbs();
@ -316,20 +307,20 @@ void LLSidepanelInventory::updateInboxOutbox()
// Set up observer for inbox changes, if we have an inbox already
if (!inbox_id.isNull())
{
observeInboxModifications(inbox_id);
// Enable the display of the inbox if it exists
enableInbox(true);
observeInboxModifications(inbox_id);
}
#if ENABLE_MERCHANT_OUTBOX_PANEL
// Set up observer for outbox changes, if we have an outbox already
if (!outbox_id.isNull())
{
observeOutboxModifications(outbox_id);
// Enable the display of the outbox if it exists
enableOutbox(true);
observeOutboxModifications(outbox_id);
}
#endif
}
@ -459,6 +450,24 @@ void LLSidepanelInventory::enableOutbox(bool enabled)
}
}
void LLSidepanelInventory::openInbox()
{
if (mInboxEnabled)
{
getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true);
onToggleInboxBtn();
}
}
void LLSidepanelInventory::openOutbox()
{
if (mOutboxEnabled)
{
getChild<LLButton>(OUTBOX_BUTTON_NAME)->setToggleState(true);
onToggleOutboxBtn();
}
}
void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id)
{
// Trigger a load of the entire inbox so we always know the contents and their creation dates for sorting

View File

@ -58,6 +58,9 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any.
LLInventoryPanel* getInboxPanel() const { return mInventoryPanelInbox; }
LLInventoryPanel* getOutboxPanel() const { return mInventoryPanelOutbox; }
LLPanelMainInventory* getMainInventoryPanel() const { return mPanelMainInventory; }
BOOL isMainInventoryPanelActive() const;
@ -77,6 +80,9 @@ public:
void enableInbox(bool enabled);
void enableOutbox(bool enabled);
void openInbox();
void openOutbox();
bool isInboxEnabled() const { return mInboxEnabled; }
bool isOutboxEnabled() const { return mOutboxEnabled; }

View File

@ -62,6 +62,13 @@ void LLSideTrayPanelContainer::onOpen(const LLSD& key)
getCurrentPanel()->onOpen(key);
}
void LLSideTrayPanelContainer::openPanel(const std::string& panel_name, const LLSD& key)
{
LLSD combined_key = key;
combined_key[PARAM_SUB_PANEL_NAME] = panel_name;
onOpen(combined_key);
}
void LLSideTrayPanelContainer::openPreviousPanel()
{
if(!mDefaultPanelName.empty())

View File

@ -56,6 +56,11 @@ public:
*/
/*virtual*/ void onOpen(const LLSD& key);
/**
* Opens given subpanel.
*/
void openPanel(const std::string& panel_name, const LLSD& key = LLSD::emptyMap());
/**
* Opens previous panel from panel navigation history.
*/

View File

@ -190,6 +190,7 @@
#include "lllogin.h"
#include "llevents.h"
#include "llstartuplistener.h"
#include "lltoolbarview.h"
#if LL_WINDOWS
#include "lldxhardware.h"
@ -2126,7 +2127,7 @@ bool idle_startup()
show_debug_menus(); // Debug menu visiblity and First Use trigger
// If we've got a startup URL, dispatch it
LLStartUp::dispatchURL();
//LLStartUp::dispatchURL();
// Retrieve information about the land data
// (just accessing this the first time will fetch it,
@ -2186,7 +2187,12 @@ void login_show()
#else
BOOL bUseDebugLogin = TRUE;
#endif
// Hide the toolbars: may happen to come back here if login fails after login agent but before login in region
if (gToolBarView)
{
gToolBarView->setVisible(FALSE);
}
LLPanelLogin::show( gViewerWindow->getWindowRectScaled(),
bUseDebugLogin || gSavedSettings.getBOOL("SecondLifeEnterprise"),
login_callback, NULL );
@ -2783,12 +2789,12 @@ void LLStartUp::cleanupNameCache()
bool LLStartUp::dispatchURL()
{
// ok, if we've gotten this far and have a startup URL
if (!getStartSLURL().isValid())
if (!getStartSLURL().isValid())
{
return false;
}
if(getStartSLURL().getType() != LLSLURL::APP)
{
if(getStartSLURL().getType() != LLSLURL::APP)
{
// If we started with a location, but we're already
// at that location, don't pop dialogs open.

View File

@ -1641,8 +1641,8 @@ void LLTextureCache::purgeTextures(bool validate)
{
purge_count++;
LL_DEBUGS("TextureCache") << "PURGING: " << filename << LL_ENDL;
removeEntry(idx, entries[idx], filename) ;
cache_size -= entries[idx].mBodySize;
removeEntry(idx, entries[idx], filename) ;
}
}
@ -1879,13 +1879,12 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename)
file_maybe_exists = false;
}
}
mTexturesSizeTotal -= entry.mBodySize;
entry.mImageSize = -1;
entry.mBodySize = 0;
mHeaderIDMap.erase(entry.mID);
mTexturesSizeMap.erase(entry.mID);
mTexturesSizeTotal -= entry.mBodySize;
mTexturesSizeMap.erase(entry.mID);
mFreeList.insert(idx);
}

View File

@ -315,6 +315,19 @@ bool LLToolBarView::loadToolbars(bool force_default)
return true;
}
bool LLToolBarView::clearToolbars()
{
for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
{
if (mToolbars[i])
{
mToolbars[i]->clearCommandsList();
}
}
return true;
}
//static
bool LLToolBarView::loadDefaultToolbars()
{
@ -332,6 +345,23 @@ bool LLToolBarView::loadDefaultToolbars()
return retval;
}
//static
bool LLToolBarView::clearAllToolbars()
{
bool retval = false;
if (gToolBarView)
{
retval = gToolBarView->clearToolbars();
if (retval)
{
gToolBarView->saveToolbars();
}
}
return retval;
}
void LLToolBarView::saveToolbars() const
{
if (!mToolbarsLoaded)

View File

@ -94,9 +94,13 @@ public:
// Loads the toolbars from the existing user or default settings
bool loadToolbars(bool force_default = false); // return false if load fails
// Clears all buttons off the toolbars
bool clearToolbars();
void setToolBarsVisible(bool visible);
static bool loadDefaultToolbars();
static bool clearAllToolbars();
static void startDragTool(S32 x, S32 y, LLToolBarButton* toolbarButton);
static BOOL handleDragTool(S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type);

View File

@ -64,7 +64,6 @@
#include "llfloatergroups.h"
#include "llfloaterhardwaresettings.h"
#include "llfloaterhelpbrowser.h"
#include "llfloatermediabrowser.h"
#include "llfloaterwebcontent.h"
#include "llfloatermediasettings.h"
#include "llfloaterhud.h"
@ -85,7 +84,6 @@
#include "llfloateropenobject.h"
#include "llfloaterpay.h"
#include "llfloaterperms.h"
#include "llfloaterpostcard.h"
#include "llfloaterpostprocess.h"
#include "llfloaterpreference.h"
#include "llfloaterproperties.h"
@ -227,7 +225,6 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLandHoldings>);
LLFloaterReg::add("mem_leaking", "floater_mem_leaking.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMemLeak>);
LLFloaterReg::add("media_browser", "floater_media_browser.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMediaBrowser>);
LLFloaterReg::add("media_settings", "floater_media_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMediaSettings>);
LLFloaterReg::add("message_critical", "floater_critical.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTOS>);
LLFloaterReg::add("message_tos", "floater_tos.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTOS>);
@ -245,7 +242,6 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("people", "floater_people.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
LLFloaterReg::add("places", "floater_places.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
LLFloaterReg::add("postcard", "floater_postcard.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPostcard>);
LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>);
LLFloaterReg::add("prefs_proxy", "floater_preferences_proxy.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreferenceProxy>);
LLFloaterReg::add("prefs_hardware_settings", "floater_hardware_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHardwareSettings>);

View File

@ -1209,7 +1209,23 @@ void move_inventory_item(
gAgent.sendReliableMessage();
}
void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecard_inv_id, const LLInventoryItem *src, U32 callback_id)
const LLUUID get_folder_by_itemtype(const LLInventoryItem *src)
{
LLUUID retval = LLUUID::null;
if (src)
{
retval = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(src->getType()));
}
return retval;
}
void copy_inventory_from_notecard(const LLUUID& destination_id,
const LLUUID& object_id,
const LLUUID& notecard_inv_id,
const LLInventoryItem *src,
U32 callback_id)
{
if (NULL == src)
{
@ -1255,7 +1271,7 @@ void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecar
body["notecard-id"] = notecard_inv_id;
body["object-id"] = object_id;
body["item-id"] = src->getUUID();
body["folder-id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(src->getType()));
body["folder-id"] = destination_id;
body["callback-id"] = (LLSD::Integer)callback_id;
request["message"] = "CopyInventoryFromNotecard";

View File

@ -363,7 +363,10 @@ void move_inventory_item(
const std::string& new_name,
LLPointer<LLInventoryCallback> cb);
void copy_inventory_from_notecard(const LLUUID& object_id,
const LLUUID get_folder_by_itemtype(const LLInventoryItem *src);
void copy_inventory_from_notecard(const LLUUID& destination_id,
const LLUUID& object_id,
const LLUUID& notecard_inv_id,
const LLInventoryItem *src,
U32 callback_id = 0);

View File

@ -50,6 +50,7 @@
#include "llvoavatar.h"
#include "llvoavatarself.h"
#include "llviewerregion.h"
#include "llwebprofile.h"
#include "llwebsharing.h" // For LLWebSharing::setOpenIDCookie(), *TODO: find a better way to do this!
#include "llfilepicker.h"
#include "llnotifications.h"
@ -68,7 +69,6 @@
#include "llwindow.h"
#include "llfloatermediabrowser.h" // for handling window close requests and geometry change requests in media browser windows.
#include "llfloaterwebcontent.h" // for handling window close requests and geometry change requests in media browser windows.
#include <boost/bind.hpp> // for SkinFolder listener
@ -319,6 +319,10 @@ public:
std::string cookie = content["set-cookie"].asString();
LLViewerMedia::getCookieStore()->setCookiesFromHost(cookie, mHost);
// Set cookie for snapshot publishing.
std::string auth_cookie = cookie.substr(0, cookie.find(";")); // strip path
LLWebProfile::setAuthCookie(auth_cookie);
}
void completedRaw(
@ -1501,6 +1505,8 @@ void LLViewerMedia::setOpenIDCookie()
std::string profile_url = getProfileURL("");
LLURL raw_profile_url( profile_url.c_str() );
LL_DEBUGS("MediaAuth") << "Requesting " << profile_url << llendl;
LL_DEBUGS("MediaAuth") << "sOpenIDCookie = [" << sOpenIDCookie << "]" << llendl;
LLHTTPClient::get(profile_url,
new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()),
headers);
@ -1733,7 +1739,8 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id,
mNavigateSuspended(false),
mNavigateSuspendedDeferred(false),
mIsUpdated(false),
mTrustedBrowser(false)
mTrustedBrowser(false),
mZoomFactor(1.0)
{
// Set up the mute list observer if it hasn't been set up already.
@ -2319,6 +2326,17 @@ void LLViewerMediaImpl::clearCache()
}
}
//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::setPageZoomFactor( double factor )
{
if(mMediaSource && factor != mZoomFactor)
{
mZoomFactor = factor;
mMediaSource->set_page_zoom_factor( factor );
}
}
//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::mouseDown(S32 x, S32 y, MASK mask, S32 button)
{
@ -2467,44 +2485,58 @@ BOOL LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask)
//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::updateJavascriptObject()
{
static LLFrameTimer timer ;
if ( mMediaSource )
{
// flag to expose this information to internal browser or not.
bool enable = gSavedSettings.getBOOL("BrowserEnableJSObject");
if(!enable)
{
return ; //no need to go further.
}
if(timer.getElapsedTimeF32() < 1.0f)
{
return ; //do not update more than once per second.
}
timer.reset() ;
mMediaSource->jsEnableObject( enable );
// these values are only menaingful after login so don't set them before
bool logged_in = LLLoginInstance::getInstance()->authSuccess();
if ( logged_in )
{
// current location within a region
LLVector3 agent_pos = gAgent.getPositionAgent();
double x = agent_pos.mV[ VX ];
double y = agent_pos.mV[ VY ];
double z = agent_pos.mV[ VZ ];
mMediaSource->jsAgentLocationEvent( x, y, z );
// current location within a region
LLVector3 agent_pos = gAgent.getPositionAgent();
double x = agent_pos.mV[ VX ];
double y = agent_pos.mV[ VY ];
double z = agent_pos.mV[ VZ ];
mMediaSource->jsAgentLocationEvent( x, y, z );
// current location within the grid
LLVector3d agent_pos_global = gAgent.getLastPositionGlobal();
double global_x = agent_pos_global.mdV[ VX ];
double global_y = agent_pos_global.mdV[ VY ];
double global_z = agent_pos_global.mdV[ VZ ];
mMediaSource->jsAgentGlobalLocationEvent( global_x, global_y, global_z );
// current location within the grid
LLVector3d agent_pos_global = gAgent.getLastPositionGlobal();
double global_x = agent_pos_global.mdV[ VX ];
double global_y = agent_pos_global.mdV[ VY ];
double global_z = agent_pos_global.mdV[ VZ ];
mMediaSource->jsAgentGlobalLocationEvent( global_x, global_y, global_z );
// current agent orientation
double rotation = atan2( gAgent.getAtAxis().mV[VX], gAgent.getAtAxis().mV[VY] );
double angle = rotation * RAD_TO_DEG;
if ( angle < 0.0f ) angle = 360.0f + angle; // TODO: has to be a better way to get orientation!
mMediaSource->jsAgentOrientationEvent( angle );
// current agent orientation
double rotation = atan2( gAgent.getAtAxis().mV[VX], gAgent.getAtAxis().mV[VY] );
double angle = rotation * RAD_TO_DEG;
if ( angle < 0.0f ) angle = 360.0f + angle; // TODO: has to be a better way to get orientation!
mMediaSource->jsAgentOrientationEvent( angle );
// current region agent is in
std::string region_name("");
LLViewerRegion* region = gAgent.getRegion();
if ( region )
{
region_name = region->getName();
};
mMediaSource->jsAgentRegionEvent( region_name );
// current region agent is in
std::string region_name("");
LLViewerRegion* region = gAgent.getRegion();
if ( region )
{
region_name = region->getName();
};
mMediaSource->jsAgentRegionEvent( region_name );
}
// language code the viewer is set to
@ -3371,7 +3403,6 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
{
// This close request is directed at another instance
pass_through = false;
LLFloaterMediaBrowser::closeRequest(uuid);
LLFloaterWebContent::closeRequest(uuid);
}
}
@ -3391,7 +3422,6 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
{
// This request is directed at another instance
pass_through = false;
LLFloaterMediaBrowser::geometryChanged(uuid, plugin->getGeometryX(), plugin->getGeometryY(), plugin->getGeometryWidth(), plugin->getGeometryHeight());
LLFloaterWebContent::geometryChanged(uuid, plugin->getGeometryX(), plugin->getGeometryY(), plugin->getGeometryWidth(), plugin->getGeometryHeight());
}
}

View File

@ -250,6 +250,7 @@ public:
std::string getMediaEntryURL() { return mMediaEntryURL; }
void setHomeURL(const std::string& home_url, const std::string& mime_type = LLStringUtil::null) { mHomeURL = home_url; mHomeMimeType = mime_type;};
void clearCache();
void setPageZoomFactor( double factor );
std::string getMimeType() { return mMimeType; }
void scaleMouse(S32 *mouse_x, S32 *mouse_y);
void scaleTextureCoords(const LLVector2& texture_coords, S32 *x, S32 *y);
@ -416,6 +417,7 @@ private:
private:
// a single media url with some data and an impl.
LLPluginClassMedia* mMediaSource;
F64 mZoomFactor;
LLUUID mTextureId;
bool mMovieImageHasMips;
std::string mMediaURL; // The last media url set with NavigateTo

View File

@ -7681,7 +7681,14 @@ class LLWorldEnvSettings : public view_listener_t
}
else
{
LLEnvManagerNew::instance().setUseDayCycle(LLEnvManagerNew::instance().getDayCycleName());
LLEnvManagerNew &envmgr = LLEnvManagerNew::instance();
// reset all environmental settings to track the region defaults, make this reset 'sticky' like the other sun settings.
bool use_fixed_sky = false;
bool use_region_settings = true;
envmgr.setUserPrefs(envmgr.getWaterPresetName(),
envmgr.getSkyPresetName(),
envmgr.getDayCycleName(),
use_fixed_sky, use_region_settings);
}
return true;

View File

@ -528,23 +528,7 @@ class LLFileTakeSnapshotToDisk : public view_listener_t
{
gViewerWindow->playSnapshotAnimAndSound();
LLPointer<LLImageFormatted> formatted;
switch(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat")))
{
case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG:
formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality"));
break;
case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
formatted = new LLImagePNG;
break;
case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP:
formatted = new LLImageBMP;
break;
default:
llwarns << "Unknown Local Snapshot format" << llendl;
return true;
}
LLPointer<LLImageFormatted> formatted = new LLImagePNG;
formatted->enableOverSize() ;
formatted->encode(raw, 0);
formatted->disableOverSize() ;

View File

@ -59,9 +59,9 @@
#include "llfloaterland.h"
#include "llfloaterregioninfo.h"
#include "llfloaterlandholdings.h"
#include "llfloaterpostcard.h"
#include "llfloaterpreference.h"
#include "llfloatersidepanelcontainer.h"
#include "llfloatersnapshot.h"
#include "llhudeffecttrail.h"
#include "llhudmanager.h"
#include "llinventoryfunctions.h"
@ -1256,14 +1256,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam
const BOOL auto_open =
gSavedSettings.getBOOL("ShowInInventory") && // don't open if showininventory is false
!from_name.empty(); // don't open if it's not from anyone.
LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open);
if(active_panel)
{
LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL;
LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
active_panel->setSelection(obj_id, TAKE_FOCUS_NO);
gFocusMgr.setKeyboardFocus(focus_ctrl);
}
LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id);
}
}
@ -6470,7 +6463,7 @@ void process_user_info_reply(LLMessageSystem* msg, void**)
msg->getString( "UserData", "DirectoryVisibility", dir_visibility);
LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email, email);
LLFloaterPostcard::updateUserInfo(email);
LLFloaterSnapshot::setAgentEmail(email);
}

View File

@ -113,7 +113,7 @@ LLViewerParcelMgr::LLViewerParcelMgr()
mRequestResult(0),
mWestSouth(),
mEastNorth(),
mSelectedDwell(0.f),
mSelectedDwell(DWELL_NAN),
mAgentParcelSequenceID(-1),
mHoverRequestResult(0),
mHoverWestSouth(),
@ -233,7 +233,7 @@ void LLViewerParcelMgr::getDisplayInfo(S32* area_out, S32* claim_out,
S32 price = 0;
S32 rent = 0;
BOOL for_sale = FALSE;
F32 dwell = 0.f;
F32 dwell = DWELL_NAN;
if (mSelected)
{
@ -579,7 +579,7 @@ void LLViewerParcelMgr::deselectLand()
mCurrentParcel->mBanList.clear();
//mCurrentParcel->mRenterList.reset();
mSelectedDwell = 0.f;
mSelectedDwell = DWELL_NAN;
// invalidate parcel selection so that existing users of this selection can clean up
mCurrentParcelSelection->setParcel(NULL);
@ -1663,7 +1663,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
LLViewerParcelMgr::getInstance()->requestParcelMediaURLFilter();
// Request dwell for this land, if it's not public land.
LLViewerParcelMgr::getInstance()->mSelectedDwell = 0.f;
LLViewerParcelMgr::getInstance()->mSelectedDwell = DWELL_NAN;
if (0 != local_id)
{
LLViewerParcelMgr::getInstance()->sendParcelDwellRequest();

View File

@ -43,6 +43,8 @@ class LLParcel;
class LLViewerTexture;
class LLViewerRegion;
const F32 DWELL_NAN = -1.0f; // A dwell having this value will be displayed as Loading...
// Constants for sendLandOwner
//const U32 NO_NEIGHBOR_JOIN = 0x0;
//const U32 ALL_NEIGHBOR_JOIN = U32( NORTH_MASK

View File

@ -88,12 +88,12 @@ public:
{
LLVector3d global_pos;
landmark->getGlobalPos(global_pos);
LLViewerInventoryItem* agent_lanmark =
LLViewerInventoryItem* agent_landmark =
LLLandmarkActions::findLandmarkForGlobalPos(global_pos);
if (agent_lanmark)
if (agent_landmark)
{
showInfo(agent_lanmark->getUUID());
showInfo(agent_landmark->getUUID());
}
else
{
@ -104,8 +104,13 @@ public:
}
else
{
LLInventoryItem* item = item_ptr.get();
LLPointer<LLEmbeddedLandmarkCopied> cb = new LLEmbeddedLandmarkCopied();
copy_inventory_from_notecard(object_id, notecard_inventory_id, item_ptr.get(), gInventoryCallbacks.registerCB(cb));
copy_inventory_from_notecard(get_folder_by_itemtype(item),
object_id,
notecard_inventory_id,
item,
gInventoryCallbacks.registerCB(cb));
}
}
}
@ -1266,9 +1271,11 @@ bool LLViewerTextEditor::importStream(std::istream& str)
void LLViewerTextEditor::copyInventory(const LLInventoryItem* item, U32 callback_id)
{
copy_inventory_from_notecard(mObjectID,
copy_inventory_from_notecard(LLUUID::null, // Don't specify a destination -- let the sim do that
mObjectID,
mNotecardInventoryID,
item, callback_id);
item,
callback_id);
}
bool LLViewerTextEditor::hasEmbeddedInventory()

View File

@ -417,6 +417,48 @@ const S32 min_non_tex_system_mem = (128<<20); // 128 MB
F32 texmem_lower_bound_scale = 0.85f;
F32 texmem_middle_bound_scale = 0.925f;
//static
bool LLViewerTexture::isMemoryForTextureLow()
{
const static S32 MIN_FREE_TEXTURE_MEMORY = 5 ; //MB
const static S32 MIN_FREE_MAIN_MEMORy = 100 ; //MB
bool low_mem = false ;
if (gGLManager.mHasATIMemInfo)
{
S32 meminfo[4];
glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, meminfo);
if(meminfo[0] / 1024 < MIN_FREE_TEXTURE_MEMORY)
{
low_mem = true ;
}
}
#if 0 //ignore nVidia cards
else if (gGLManager.mHasNVXMemInfo)
{
S32 free_memory;
glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, &free_memory);
if(free_memory / 1024 < MIN_FREE_TEXTURE_MEMORY)
{
low_mem = true ;
}
}
#endif
if(!low_mem) //check main memory, only works for windows.
{
LLMemory::updateMemoryInfo() ;
if(LLMemory::getAvailableMemKB() / 1024 < MIN_FREE_MAIN_MEMORy)
{
low_mem = true ;
}
}
return low_mem ;
}
//static
void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity)
{
@ -449,6 +491,11 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity
sEvaluationTimer.reset();
}
}
else if(sEvaluationTimer.getElapsedTimeF32() > discard_delta_time && isMemoryForTextureLow())
{
sDesiredDiscardBias += discard_bias_delta;
sEvaluationTimer.reset();
}
else if (sDesiredDiscardBias > 0.0f &&
BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) < sMaxBoundTextureMemInMegaBytes * texmem_lower_bound_scale &&
BYTES_TO_MEGA_BYTES(sTotalTextureMemoryInBytes) < sMaxTotalTextureMemInMegaBytes * texmem_lower_bound_scale)

View File

@ -267,6 +267,7 @@ private:
/*virtual*/ LLImageGL* getGLTexture() const ;
virtual void switchToCachedImage();
static bool isMemoryForTextureLow() ;
protected:
LLUUID mID;
S32 mBoostLevel; // enum describing priority level

View File

@ -530,9 +530,11 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image)
}
llerrs << "LLViewerTextureList::removeImageFromList - Image not in list" << llendl;
}
if(mImageList.erase(image) != 1)
S32 count = mImageList.erase(image) ;
if(count != 1)
{
llerrs << "Error happens when remove image from mImageList!" << llendl ;
llerrs << "Error happens when remove image from mImageList: " << count << llendl ;
}
image->setInImageList(FALSE) ;
@ -1075,6 +1077,13 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended)
// Treat any card with < 32 MB (shudder) as having 32 MB
// - it's going to be swapping constantly regardless
S32 max_vram = gGLManager.mVRAM;
if(gGLManager.mIsATI)
{
//shrink the availabe vram for ATI cards because some of them do not handel texture swapping well.
max_vram = (S32)(max_vram * 0.75f);
}
max_vram = llmax(max_vram, getMinVideoRamSetting());
max_texmem = max_vram;
if (!get_recommended)
@ -1082,10 +1091,19 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended)
}
else
{
if (get_recommended)
max_texmem = 128;
else
if (!get_recommended)
{
max_texmem = 512;
}
else if (gSavedSettings.getBOOL("NoHardwareProbe")) //did not do hardware detection at startup
{
max_texmem = 512;
}
else
{
max_texmem = 128;
}
llwarns << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << llendl;
}

Some files were not shown because too many files have changed in this diff Show More