Skip to content
Snippets Groups Projects
Commit cda35e83 authored by ¡Cinder! ㊝'s avatar ¡Cinder! ㊝ :speech_balloon:
Browse files

[OpenSim] Grid manager

parent 9158e458
No related branches found
No related tags found
No related merge requests found
......@@ -96,6 +96,7 @@
#include "llstartup.h"
#include "lltextbox.h"
#include "llui.h"
#include "llviewernetwork.h"
#include "llviewerobjectlist.h"
#include "llvoavatar.h"
#include "llvovolume.h"
......@@ -375,6 +376,9 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.DeleteTranscripts", boost::bind(&LLFloaterPreference::onDeleteTranscripts, this));
mCommitCallbackRegistrar.add("Pref.ResetToDefault", boost::bind(&LLFloaterPreference::onClickResetControlDefault, this, _2)); // <alchemy/>
mCommitCallbackRegistrar.add("Pref.AddGrid", boost::bind(&LLFloaterPreference::onClickAddGrid, this));
mCommitCallbackRegistrar.add("Pref.RemoveGrid", boost::bind(&LLFloaterPreference::onClickRemoveGrid, this));
mCommitCallbackRegistrar.add("Pref.SelectGrid", boost::bind(&LLFloaterPreference::onSelectGrid, this, _2));
}
void LLFloaterPreference::processProperties( void* pData, EAvatarProcessorType type )
......@@ -476,6 +480,9 @@ BOOL LLFloaterPreference::postBuild()
LLLogChat::setSaveHistorySignal(boost::bind(&LLFloaterPreference::onLogChatHistorySaved, this));
refreshGridList();
mGridListChangedConnection = LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&LLFloaterPreference::refreshGridList, this));
#ifdef LL_DARWIN
getChild<LLPanel>("ohehsex")->setVisible(TRUE);
#else // !LL_DARWIN
......@@ -502,6 +509,92 @@ void LLFloaterPreference::onDoNotDisturbResponseChanged()
gSavedPerAccountSettings.setBOOL("DoNotDisturbResponseChanged", response_changed_flag );
}
void LLFloaterPreference::refreshGridList()
{
LLScrollListCtrl* grid_list = getChild<LLScrollListCtrl>("grid_list");
grid_list->clearRows();
std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
for (std::map<std::string, std::string>::iterator grid_iter = known_grids.begin();
grid_iter != known_grids.end(); grid_iter++)
{
if (!grid_iter->first.empty() && !grid_iter->second.empty())
{
bool connected_grid = LLGridManager::getInstance()->getGrid() == grid_iter->first;
std::vector<std::string> uris;
LLGridManager::getInstance()->getLoginURIs(grid_iter->first, uris);
LLURI login_uri = LLURI(uris.at(0));
LLSD row;
row["id"] = grid_iter->first;
row["columns"][0]["column"] = "grid_label";
row["columns"][0]["value"] = grid_iter->second;
row["columns"][0]["font"]["style"] = connected_grid ? "BOLD" : "NORMAL";
row["columns"][1]["column"] = "login_uri";
row["columns"][1]["value"] = login_uri.authority();
row["columns"][1]["font"]["style"] = connected_grid ? "BOLD" : "NORMAL";
grid_list->addElement(row);
}
}
}
void LLFloaterPreference::onClickAddGrid()
{
std::string login_uri = getChild<LLLineEditor>("add_grid")->getValue().asString();
LLGridManager::getInstance()->addRemoteGrid(login_uri);
}
void LLFloaterPreference::onClickRemoveGrid()
{
std::string grid = getChild<LLScrollListCtrl>("grid_list")->getSelectedValue().asString();
if (LLGridManager::getInstance()->getGrid() == grid)
{
LLNotificationsUtil::add("CannotRemoveConnectedGrid",
LLSD().with("GRID", LLGridManager::getInstance()->getGridLabel()));
}
else
{
LLNotificationsUtil::add("ConfirmRemoveGrid",
LLSD().with("GRID", LLGridManager::getInstance()->getGridLabel(grid)),
LLSD(grid), boost::bind(&LLFloaterPreference::handleRemoveGridCB, this, _1, _2));
}
}
void LLFloaterPreference::onClickRefreshGrid()
{
std::string grid = getChild<LLScrollListCtrl>("grid_list")->getSelectedValue().asString();
// So I'm a little paranoid, no big deal...
if (!LLGridManager::getInstance()->isSystemGrid(grid))
{
LLGridManager::getInstance()->addRemoteGrid(grid);
}
}
void LLFloaterPreference::onClickDebugGrid()
{
// no-op for now
}
void LLFloaterPreference::onSelectGrid(const LLSD& data)
{
getChild<LLUICtrl>("remove_grid")->setEnabled(LLGridManager::getInstance()->getGrid() != data.asString()
&& !LLGridManager::getInstance()->isSystemGrid(data.asString()));
getChild<LLUICtrl>("refresh_grid")->setEnabled(!LLGridManager::getInstance()->isSystemGrid(data.asString()));
}
bool LLFloaterPreference::handleRemoveGridCB(const LLSD& notification, const LLSD& response)
{
const S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (0 == option)
{
const std::string& grid = notification["payload"].asString();
if (!LLGridManager::getInstance()->removeGrid(grid))
LLNotificationsUtil::add("RemoveGridFailure",
LLSD().with("GRID", notification["substitutions"]["GRID"].asString()));
}
return false;
}
LLFloaterPreference::~LLFloaterPreference()
{
// clean up user data
......@@ -510,6 +603,9 @@ LLFloaterPreference::~LLFloaterPreference()
{
ctrl_window_size->setCurrentByIndex(i);
}
if (mGridListChangedConnection.connected())
mGridListChangedConnection.disconnect();
LLConversationLog::instance().removeObserver(this);
}
......@@ -2380,4 +2476,3 @@ void LLFloaterPreferenceProxy::onChangeSocksSettings()
}
}
......@@ -180,6 +180,14 @@ private:
void onDeleteTranscripts();
void onDeleteTranscriptsResponse(const LLSD& notification, const LLSD& response);
void updateDeleteTranscriptsButton();
void refreshGridList();
void onClickAddGrid();
void onClickRemoveGrid();
void onClickRefreshGrid();
void onClickDebugGrid();
void onSelectGrid(const LLSD& data);
bool handleRemoveGridCB(const LLSD& notification, const LLSD& response);
static std::string sSkin;
notifications_map mNotificationOptions;
......@@ -194,6 +202,8 @@ private:
std::string mDirectoryVisibility;
LLAvatarData mAvatarProperties;
boost::signals2::connection mGridListChangedConnection;
};
class LLPanelPreference : public LLPanel
......
......@@ -138,29 +138,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
LLComboBox* server_choice_combo = getChild<LLComboBox>("server_combo");
server_choice_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectServer, this));
// Load all of the grids, sorted, and then add a bar and the current grid at the top
server_choice_combo->removeall();
std::string current_grid = LLGridManager::getInstance()->getGrid();
std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
for (std::map<std::string, std::string>::iterator grid_choice = known_grids.begin();
grid_choice != known_grids.end();
grid_choice++)
{
if (!grid_choice->first.empty() && current_grid != grid_choice->first)
{
LL_DEBUGS("AppInit")<<"adding "<<grid_choice->first<<LL_ENDL;
server_choice_combo->add(grid_choice->second, grid_choice->first);
}
}
server_choice_combo->sortByName();
server_choice_combo->addSeparator(ADD_TOP);
LL_DEBUGS("AppInit")<<"adding current "<<current_grid<<LL_ENDL;
server_choice_combo->add(LLGridManager::getInstance()->getGridLabel(),
current_grid,
ADD_TOP);
server_choice_combo->selectFirstItem();
refreshGridList();
mGridListChangedConnection = LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&LLPanelLogin::refreshGridList, this));
LLSLURL start_slurl(LLStartUp::getStartSLURL());
if ( !start_slurl.isSpatial() ) // has a start been established by the command line or NextLoginLocation ?
......@@ -312,6 +292,9 @@ void LLPanelLogin::reshapeBrowser()
LLPanelLogin::~LLPanelLogin()
{
if (mGridListChangedConnection.connected())
mGridListChangedConnection.disconnect();
LLPanelLogin::sInstance = NULL;
// Controls having keyboard focus by default
......@@ -1015,3 +998,24 @@ void LLPanelLogin::onLocationSLURL()
LLStartUp::setStartSLURL(location); // calls onUpdateStartSLURL, above
}
void LLPanelLogin::refreshGridList()
{
LLComboBox* server_choice_combo = getChild<LLComboBox>("server_combo");
server_choice_combo->removeall();
const std::string& current_grid = LLGridManager::getInstance()->getGrid();
std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
for (std::map<std::string, std::string>::iterator grid_choice = known_grids.begin();
grid_choice != known_grids.end(); grid_choice++)
{
if (!grid_choice->first.empty() && current_grid != grid_choice->first)
{
server_choice_combo->add(grid_choice->second, grid_choice->first);
}
}
server_choice_combo->sortByName();
server_choice_combo->addSeparator(ADD_TOP);
server_choice_combo->add(LLGridManager::getInstance()->getGridLabel(), current_grid, ADD_TOP);
server_choice_combo->selectFirstItem();
}
......@@ -93,6 +93,7 @@ private:
void addUsersWithFavoritesToUsername();
void onSelectServer();
void onLocationSLURL();
void refreshGridList();
static void onClickConnect(void*);
static void onClickNewAccount(void*);
......@@ -113,6 +114,8 @@ private:
static LLPanelLogin* sInstance;
static BOOL sCapslockDidNotification;
boost::signals2::connection mGridListChangedConnection;
};
#endif
......@@ -29,11 +29,14 @@
#include "llviewernetwork.h"
#include "llviewercontrol.h"
#include "llbufferstream.h"
#include "llhttpclient.h"
#include "llnotificationsutil.h"
#include "llsdserialize.h"
#include "llsecapi.h"
#include "lltrans.h"
#include "llweb.h"
#include "llxmlnode.h"
/// key used to store the grid, and the name attribute in the grid data
const std::string GRID_VALUE = "keyname";
......@@ -45,7 +48,7 @@ const std::string GRID_ID_VALUE = "grid_login_id";
const std::string GRID_LOGIN_URI_VALUE = "login_uri";
/// url base for update queries
const std::string GRID_UPDATE_SERVICE_URL = "update_query_url_base";
///
/// uri for data helpers like currency and landbuy
const std::string GRID_HELPER_URI_VALUE = "helper_uri";
/// the splash page url
const std::string GRID_LOGIN_PAGE_VALUE = "login_page";
......@@ -57,6 +60,8 @@ const std::string GRID_LOGIN_IDENTIFIER_TYPES = "login_identifier_types";
const std::string GRID_ACCOUNT_REGISTRATION_URL = "register";
/// the url for retrieving passwords for the given grid
const std::string GRID_FORGOT_PASSWORD_URL = "password";
/// the platform string for a given grid
const std::string GRID_PLATFORM = "platform";
// defines slurl formats associated with various grids.
// we need to continue to support existing forms, as slurls
......@@ -78,6 +83,55 @@ const char* SYSTEM_GRID_SLURL_BASE = "secondlife://%s/secondlife/";
const char* DEFAULT_SLURL_BASE = "https://%s/region/";
const char* DEFAULT_APP_SLURL_BASE = "x-grid-location-info://%s/app";
//
const std::string GRIDS_USER_FILE = "grids_user.xml";
class LLGridInfoRequestResponder : public LLHTTPClient::Responder
{
private:
LLGridManager *mParent;
LLSD mData;
public:
LLGridInfoRequestResponder(LLGridManager* parent, LLSD& data)
: mParent(parent), mData(data) {}
void completedRaw(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) override
{
if (getStatus() == HTTP_OK)
{
LLBufferStream istr(channels, buffer.get());
LLPointer<LLXMLNode> xmlnode;
if(LLXMLNode::parseStream(istr, xmlnode, NULL))
{
mParent->gridInfoResponderCallback(mData, xmlnode);
}
else
{
LLSD args;
args["GRID"] = mData[GRID_VALUE];
LLNotificationsUtil::add("MalformedGridInfo", args);
}
}
else
{
httpFailure();
}
}
void httpFailure() override
{
if (getStatus() == HTTP_GATEWAY_TIME_OUT)
{
}
else
{
}
}
};
LLGridManager::LLGridManager()
: mPlatform(NOPLATFORM)
{
......@@ -87,7 +141,7 @@ LLGridManager::LLGridManager()
// as that would be a security issue when they are overwritten by
// an attacker. Don't want someone snagging a password.
std::string grid_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
"grids.xml");
GRIDS_USER_FILE);
LL_DEBUGS("GridManager")<<LL_ENDL;
initialize(grid_file);
......@@ -131,6 +185,7 @@ void LLGridManager::initialize(const std::string& grid_file)
"http://secondlife.com/account/request.php",
"http://join.secondlife.com/?sourceid=AlchemyViewer",
SL_UPDATE_QUERY_URL,
"secondlife",
"Agni");
addSystemGrid("Second Life Beta",
"util.aditi.lindenlab.com",
......@@ -140,6 +195,7 @@ void LLGridManager::initialize(const std::string& grid_file)
"http://secondlife.com/account/request.php",
"http://join.secondlife.com/?sourceid=AlchemyViewer",
SL_UPDATE_QUERY_URL,
"secondlife",
"Aditi");
LLSD other_grids;
......@@ -339,6 +395,19 @@ bool LLGridManager::addGrid(LLSD& grid_data)
return added;
}
bool LLGridManager::removeGrid(const std::string& gridkey)
{
//Grid must exist and not be a system addition
if (mGridList.has(gridkey) && !isSystemGrid(gridkey))
{
mGridList.erase(gridkey);
mGridListChangedSignal();
saveGridList();
return true;
}
return false;
}
//
// LLGridManager::addSystemGrid - helper for adding a system grid.
void LLGridManager::addSystemGrid(const std::string& label,
......@@ -349,6 +418,7 @@ void LLGridManager::addSystemGrid(const std::string& label,
const std::string& password_url,
const std::string& register_url,
const std::string& update_url_base,
const std::string& platform,
const std::string& login_id)
{
LLSD grid = LLSD::emptyMap();
......@@ -364,6 +434,7 @@ void LLGridManager::addSystemGrid(const std::string& label,
grid[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_AGENT);
grid[GRID_FORGOT_PASSWORD_URL] = password_url;
grid[GRID_ACCOUNT_REGISTRATION_URL] = register_url;
grid[GRID_PLATFORM] = platform;
grid[GRID_APP_SLURL_BASE] = SYSTEM_GRID_APP_SLURL_BASE;
if (login_id.empty())
......@@ -387,6 +458,122 @@ void LLGridManager::addSystemGrid(const std::string& label,
addGrid(grid);
}
void LLGridManager::addRemoteGrid(const std::string& login_uri)
{
LL_DEBUGS("GridManager") << "Adding '" << login_uri << "' to grid manager." << LL_ENDL;
if (login_uri.empty()) return;
std::string grid = utf8str_tolower(login_uri);
// Grid needs to be in the form of a dns address,
// but also support localhost:9000 or localhost:9000/login
if (grid.find_first_not_of("abcdefghijklmnopqrstuvwxyz1234567890-_.:/@% ") != std::string::npos)
{
LLNotificationsUtil::add("InvalidGrid", LLSD().with("GRID", grid));
return;
}
// Trim any ending slash
size_t slash_pos = grid.find_last_of("/");
if (grid.length() - 1 == slash_pos)
{
grid.erase(slash_pos);
}
std::string slashy_slash("://");
size_t find_scheme = grid.find(slashy_slash);
std::string grid_value(grid);
if (find_scheme != std::string::npos)
{
grid_value.erase(0, find_scheme + slashy_slash.length());
}
else
{
// default to http
grid.insert(0, "http://");
}
LLSD data;
data[GRID_VALUE] = grid_value;
data[GRID_IS_SYSTEM_GRID_VALUE] = false;
LLHTTPClient::get(llformat("%s/get_grid_info", grid.c_str()),
new LLGridInfoRequestResponder(this, data));
}
void LLGridManager::gridInfoResponderCallback(LLSD& grid, LLXMLNodePtr root_node)
{
for (LLXMLNode* node = root_node->getFirstChild(); node != nullptr; node = node->getNextSibling())
{
if (node->hasName("login"))
{
grid[GRID_LOGIN_URI_VALUE] = LLSD::emptyArray();
grid[GRID_LOGIN_URI_VALUE].append(node->getTextContents());
LL_DEBUGS("GridManager") << "[\"login\"]: " << grid[GRID_LOGIN_URI_VALUE] << LL_ENDL;
}
else if (node->hasName("gridname"))
{
grid[GRID_LABEL_VALUE] = node->getTextContents();
LL_DEBUGS("GridManager") << "[\"gridname\"]: " << grid[GRID_LABEL_VALUE] << LL_ENDL;
}
/*else if (node->hasName("gridnick"))
{
grid[GRID_LABEL_VALUE] = node->getTextContents();
LL_DEBUGS("GridManager") << "[\"gridnick\"]: " << grid[GRID_LABEL_VALUE] << LL_ENDL;
}*/
else if (node->hasName("platform"))
{
grid[GRID_PLATFORM] = node->getTextContents();
LL_DEBUGS("GridManager") << "[\"platform\"]: " << grid[GRID_PLATFORM] << LL_ENDL;
}
else if (node->hasName("welcome"))
{
grid[GRID_LOGIN_PAGE_VALUE] = node->getTextContents();
LL_DEBUGS("GridManager") << "[\"welcome\"]: " << grid[GRID_LOGIN_PAGE_VALUE] << LL_ENDL;
}
else if (node->hasName("register"))
{
grid[GRID_ACCOUNT_REGISTRATION_URL] = node->getTextContents();
LL_DEBUGS("GridManager") << "[\"register\"]: " << grid[GRID_ACCOUNT_REGISTRATION_URL] << LL_ENDL;
}
else if (node->hasName("password"))
{
grid[GRID_FORGOT_PASSWORD_URL] = node->getTextContents();
LL_DEBUGS("GridManager") << "[\"password\"]: " << grid[GRID_FORGOT_PASSWORD_URL] << LL_ENDL;
}
// Two names for the same thing...
else if (node->hasName("economy") || node->hasName("helperuri"))
{
grid[GRID_HELPER_URI_VALUE] = node->getTextContents();
LL_DEBUGS("GridManager") << "[\"economy\"]: " << grid[GRID_HELPER_URI_VALUE] << LL_ENDL;
}
}
grid[GRID_LOGIN_IDENTIFIER_TYPES] = LLSD::emptyArray();
grid[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_AGENT);
grid[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_ACCOUNT);
if (addGrid(grid))
{
mGridListChangedSignal();
saveGridList();
}
}
void LLGridManager::saveGridList()
{
LLSD data;
for(LLSD::map_iterator grid_iter = mGridList.beginMap();
grid_iter != mGridList.endMap();
grid_iter++)
{
// We don't need to store system grids, they're hard coded!
if (grid_iter->second[GRID_IS_SYSTEM_GRID_VALUE].asBoolean())
continue;
data[grid_iter->first] = grid_iter->second;
}
const std::string& filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, GRIDS_USER_FILE);
llofstream outstream;
outstream.open(filename.c_str());
LLSDSerialize::toPrettyXML(data, outstream);
outstream.close();
}
// return a list of grid name -> grid label mappings for UI purposes
std::map<std::string, std::string> LLGridManager::getKnownGrids()
{
......@@ -575,6 +762,14 @@ std::string LLGridManager::getGridLoginID()
return mGridList[mGrid][GRID_ID_VALUE];
}
std::string LLGridManager::getPlatformString()
{
std::string platform = mGridList[mGrid].has(GRID_PLATFORM)
? mGridList[mGrid][GRID_PLATFORM].asString()
: LLStringUtil::null;
return platform;
}
std::string LLGridManager::getUpdateServiceURL()
{
std::string update_url_base = gSavedSettings.getString("CmdLineUpdateService");;
......@@ -635,8 +830,15 @@ void LLGridManager::updateIsInProductionGrid()
}
}
// HACK: OPENSIM - I don't really know of a good way to detect an opensim grid. Just fallthrough to that.
LL_DEBUGS("GridManager")<< "Setting grid platform to OPENSIM" << LL_ENDL;
if (getPlatformString() == "OpenSim")
{
LL_DEBUGS("GridManager")<< "Setting grid platform to OPENSIM" << LL_ENDL;
mPlatform = OPENSIM;
return;
}
// Default to OpenSim
LL_DEBUGS("GridManager")<< "Defaulting to OPENSIM" << LL_ENDL;
mPlatform = OPENSIM;
}
......
......@@ -28,6 +28,9 @@
#ifndef LL_LLVIEWERNETWORK_H
#define LL_LLVIEWERNETWORK_H
#include "../llxml/llxmlnode.h"
#include <boost/signals2.hpp>
// @TODO this really should be private, but is used in llslurl
#define MAINGRID "util.agni.lindenlab.com"
......@@ -58,6 +61,8 @@ protected:
**/
class LLGridManager : public LLSingleton<LLGridManager>
{
friend class LLGridInfoRequestResponder;
public:
/* ================================================================
* @name Initialization and Configuration
......@@ -137,6 +142,9 @@ class LLGridManager : public LLSingleton<LLGridManager>
/// Get the id to be used as a short name in url path components or parameters
std::string getGridLoginID();
/// Get the platform string for the selected grid
std::string getPlatformString();
/// Get an array of the login types supported by the grid
void getLoginIdentifierTypes(LLSD& idTypes);
......@@ -217,19 +225,33 @@ class LLGridManager : public LLSingleton<LLGridManager>
/// Is the selected grid aditi?
bool isInSLBeta();
/**
* yes, that's not a very helpful description.
* I don't really know why that is different from isSystemGrid()
* In practice, the implementation is that it
* @returns true if the login uri for the grid is the uri for MAINGRID
/* ===============================================================
* @name User grid management functions
* @{
*/
/// Add a grid by fetching its gridInfo
void addRemoteGrid(const std::string& login_uri);
/// Remove a grid from the grid list by key
bool removeGrid(const std::string& gridkey);
///< @returns true if successfully removed
//@}
protected:
private:
void gridInfoResponderCallback(LLSD& data, LLXMLNodePtr root_node);
private:
/// Add a grid to the list of grids
/// Add a grid to the list of grids
bool addGrid(LLSD& grid_info);
///< @returns true if successfully added
/// Save grids list to file
void saveGridList();
void updateIsInProductionGrid();
// helper function for adding the hard coded grids
......@@ -241,13 +263,30 @@ class LLGridManager : public LLSingleton<LLGridManager>
const std::string& password_url,
const std::string& register_url,
const std::string& update_url_base,
const std::string& login_id = "");
const std::string& platform,
const std::string& login_id = "");
std::string mGrid;
std::string mGridFile;
LLSD mGridList;
EGridPlatform mPlatform;
/* ===============================================================
* @name Grid list signal updates
* @{
*/
private:
typedef boost::signals2::signal<void()> grid_list_changed_signal_t;
grid_list_changed_signal_t mGridListChangedSignal;
public:
/// Add grid list change callback
boost::signals2::connection addGridListChangedCallback(const grid_list_changed_signal_t::slot_type& cb)
{ return mGridListChangedSignal.connect(cb); }
//@}
};
const S32 MAC_ADDRESS_BYTES = 6;
......
......@@ -120,19 +120,18 @@
layout="topleft"
help_topic="preferences_advanced1_tab"
name="advanced1" />
<panel
<panel
class="panel_preference"
filename="panel_preferences_interface.xml"
label="Interface"
layout="topleft"
name="alchemy" />
<!-- Unused at the moment, what was there is in the chat preferences now. reserved for future use. -->
<!-- <panel
class="panel_preference"
filename="panel_preferences_alchemy.xml"
label="Alchemy"
<panel
class="panel_preference_grid"
filename="panel_preferences_grids.xml"
label="Grids"
layout="topleft"
name="alchemy" /> -->
name="grids" />
</tab_container>
</floater>
......@@ -10952,6 +10952,54 @@ Cannot create large prims that intersect other players. Please re-try when othe
Shape import failed. Are you sure [FILENAME] is an avatar genepool file?
</notification>
<notification
icon="alertmodal.tga"
name="InvalidGrid"
type="alertmodal">
<tag>fail</tag>
<tag>opensim</tag>
'[GRID]' is not a valid grid identifier.
</notification>
<notification
icon="alertmodal.tga"
name="MalformedGridInfo"
type="alertmodal">
<tag>fail</tag>
<tag>opensim</tag>
[GRID] provided malformed grid info.
Please contact them for support.
</notification>
<notification
icon="alertmodal.tga"
name="CannotRemoveConnectedGrid"
type="alertmodal">
<tag>fail</tag>
<tag>opensim</tag>
[GRID] cannot be removed while you are connected to it.
</notification>
<notification
icon="alertmodal.tga"
name="ConfirmRemoveGrid"
type="alertmodal">
<tag>opensim</tag>
<tag>confirm</tag>
Are you sure you want to remove [GRID] from the grid list?
<usetemplate
ignoretext="Confirm removing grids"
name="okcancelignore"
notext="Cancel"
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
name="RemoveGridFailure"
type="alertmodal">
<tag>fail</tag>
<tag>opensim</tag>
Failed to remove [GRID] from the list.
</notification>
<notification
icon="alert.tga"
name="RegionTrackerAdd"
......
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
border="true"
follows="left|top|right|bottom"
height="408"
label="Grids"
layout="topleft"
left="102"
name="grids"
top="1"
width="517">
<text
type="string"
length="1"
follows="left|top"
height="12"
layout="topleft"
left="30"
name="add_grid_text"
top="12"
width="400">
Add new grid:
</text>
<line_editor
border_style="line"
border_thickness="1"
follows="left|top"
font="SansSerif"
height="19"
layout="topleft"
left="50"
max_length_chars="4096"
name="add_grid"
top_pad="8"
label="Enter a LoginURI"
width="320" />
<button
follows="left|top"
height="19"
label="Add"
layout="topleft"
left_pad="2"
name="add_grid_commit"
top_delta="0"
width="50">
<button.commit_callback
function="Pref.AddGrid" />
</button>
<text
type="string"
length="1"
follows="left|top"
height="12"
layout="topleft"
left="30"
name="manage_grid_text"
top_pad="4"
width="400">
Manage grids:
</text>
<scroll_list
height="225"
layout="topleft"
left="50"
name="grid_list"
draw_heading="true"
top_pad="8"
width="370">
<scroll_list.columns
label="Grid name"
name="grid_label"
width="150" />
<scroll_list.columns
dynamic_width="true"
label="Login URI"
name="login_uri" />
<scroll_list.commit_callback
function="Pref.SelectGrid" />
</scroll_list>
<button
enabled="false"
follows="left|top"
height="19"
label="Refresh"
layout="topleft"
left_pad="5"
name="refresh_grid"
top_delta="5"
width="75">
<button.commit_callback
function="Pref.RefreshGrid" />
</button>
<button
enabled="false"
follows="left|top"
height="19"
label="Remove"
layout="topleft"
left_delta="0"
name="remove_grid"
top_pad="5"
width="75">
<button.commit_callback
function="Pref.RemoveGrid" />
</button>
<!--<button
enabled="false"
follows="left|top"
height="19"
label="Debug"
layout="topleft"
left_delta="0"
name="debug_grid"
top_pad="5"
width="75">
<button.commit_callback
function="Pref.DebugGrid" />
</button>-->
</panel>
......@@ -138,9 +138,11 @@ void LLGridManager::addSystemGrid(const std::string& label,
const std::string& password_url,
const std::string& register_url,
const std::string& update_url_base,
const std::string& platform,
const std::string& login_id)
{
}
std::map<std::string, std::string> LLGridManager::getKnownGrids()
{
std::map<std::string, std::string> result;
......
......@@ -30,7 +30,7 @@
#include "../test/lltut.h"
#include "../llslurl.h"
#include "llxmlnode.h"
#include "../../llxml/llcontrol.h"
#include "llcontrol.h"
#include "llsdserialize.h"
#include "llnotificationsutil.h"
......@@ -54,7 +54,6 @@ LLControlVariable* LLControlGroup::declareString(const std::string& name,
LLControlVariable::ePersist persist) {return NULL;}
void LLControlGroup::setString(const std::string& name, const std::string& val) {}
LLNotificationPtr LLNotificationsUtil::add(const std::string& name, const LLSD& substitutions) { return NULL; }
bool LLXMLNode::parseStream(std::istream& str, LLXMLNodePtr& node, LLXMLNode* defaults) { return true; }
std::string gCmdLineLoginURI;
......
......@@ -28,18 +28,19 @@
#include "../llviewerprecompiledheaders.h"
#include "../llviewernetwork.h"
#include "../test/lltut.h"
#include "../../llxml/llcontrol.h"
#include "llcontrol.h"
#include "llfile.h"
#include "llxmlnode.h"
#include "llnotificationsutil.h"
namespace
{
// Should not collide with other test programs creating temp files.
static const char * const TEST_FILENAME("llviewernetwork_test.xml");
}
// Should not collide with other test programs creating temp files.
static const char * const TEST_FILENAME("llviewernetwork_test.xml");
const std::string REMOTE_GRID = "http://login.yrgrid.com:8002/";
}
//----------------------------------------------------------------------------
// Mock objects for the dependencies of the code we're testing
......@@ -52,7 +53,6 @@ LLControlVariable* LLControlGroup::declareString(const std::string& name,
LLControlVariable::ePersist persist) {return NULL;}
void LLControlGroup::setString(const std::string& name, const std::string& val) {}
LLNotificationPtr LLNotificationsUtil::add(const std::string& name, const LLSD& substitutions) { return NULL; }
bool LLXMLNode::parseStream(std::istream& str, LLXMLNodePtr& node, LLXMLNode* defaults) { return true; }
std::string gCmdLineLoginURI;
std::string gCmdLineGridChoice;
......@@ -377,7 +377,7 @@ namespace tut
// validate grid selection
template<> template<>
void viewerNetworkTestObject::test<7>()
void viewerNetworkTestObject::test<3>()
{
// adding a grid with simply a name will populate the values.
llofstream gridfile(TEST_FILENAME);
......@@ -428,5 +428,4 @@ namespace tut
ensure("alternative grid is not Second Life",
!LLGridManager::getInstance()->isInSecondlife());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment