summaryrefslogtreecommitdiff
path: root/indra/newview/llviewernetwork.cpp
diff options
context:
space:
mode:
authorRoxanne Skelly <roxie@lindenlab.com>2009-07-09 20:56:23 +0000
committerRoxanne Skelly <roxie@lindenlab.com>2009-07-09 20:56:23 +0000
commit7a64aad1def1b0612addbf2e66c66db061d7e182 (patch)
tree2e011e8b58933e692c0cae738a4382a37e3e222b /indra/newview/llviewernetwork.cpp
parent311aaf7ffd8f7dc95dba84f10fcae97bc93901bb (diff)
DEV-34822 - merge 1.23
merge -r119443 - basic slurl handling ignore dead branch
Diffstat (limited to 'indra/newview/llviewernetwork.cpp')
-rw-r--r--indra/newview/llviewernetwork.cpp36
1 files changed, 31 insertions, 5 deletions
diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp
index 82dc459777..3615c00f37 100644
--- a/indra/newview/llviewernetwork.cpp
+++ b/indra/newview/llviewernetwork.cpp
@@ -5,7 +5,7 @@
*
* $LicenseInfo:firstyear=2006&license=viewergpl$
*
- * Copyright (c) 2006-2010, Linden Research, Inc.
+ * Copyright (c) 2006-2007, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
@@ -40,7 +40,8 @@
const char* DEFAULT_LOGIN_PAGE = "http://secondlife.com/app/login/";
-const char* SYSTEM_GRID_SLURL_BASE = "http://slurl.com/secondlife/";
+const char* SYSTEM_GRID_SLURL_BASE = "secondlife://%s/secondlife/";
+const char* MAIN_GRID_SLURL_BASE = "http://slurl.com/secondlife/";
const char* SYSTEM_GRID_APP_SLURL_BASE = "secondlife:///app";
const char* DEFAULT_SLURL_BASE = "https://%s/region/";
@@ -60,6 +61,12 @@ LLGridManager::LLGridManager()
}
+LLGridManager::LLGridManager(const std::string& grid_file)
+{
+ // initialize with an explicity grid file for testing.
+ initialize(grid_file);
+}
+
//
// LLGridManager - class for managing the list of known grids, and the current
// selection
@@ -391,7 +398,7 @@ void LLGridManager::addSystemGrid(const std::string& label,
grid[GRID_LOGIN_PAGE_VALUE] = login_page;
grid[GRID_IS_SYSTEM_GRID_VALUE] = TRUE;
grid[GRID_LOGIN_CREDENTIAL_PAGE_TYPE_VALUE] = GRID_LOGIN_CREDENTIAL_PAGE_TYPE_AGENT;
- grid[GRID_SLURL_BASE] = SYSTEM_GRID_SLURL_BASE;
+
grid[GRID_APP_SLURL_BASE] = SYSTEM_GRID_APP_SLURL_BASE;
if (login_id.empty())
{
@@ -406,8 +413,13 @@ void LLGridManager::addSystemGrid(const std::string& label,
// if we're building a debug version.
if (name == std::string(MAINGRID))
{
+ grid[GRID_SLURL_BASE] = MAIN_GRID_SLURL_BASE;
grid[GRID_IS_FAVORITE_VALUE] = TRUE;
}
+ else
+ {
+ grid[GRID_SLURL_BASE] = llformat(SYSTEM_GRID_SLURL_BASE, label.c_str());
+ }
addGrid(grid);
}
@@ -458,6 +470,20 @@ void LLGridManager::setGridChoice(const std::string& grid_name)
gSavedSettings.setString("CurrentGrid", grid_name);
}
+std::string LLGridManager::getGridByLabel( const std::string &grid_label)
+{
+ for(LLSD::map_iterator grid_iter = mGridList.beginMap();
+ grid_iter != mGridList.endMap();
+ grid_iter++)
+ {
+ if (grid_iter->second.has(GRID_LABEL_VALUE) && (grid_iter->second[GRID_LABEL_VALUE].asString() == grid_label))
+ {
+ return grid_iter->first;
+ }
+ }
+ return std::string();
+}
+
void LLGridManager::getLoginURIs(std::vector<std::string>& uris)
{
uris.clear();
@@ -528,10 +554,10 @@ std::string LLGridManager::getAppSLURLBase(const std::string& grid_name)
std::string grid_base;
if(mGridList.has(grid_name) && mGridList[grid_name].has(GRID_APP_SLURL_BASE))
{
- return mGridList[grid_name][GRID_APP_SLURL_BASE].asString();
+ return mGridList[grid_name][GRID_APP_SLURL_BASE].asString();
}
else
{
- return llformat(DEFAULT_APP_SLURL_BASE, grid_name.c_str());
+ return llformat(DEFAULT_APP_SLURL_BASE, grid_name.c_str());
}
}