diff options
author | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
commit | 117e22047c5752352342d64e3fb7ce00a4eb8113 (patch) | |
tree | e32de2cfba0dda8705ae528fcd1fbe23ba075685 /linden/indra/newview/llfolderview.cpp | |
parent | Second Life viewer sources 1.18.0.6 (diff) | |
download | meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.zip meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.gz meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.bz2 meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.xz |
Second Life viewer sources 1.18.1.2
Diffstat (limited to 'linden/indra/newview/llfolderview.cpp')
-rw-r--r-- | linden/indra/newview/llfolderview.cpp | 79 |
1 files changed, 61 insertions, 18 deletions
diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp index 36d0b40..f3c6ace 100644 --- a/linden/indra/newview/llfolderview.cpp +++ b/linden/indra/newview/llfolderview.cpp | |||
@@ -568,16 +568,15 @@ void LLFolderViewItem::rename(const LLString& new_name) | |||
568 | if( !new_name.empty() ) | 568 | if( !new_name.empty() ) |
569 | { | 569 | { |
570 | mLabel = new_name.c_str(); | 570 | mLabel = new_name.c_str(); |
571 | BOOL is_renamed = TRUE; | ||
572 | if( mListener ) | 571 | if( mListener ) |
573 | { | 572 | { |
574 | is_renamed = mListener->renameItem(new_name); | 573 | mListener->renameItem(new_name); |
575 | } | 574 | |
576 | if(mParentFolder && is_renamed) | 575 | if(mParentFolder) |
577 | { | 576 | { |
578 | mParentFolder->resort(this); | 577 | mParentFolder->resort(this); |
578 | } | ||
579 | } | 579 | } |
580 | //refresh(); | ||
581 | } | 580 | } |
582 | } | 581 | } |
583 | 582 | ||
@@ -2990,7 +2989,10 @@ void LLFolderView::sanitizeSelection() | |||
2990 | // store off current item in case it is automatically deselected | 2989 | // store off current item in case it is automatically deselected |
2991 | // and we want to preserve context | 2990 | // and we want to preserve context |
2992 | LLFolderViewItem* original_selected_item = getCurSelectedItem(); | 2991 | LLFolderViewItem* original_selected_item = getCurSelectedItem(); |
2993 | 2992 | ||
2993 | // Cache "Show all folders" filter setting | ||
2994 | BOOL show_all_folders = (getRoot()->getShowFolderState() == LLInventoryFilter::SHOW_ALL_FOLDERS); | ||
2995 | |||
2994 | std::vector<LLFolderViewItem*> items_to_remove; | 2996 | std::vector<LLFolderViewItem*> items_to_remove; |
2995 | selected_items_t::iterator item_iter; | 2997 | selected_items_t::iterator item_iter; |
2996 | for (item_iter = mSelectedItems.begin(); item_iter != mSelectedItems.end(); ++item_iter) | 2998 | for (item_iter = mSelectedItems.begin(); item_iter != mSelectedItems.end(); ++item_iter) |
@@ -3001,10 +3003,20 @@ void LLFolderView::sanitizeSelection() | |||
3001 | BOOL visible = item->potentiallyVisible(); // initialize from filter state for this item | 3003 | BOOL visible = item->potentiallyVisible(); // initialize from filter state for this item |
3002 | // modify with parent open and filters states | 3004 | // modify with parent open and filters states |
3003 | LLFolderViewFolder* parent_folder = item->getParentFolder(); | 3005 | LLFolderViewFolder* parent_folder = item->getParentFolder(); |
3004 | while(parent_folder) | 3006 | if ( parent_folder ) |
3005 | { | 3007 | { |
3006 | visible = visible && parent_folder->isOpen() && parent_folder->potentiallyVisible(); | 3008 | if ( show_all_folders ) |
3007 | parent_folder = parent_folder->getParentFolder(); | 3009 | { // "Show all folders" is on, so this folder is visible |
3010 | visible = TRUE; | ||
3011 | } | ||
3012 | else | ||
3013 | { // Move up through parent folders and see what's visible | ||
3014 | while(parent_folder) | ||
3015 | { | ||
3016 | visible = visible && parent_folder->isOpen() && parent_folder->potentiallyVisible(); | ||
3017 | parent_folder = parent_folder->getParentFolder(); | ||
3018 | } | ||
3019 | } | ||
3008 | } | 3020 | } |
3009 | 3021 | ||
3010 | // deselect item if any ancestor is closed or didn't pass filter requirements. | 3022 | // deselect item if any ancestor is closed or didn't pass filter requirements. |
@@ -3020,7 +3032,7 @@ void LLFolderView::sanitizeSelection() | |||
3020 | for (other_item_iter = mSelectedItems.begin(); other_item_iter != mSelectedItems.end(); ++other_item_iter) | 3032 | for (other_item_iter = mSelectedItems.begin(); other_item_iter != mSelectedItems.end(); ++other_item_iter) |
3021 | { | 3033 | { |
3022 | LLFolderViewItem* other_item = *other_item_iter; | 3034 | LLFolderViewItem* other_item = *other_item_iter; |
3023 | for(LLFolderViewFolder* parent_folder = other_item->getParentFolder(); parent_folder; parent_folder = parent_folder->getParentFolder()) | 3035 | for( parent_folder = other_item->getParentFolder(); parent_folder; parent_folder = parent_folder->getParentFolder()) |
3024 | { | 3036 | { |
3025 | if (parent_folder == item) | 3037 | if (parent_folder == item) |
3026 | { | 3038 | { |
@@ -3359,19 +3371,30 @@ void LLFolderView::openSelectedItems( void ) | |||
3359 | { | 3371 | { |
3360 | S32 left, top; | 3372 | S32 left, top; |
3361 | gFloaterView->getNewFloaterPosition(&left, &top); | 3373 | gFloaterView->getNewFloaterPosition(&left, &top); |
3362 | |||
3363 | LLMultiPreview* multi_previewp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100)); | 3374 | LLMultiPreview* multi_previewp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100)); |
3364 | 3375 | gFloaterView->getNewFloaterPosition(&left, &top); | |
3365 | LLFloater::setFloaterHost(multi_previewp); | 3376 | LLMultiProperties* multi_propertiesp = new LLMultiProperties(LLRect(left, top, left + 300, top - 100)); |
3366 | 3377 | ||
3367 | selected_items_t::iterator item_it; | 3378 | selected_items_t::iterator item_it; |
3368 | for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) | 3379 | for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) |
3369 | { | 3380 | { |
3370 | (*item_it)->open(); /* Flawfinder: ignore */ | 3381 | // IT_{OBJECT,ATTACHMENT} creates LLProperties |
3382 | // floaters; others create LLPreviews. Put | ||
3383 | // each one in the right type of container. | ||
3384 | LLFolderViewEventListener* listener = (*item_it)->getListener(); | ||
3385 | bool is_prop = listener && (listener->getInventoryType() == LLInventoryType::IT_OBJECT || listener->getInventoryType() == LLInventoryType::IT_ATTACHMENT); | ||
3386 | if (is_prop) | ||
3387 | LLFloater::setFloaterHost(multi_propertiesp); | ||
3388 | else | ||
3389 | LLFloater::setFloaterHost(multi_previewp); | ||
3390 | (*item_it)->open(); | ||
3371 | } | 3391 | } |
3372 | 3392 | ||
3373 | LLFloater::setFloaterHost(NULL); | 3393 | LLFloater::setFloaterHost(NULL); |
3374 | multi_previewp->open(); /* Flawfinder: ignore */ | 3394 | // *NOTE: LLMulti* will safely auto-delete when open'd |
3395 | // without any children. | ||
3396 | multi_previewp->open(); | ||
3397 | multi_propertiesp->open(); | ||
3375 | } | 3398 | } |
3376 | } | 3399 | } |
3377 | } | 3400 | } |
@@ -4665,7 +4688,7 @@ void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl) | |||
4665 | 4688 | ||
4666 | BOOL LLInventoryFilter::isSinceLogoff() | 4689 | BOOL LLInventoryFilter::isSinceLogoff() |
4667 | { | 4690 | { |
4668 | return mFilterOps.mMinDate == mLastLogoff && mFilterOps.mMaxDate == U32_MAX; | 4691 | return (mFilterOps.mMinDate == mLastLogoff) && (mFilterOps.mMaxDate == U32_MAX); |
4669 | } | 4692 | } |
4670 | 4693 | ||
4671 | void LLInventoryFilter::setHoursAgo(U32 hours) | 4694 | void LLInventoryFilter::setHoursAgo(U32 hours) |
@@ -4966,28 +4989,48 @@ void LLInventoryFilter::toLLSD(LLSD& data) | |||
4966 | data["permissions"] = (LLSD::Integer)getFilterPermissions(); | 4989 | data["permissions"] = (LLSD::Integer)getFilterPermissions(); |
4967 | data["substring"] = (LLSD::String)getFilterSubString(); | 4990 | data["substring"] = (LLSD::String)getFilterSubString(); |
4968 | data["sort_order"] = (LLSD::Integer)getSortOrder(); | 4991 | data["sort_order"] = (LLSD::Integer)getSortOrder(); |
4992 | data["since_logoff"] = (LLSD::Boolean)isSinceLogoff(); | ||
4969 | } | 4993 | } |
4970 | 4994 | ||
4971 | void LLInventoryFilter::fromLLSD(LLSD& data) | 4995 | void LLInventoryFilter::fromLLSD(LLSD& data) |
4972 | { | 4996 | { |
4973 | if(data.has("filter_types")) | 4997 | if(data.has("filter_types")) |
4998 | { | ||
4974 | setFilterTypes((U32)data["filter_types"].asInteger()); | 4999 | setFilterTypes((U32)data["filter_types"].asInteger()); |
5000 | } | ||
4975 | 5001 | ||
4976 | if(data.has("min_date") && data.has("max_date")) | 5002 | if(data.has("min_date") && data.has("max_date")) |
5003 | { | ||
4977 | setDateRange((U32)data["min_date"].asInteger(), (U32)data["max_date"].asInteger()); | 5004 | setDateRange((U32)data["min_date"].asInteger(), (U32)data["max_date"].asInteger()); |
5005 | } | ||
4978 | 5006 | ||
4979 | if(data.has("hours_ago")) | 5007 | if(data.has("hours_ago")) |
5008 | { | ||
4980 | setHoursAgo((U32)data["hours_ago"].asInteger()); | 5009 | setHoursAgo((U32)data["hours_ago"].asInteger()); |
5010 | } | ||
4981 | 5011 | ||
4982 | if(data.has("show_folder_state")) | 5012 | if(data.has("show_folder_state")) |
5013 | { | ||
4983 | setShowFolderState((EFolderShow)data["show_folder_state"].asInteger()); | 5014 | setShowFolderState((EFolderShow)data["show_folder_state"].asInteger()); |
5015 | } | ||
4984 | 5016 | ||
4985 | if(data.has("permissions")) | 5017 | if(data.has("permissions")) |
5018 | { | ||
4986 | setFilterPermissions((PermissionMask)data["permissions"].asInteger()); | 5019 | setFilterPermissions((PermissionMask)data["permissions"].asInteger()); |
5020 | } | ||
4987 | 5021 | ||
4988 | if(data.has("substring")) | 5022 | if(data.has("substring")) |
5023 | { | ||
4989 | setFilterSubString(LLString(data["substring"].asString())); | 5024 | setFilterSubString(LLString(data["substring"].asString())); |
5025 | } | ||
4990 | 5026 | ||
4991 | if(data.has("sort_order")) | 5027 | if(data.has("sort_order")) |
5028 | { | ||
4992 | setSortOrder((U32)data["sort_order"].asInteger()); | 5029 | setSortOrder((U32)data["sort_order"].asInteger()); |
5030 | } | ||
5031 | |||
5032 | if(data.has("since_logoff")) | ||
5033 | { | ||
5034 | setDateRangeLastLogoff((bool)data["since_logoff"].asBoolean()); | ||
5035 | } | ||
4993 | } | 5036 | } |