diff options
author | Josh Bell <josh@lindenlab.com> | 2007-02-20 22:02:36 +0000 |
---|---|---|
committer | Josh Bell <josh@lindenlab.com> | 2007-02-20 22:02:36 +0000 |
commit | 7dada07dbaae3dfb9b1319453e51019bfff2717f (patch) | |
tree | a7f2b84ea65c39cee31474640dd5f265c0b2f432 /indra/newview/llviewermenu.cpp | |
parent | 73bc0fb42b5bcd80030d9f30d5cb57ec2397ba08 (diff) |
svn merge -r 57620:58007 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 9b6fc425fa..c7bd6b51e4 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -89,7 +89,6 @@ #include "llfloaterland.h" #include "llfloaterlandholdings.h" #include "llfloatermap.h" -#include "llfloateraccounthistory.h" #include "llfloaterimagepreview.h" #include "llfloatermute.h" #include "llfloaternamedesc.h" @@ -5215,15 +5214,23 @@ void upload_error(const char* error_message, const char* label, const std::strin LLFilePicker::instance().reset(); } +class LLFileEnableCloseWindow : public view_listener_t +{ + bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + { + bool new_value = gFloaterView->getFocusedFloater() != NULL || gSnapshotFloaterView->getFocusedFloater() != NULL; + // horrendously opaque, this code + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); + return true; + } +}; + class LLFileCloseWindow : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - LLFloater *top = gFloaterView->getFrontmost(); - if (top && top->hasFocus()) - { - LLFloater::closeByMenu( top ); - } + LLFloater::closeFocusedFloater(); + return true; } }; @@ -6411,10 +6418,6 @@ class LLShowFloater : public view_listener_t { gDebugView->mStatViewp->setVisible(!gDebugView->mStatViewp->getVisible()); } - else if (floater_name == "account history") - { - LLFloaterAccountHistory::show(NULL); - } else if (floater_name == "my land") { LLFloaterLandHoldings::show(NULL); @@ -8615,6 +8618,7 @@ void initialize_menu_actions() (new LLFileUploadAnim())->registerListener(gMenuHolder, "File.UploadAnim"); (new LLFileUploadBulk())->registerListener(gMenuHolder, "File.UploadBulk"); (new LLFileCloseWindow())->registerListener(gMenuHolder, "File.CloseWindow"); + (new LLFileEnableCloseWindow())->registerListener(gMenuHolder, "File.EnableCloseWindow"); (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture"); (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); |