diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterland.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpanelavatar.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llpanelface.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llpanelplace.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llpanelplaceinfo.cpp | 1 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 46 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.h | 55 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_about_land.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_buy_land.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_tools.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_edit_profile.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_landmark_info.xml | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_my_profile.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_place_profile.xml | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_profile.xml | 2 |
15 files changed, 61 insertions, 65 deletions
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 76263a4307..98f940c233 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1940,8 +1940,6 @@ BOOL LLPanelLandOptions::postBuild() mLandingTypeCombo = getChild<LLComboBox>( "landing type"); childSetCommitCallback("landing type", onCommitAny, this); - getChild<LLTextureCtrl>("snapshot_ctrl")->setFallbackImageName("default_land_picture.j2c"); - return TRUE; } diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 8a21785a93..534bb6e3fc 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -513,12 +513,6 @@ BOOL LLPanelAvatarProfile::postBuild() mProfileMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_profile_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - LLTextureCtrl* pic = getChild<LLTextureCtrl>("2nd_life_pic"); - pic->setFallbackImageName("default_profile_picture.j2c"); - - pic = getChild<LLTextureCtrl>("real_world_pic"); - pic->setFallbackImageName("default_profile_picture.j2c"); - LLVoiceClient::getInstance()->addObserver((LLVoiceClientStatusObserver*)this); resetControls(); diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index b50c6442e1..7d5be39074 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -790,7 +790,6 @@ void LLPanelFace::getState() if(texture_ctrl) { texture_ctrl->setImageAssetID( LLUUID::null ); - texture_ctrl->setFallbackImageName( "locked_image.j2c" ); texture_ctrl->setEnabled( FALSE ); // this is a LLUICtrl, but we don't want it to have keyboard focus so we add it as a child, not a ctrl. // texture_ctrl->setValid(FALSE); } diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp index 6985b73200..1446088c4f 100644 --- a/indra/newview/llpanelplace.cpp +++ b/indra/newview/llpanelplace.cpp @@ -342,7 +342,6 @@ void LLPanelPlace::displayParcelInfo(const LLVector3& pos_region, mDescEditor->setText(getString("server_update_text")); } mSnapshotCtrl->setImageAssetID(LLUUID::null); - mSnapshotCtrl->setFallbackImageName("default_land_picture.j2c"); } // static diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index f6133d4446..db305b25fa 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -110,7 +110,6 @@ void LLPanelPlaceInfo::resetLocation() mDescEditor->setText(loading); mSnapshotCtrl->setImageAssetID(LLUUID::null); - mSnapshotCtrl->setFallbackImageName("default_land_picture.j2c"); } //virtual diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index a1ab051021..f3530b69db 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -100,7 +100,7 @@ public: PermissionMask immediate_filter_perm_mask, PermissionMask non_immediate_filter_perm_mask, BOOL can_apply_immediately, - const std::string& fallback_image_name); + LLUIImagePtr fallback_image_name); virtual ~LLFloaterTexturePicker(); @@ -153,7 +153,7 @@ protected: LLTextureCtrl* mOwner; LLUUID mImageAssetID; // Currently selected texture - std::string mFallbackImageName; // What to show if currently selected texture is null. + LLUIImagePtr mFallbackImage; // What to show if currently selected texture is null. LLUUID mWhiteImageAssetID; LLUUID mSpecialCurrentImageAssetID; // Used when the asset id has no corresponding texture in the user's inventory. @@ -183,11 +183,11 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( PermissionMask immediate_filter_perm_mask, PermissionMask non_immediate_filter_perm_mask, BOOL can_apply_immediately, - const std::string& fallback_image_name) + LLUIImagePtr fallback_image) : LLFloater(LLSD()), mOwner( owner ), mImageAssetID( owner->getImageAssetID() ), - mFallbackImageName( fallback_image_name ), + mFallbackImage( fallback_image ), mWhiteImageAssetID( gSavedSettings.getString( "UIImgWhiteUUID" ) ), mOriginalImageAssetID(owner->getImageAssetID()), mLabel(label), @@ -533,11 +533,6 @@ void LLFloaterTexturePicker::draw() mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, MIPMAP_YES); mTexturep->setBoostLevel(LLViewerTexture::BOOST_PREVIEW); } - else if (!mFallbackImageName.empty()) - { - mTexturep = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName); - mTexturep->setBoostLevel(LLViewerTexture::BOOST_PREVIEW); - } if (mTentativeLabel) { @@ -578,13 +573,10 @@ void LLFloaterTexturePicker::draw() // Pump the priority mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) ); - - // Draw Tentative Label over the image - if( mOwner->getTentative() && !mViewModel->isDirty() ) - { - mTentativeLabel->setVisible( TRUE ); - drawChild(mTentativeLabel); - } + } + else if (!mFallbackImage.isNull()) + { + mFallbackImage->draw(interior); } else { @@ -593,6 +585,13 @@ void LLFloaterTexturePicker::draw() // Draw X gl_draw_x(interior, LLColor4::black ); } + + // Draw Tentative Label over the image + if( mOwner->getTentative() && !mViewModel->isDirty() ) + { + mTentativeLabel->setVisible( TRUE ); + drawChild(mTentativeLabel); + } } } @@ -875,7 +874,8 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) mShowLoadingPlaceholder( TRUE ), mImageAssetID(p.image_id), mDefaultImageAssetID(p.default_image_id), - mDefaultImageName(p.default_image_name) + mDefaultImageName(p.default_image_name), + mFallbackImage(p.fallback_image) { setAllowNoTexture(p.allow_no_texture); setCanApplyImmediately(p.can_apply_immediately); @@ -1019,7 +1019,7 @@ void LLTextureCtrl::showPicker(BOOL take_focus) mImmediateFilterPermMask, mNonImmediateFilterPermMask, mCanApplyImmediately, - mFallbackImageName); + mFallbackImage); mFloaterHandle = floaterp->getHandle(); @@ -1223,12 +1223,6 @@ void LLTextureCtrl::draw() mTexturep = texture; } - else if (!mFallbackImageName.empty()) - { - // Show fallback image. - mTexturep = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName); - mTexturep->setBoostLevel(LLViewerTexture::BOOST_PREVIEW); - } else//mImageAssetID == LLUUID::null { mTexturep = NULL; @@ -1252,6 +1246,10 @@ void LLTextureCtrl::draw() gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep); mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) ); } + else if (!mFallbackImage.isNull()) + { + mFallbackImage->draw(interior); + } else { gl_rect_2d( interior, LLColor4::grey, TRUE ); diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index bcd0a083f2..b5dfa1b948 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -78,6 +78,7 @@ public: // only on DnD or when OK is pressed in the picker Optional<S32> label_width; Optional<LLUIColor> border_color; + Optional<LLUIImage*> fallback_image; Optional<LLTextBox::Params> multiselect_text, caption_text; @@ -93,6 +94,7 @@ public: no_commit_on_selection("no_commit_on_selection", false), label_width("label_width", -1), border_color("border_color"), + fallback_image("fallback_image"), multiselect_text("multiselect_text"), caption_text("caption_text"), border("border") @@ -152,9 +154,6 @@ public: const std::string& getDefaultImageName() const { return mDefaultImageName; } - void setFallbackImageName( const std::string& name ) { mFallbackImageName = name; } - const std::string& getFallbackImageName() const { return mFallbackImageName; } - void setCaption(const std::string& caption); void setCanApplyImmediately(BOOL b); @@ -192,32 +191,32 @@ private: BOOL doDrop(LLInventoryItem* item); private: - drag_n_drop_callback mDragCallback; - drag_n_drop_callback mDropCallback; - commit_callback_t mOnCancelCallback; - commit_callback_t mOnSelectCallback; + drag_n_drop_callback mDragCallback; + drag_n_drop_callback mDropCallback; + commit_callback_t mOnCancelCallback; + commit_callback_t mOnSelectCallback; LLPointer<LLViewerFetchedTexture> mTexturep; - LLUIColor mBorderColor; - LLUUID mImageItemID; - LLUUID mImageAssetID; - LLUUID mDefaultImageAssetID; - std::string mFallbackImageName; - std::string mDefaultImageName; - LLHandle<LLFloater> mFloaterHandle; - LLTextBox* mTentativeLabel; - LLTextBox* mCaption; - std::string mLabel; - BOOL mAllowNoTexture; // If true, the user can select "none" as an option - PermissionMask mImmediateFilterPermMask; - PermissionMask mNonImmediateFilterPermMask; - BOOL mCanApplyImmediately; - BOOL mCommitOnSelection; - BOOL mNeedsRawImageData; - LLViewBorder* mBorder; - BOOL mValid; - BOOL mShowLoadingPlaceholder; - std::string mLoadingPlaceholderString; - S32 mLabelWidth; + LLUIColor mBorderColor; + LLUUID mImageItemID; + LLUUID mImageAssetID; + LLUUID mDefaultImageAssetID; + LLUIImagePtr mFallbackImage; + std::string mDefaultImageName; + LLHandle<LLFloater> mFloaterHandle; + LLTextBox* mTentativeLabel; + LLTextBox* mCaption; + std::string mLabel; + BOOL mAllowNoTexture; // If true, the user can select "none" as an option + PermissionMask mImmediateFilterPermMask; + PermissionMask mNonImmediateFilterPermMask; + BOOL mCanApplyImmediately; + BOOL mCommitOnSelection; + BOOL mNeedsRawImageData; + LLViewBorder* mBorder; + BOOL mValid; + BOOL mShowLoadingPlaceholder; + std::string mLoadingPlaceholderString; + S32 mLabelWidth; }; // XUI HACK: When floaters converted, switch this file to lltexturepicker.h/cpp diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index b9489895ae..14aacafa9f 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1489,6 +1489,7 @@ Only large parcels can be listed in search. layout="topleft" left="14" name="snapshot_ctrl" + fallback_image="default_land_picture.j2c" tool_tip="Click to choose a picture" width="195" /> <text diff --git a/indra/newview/skins/default/xui/en/floater_buy_land.xml b/indra/newview/skins/default/xui/en/floater_buy_land.xml index acaa508792..0ad4fbc967 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_land.xml @@ -380,6 +380,7 @@ supports [AMOUNT2] objects width="275" /> <texture_picker enabled="false" + fallback_image="default_land_picture.j2c" follows="top|left" height="135" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 2ff832b27a..34c1b25f8c 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -2298,6 +2298,7 @@ even though the user gets a free copy. <texture_picker can_apply_immediately="true" default_image_name="Default" + fallback_image="locked_image.j2c" follows="left|top" height="80" label="Texture" diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index dff2b9a214..3ffde20af0 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -118,6 +118,7 @@ allow_no_texture="true" default_image_name="None" enabled="false" + fallback_image="default_profile_picture.j2c" follows="top|left" height="124" layout="topleft" @@ -174,6 +175,7 @@ allow_no_texture="true" default_image_name="None" enabled="false" + fallback_image="Generic_Person_Large.png" follows="top|left" height="124" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml index 55fef5aaf7..a0a1e2963a 100644 --- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml +++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml @@ -103,7 +103,8 @@ width="310"> <texture_picker enabled="false" - follows="left|top|right" + fallback_image="default_land_picture.j2c" + follows="left|top|right" height="197" layout="topleft" left="11" diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml index 841a4f5713..e657b57ab4 100644 --- a/indra/newview/skins/default/xui/en/panel_my_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_my_profile.xml @@ -83,6 +83,7 @@ allow_no_texture="true" default_image_name="None" enabled="false" + fallback_image="Generic_Person_Large.png" follows="top|left" height="124" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml index 55e0184282..35e8075896 100644 --- a/indra/newview/skins/default/xui/en/panel_place_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml @@ -200,7 +200,8 @@ width="310"> <texture_picker enabled="false" - follows="left|top|right" + fallback_image="default_land_picture.j2c" + follows="left|top|right" height="197" layout="topleft" left="11" diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index d7a601d7a3..fc33836c79 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -83,6 +83,7 @@ allow_no_texture="true" default_image_name="None" enabled="false" + fallback_image="Generic_Person_Large" follows="top|left" height="124" layout="topleft" @@ -130,6 +131,7 @@ allow_no_texture="true" default_image_name="None" enabled="false" + fallback_image="Generic_Person_Large" follows="top|left" height="124" layout="topleft" |