From fe71dd340ab396b93bde45df438041af5d85fd47 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Mon, 1 Feb 2010 15:10:19 -0800 Subject: Merge giab-viewer-trunk 2497, general merge of more secapi stuff as well as certificate handling stuff. Grid manager as well --- indra/llvfs/lldir.cpp | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'indra/llvfs/lldir.cpp') diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index b2b17fdd56..296d827a20 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -555,26 +555,23 @@ std::string LLDir::getForbiddenFileChars() return "\\/:*?\"<>|"; } -void LLDir::setLindenUserDir(const std::string &first, const std::string &last) +void LLDir::setLindenUserDir(const std::string &username) { // if both first and last aren't set, assume we're grabbing the cached dir - if (!first.empty() && !last.empty()) + if (!username.empty()) { // some platforms have case-sensitive filesystems, so be // utterly consistent with our firstname/lastname case. - std::string firstlower(first); - LLStringUtil::toLower(firstlower); - std::string lastlower(last); - LLStringUtil::toLower(lastlower); + std::string userlower(username); + LLStringUtil::toLower(userlower); + LLStringUtil::replaceChar(userlower, ' ', '_'); mLindenUserDir = getOSUserAppDir(); mLindenUserDir += mDirDelimiter; - mLindenUserDir += firstlower; - mLindenUserDir += "_"; - mLindenUserDir += lastlower; + mLindenUserDir += userlower; } else { - llerrs << "Invalid name for LLDir::setLindenUserDir(first='" << first << "', last='" << last << "')" << llendl; + llerrs << "NULL name for LLDir::setLindenUserDir" << llendl; } dumpCurrentDirectories(); @@ -592,27 +589,25 @@ void LLDir::setChatLogsDir(const std::string &path) } } -void LLDir::setPerAccountChatLogsDir(const std::string &first, const std::string &last) +void LLDir::setPerAccountChatLogsDir(const std::string &username) { // if both first and last aren't set, assume we're grabbing the cached dir - if (!first.empty() && !last.empty()) + if (!username.empty()) { // some platforms have case-sensitive filesystems, so be // utterly consistent with our firstname/lastname case. - std::string firstlower(first); - LLStringUtil::toLower(firstlower); - std::string lastlower(last); - LLStringUtil::toLower(lastlower); - mPerAccountChatLogsDir = getChatLogsDir(); - mPerAccountChatLogsDir += mDirDelimiter; - mPerAccountChatLogsDir += firstlower; - mPerAccountChatLogsDir += "_"; - mPerAccountChatLogsDir += lastlower; + std::string userlower(username); + LLStringUtil::toLower(userlower); + LLStringUtil::replaceChar(userlower, ' ', '_'); + mLindenUserDir = getChatLogsDir(); + mLindenUserDir += mDirDelimiter; + mLindenUserDir += userlower; } else { - llwarns << "Invalid name for LLDir::setPerAccountChatLogsDir" << llendl; + llerrs << "NULL name for LLDir::setPerAccountChatLogsDir" << llendl; } + } void LLDir::setSkinFolder(const std::string &skin_folder) -- cgit v1.3 From 8bd5a3bca38b0ba663d3563029e54da057020424 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Mon, 8 Mar 2010 15:10:27 -0800 Subject: DEV-45976 Last Login Location Preference not remembered --- indra/llvfs/lldir.cpp | 7 +++---- indra/newview/llappviewer.cpp | 8 ++------ indra/newview/llpanellogin.cpp | 30 +++++++++++++----------------- indra/newview/llslurl.h | 2 +- indra/newview/llstartup.cpp | 26 ++++++++++++++++++++------ indra/newview/llviewerwindow.cpp | 16 +++++++++------- 6 files changed, 48 insertions(+), 41 deletions(-) (limited to 'indra/llvfs/lldir.cpp') diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index 1f0c4fe13a..b4ee42ef3a 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -459,7 +459,6 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd } //llinfos << "*** EXPANDED FILENAME: <" << expanded_filename << ">" << llendl; - return expanded_filename; } @@ -609,9 +608,9 @@ void LLDir::setPerAccountChatLogsDir(const std::string &username) std::string userlower(username); LLStringUtil::toLower(userlower); LLStringUtil::replaceChar(userlower, ' ', '_'); - mLindenUserDir = getChatLogsDir(); - mLindenUserDir += mDirDelimiter; - mLindenUserDir += userlower; + mPerAccountChatLogsDir = getChatLogsDir(); + mPerAccountChatLogsDir += mDirDelimiter; + mPerAccountChatLogsDir += userlower; } else { diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9535e5f239..9fd486b2ff 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2098,12 +2098,8 @@ bool LLAppViewer::initConfiguration() } else if(clp.hasOption("slurl")) { - LLStartUp::setStartSLURL(LLSLURL(clp.getOption("surl")[0])); - if(LLStartUp::getStartSLURL().getType() == LLSLURL::LOCATION) - { - LLGridManager::getInstance()->setGridChoice(LLStartUp::getStartSLURL().getGrid()); - - } + LLSLURL start_slurl(clp.getOption("slurl")[0]); + LLStartUp::setStartSLURL(start_slurl); } const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index e5c8393eaa..b620a005d2 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -223,19 +223,12 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLComboBox* combo = getChild("start_location_combo"); - if(!LLStartUp::getStartSLURL().isLocation()) + if(LLStartUp::getStartSLURL().getType() != LLSLURL::LOCATION) { - LLStartUp::setStartSLURL(LLSLURL(gSavedSettings.getString("LoginLocation"))); - } - std::string sim_string = LLStartUp::getStartSLURL().getRegion(); - if (!sim_string.empty()) - { - // Replace "" with this region name - combo->remove(2); - combo->add( sim_string ); - combo->setTextEntry(sim_string); - combo->setCurrentByIndex( 2 ); + LLSLURL slurl(gSavedSettings.getString("LoginLocation")); + LLStartUp::setStartSLURL(slurl); } + updateLocationCombo(false); combo->setCommitCallback(onSelectLocation, NULL); @@ -698,6 +691,8 @@ void LLPanelLogin::updateLocationCombo( bool force_visible ) { return; } + + llinfos << "updatelocationcombo " << LLStartUp::getStartSLURL().asString() << llendl; LLComboBox* combo = sInstance->getChild("start_location_combo"); switch(LLStartUp::getStartSLURL().getType()) @@ -744,11 +739,12 @@ void LLPanelLogin::onSelectLocation(LLUICtrl*, void*) if((slurl.getType() == LLSLURL::LOCATION) && (slurl.getGrid() != LLStartUp::getStartSLURL().getGrid())) { - LLStartUp::setStartSLURL(slurl); + + // we've changed the grid, so update the grid selection try { - LLGridManager::getInstance()->setGridChoice(slurl.getGrid()); + LLStartUp::setStartSLURL(slurl); } catch (LLInvalidGridName ex) { @@ -763,12 +759,12 @@ void LLPanelLogin::onSelectLocation(LLUICtrl*, void*) } case 1: { - LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST)); + LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_HOME)); break; } default: { - LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_HOME)); + LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST)); break; } } @@ -800,7 +796,6 @@ void LLPanelLogin::getLocation(LLSLURL& slurl) void LLPanelLogin::setLocation(const LLSLURL& slurl) { LLStartUp::setStartSLURL(slurl); - LLGridManager::getInstance()->setGridChoice(slurl.getGrid()); updateServer(); } @@ -1174,11 +1169,12 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*) combo = sInstance->getChild("start_location_combo"); combo->setCurrentByIndex(1); - LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST)); + LLStartUp::setStartSLURL(LLSLURL(gSavedSettings.getString("LoginLocation"))); LLGridManager::getInstance()->setGridChoice(combo_val.asString()); // This new selection will override preset uris // from the command line. updateServer(); + updateLocationCombo(false); updateLoginPanelLinks(); } diff --git a/indra/newview/llslurl.h b/indra/newview/llslurl.h index 37bdc36fa4..28c23561cf 100644 --- a/indra/newview/llslurl.h +++ b/indra/newview/llslurl.h @@ -88,7 +88,7 @@ public: LLSD getAppPath() const { return mAppPath; } bool isValid() const { return mType != INVALID; } - bool isLocation() const { return (mType == LAST_LOCATION) || (mType == HOME_LOCATION) || (mType == LOCATION); } + bool isSpatial() const { return (mType == LAST_LOCATION) || (mType == HOME_LOCATION) || (mType == LOCATION); } bool operator==(const LLSLURL& rhs); bool operator!=(const LLSLURL&rhs); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 951806846c..6860da1bd2 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -824,10 +824,11 @@ bool idle_startup() // create necessary directories // *FIX: these mkdir's should error check - gDirUtilp->setPerAccountChatLogsDir(userid); + gDirUtilp->setLindenUserDir(userid); LLFile::mkdir(gDirUtilp->getLindenUserDir()); // Set PerAccountSettingsFile to the default value. + std::string per_account_settings_file = LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount"); gSavedSettings.setString("PerAccountSettingsFile", gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount"))); @@ -857,7 +858,8 @@ bool idle_startup() { gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath")); } - + gDirUtilp->setPerAccountChatLogsDir(userid); + LLFile::mkdir(gDirUtilp->getChatLogsDir()); LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); @@ -879,8 +881,6 @@ bool idle_startup() if (show_connect_box) { LLSLURL slurl; - LLPanelLogin::getLocation(slurl); - LLStartUp::setStartSLURL(slurl); LLPanelLogin::closePanel(); } @@ -2660,8 +2660,22 @@ bool LLStartUp::dispatchURL() void LLStartUp::setStartSLURL(const LLSLURL& slurl) { sStartSLURL = slurl; - gSavedSettings.setBOOL("LoginLastLocation", - !(slurl.getType() == LLSLURL::HOME_LOCATION)); + switch(slurl.getType()) + { + case LLSLURL::HOME_LOCATION: + { + gSavedSettings.setString("LoginLocation", LLSLURL::SIM_LOCATION_HOME); + break; + } + case LLSLURL::LAST_LOCATION: + { + gSavedSettings.setString("LoginLocation", LLSLURL::SIM_LOCATION_LAST); + break; + } + default: + LLGridManager::getInstance()->setGridChoice(slurl.getGrid()); + break; + } } bool login_alert_done(const LLSD& notification, const LLSD& response) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 5d2550b9a7..dcc2a6f4a5 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -829,13 +829,15 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi if (slurl_dnd_enabled) { - LLSLURL dropped_slurl(data); - if(dropped_slurl.isLocation()) - if (drop) - { - LLURLDispatcher::dispatch( dropped_slurl.getSLURLString(), NULL, true ); - return LLWindowCallbacks::DND_MOVE; - }; + LLSLURL dropped_slurl(data); + if(dropped_slurl.isSpatial()) + { + if (drop) + { + LLURLDispatcher::dispatch( dropped_slurl.getSLURLString(), NULL, true ); + return LLWindowCallbacks::DND_MOVE; + } + } } if (prim_media_dnd_enabled) -- cgit v1.3