diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp index 8e68677e8..c16af50a9 100644 --- a/indra/newview/ascentprefssys.cpp +++ b/indra/newview/ascentprefssys.cpp @@ -38,6 +38,8 @@ #include "llvoavatar.h" #include "llhudeffectlookat.h" #include "llagent.h" +#include "llaudioengine.h" //For POWER USER affirmation. +#include "llfloaterchat.h" //For POWER USER affirmation. #include "llstartup.h" #include "llviewercontrol.h" #include "lluictrlfactory.h" @@ -74,6 +76,7 @@ private: //always show Build BOOL mAlwaysShowFly; //Disable camera minimum distance + BOOL mPowerUser; //Chat/IM ----------------------------------------------------------------------------- BOOL mHideNotificationsInChat; BOOL mPlayTypingSound; @@ -152,6 +155,7 @@ void LLPrefsAscentSysImpl::refreshValues() //always show Build mAlwaysShowFly = gSavedSettings.getBOOL("AscentFlyAlwaysEnabled"); //Disable camera minimum distance + mPowerUser = gSavedSettings.getBOOL("AscentPowerfulWizard"); //Chat/IMs ---------------------------------------------------------------------------- mHideNotificationsInChat = gSavedSettings.getBOOL("HideNotificationsInChat"); mHideTypingNotification = gSavedSettings.getBOOL("AscentHideTypingNotification"); @@ -199,6 +203,8 @@ void LLPrefsAscentSysImpl::refresh() //always show Build childSetValue("always_fly_check", mAlwaysShowFly); //Disable camera minimum distance + childSetValue("power_user_check", mPowerUser); + childSetValue("power_user_confirm_check", mPowerUser); //Chat -------------------------------------------------------------------------------- childSetValue("hide_notifications_in_chat_check", mHideNotificationsInChat); childSetValue("play_typing_sound_check", mPlayTypingSound); @@ -341,7 +347,17 @@ void LLPrefsAscentSysImpl::apply() //always show Build gSavedSettings.setBOOL("AscentFlyAlwaysEnabled", childGetValue("always_fly_check")); //Disable camera minimum distance - + gSavedSettings.setBOOL("AscentPowerfulWizard", (childGetValue("power_user_check") && childGetValue("power_user_confirm_check"))); + if (gSavedSettings.getBOOL("AscentPowerfulWizard") && !mPowerUser) + { + LLVector3d lpos_global = gAgent.getPositionGlobal(); + gAudiop->triggerSound(LLUUID("58a38e89-44c6-c52b-deb8-9f1ddc527319"), gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI, lpos_global); + LLChat chat; + chat.mSourceType = CHAT_SOURCE_SYSTEM; + chat.mText = llformat("You are bestowed with powers beyond mortal comprehension.\nUse your newfound abilities wisely.\nUnlocked:\n- Animation Priority up to 7 - Meant for animations that should override anything and everything at all times. DO NOT USE THIS FOR GENERAL ANIMATIONS.\n- Right click > Destroy objects - Permanently deletes an object immediately, when you don't feel like waiting for the server to respond.\n- Right Click > Explode objects - Turns and object physical, temporary, and delinks it."); + LLFloaterChat::addChat(chat); + } + // //Chat/IM ------------------------------------------------------------------------------ //Use Vertical IMs //Script count @@ -438,6 +454,7 @@ void LLPrefsAscentSysImpl::apply() gSavedSettings.setBOOL("RevokePermsOnStandUp", childGetValue("revoke_perms_on_stand_up_check")); refreshValues(); + refresh(); } //--------------------------------------------------------------------------- diff --git a/indra/newview/ascentuploadbrowser.cpp b/indra/newview/ascentuploadbrowser.cpp index 033e14605..bf20a1b28 100644 --- a/indra/newview/ascentuploadbrowser.cpp +++ b/indra/newview/ascentuploadbrowser.cpp @@ -1,7 +1,7 @@ /** * @file ascentuploadbrowser.h - * @Author Duncan Garrett - * Meant as a replacement to using Windows' file browser for uploads. + * @Author Duncan Garrett (Hg Beeks) + * Meant as a replacement to using a system file browser for uploads. * * Created August 27 2010 * @@ -42,10 +42,12 @@ ASFloaterUploadBrowser::ASFloaterUploadBrowser() : LLFloater(std::string("floater_upload_browser"), std::string("FloaterUploadRect"), LLStringUtil::null) { mPathName = "C:\\Users\\Duncan\\Documents"+gDirUtilp->getDirDelimiter(); //(gDirUtilp->getSkinBaseDir()+gDirUtilp->getDirDelimiter()); + mFilterType = "None"; LLUICtrlFactory::getInstance()->buildFloater(this, "floater_upload_browser.xml"); mFileList = getChild("file_list"); childSetCommitCallback("file_list", onClickFile, this); childSetDoubleClickCallback("file_list", onDoubleClick); + childSetCommitCallback("file_filter_combo", onUpdateFilter, this); refresh(); mFileList->sortByColumn(std::string("file_name"), TRUE); mFileList->sortByColumn(std::string("file_type"), TRUE); @@ -63,6 +65,20 @@ void ASFloaterUploadBrowser::onClickFile(LLUICtrl* ctrl, void* user_data) panelp->refreshUploadOptions(); } +void ASFloaterUploadBrowser::onUpdateFilter(LLUICtrl* ctrl, void* user_data) +{ + llinfos << "Filter change triggered." << llendl; + ASFloaterUploadBrowser* panelp = (ASFloaterUploadBrowser*)user_data; + LLComboBox* combo = panelp->getChild("file_filter_combo"); + if (combo->getSelectedValue().asString() != panelp->mFilterType) + { + llinfos << "Selection is new, rebuilding file list." << llendl; + panelp->mFilterType.clear(); + panelp->mFilterType = combo->getSelectedValue().asString().c_str(); + panelp->refreshUploadOptions(); + } +} + void ASFloaterUploadBrowser::refreshUploadOptions() { if (mFileList->getFirstSelected()->getColumn(LIST_FILE_TYPE)->getValue().asInteger() == LIST_TYPE_FILE) @@ -95,10 +111,10 @@ void ASFloaterUploadBrowser::handleDoubleClick() } else if (mFileList->getFirstSelected()->getColumn(LIST_FILE_TYPE)->getValue().asInteger() == LIST_TYPE_FOLDER) { - /*std::string newPath = (mFileList->getFirstSelected()->getColumn(LIST_FILE_NAME)->getValue().asString()+gDirUtilp->getDirDelimiter()); - newPath = (mPathName+newPath); + std::string newPath = (mFileList->getFirstSelected()->getColumn(LIST_FILE_NAME)->getValue().asString()+gDirUtilp->getDirDelimiter()); + /*newPath = (mPathName+newPath); mPathName = newPath.c_str();*/ - llinfos << "Double-clicked Folder. Directory should change to " << mPathName << mFileList->getFirstSelected()->getColumn(LIST_FILE_NAME)->getValue().asString() << llendl; + llinfos << "Double-clicked Folder. Directory should change to " << mPathName << mFileList->getFirstSelected()->getColumn(LIST_FILE_NAME)->getValue().asString() << "!!" << llendl; //mPathName.append(mFileList->getFirstSelected()->getColumn(LIST_FILE_NAME)->getValue().asString().c_str() + gDirUtilp->getDirDelimiter()); refresh(); } @@ -110,16 +126,17 @@ void ASFloaterUploadBrowser::refresh() mFileList->deleteAllItems(); llinfos << "Getting file listing at " << mPathName << llendl; bool found = true; + U32 fileCount = gDirUtilp->countFilesInDir(mPathName, "*.*"); while(found) { std::string filename; found = gDirUtilp->getNextFileInDir(mPathName, "*.*", filename, false); + fileCount++; + //llinfo if(found) { - S32 periodIndex = filename.find_last_of("."); std::string extension = filename.substr(periodIndex + 1, filename.length() - 1); - llinfos << extension << llendl; LLSD element; element["path"] = mPathName + filename; @@ -137,20 +154,20 @@ void ASFloaterUploadBrowser::refresh() invtype_column["type"] = "icon"; invtype_column["value"] = "inv_folder_trash.tga"; - if ((extension == "jpeg")||(extension == "jpg")||(extension == "tga") - ||(extension == "png")||(extension == "bmp")) + if (((extension == "jpeg")||(extension == "jpg")||(extension == "tga") + ||(extension == "png")||(extension == "bmp"))&&((mFilterType == "None")||(mFilterType == "Texture"))) { invtype_column["value"] = "inv_item_texture.tga"; filename_column["value"] = filename.substr(0, periodIndex); filetype_column["value"] = LIST_TYPE_FILE; } - else if (extension == "wav") + else if ((extension == "wav")&&((mFilterType == "None")||(mFilterType == "Sound"))) { invtype_column["value"] = "inv_item_sound.tga"; filename_column["value"] = filename.substr(0, periodIndex); filetype_column["value"] = LIST_TYPE_FILE; } - else if ((extension == "bvh")||(extension == "anim")) + else if (((extension == "bvh")||(extension == "anim"))&&((mFilterType == "None")||(mFilterType == "Animation"))) { invtype_column["value"] = "inv_item_animation.tga"; filename_column["value"] = filename.substr(0, periodIndex); diff --git a/indra/newview/ascentuploadbrowser.h b/indra/newview/ascentuploadbrowser.h index 9eefbc62e..a4bc4cd1f 100644 --- a/indra/newview/ascentuploadbrowser.h +++ b/indra/newview/ascentuploadbrowser.h @@ -24,6 +24,7 @@ public: ASFloaterUploadBrowser(); virtual ~ASFloaterUploadBrowser(); static void onClickFile(LLUICtrl* ctrl, void* user_data); + static void onUpdateFilter(LLUICtrl* ctrl, void* user_data); static void onDoubleClick(void* user_data); void refresh(); @@ -50,6 +51,7 @@ private: }; LLScrollListCtrl* mFileList; std::string mPathName; + std::string mFilterType; }; diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index 55530e355..e00cbd958 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -189,6 +189,11 @@ BOOL LLFloaterAnimPreview::postBuild() childSetCommitCallback("name_form", onCommitName, this); + if (gSavedSettings.getBOOL("AscentPowerfulWizard")) + { + childSetMaxValue("priority", 7); + } + childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",sUploadAmount)); childSetAction("ok_btn", onBtnOK, this); setDefaultBtn(); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index c9475bc7a..35d87e393 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -462,9 +462,47 @@ void LLFloaterTools::refresh() // Refresh object and prim count labels LLLocale locale(LLLocale::USER_LOCALE); - std::string obj_count_string; - LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); - childSetTextArg("obj_count", "[COUNT]", obj_count_string); + // Added in Link Num value -HgB + S32 object_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount(); + S32 prim_count = LLSelectMgr::getInstance()->getEditSelection()->getObjectCount(); + std::string value_string; + std::string desc_string; + if ((gSavedSettings.getBOOL("EditLinkedParts"))&&(prim_count == 1)) //Selecting a single prim in "Edit Linked" mode, show link number + { + desc_string = "Link number:"; + + LLViewerObject* selected = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); + if (selected && selected->getRootEdit()) + { + LLViewerObject::child_list_t children = selected->getRootEdit()->getChildren(); + if (children.empty()) + { + value_string = "0"; // An unlinked prim is "link 0". + } + else + { + children.push_front(selected->getRootEdit()); // need root in the list too + S32 index = 0; + for (LLViewerObject::child_list_t::iterator iter = children.begin(); iter != children.end(); ++iter) + { + index++; + if ((*iter)->isSelected()) + { + LLResMgr::getInstance()->getIntegerString(value_string, index); + break; + } + } + } + } + } + else + { + desc_string = "Selected objects:"; + LLResMgr::getInstance()->getIntegerString(value_string, object_count); + } + childSetTextArg("link_num_obj_count", "[DESC]", desc_string); + childSetTextArg("link_num_obj_count", "[NUM]", value_string); + std::string prim_count_string; LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); childSetTextArg("prim_count", "[COUNT]", prim_count_string); @@ -746,8 +784,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) mSliderDozerForce ->setVisible( land_visible ); childSetVisible("Strength:", land_visible); } - - childSetVisible("obj_count", !land_visible); + + childSetVisible("link_num_obj_count", !land_visible); childSetVisible("prim_count", !land_visible); mTab->setVisible(!land_visible); mPanelLandInfo->setVisible(land_visible); diff --git a/indra/newview/llinventoryview.cpp b/indra/newview/llinventoryview.cpp index 7c239fae1..48d861c02 100644 --- a/indra/newview/llinventoryview.cpp +++ b/indra/newview/llinventoryview.cpp @@ -498,13 +498,14 @@ void LLInventoryView::init(LLInventoryModel* inventory) addBoolControl("Inventory.FoldersAlwaysByName", sort_folders_by_name ); addBoolControl("Inventory.SystemFoldersToTop", sort_system_folders_to_top ); - + //Search Controls - RKeast U32 search_type = gSavedPerAccountSettings.getU32("rkeastInventorySearchType"); BOOL search_by_name = (search_type == 0); addBoolControl("Inventory.SearchByName", search_by_name); addBoolControl("Inventory.SearchByCreator", !search_by_name); addBoolControl("Inventory.SearchByDesc", !search_by_name); + addBoolControl("Inventory.SearchByUUID", !search_by_name); addBoolControl("Inventory.SearchByAll", !search_by_name); @@ -608,6 +609,9 @@ BOOL LLInventoryView::postBuild() childSetTabChangeCallback("inventory filter tabs", "Recent Items", onFilterSelected, this); childSetTabChangeCallback("inventory filter tabs", "Worn Items", onFilterSelected, this); + childSetAction("Inventory.ResetAll",onResetAll,this); + childSetAction("Inventory.ExpandAll",onExpandAll,this); + //panel->getFilter()->markDefault(); return TRUE; } @@ -832,7 +836,7 @@ void LLInventoryView::changed(U32 mask) std::string item_count_string; LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); - //Displays a progress indication for loading the inventory, but not if it hasn't been loaded before on this PC, or we load more than expected - rkeast + //Displays a progress indication for loading the inventory, but not if it hasn't been loaded before on this PC, or we load more than expected - rkeast if(mItemCount == -1) { title << " (Fetched " << item_count_string << " items...)"; @@ -1340,6 +1344,38 @@ void LLInventoryView::refreshQuickFilter(LLUICtrl* ctrl) // return FALSE; // } + +//static +void LLInventoryView::onResetAll(void* userdata) +{ + LLInventoryView* self = (LLInventoryView*) userdata; + self->mActivePanel = (LLInventoryPanel*)self->childGetVisibleTab("inventory filter tabs"); + + if (!self->mActivePanel) + { + return; + } + if (self->mActivePanel && self->mSearchEditor) + { + self->mSearchEditor->setText(LLStringUtil::null); + } + self->onSearchEdit("",userdata); + self->mActivePanel->closeAllFolders(); +} + +//static +void LLInventoryView::onExpandAll(void* userdata) +{ + LLInventoryView* self = (LLInventoryView*) userdata; + self->mActivePanel = (LLInventoryPanel*)self->childGetVisibleTab("inventory filter tabs"); + + if (!self->mActivePanel) + { + return; + } + self->mActivePanel->openAllFolders(); +} + //static void LLInventoryView::onFilterSelected(void* userdata, bool from_click) { diff --git a/indra/newview/llinventoryview.h b/indra/newview/llinventoryview.h index 48afb16d5..5d9936476 100644 --- a/indra/newview/llinventoryview.h +++ b/indra/newview/llinventoryview.h @@ -293,6 +293,8 @@ public: static void refreshQuickFilter(LLUICtrl* ctrl); static void onFilterSelected(void* userdata, bool from_click); + static void onResetAll(void* userdata); + static void onExpandAll(void* userdata); static void onSelectionChange(const std::deque &items, BOOL user_action, void* data); const std::string getFilterSubString() { return mActivePanel->getFilterSubString(); } diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 51d344b4e..90b01d643 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -2080,7 +2080,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) args["[PAYMENTINFO]"] = self->mPanelSecondLife->getString(payment_text); std::string age_text = age_verified ? "AgeVerified" : "NotAgeVerified"; // Do not display age verification status at this time - //args["[[AGEVERIFICATION]]"] = self->mPanelSecondLife->getString(age_text); + args["[[AGEVERIFICATION]]"] = self->mPanelSecondLife->getString(age_text); args["[AGEVERIFICATION]"] = " "; } else diff --git a/indra/newview/llpanelinventory.cpp b/indra/newview/llpanelinventory.cpp index cd32887d1..ae458bc26 100644 --- a/indra/newview/llpanelinventory.cpp +++ b/indra/newview/llpanelinventory.cpp @@ -751,10 +751,7 @@ BOOL LLTaskCategoryBridge::renameItem(const std::string& new_name) BOOL LLTaskCategoryBridge::isItemRemovable() { - // - //return FALSE; - return TRUE; - // + return FALSE; } void LLTaskCategoryBridge::buildContextMenu(LLMenuGL& menu, U32 flags) @@ -825,19 +822,19 @@ BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_BODYPART: case DAD_ANIMATION: case DAD_GESTURE: - // - case DAD_CALLINGCARD: - // + // + case DAD_CALLINGCARD: + // // *HACK: In order to resolve SL-22177, we need to block // drags from notecards and objects onto other // objects. uncomment the simpler version when we have // that right. - accept = LLToolDragAndDrop::isInventoryDropAcceptable(object, (LLViewerInventoryItem*)cargo_data); - // testzone - //if(LLToolDragAndDrop::isInventoryDropAcceptable( - // object, (LLViewerInventoryItem*)cargo_data) - if(object->permModify() - // + accept = LLToolDragAndDrop::isInventoryDropAcceptable(object, (LLViewerInventoryItem*)cargo_data); + // testzone + //if(LLToolDragAndDrop::isInventoryDropAcceptable( + // object, (LLViewerInventoryItem*)cargo_data) + if(object->permModify() + // && (LLToolDragAndDrop::SOURCE_WORLD != LLToolDragAndDrop::getInstance()->getSource()) && (LLToolDragAndDrop::SOURCE_NOTECARD != LLToolDragAndDrop::getInstance()->getSource())) { @@ -875,9 +872,9 @@ BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop, LLToolDragAndDrop::getInstance()->getSourceID()); } break; - // - //case DAD_CALLINGCARD: - // + // + //case DAD_CALLINGCARD: + // default: break; } diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 339c3436b..23d77ed84 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -50,6 +50,8 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" #include "lllineeditor.h" +#include "llfloateravatarinfo.h" + const S32 PREVIEW_TEXTURE_MIN_WIDTH = 300; const S32 PREVIEW_TEXTURE_MIN_HEIGHT = 120; @@ -61,6 +63,7 @@ const S32 CLIENT_RECT_VPAD = 4; const F32 SECONDS_TO_SHOW_FILE_SAVED_MSG = 8.f; +LLPreviewTexture * LLPreviewTexture::sInstance; LLPreviewTexture::LLPreviewTexture(const std::string& name, const LLRect& rect, const std::string& title, @@ -74,7 +77,8 @@ LLPreviewTexture::LLPreviewTexture(const std::string& name, mIsCopyable(FALSE), mLastHeight(0), mLastWidth(0), - mAspectRatio(0.f) + mAspectRatio(0.f), + mCreatorKey(LLUUID()) { const LLInventoryItem *item = getItem(); if(item) @@ -117,7 +121,8 @@ LLPreviewTexture::LLPreviewTexture( const LLRect& rect, const std::string& title, const LLUUID& asset_id, - BOOL copy_to_inv) + BOOL copy_to_inv, + BOOL copyable) : LLPreview( name, @@ -132,7 +137,7 @@ LLPreviewTexture::LLPreviewTexture( mLoadingFullImage( FALSE ), mShowKeepDiscard(FALSE), mCopyToInv(copy_to_inv), - mIsCopyable(copy_to_inv), + mIsCopyable(copyable), mLastHeight(0), mLastWidth(0), mAspectRatio(0.f) @@ -141,7 +146,6 @@ LLPreviewTexture::LLPreviewTexture( init(); setTitle(title); - LLRect curRect = getRect(); translate(curRect.mLeft - rect.mLeft, curRect.mTop - rect.mTop); @@ -155,53 +159,41 @@ LLPreviewTexture::~LLPreviewTexture() getWindow()->decBusyCount(); } + if(mImage.notNull()) + { + mImage->destroySavedRawImage() ; + } mImage = NULL; + sInstance = NULL; } void LLPreviewTexture::init() { + sInstance = this; + LLUICtrlFactory::getInstance()->buildFloater(sInstance,"floater_preview_texture.xml"); - - /*if (mCopyToInv) - { - llinfos << "Loading embedded" << llendl; - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_embedded_texture.xml"); + childSetVisible("desc", !mCopyToInv); // Hide description field for embedded textures + childSetVisible("desc txt", !mCopyToInv); + childSetVisible("Copy To Inventory", mCopyToInv); + childSetVisible("Keep", mShowKeepDiscard); + childSetVisible("Discard", mShowKeepDiscard); + childSetAction("openprofile", onClickProfile, this); + llinfos << "Image has alpha :" << mImage->getIsAlphaMask() << llendl; + if (mCopyToInv) + { childSetAction("Copy To Inventory",LLPreview::onBtnCopyToInv,this); } else if (mShowKeepDiscard) { - llinfos << "Loading Keep/Discard" << llendl; - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_texture_keep_discard.xml"); - childSetAction("Keep",onKeepBtn,this); childSetAction("Discard",onDiscardBtn,this); } else - {*/ - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_texture.xml"); - childSetVisible("Copy To Inventory", mCopyToInv); - childSetVisible("Keep", mShowKeepDiscard); - childSetVisible("Discard", mShowKeepDiscard); - llinfos << "Image has alpha :" << mImage->getIsAlphaMask() << llendl; - - //} - - - if (!mCopyToInv) { - const LLInventoryItem* item = getItem(); - - if (item) - { - childSetCommitCallback("desc", LLPreview::onText, this); - childSetText("desc", item->getDescription()); - childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); - } - // If the buttons are hidden move stuff down to use the space. LLRect keep_rect, old_rect, new_rect; @@ -212,30 +204,51 @@ void LLPreviewTexture::init() diff = old_rect.mBottom - keep_rect.mBottom; - new_rect.setOriginAndSize(old_rect.mLeft, old_rect.mBottom - diff - 3, + new_rect.setOriginAndSize(old_rect.mLeft, old_rect.mBottom - diff, old_rect.getWidth(), old_rect.getHeight()); childSetRect("combo_aspect_ratio", new_rect); childGetRect("aspect_ratio", old_rect); - new_rect.setOriginAndSize(old_rect.mLeft, old_rect.mBottom - diff - 3, + new_rect.setOriginAndSize(old_rect.mLeft, old_rect.mBottom - diff, old_rect.getWidth(), old_rect.getHeight()); childSetRect("aspect_ratio", new_rect); childGetRect("dimensions", old_rect); - new_rect.setOriginAndSize(old_rect.mLeft, old_rect.mBottom - diff - 3, + new_rect.setOriginAndSize(old_rect.mLeft, old_rect.mBottom - diff, old_rect.getWidth(), old_rect.getHeight()); childSetRect("dimensions", new_rect); } - childSetText("uuid", getItemID().asString()); - childSetText("uploader", getItemCreatorName()); - childSetText("uploadtime", getItemCreationDate()); + if (!mCopyToInv) + { + const LLInventoryItem* item = getItem(); + + if (item) + { + mCreatorKey = item->getCreatorUUID(); + childSetCommitCallback("desc", LLPreview::onText, this); + childSetText("desc", item->getDescription()); + childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); + childSetText("uuid", getItemID().asString()); + childSetText("uploader", getItemCreatorName()); + childSetText("uploadtime", getItemCreationDate()); + } + } + childSetCommitCallback("combo_aspect_ratio", onAspectRatioCommit, this); LLComboBox* combo = getChild("combo_aspect_ratio"); combo->setCurrentByIndex(0); } +void LLPreviewTexture::callbackLoadAvatarName(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data) +{ + if (!sInstance) return; + std::ostringstream fullname; + fullname << first << " " << last; + sInstance->childSetText("uploader", fullname.str()); +} + void LLPreviewTexture::draw() { updateDimensions(); @@ -268,7 +281,11 @@ void LLPreviewTexture::draw() // Pump the texture priority F32 pixel_area = mLoadingFullImage ? (F32)MAX_IMAGE_AREA : (F32)(interior.getWidth() * interior.getHeight() ); mImage->addTextureStats( pixel_area ); - + if(pixel_area > 0.f) + { + //boost the previewed image priority to the highest to make it to get loaded first. + mImage->setAdditionalDecodePriority(1.0f) ; + } // Don't bother decoding more than we can display, unless // we're loading the full image. if (!mLoadingFullImage) @@ -319,7 +336,7 @@ void LLPreviewTexture::draw() } } } - else if( !mSavedFileTimer.hasExpired() ) + else if(!mSavedFileTimer.hasExpired()) { // *TODO: Translate LLFontGL::getFontSansSerif()->renderUTF8(std::string("File Saved"), 0, @@ -448,6 +465,7 @@ std::string LLPreviewTexture::getItemCreatorName() { std::string name; gCacheName->getFullName(item->getCreatorUUID(), name); + mCreatorKey = item->getCreatorUUID(); return name; } return "Unknown"; @@ -470,12 +488,11 @@ void LLPreviewTexture::updateDimensions() S32 vert_pad = PREVIEW_HEADER_SIZE + 2 * CLIENT_RECT_VPAD + LLPANEL_BORDER_WIDTH; S32 max_client_width = gViewerWindow->getWindowWidth() - horiz_pad; S32 max_client_height = gViewerWindow->getWindowHeight() - vert_pad; - - if (mAspectRatio > 0.f) - client_height = llceil((F32)client_width / mAspectRatio); + + if (mAspectRatio > 0.f) client_height = llceil((F32)client_width / mAspectRatio); while ((client_width > max_client_width) || - (client_height > max_client_height ) ) + (client_height > max_client_height )) { client_width /= 2; client_height /= 2; @@ -603,6 +620,13 @@ bool LLPreviewTexture::setAspectRatio(const F32 width, const F32 height) return (ratio == mAspectRatio); } +void LLPreviewTexture::onClickProfile(void* userdata) +{ + LLPreviewTexture* self = (LLPreviewTexture*) userdata; + LLUUID key = self->mCreatorKey; + if (!key.isNull()) LLFloaterAvatarInfo::showFromDirectory(key); +} + void LLPreviewTexture::onAspectRatioCommit(LLUICtrl* ctrl, void* userdata) { LLPreviewTexture* self = (LLPreviewTexture*) userdata; @@ -630,6 +654,7 @@ void LLPreviewTexture::loadAsset() { mImage = gImageList.getImage(mImageID, MIPMAP_TRUE, FALSE); mImage->setBoostLevel(LLViewerImageBoostLevel::BOOST_PREVIEW); + mImage->forceToSaveRawImage(0) ; mAssetStatus = PREVIEW_ASSET_LOADING; } diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index 977ddf005..2f0be6f22 100644 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -38,6 +38,7 @@ #include "llframetimer.h" #include "llviewerimage.h" +class LLComboBox; class LLImageRaw; class LLPreviewTexture : public LLPreview @@ -55,7 +56,8 @@ public: const LLRect& rect, const std::string& title, const LLUUID& asset_id, - BOOL copy_to_inv = FALSE); + BOOL copy_to_inv = FALSE, + BOOL copyable = TRUE); ~LLPreviewTexture(); virtual void draw(); @@ -77,7 +79,8 @@ public: S32 discard_level, BOOL final, void* userdata ); - + static LLPreviewTexture* getInstance(){ return sInstance; } + LLUUID mCreatorKey; protected: void init(); @@ -95,6 +98,10 @@ private: LLFrameTimer mSavedFileTimer; BOOL mShowKeepDiscard; BOOL mCopyToInv; + + static LLPreviewTexture* sInstance; + static void onClickProfile(void* userdata); + static void callbackLoadAvatarName(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data); // This is stored off in a member variable, because the save-as // button and drag and drop functionality need to know. @@ -102,7 +109,7 @@ private: S32 mLastHeight; S32 mLastWidth; - F32 mAspectRatio; + F32 mAspectRatio; // 0 = Unconstrained }; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 4dd61121f..dea7f4c81 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -756,10 +756,11 @@ void init_menus() menu->append(new LLMenuItemCallGL( "Toggle IM Typing Notification", &handle_hide_typing_notification, NULL)); menu->append(new LLMenuItemCallGL( "Close All Dialogs", &handle_close_all_notifications, NULL, NULL, 'D', MASK_CONTROL | MASK_ALT | MASK_SHIFT)); - - menu->append(new LLMenuItemCallGL( "Message Log", &handle_open_message_log, NULL)); - menu->append(new LLMenuItemCallGL( "Message Builder", &handle_open_message_builder, NULL)); - + if (gSavedSettings.getBOOL("AscentPowerfulWizard")) + { + menu->append(new LLMenuItemCallGL( "Message Log", &handle_open_message_log, NULL)); + menu->append(new LLMenuItemCallGL( "Message Builder", &handle_open_message_builder, NULL)); + } menu->append(new LLMenuItemCallGL( "Sound Explorer", &handle_sounds_explorer, NULL)); menu->append(new LLMenuItemCallGL( "Asset Blacklist", @@ -2437,7 +2438,7 @@ class LLCanIHasKillEmAll : public view_listener_t bool new_value = false; if(objpos) { - if (!objpos->permYouOwner()) + if (!objpos->permYouOwner()||!gSavedSettings.getBOOL("AscentPowerfulWizard")) new_value = false; // Don't give guns to retarded children. else new_value = true; } @@ -2455,9 +2456,10 @@ class LLOHGOD : public view_listener_t bool new_value = false; if(objpos) { - if (!objpos->permYouOwner()) + if (!objpos->permYouOwner()||!gSavedSettings.getBOOL("AscentPowerfulWizard")) new_value = false; // Don't give guns to retarded children. - else new_value = true; + else + new_value = true; } gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); @@ -2494,6 +2496,7 @@ class LLPowerfulWizard : public view_listener_t LLSelectMgr::getInstance()->selectionUpdateTemporary(1);//set temp to TRUE LLSelectMgr::getInstance()->selectionUpdatePhysics(1); LLSelectMgr::getInstance()->sendDelink(); + LLSelectMgr::getInstance()->deselectAll(); } return true; diff --git a/indra/newview/skins/default/xui/en-us/floater_animation_preview.xml b/indra/newview/skins/default/xui/en-us/floater_animation_preview.xml index 324ac5eed..bc1dc0aa5 100644 --- a/indra/newview/skins/default/xui/en-us/floater_animation_preview.xml +++ b/indra/newview/skins/default/xui/en-us/floater_animation_preview.xml @@ -16,7 +16,7 @@ max_length="254" name="description_form" right="-10" /> diff --git a/indra/newview/skins/default/xui/en-us/floater_preview_texture.xml b/indra/newview/skins/default/xui/en-us/floater_preview_texture.xml index af10638b6..0cd554eaa 100644 --- a/indra/newview/skins/default/xui/en-us/floater_preview_texture.xml +++ b/indra/newview/skins/default/xui/en-us/floater_preview_texture.xml @@ -9,7 +9,7 @@ follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="false" height="17" left="93" max_length="127" mouse_opaque="true" name="desc" select_all_on_focus_received="false" select_on_focus="false" width="229" /> - + select_on_focus="false" width="420" />