From 251bf8ceca2af09d7b6aa7dbdc6178bf8f01afff Mon Sep 17 00:00:00 2001 From: JJ Linden Date: Wed, 19 Feb 2014 14:40:27 -0800 Subject: duplicated the workaround added for darwin codesigning onto the windos codesigning --- indra/newview/viewer_manifest.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 96b4c7268c..85d18b7789 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -622,7 +622,22 @@ class Windows_i686_Manifest(ViewerManifest): NSIS_path = os.path.expandvars('${ProgramFiles}\\NSIS\\Unicode\\makensis.exe') if not os.path.exists(NSIS_path): NSIS_path = os.path.expandvars('${ProgramFiles(x86)}\\NSIS\\Unicode\\makensis.exe') - self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile)) + signed=False + sign_attempts=3 + sign_retry_wait=15 + while (not signed) and (sign_attempts > 0): + try: + sign_attempts-=1; + self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile)) + signed=True # if no exception was raised, the codesign worked + except ManifestError, err: + if sign_attempts: + print >> sys.stderr, "codesign failed, waiting %d seconds before retrying" % sign_retry_wait + time.sleep(sign_retry_wait) + sign_retry_wait*=2 + else: + print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" + raise # self.remove(self.dst_path_of(tempfile)) # If we're on a build machine, sign the code using our Authenticode certificate. JC sign_py = os.path.expandvars("${SIGN}") -- cgit v1.2.3 From 0abdab7848b6fb02c2600e74774426acc6bf5ef6 Mon Sep 17 00:00:00 2001 From: JJ Linden Date: Fri, 21 Feb 2014 11:59:17 -0800 Subject: changed variable names and errors to more accurately reflect the operation being performed --- indra/newview/viewer_manifest.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'indra') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 85d18b7789..fe0774b409 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -622,21 +622,21 @@ class Windows_i686_Manifest(ViewerManifest): NSIS_path = os.path.expandvars('${ProgramFiles}\\NSIS\\Unicode\\makensis.exe') if not os.path.exists(NSIS_path): NSIS_path = os.path.expandvars('${ProgramFiles(x86)}\\NSIS\\Unicode\\makensis.exe') - signed=False - sign_attempts=3 - sign_retry_wait=15 - while (not signed) and (sign_attempts > 0): + installer_created=False + nsis_attempts=3 + nsis_retry_wait=15 + while (not installer_created) and (nsis_attempts > 0): try: - sign_attempts-=1; + nsis_attempts-=1; self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile)) - signed=True # if no exception was raised, the codesign worked + installer_created=True # if no exception was raised, the codesign worked except ManifestError, err: - if sign_attempts: - print >> sys.stderr, "codesign failed, waiting %d seconds before retrying" % sign_retry_wait - time.sleep(sign_retry_wait) - sign_retry_wait*=2 + if nsis_attempts: + print >> sys.stderr, "nsis failed, waiting %d seconds before retrying" % nsis_retry_wait + time.sleep(nsis_retry_wait) + nsis_retry_wait*=2 else: - print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" + print >> sys.stderr, "Maximum nsis attempts exceeded; giving up" raise # self.remove(self.dst_path_of(tempfile)) # If we're on a build machine, sign the code using our Authenticode certificate. JC -- cgit v1.2.3 From 16aec9dca7836505b58f5d4306ccf64b096c9fcd Mon Sep 17 00:00:00 2001 From: akl Date: Mon, 24 Feb 2014 19:30:30 +0200 Subject: MAINT-2588 FIXED User cannot delete items from content of other object, using 'Delete' button on keyboard. --- indra/newview/llpanelobjectinventory.cpp | 43 ++++++++++++++++++++++++++++++++ indra/newview/llpanelobjectinventory.h | 3 +++ 2 files changed, 46 insertions(+) (limited to 'indra') diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index bb063f48a5..6c9616511f 100755 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -2011,3 +2011,46 @@ void LLPanelObjectInventory::clearItemIDs() mItemMap.clear(); } +BOOL LLPanelObjectInventory::handleKeyHere( KEY key, MASK mask ) +{ + BOOL handled = FALSE; + switch (key) + { + case KEY_DELETE: + case KEY_BACKSPACE: + // Delete selected items if delete or backspace key hit on the inventory panel + // Note: on Mac laptop keyboards, backspace and delete are one and the same + if (isSelectionRemovable() && mask == MASK_NONE) + { + LLInventoryAction::doToSelected(&gInventory, mFolders, "delete"); + handled = TRUE; + } + break; + } + return handled; +} + +BOOL LLPanelObjectInventory::isSelectionRemovable() +{ + if (!mFolders || !mFolders->getRoot()) + { + return FALSE; + } + std::set selection_set = mFolders->getRoot()->getSelectionList(); + if (selection_set.empty()) + { + return FALSE; + } + for (std::set::iterator iter = selection_set.begin(); + iter != selection_set.end(); + ++iter) + { + LLFolderViewItem *item = *iter; + const LLFolderViewModelItemInventory *listener = dynamic_cast(item->getViewModelItem()); + if (!listener || !listener->isItemRemovable() || listener->isItemInTrash()) + { + return FALSE; + } + } + return TRUE; +} diff --git a/indra/newview/llpanelobjectinventory.h b/indra/newview/llpanelobjectinventory.h index f497c695b3..9559f7e886 100755 --- a/indra/newview/llpanelobjectinventory.h +++ b/indra/newview/llpanelobjectinventory.h @@ -94,6 +94,9 @@ protected: void removeItemID(const LLUUID& id); void clearItemIDs(); + BOOL handleKeyHere( KEY key, MASK mask ); + BOOL isSelectionRemovable(); + private: std::map mItemMap; -- cgit v1.2.3 From 100b9154dd00187079529dab7b4076bdac92c027 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 26 Feb 2014 12:49:29 -0800 Subject: MAINT-3555 : crash in LLPanel::~LLPanel() on shutdown. Fixes to be paranoid about the return type for calls to LLView::getParent(): never assume a down cast is possible. --- indra/llui/lldraghandle.cpp | 5 ++- indra/llui/llfloater.cpp | 29 +++++++++---- indra/llui/llmenugl.cpp | 99 +++++++++++++++++++++++++++++++++------------ 3 files changed, 99 insertions(+), 34 deletions(-) (limited to 'indra') diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index 5f69c6af31..304d21d0df 100755 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -315,14 +315,15 @@ BOOL LLDragHandle::handleHover(S32 x, S32 y, MASK mask) S32 delta_y = screen_y - mDragLastScreenY; // if dragging a docked floater we want to undock - if (((LLFloater*)getParent())->isDocked()) + LLFloater * parent = dynamic_cast(getParent()); + if (parent && parent->isDocked()) { const S32 SLOP = 12; if (delta_y <= -SLOP || delta_y >= SLOP) { - ((LLFloater*)getParent())->setDocked(false, false); + parent->setDocked(false, false); return TRUE; } else diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index cc25bfcfeb..e6db65916e 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1146,7 +1146,11 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user) if (by_user && !getHost()) { - static_cast(getParent())->adjustToFitScreen(this, !isMinimized()); + LLFloaterView * floaterVp = dynamic_cast(getParent()); + if (floaterVp) + { + floaterVp->adjustToFitScreen(this, !isMinimized()); + } } // if not minimized, adjust all snapped dependents to new shape @@ -1357,7 +1361,8 @@ void LLFloater::setFocus( BOOL b ) if (b) { // only push focused floaters to front of stack if not in midst of ctrl-tab cycle - if (!getHost() && !((LLFloaterView*)getParent())->getCycleMode()) + LLFloaterView * parent = dynamic_cast(getParent()); + if (!getHost() && parent && !parent->getCycleMode()) { if (!isFrontmost()) { @@ -1627,7 +1632,7 @@ void LLFloater::bringToFront( S32 x, S32 y ) } else { - LLFloaterView* parent = (LLFloaterView*) getParent(); + LLFloaterView* parent = dynamic_cast( getParent() ); if (parent) { parent->bringToFront( this ); @@ -1666,7 +1671,11 @@ void LLFloater::setFrontmost(BOOL take_focus) { // there are more than one floater view // so we need to query our parent directly - ((LLFloaterView*)getParent())->bringToFront(this, take_focus); + LLFloaterView * parent = dynamic_cast( getParent() ); + if (parent) + { + parent->bringToFront(this, take_focus); + } // Make sure to set the appropriate transparency type (STORM-732). updateTransparency(hasFocus() || getIsChrome() ? TT_ACTIVE : TT_INACTIVE); @@ -2396,6 +2405,9 @@ LLRect LLFloaterView::findNeighboringPosition( LLFloater* reference_floater, LLF void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus) { + if (!child) + return; + if (mFrontChild == child) { if (give_focus && !gFocusMgr.childHasKeyboardFocus(child)) @@ -2874,10 +2886,13 @@ LLFloater *LLFloaterView::getFocusedFloater() const { for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { - LLUICtrl* ctrlp = (*child_it)->isCtrl() ? static_cast(*child_it) : NULL; - if ( ctrlp && ctrlp->hasFocus() ) + if ((*child_it)->isCtrl()) { - return static_cast(ctrlp); + LLFloater* ctrlp = dynamic_cast(*child_it); + if ( ctrlp && ctrlp->hasFocus() ) + { + return ctrlp; + } } } return NULL; diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index f854e1785d..6a57158eaa 100755 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -693,8 +693,11 @@ void LLMenuItemTearOffGL::onCommit() { if (getMenu()->getTornOff()) { - LLTearOffMenu* torn_off_menu = (LLTearOffMenu*)(getMenu()->getParent()); - torn_off_menu->closeFloater(); + LLTearOffMenu * torn_off_menu = dynamic_cast(getMenu()->getParent()); + if (torn_off_menu) + { + torn_off_menu->closeFloater(); + } } else { @@ -1097,7 +1100,8 @@ void LLMenuItemBranchGL::setHighlight( BOOL highlight ) BOOL auto_open = getEnabled() && (!branch->getVisible() || branch->getTornOff()); // torn off menus don't open sub menus on hover unless they have focus - if (getMenu()->getTornOff() && !((LLFloater*)getMenu()->getParent())->hasFocus()) + LLFloater * menu_parent = dynamic_cast(getMenu()->getParent()); + if (getMenu()->getTornOff() && menu_parent && !menu_parent->hasFocus()) { auto_open = FALSE; } @@ -1118,7 +1122,11 @@ void LLMenuItemBranchGL::setHighlight( BOOL highlight ) { if (branch->getTornOff()) { - ((LLFloater*)branch->getParent())->setFocus(FALSE); + LLFloater * branch_parent = dynamic_cast(branch->getParent()); + if (branch_parent) + { + branch_parent->setFocus(FALSE); + } branch->clearHoverItem(); } else @@ -1175,11 +1183,19 @@ BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) BOOL handled = branch->clearHoverItem(); if (branch->getTornOff()) { - ((LLFloater*)branch->getParent())->setFocus(FALSE); + LLFloater * branch_parent = dynamic_cast(branch->getParent()); + if (branch_parent) + { + branch_parent->setFocus(FALSE); + } } if (handled && getMenu()->getTornOff()) { - ((LLFloater*)getMenu()->getParent())->setFocus(TRUE); + LLFloater * menu_parent = dynamic_cast(getMenu()->getParent()); + if (menu_parent) + { + menu_parent->setFocus(TRUE); + } } return handled; } @@ -1219,9 +1235,13 @@ void LLMenuItemBranchGL::openMenu() if (branch->getTornOff()) { - gFloaterView->bringToFront((LLFloater*)branch->getParent()); - // this might not be necessary, as torn off branches don't get focus and hence no highligth - branch->highlightNextItem(NULL); + LLFloater * branch_parent = dynamic_cast(branch->getParent()); + if (branch_parent) + { + gFloaterView->bringToFront(branch_parent); + // this might not be necessary, as torn off branches don't get focus and hence no highligth + branch->highlightNextItem(NULL); + } } else if( !branch->getVisible() ) { @@ -1348,7 +1368,11 @@ void LLMenuItemBranchDownGL::openMenu( void ) { if (branch->getTornOff()) { - gFloaterView->bringToFront((LLFloater*)branch->getParent()); + LLFloater * branch_parent = dynamic_cast(branch->getParent()); + if (branch_parent) + { + gFloaterView->bringToFront(branch_parent); + } } else { @@ -1403,7 +1427,11 @@ void LLMenuItemBranchDownGL::setHighlight( BOOL highlight ) { if (branch->getTornOff()) { - ((LLFloater*)branch->getParent())->setFocus(FALSE); + LLFloater * branch_parent = dynamic_cast(branch->getParent()); + if (branch_parent) + { + branch_parent->setFocus(FALSE); + } branch->clearHoverItem(); } else @@ -1826,20 +1854,28 @@ BOOL LLMenuGL::jumpKeysActive() { LLMenuItemGL* highlighted_item = getHighlightedItem(); BOOL active = getVisible() && getEnabled(); - if (getTornOff()) - { - // activation of jump keys on torn off menus controlled by keyboard focus - active = active && ((LLFloater*)getParent())->hasFocus(); - } - else + if (active) { - // Are we the terminal active menu? - // Yes, if parent menu item deems us to be active (just being visible is sufficient for top-level menus) - // and we don't have a highlighted menu item pointing to an active sub-menu - active = active && (!getParentMenuItem() || getParentMenuItem()->isActive()) // I have a parent that is active... - && (!highlighted_item || !highlighted_item->isActive()); //... but no child that is active + if (getTornOff()) + { + // activation of jump keys on torn off menus controlled by keyboard focus + LLFloater * parent = dynamic_cast(getParent()); + if (parent) + { + active = parent->hasFocus(); + } + } + else + { + // Are we the terminal active menu? + // Yes, if parent menu item deems us to be active (just being visible is sufficient for top-level menus) + // and we don't have a highlighted menu item pointing to an active sub-menu + active = (!getParentMenuItem() || getParentMenuItem()->isActive()) // I have a parent that is active... + && (!highlighted_item || !highlighted_item->isActive()); //... but no child that is active + } } + return active; } @@ -1855,7 +1891,12 @@ BOOL LLMenuGL::isOpen() return TRUE; } // otherwise we are only active if we have keyboard focus - return ((LLFloater*)getParent())->hasFocus(); + LLFloater * parent = dynamic_cast(getParent()); + if (parent) + { + return parent->hasFocus(); + } + return FALSE; } else { @@ -2714,7 +2755,11 @@ LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disa // same as giving focus to it if (!cur_item && getTornOff()) { - ((LLFloater*)getParent())->setFocus(TRUE); + LLFloater * parent = dynamic_cast(getParent()); + if (parent) + { + parent->setFocus(TRUE); + } } // Current item position in the items list @@ -2816,7 +2861,11 @@ LLMenuItemGL* LLMenuGL::highlightPrevItem(LLMenuItemGL* cur_item, BOOL skip_disa // same as giving focus to it if (!cur_item && getTornOff()) { - ((LLFloater*)getParent())->setFocus(TRUE); + LLFloater * parent = dynamic_cast(getParent()); + if (parent) + { + parent->setFocus(TRUE); + } } // Current item reverse position from the end of the list -- cgit v1.2.3 From 483ad8dc558156b65bf1e0a301fc18040bb038c3 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 26 Feb 2014 20:14:41 +0200 Subject: MAINT-3555 FIXED crash in LLPanel::~LLPanel() on shutdown: - LLFloaterView::mToolbarRects[3] was transformed to LLRect mToolbarLeftRect, mToolbarBottomRect, mToolbarRightRect; --- indra/llui/llfloater.cpp | 27 ++++++++++++++++----------- indra/llui/llfloater.h | 4 +++- 2 files changed, 19 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index e6db65916e..8e7aa7b22b 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2815,29 +2815,26 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } } - const LLRect& left_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_LEFT]; - const LLRect& bottom_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_BOTTOM]; - const LLRect& right_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_RIGHT]; const LLRect& floater_rect = floater->getRect(); - S32 delta_left = left_toolbar_rect.notEmpty() ? left_toolbar_rect.mRight - floater_rect.mRight : 0; - S32 delta_bottom = bottom_toolbar_rect.notEmpty() ? bottom_toolbar_rect.mTop - floater_rect.mTop : 0; - S32 delta_right = right_toolbar_rect.notEmpty() ? right_toolbar_rect.mLeft - floater_rect.mLeft : 0; + S32 delta_left = mToolbarLeftRect.notEmpty() ? mToolbarLeftRect.mRight - floater_rect.mRight : 0; + S32 delta_bottom = mToolbarBottomRect.notEmpty() ? mToolbarBottomRect.mTop - floater_rect.mTop : 0; + S32 delta_right = mToolbarRightRect.notEmpty() ? mToolbarRightRect.mLeft - floater_rect.mLeft : 0; // move window fully onscreen if (floater->translateIntoRect( snap_in_toolbars ? getSnapRect() : gFloaterView->getRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) { floater->clearSnapTarget(); } - else if (delta_left > 0 && floater_rect.mTop < left_toolbar_rect.mTop && floater_rect.mBottom > left_toolbar_rect.mBottom) + else if (delta_left > 0 && floater_rect.mTop < mToolbarLeftRect.mTop && floater_rect.mBottom > mToolbarLeftRect.mBottom) { floater->translate(delta_left, 0); } - else if (delta_bottom > 0 && floater_rect.mLeft > bottom_toolbar_rect.mLeft && floater_rect.mRight < bottom_toolbar_rect.mRight) + else if (delta_bottom > 0 && floater_rect.mLeft > mToolbarBottomRect.mLeft && floater_rect.mRight < mToolbarBottomRect.mRight) { floater->translate(0, delta_bottom); } - else if (delta_right < 0 && floater_rect.mTop < right_toolbar_rect.mTop && floater_rect.mBottom > right_toolbar_rect.mBottom) + else if (delta_right < 0 && floater_rect.mTop < mToolbarRightRect.mTop && floater_rect.mBottom > mToolbarRightRect.mBottom) { floater->translate(delta_right, 0); } @@ -3045,9 +3042,17 @@ void LLFloaterView::popVisibleAll(const skip_list_t& skip_list) void LLFloaterView::setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LLRect& toolbar_rect) { - if (tb < LLToolBarEnums::TOOLBAR_COUNT) + switch (tb) { - mToolbarRects[tb] = toolbar_rect; + case LLToolBarEnums::TOOLBAR_LEFT: + mToolbarLeftRect = toolbar_rect; + break; + case LLToolBarEnums::TOOLBAR_BOTTOM: + mToolbarBottomRect = toolbar_rect; + break; + case LLToolBarEnums::TOOLBAR_RIGHT: + mToolbarRightRect = toolbar_rect; + break; } } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index ccaae1d02b..12eb3cdbfa 100755 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -581,7 +581,9 @@ private: void hiddenFloaterClosed(LLFloater* floater); LLRect mLastSnapRect; - LLRect mToolbarRects[LLToolBarEnums::TOOLBAR_COUNT]; + LLRect mToolbarLeftRect; + LLRect mToolbarBottomRect; + LLRect mToolbarRightRect; LLHandle mSnapView; BOOL mFocusCycleMode; S32 mSnapOffsetBottom; -- cgit v1.2.3 From 0a46023db52cce799523e69de433b6b781145ffc Mon Sep 17 00:00:00 2001 From: Simon Linden Date: Wed, 26 Feb 2014 23:52:34 +0000 Subject: Fix linux build - make default check in switch statement --- indra/llui/llfloater.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 8e7aa7b22b..2b93237de6 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -3053,6 +3053,9 @@ void LLFloaterView::setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LL case LLToolBarEnums::TOOLBAR_RIGHT: mToolbarRightRect = toolbar_rect; break; + default: + llwarns << "setToolbarRect() passed odd toolbar number " << (S32) tb << llendl; + break; } } -- cgit v1.2.3