From 08f3ea28f5681bbbd755947ec09970c11410bd0a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 11 Sep 2009 22:12:34 -0400 Subject: QAR-1619: Remove unneeded llfloatertos.h #includes. Neither lllogininstance.cpp nor lllogininstance_test.cpp need llfloatertos.h any more, since LLLoginInstance talks to LLFloaterTOS only via LLFloaterReg and LLEventPumps. However, both sources depended on llfloatertos.h dragging in llnotifications.h, so include that explicitly instead of llfloatertos.h. --- indra/newview/lllogininstance.cpp | 2 +- indra/newview/tests/lllogininstance_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index e56d28e066..8bf769a132 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -50,7 +50,7 @@ #include "llviewercontrol.h" #include "llurlsimstring.h" #include "llfloaterreg.h" -#include "llfloatertos.h" +#include "llnotifications.h" #include "llwindow.h" #if LL_LINUX || LL_SOLARIS #include "lltrans.h" diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index a84e796159..75db76df27 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -91,7 +91,7 @@ LLURLSimString LLURLSimString::sInstance; bool LLURLSimString::parse() { return true; } //----------------------------------------------------------------------------- -#include "../llfloatertos.h" +#include "llnotifications.h" #include "llfloaterreg.h" static std::string gTOSType; static LLEventPump * gTOSReplyPump = NULL; -- cgit v1.2.3 From 8e0128c493bce16555b3a9132bd71b670c322d63 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 11 Sep 2009 22:14:57 -0400 Subject: QAR-1619: Reconcile LLFloaterTOS::onCancel() with viewer-2 version. The viewer-2 onCancel() pops up a "MustAgreeToLogIn" notification. Make ours do the same. --- indra/newview/llfloatertos.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index d8aea2770f..8d2d48f1af 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -48,6 +48,7 @@ #include "lluictrlfactory.h" #include "llvfile.h" #include "message.h" +#include "llstartup.h" // login_alert_done LLFloaterTOS::LLFloaterTOS(const LLSD& data) @@ -206,6 +207,7 @@ void LLFloaterTOS::onCancel( void* userdata ) { LLFloaterTOS* self = (LLFloaterTOS*) userdata; llinfos << "User disagrees with TOS." << llendl; + LLNotifications::instance().add("MustAgreeToLogIn", LLSD(), LLSD(), login_alert_done); if(self->mReplyPumpName != "") { -- cgit v1.2.3 From d40d745cba1de0df4ada7d4d2cf9f1632279ae12 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 11 Sep 2009 22:24:30 -0400 Subject: DEV-38598, QAR-1619: Ensure we remove LLFloaterTOS from LLFloaterReg registry. LLFloater's destructor calls LLFloaterReg::removeInstance() with its own name and key. But for the new LLFloaterTOS invocation, we pass a key that's an LLSD map. removeInstance() critically depends on LLFloater::KeyCompare::equate() -- but equate() never considered a non-scalar LLSD key value. Fortunately llsdutil.h already provides a deep-equality function for LLSD: llsd_equals(). Making equate() trivially call llsd_equals() fixes the crash on TOS cancel. --- indra/llui/llfloater.cpp | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index ca3829e1bd..786340b468 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -60,6 +60,7 @@ #include "v2math.h" #include "lltrans.h" #include "llmultifloater.h" +#include "llsdutil.h" // use this to control "jumping" behavior when Ctrl-Tabbing const S32 TABBED_FLOATER_OFFSET = 0; @@ -175,29 +176,7 @@ bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b) bool LLFloater::KeyCompare::equate(const LLSD& a, const LLSD& b) { - if (a.type() != b.type()) - { - //llerrs << "Mismatched LLSD types: (" << a << ") mismatches (" << b << ")" << llendl; - return false; - } - else if (a.isUndefined()) - return true; - else if (a.isInteger()) - return a.asInteger() == b.asInteger(); - else if (a.isReal()) - return a.asReal() == b.asReal(); - else if (a.isString()) - return a.asString() == b.asString(); - else if (a.isUUID()) - return a.asUUID() == b.asUUID(); - else if (a.isDate()) - return a.asDate() == b.asDate(); - else if (a.isURI()) - return a.asString() == b.asString(); // compare URIs as strings - else if (a.isBoolean()) - return a.asBoolean() == b.asBoolean(); - else - return false; // no valid operation for Binary + return llsd_equals(a, b); } //************************************ -- cgit v1.2.3 From 689af4b32948e2d2a07b60adcc318668c4d55585 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 12 Sep 2009 09:11:32 -0400 Subject: DEV-38598: remove dangerous compare-LLSD-less-than operation --- indra/llui/llfloater.cpp | 11 +++++++++++ indra/llui/llfloater.h | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 786340b468..a372bac497 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -146,6 +146,16 @@ LLFloater::handle_map_t LLFloater::sFloaterMap; LLFloaterView* gFloaterView = NULL; +/*==========================================================================*| +// DEV-38598: The fundamental problem with this operation is that it can only +// support a subset of LLSD values. While it's plausible to compare two arrays +// lexicographically, what strict ordering can you impose on maps? +// (LLFloaterTOS's current key is an LLSD map.) + +// Of course something like this is necessary if you want to build a std::set +// or std::map with LLSD keys. Fortunately we're getting by with other +// container types for now. + //static bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b) { @@ -173,6 +183,7 @@ bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b) else return false; // no valid operation for Binary } +|*==========================================================================*/ bool LLFloater::KeyCompare::equate(const LLSD& a, const LLSD& b) { diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index ee066317e0..cace13939f 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -87,12 +87,14 @@ friend class LLMultiFloater; public: struct KeyCompare { - static bool compare(const LLSD& a, const LLSD& b); +// static bool compare(const LLSD& a, const LLSD& b); static bool equate(const LLSD& a, const LLSD& b); +/*==========================================================================*| bool operator()(const LLSD& a, const LLSD& b) const { return compare(a, b); } +|*==========================================================================*/ }; enum EFloaterButtons -- cgit v1.2.3 From 7dca49b0f238063b7396ead5dbd8206669a5934f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 14 Sep 2009 09:16:19 -0400 Subject: QAR-1619: At Sam's request, move SLPlugin to viewer executable dir, consistent with Mac and Linux. --- indra/llvfs/lldir_win32.cpp | 2 +- indra/newview/viewer_manifest.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp index 872f2cf1c1..3e302764de 100644 --- a/indra/llvfs/lldir_win32.cpp +++ b/indra/llvfs/lldir_win32.cpp @@ -397,7 +397,7 @@ BOOL LLDir_Win32::fileExists(const std::string &filename) const /*virtual*/ std::string LLDir_Win32::getLLPluginLauncher() { - return gDirUtilp->getLLPluginDir() + gDirUtilp->getDirDelimiter() + + return gDirUtilp->getExecutableDir() + gDirUtilp->getDirDelimiter() + "SLPlugin.exe"; } diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index bb48e8e572..109c437730 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -169,6 +169,11 @@ class WindowsManifest(ViewerManifest): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) + # Plugin host application + self.path(os.path.join(os.pardir, + 'llplugin', 'slplugin', self.args['configuration'], "slplugin.exe"), + "slplugin.exe") + # need to get the llcommon.dll from the build directory as well if self.prefix(src=self.args['configuration'], dst=""): try: @@ -206,11 +211,6 @@ class WindowsManifest(ViewerManifest): self.path("openjpeg.dll") self.end_prefix() - # Plugin host application - if self.prefix(src='../llplugin/slplugin/%s' % self.args['configuration'], dst="llplugin"): - self.path("slplugin.exe") - self.end_prefix() - # Media plugins - QuickTime if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"): self.path("media_plugin_quicktime.dll") -- cgit v1.2.3 From a81a89b5c73f1b2ecc9ad7a0b4845cc9d1876661 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 14 Sep 2009 13:39:23 -0400 Subject: QAR-1619: reconcile redundant SLPlugin.exe copy_if_different with viewer_manifest.py --- indra/newview/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index cae6a79ec8..3f8b8688d2 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1639,7 +1639,7 @@ if (WINDOWS) -E copy_if_different ${BUILT_SLPLUGIN} - ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} COMMENT "Copying SLPlugin executable to the runtime folder." ) -- cgit v1.2.3 From 9a13b059dc6f4ddc302954d735202dfee3992c2d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 14 Sep 2009 16:48:31 -0400 Subject: DEV-38598: More closely align new login-failure control flow with viewer-2. In the viewer-2 code base, the "tos" case is detected inline, a sibling of the other types of login failure, and doesn't reach the notification. Our new logic needs to detect "tos" as well. Also, the case of process_login_success_response() returning false was inconsistent, attempting a notification with an empty string. --- indra/newview/llstartup.cpp | 68 +++++++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 21 deletions(-) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 5576d446fa..477149194b 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -256,6 +256,7 @@ void release_start_screen(); void reset_login(); void apply_udp_blacklist(const std::string& csv); bool process_login_success_response(); +void transition_back_to_login_panel(const std::string& emsg); void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group) { @@ -884,6 +885,18 @@ bool idle_startup() if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState()) { + // Move the progress view in front of the UI immediately when login is performed + // this allows not to see main menu after Alt+Tab was pressed while login. EXT-744. + gViewerWindow->moveProgressViewToFront(); + + //reset the values that could have come in from a slurl + if (!gLoginHandler.getWebLoginKey().isNull()) + { + gFirstname = gLoginHandler.getFirstName(); + gLastname = gLoginHandler.getLastName(); +// gWebLoginKey = gLoginHandler.getWebLoginKey(); + } + if (show_connect_box) { // TODO if not use viewer auth @@ -1065,13 +1078,14 @@ bool idle_startup() if(STATE_LOGIN_PROCESS_RESPONSE == LLStartUp::getStartupState()) { - bool transitionBackToLoginPanel = false; std::ostringstream emsg; + emsg << "Login failed.\n"; if(LLLoginInstance::getInstance()->authFailure()) { + LL_INFOS("LLStartup") << "Login failed, LLLoginInstance::getResponse(): " + << LLLoginInstance::getInstance()->getResponse() << LL_ENDL; // Still have error conditions that may need some // sort of handling. - emsg << "Login failed.\n"; std::string reason_response = LLLoginInstance::getInstance()->getResponse("reason"); std::string message_response = LLLoginInstance::getInstance()->getResponse("message"); @@ -1109,10 +1123,20 @@ bool idle_startup() } else { - transitionBackToLoginPanel = true; + // Don't pop up a notification in the TOS case because + // LLFloaterTOS::onCancel() already scolded the user. + if (reason_response != "tos") + { + LLSD args; + args["ERROR_MESSAGE"] = emsg.str(); + LL_INFOS("LLStartup") << "Notification: " << args << LL_ENDL; + LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done); + } //setup map of datetime strings to codes and slt & local time offset from utc LLStringOps::setupDatetimeInfo (gPacificDaylightTime); + transition_back_to_login_panel(emsg.str()); + show_connect_box = true; } } else if(LLLoginInstance::getInstance()->authSuccess()) @@ -1125,7 +1149,12 @@ bool idle_startup() } else { - transitionBackToLoginPanel = false; + LLSD args; + args["ERROR_MESSAGE"] = emsg.str(); + LL_INFOS("LLStartup") << "Notification: " << args << LL_ENDL; + LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done); + transition_back_to_login_panel(emsg.str()); + show_connect_box = true; } } else @@ -1138,23 +1167,6 @@ bool idle_startup() set_startup_status(progress, auth_desc, auth_message); } - if(transitionBackToLoginPanel) - { - if (gNoRender) - { - LL_WARNS("AppInit") << "Failed to login!" << LL_ENDL; - LL_WARNS("AppInit") << emsg << LL_ENDL; - exit(0); - } - - // Bounce back to the login screen. - LLSD args; - args["ERROR_MESSAGE"] = emsg.str(); - LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done); - reset_login(); // calls LLStartUp::setStartupState( STATE_LOGIN_SHOW ); - gSavedSettings.setBOOL("AutoLogin", FALSE); - show_connect_box = true; - } return FALSE; } @@ -3080,3 +3092,17 @@ bool process_login_success_response() return success; } + +void transition_back_to_login_panel(const std::string& emsg) +{ + if (gNoRender) + { + LL_WARNS("AppInit") << "Failed to login!" << LL_ENDL; + LL_WARNS("AppInit") << emsg << LL_ENDL; + exit(0); + } + + // Bounce back to the login screen. + reset_login(); // calls LLStartUp::setStartupState( STATE_LOGIN_SHOW ); + gSavedSettings.setBOOL("AutoLogin", FALSE); +} -- cgit v1.2.3