diff options
author | Jacek Antonelli | 2008-08-15 23:44:58 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:58 -0500 |
commit | 089fc07d207c71ce1401e72f09c31ad8c45872e2 (patch) | |
tree | 0028955add042c6f45b47a7b774adeeac9c592cb /linden/indra/newview/llpanelavatar.cpp | |
parent | Second Life viewer sources 1.16.0.5 (diff) | |
download | meta-impy-089fc07d207c71ce1401e72f09c31ad8c45872e2.zip meta-impy-089fc07d207c71ce1401e72f09c31ad8c45872e2.tar.gz meta-impy-089fc07d207c71ce1401e72f09c31ad8c45872e2.tar.bz2 meta-impy-089fc07d207c71ce1401e72f09c31ad8c45872e2.tar.xz |
Second Life viewer sources 1.17.0.12
Diffstat (limited to 'linden/indra/newview/llpanelavatar.cpp')
-rw-r--r-- | linden/indra/newview/llpanelavatar.cpp | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index 9c73dad..0180bb3 100644 --- a/linden/indra/newview/llpanelavatar.cpp +++ b/linden/indra/newview/llpanelavatar.cpp | |||
@@ -865,14 +865,44 @@ void LLPanelAvatarClassified::refresh() | |||
865 | bool allow_delete = (tab_count > 0); | 865 | bool allow_delete = (tab_count > 0); |
866 | bool show_help = (tab_count == 0); | 866 | bool show_help = (tab_count == 0); |
867 | 867 | ||
868 | childSetEnabled("New...",self && allow_new); | 868 | // *HACK: Don't allow making new classifieds from inside the directory. |
869 | childSetEnabled("Delete...",self && allow_delete); | 869 | // The logic for save/don't save when closing is too hairy, and the |
870 | // directory is conceptually read-only. JC | ||
871 | bool in_directory = false; | ||
872 | LLView* view = this; | ||
873 | while (view) | ||
874 | { | ||
875 | if (view->getName() == "directory") | ||
876 | { | ||
877 | in_directory = true; | ||
878 | break; | ||
879 | } | ||
880 | view = view->getParent(); | ||
881 | } | ||
882 | childSetEnabled("New...", self && !in_directory && allow_new); | ||
883 | childSetVisible("New...", !in_directory); | ||
884 | childSetEnabled("Delete...", self && !in_directory && allow_delete); | ||
885 | childSetVisible("Delete...", !in_directory); | ||
870 | childSetVisible("classified tab",!show_help); | 886 | childSetVisible("classified tab",!show_help); |
871 | 887 | ||
872 | sendAvatarProfileRequestIfNeeded("avatarclassifiedsrequest"); | 888 | sendAvatarProfileRequestIfNeeded("avatarclassifiedsrequest"); |
873 | } | 889 | } |
874 | 890 | ||
875 | 891 | ||
892 | BOOL LLPanelAvatarClassified::canClose() | ||
893 | { | ||
894 | LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this, "classified tab"); | ||
895 | for (S32 i = 0; i < tabs->getTabCount(); i++) | ||
896 | { | ||
897 | LLPanelClassified* panel = (LLPanelClassified*)tabs->getPanelByIndex(i); | ||
898 | if (!panel->canClose()) | ||
899 | { | ||
900 | return FALSE; | ||
901 | } | ||
902 | } | ||
903 | return TRUE; | ||
904 | } | ||
905 | |||
876 | BOOL LLPanelAvatarClassified::titleIsValid() | 906 | BOOL LLPanelAvatarClassified::titleIsValid() |
877 | { | 907 | { |
878 | LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this, "classified tab"); | 908 | LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this, "classified tab"); |
@@ -1300,6 +1330,11 @@ LLPanelAvatar::~LLPanelAvatar() | |||
1300 | } | 1330 | } |
1301 | 1331 | ||
1302 | 1332 | ||
1333 | BOOL LLPanelAvatar::canClose() | ||
1334 | { | ||
1335 | return mPanelClassified && mPanelClassified->canClose(); | ||
1336 | } | ||
1337 | |||
1303 | void LLPanelAvatar::setAvatar(LLViewerObject *avatarp) | 1338 | void LLPanelAvatar::setAvatar(LLViewerObject *avatarp) |
1304 | { | 1339 | { |
1305 | // find the avatar and grab the name | 1340 | // find the avatar and grab the name |