Merge branch 'master' of git://github.com/siana/SingularityViewer.git

This commit is contained in:
Shyotl
2011-02-14 21:40:58 -06:00
8 changed files with 78 additions and 89 deletions

View File

@@ -1,10 +1,9 @@
<llsd>
<array>
<!--
This file contains fallback settings only.
The actual list of grids is loaded from a web server.
-->
<map>
<key>default_grids_version</key><string>1</string>
</map>
<!-- Second Life -->
<map>

View File

@@ -10741,7 +10741,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<integer>1</integer>
</map>
<key>ShowTangentBasis</key>
<map>

View File

@@ -954,7 +954,7 @@ void HippoGridManager::saveFile()
}
// write client grid info file
std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml");
std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids_sg1.xml");
llofstream file;
file.open(fileName.c_str());
if (file.is_open())

View File

@@ -89,6 +89,10 @@
#include "llviewermessage.h"
#include <boost/lexical_cast.hpp>
// </edit>
#include <boost/algorithm/string.hpp>
#include "llstring.h"
#include <cctype>
#define USE_VIEWER_AUTH 0
const S32 BLACK_BORDER_HEIGHT = 160;
@@ -98,6 +102,30 @@ LLPanelLogin *LLPanelLogin::sInstance = NULL;
BOOL LLPanelLogin::sCapslockDidNotification = FALSE;
static bool nameSplit(const std::string& full, std::string& first, std::string& last) {
std::vector<std::string> fragments;
boost::algorithm::split(fragments, full, boost::is_any_of(" ."));
if (fragments.size() == 0)
return false;
first = fragments[0];
if (fragments.size() == 1)
last = "resident";
else
last = fragments[1];
return (fragments.size() <= 2);
}
static std::string nameJoin(const std::string& first,const std::string& last) {
if (last.empty() || boost::algorithm::iequals(last, "resident"))
return first;
else {
if(std::islower(last[0]))
return first + "." + last;
else
return first + " " + last;
}
}
class LLLoginRefreshHandler : public LLCommandHandler
{
public:
@@ -216,16 +244,11 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
reshape(rect.getWidth(), rect.getHeight());
#if !USE_VIEWER_AUTH
LLComboBox* first_name_combo = sInstance->getChild<LLComboBox>("first_name_combo");
first_name_combo->setCommitCallback(onSelectLoginEntry);
first_name_combo->setFocusLostCallback(onLoginComboLostFocus);
first_name_combo->setPrevalidate(LLLineEditor::prevalidatePrintableNoSpace);
first_name_combo->setSuppressTentative(true);
LLLineEditor* last_name_edit = sInstance->getChild<LLLineEditor>("last_name_edit");
last_name_edit->setPrevalidate(LLLineEditor::prevalidatePrintableNoSpace);
last_name_edit->setCommitCallback(onLastNameEditLostFocus);
LLComboBox* name_combo = sInstance->getChild<LLComboBox>("name_combo");
name_combo->setCommitCallback(onSelectLoginEntry);
name_combo->setFocusLostCallback(onLoginComboLostFocus);
name_combo->setPrevalidate(LLLineEditor::prevalidatePrintableNotPipe);
name_combo->setSuppressTentative(true);
childSetCommitCallback("remember_name_check", onNameCheckChanged);
childSetCommitCallback("password_edit", mungePassword);
@@ -445,7 +468,7 @@ void LLPanelLogin::setLoginHistory(LLSavedLogins const& login_history)
{
sInstance->mLoginHistoryData = login_history;
LLComboBox* login_combo = sInstance->getChild<LLComboBox>("first_name_combo");
LLComboBox* login_combo = sInstance->getChild<LLComboBox>("name_combo");
llassert(login_combo);
login_combo->clear();
@@ -454,7 +477,8 @@ void LLPanelLogin::setLoginHistory(LLSavedLogins const& login_history)
i != saved_login_entries.rend(); ++i)
{
LLSD e = i->asLLSD();
if (e.isMap()) login_combo->add(i->getDisplayString(), e);
if (e.isMap())
login_combo->add(nameJoin(i->getFirstName(), i->getLastName()), e);
}
}
@@ -571,7 +595,7 @@ void LLPanelLogin::giveFocus()
if( sInstance )
{
// Grab focus and move cursor to first blank input field
std::string first = sInstance->childGetText("first_name_combo");
std::string first = sInstance->childGetText("name_combo");
std::string pass = sInstance->childGetText("password_edit");
BOOL have_first = !first.empty();
@@ -580,7 +604,7 @@ void LLPanelLogin::giveFocus()
if (!have_first)
{
// User doesn't have a name, so start there.
LLComboBox* combo = sInstance->getChild<LLComboBox>("first_name_combo");
LLComboBox* combo = sInstance->getChild<LLComboBox>("name_combo");
combo->setFocusText(TRUE);
}
else if (!have_pass)
@@ -633,11 +657,10 @@ void LLPanelLogin::setFields(const std::string& firstname,
return;
}
LLComboBox* login_combo = sInstance->getChild<LLComboBox>("first_name_combo");
sInstance->childSetText("last_name_edit", lastname);
LLComboBox* login_combo = sInstance->getChild<LLComboBox>("name_combo");
llassert_always(firstname.find(' ') == std::string::npos);
login_combo->setLabel(firstname);
login_combo->setLabel(nameJoin(firstname, lastname));
// Max "actual" password length is 16 characters.
// Hex digests are always 32 characters.
@@ -674,15 +697,11 @@ void LLPanelLogin::setFields(const LLSavedLoginEntry& entry, bool takeFocus)
}
LLCheckBoxCtrl* remember_pass_check = sInstance->getChild<LLCheckBoxCtrl>("remember_check");
LLComboBox* login_combo = sInstance->getChild<LLComboBox>("first_name_combo");
login_combo->setLabel(entry.getFirstName());
login_combo->resetDirty();
login_combo->resetTextDirty();
LLLineEditor* last_name = sInstance->getChild<LLLineEditor>("last_name_edit");
last_name->setText(entry.getLastName());
last_name->resetDirty();
std::string fullname = nameJoin(entry.getFirstName(), entry.getLastName());
LLComboBox* login_combo = sInstance->getChild<LLComboBox>("name_combo");
login_combo->setLabel(fullname);
sInstance->childSetText("name_combo", fullname);
if (entry.getPassword().empty())
{
sInstance->childSetText("password_edit", std::string(""));
@@ -714,10 +733,8 @@ void LLPanelLogin::getFields(std::string *firstname,
return;
}
*firstname = sInstance->childGetText("first_name_combo");
nameSplit(sInstance->childGetText("name_combo"), *firstname, *lastname);
LLStringUtil::trim(*firstname);
*lastname = sInstance->childGetText("last_name_edit");
LLStringUtil::trim(*lastname);
*password = sInstance->mMungedPassword;
@@ -1077,9 +1094,8 @@ void LLPanelLogin::onClickConnect(void *)
// JC - Make sure the fields all get committed.
sInstance->setFocus(FALSE);
std::string first = sInstance->childGetText("first_name_combo");
std::string last = sInstance->childGetText("last_name_edit");
if (!first.empty() && !last.empty())
std::string first, last;
if (nameSplit(sInstance->childGetText("name_combo"), first, last))
{
// has both first and last name typed
sInstance->mCallback(0, sInstance->mCallbackData);
@@ -1172,29 +1188,12 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
}
}
// static
void LLPanelLogin::onLastNameEditLostFocus(LLUICtrl* ctrl, void* data)
{
if (sInstance)
{
LLLineEditor* edit = sInstance->getChild<LLLineEditor>("last_name_edit");
if(ctrl == edit)
{
if (edit->isDirty())
{
clearPassword();
LLViewerLogin::getInstance()->setNameEditted(true);
}
}
}
}
// static
void LLPanelLogin::onSelectLoginEntry(LLUICtrl* ctrl, void* data)
{
if (sInstance)
{
LLComboBox* combo = sInstance->getChild<LLComboBox>("first_name_combo");
LLComboBox* combo = sInstance->getChild<LLComboBox>("name_combo");
if (ctrl == combo)
{
LLSD selected_entry = combo->getSelectedValue();
@@ -1214,7 +1213,7 @@ void LLPanelLogin::onLoginComboLostFocus(LLFocusableElement* fe, void*)
{
if (sInstance)
{
LLComboBox* combo = sInstance->getChild<LLComboBox>("first_name_combo");
LLComboBox* combo = sInstance->getChild<LLComboBox>("name_combo");
if(fe == combo)
{
if (combo->isTextDirty())

View File

@@ -79,7 +79,7 @@ public:
* @brief Set the values of the displayed fields from a populated history entry.
* @param entry History entry containing all necessary fields.
*/
static void setFields(const LLSavedLoginEntry& entry, bool takeFocus = true);
static void setFields(const LLSavedLoginEntry& entry, bool takeFocus = false);
//static void addServer(const std::string& server, S32 domain_name);
static void refreshLocation( bool force_visible );
@@ -117,7 +117,6 @@ private:
static void onPassKey(LLLineEditor* caller, void* user_data);
//static void onSelectServer(LLUICtrl*, void*);
//static void onServerComboLostFocus(LLFocusableElement*, void*);
static void onLastNameEditLostFocus(LLUICtrl* ctrl, void* data);
static void onSelectLoginEntry(LLUICtrl*, void*);
static void onLoginComboLostFocus(LLFocusableElement* fe, void*);
static void onNameCheckChanged(LLUICtrl* ctrl, void* data);

View File

@@ -410,7 +410,7 @@ void LLViewerShaderMgr::setShaders()
//Flag base shader objects for deletion
//Don't worry-- they won't be deleted until no programs refrence them.
std::map<std::string, GLhandleARB>::iterator it = mShaderObjects.begin();
for(it;it!=mShaderObjects.end();++it)
for(; it!=mShaderObjects.end();++it)
if(it->second)
glDeleteObjectARB(it->second);
mShaderObjects.clear();

View File

@@ -227,13 +227,13 @@ public:
shader_iter beginShaders() const
{
return getGlobalShaderList().begin();
return (shader_iter)(getGlobalShaderList().begin());
//return mShaderList.begin();
}
shader_iter endShaders() const
{
return getGlobalShaderList().end();
return (shader_iter)(getGlobalShaderList().end());
//return mShaderList.end();
}

View File

@@ -14,66 +14,58 @@
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="54" drop_shadow_visible="true" follows="left|bottom"
font="SansSerif" h_pad="0" halign="left" height="16"
left="32" mouse_opaque="true" name="first_name_text" v_pad="0" width="120">
First Name:
left="32" mouse_opaque="true" name="name_label" v_pad="0" width="120">
Name or Username:
</text>
<combo_box bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-24"
font="SansSerif" handle_edit_keys_directly="true" height="20" left="32"
max_chars="31" mouse_opaque="true" name="first_name_combo"
select_all_on_focus_received="true" width="120" allow_text_entry="true" />
max_chars="64" mouse_opaque="true" name="name_combo"
select_all_on_focus_received="true" width="155" allow_text_entry="true" />
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="54" drop_shadow_visible="true" follows="left|bottom"
font="SansSerif" h_pad="0" halign="left" height="16"
left="164" mouse_opaque="true" name="last_name_text" v_pad="0" width="120">
Last Name:
</text>
<line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-24"
follows="left|bottom" font="SansSerifSmall" handle_edit_keys_directly="true"
height="20" left="164" max_length="31" mouse_opaque="true"
name="last_name_edit" select_all_on_focus_received="true" width="120" />
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="54" drop_shadow_visible="true" follows="left|bottom"
font="SansSerif" h_pad="0" halign="left" height="16"
left="296" mouse_opaque="true" name="password_text" v_pad="0" width="120">
left="203" mouse_opaque="true" name="password_text" v_pad="0" width="120">
Password:
</text>
<line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-24"
follows="left|bottom" font="SansSerifSmall" handle_edit_keys_directly="true"
height="20" left="296" max_length="16" mouse_opaque="true"
height="20" left="203" max_length="16" mouse_opaque="true"
name="password_edit" select_all_on_focus_received="true" width="120" />
<check_box bottom="10" control_name="RememberName"
follows="left|bottom" font="SansSerifSmall" height="16"
initial_value="true" label="Remember resident name"
initial_value="true" label="Remember name"
left="28" mouse_opaque="true" name="remember_name_check" width="158" />
<check_box bottom="10" control_name="RememberPassword"
follows="left|bottom" font="SansSerifSmall" height="16"
initial_value="false" label="Remember password"
left="292" mouse_opaque="true" name="remember_check" width="138" />
left="199" mouse_opaque="true" name="remember_check" width="138" />
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="54" drop_shadow_visible="true" follows="left|bottom"
font="SansSerifSmall" h_pad="0" halign="left" height="16"
left="428" mouse_opaque="true" name="grids_combo_text" v_pad="0" width="120">
left="339" mouse_opaque="true" name="grids_combo_text" v_pad="0" width="120">
Grid:
</text>
<combo_box allow_text_entry="false" bottom_delta="-24" follows="left|bottom" height="20"
left="428" mouse_opaque="true" name="grids_combo" width="120" />
left="339" mouse_opaque="true" name="grids_combo" width="120" />
<button name="grids_btn" label="Grid Manager"
bottom_delta="-20" left_delta="10" height="16" width="100"
follows="left|bottom" font="SansSerifSmall" halign="center"
mouse_opaque="true" scale_image="TRUE" />
<button bottom_delta="-3" follows="left|bottom" font="SansSerif" halign="center"
height="24" width="60" label="Grids" label_selected="Grids"
left="550" mouse_opaque="true" name="grids_btn" scale_image="TRUE"/>
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="54" drop_shadow_visible="true" follows="left|bottom"
font="SansSerifSmall" h_pad="0" halign="left" height="16"
left="624" mouse_opaque="true" name="start_location_text" v_pad="0" width="120">
left="475" mouse_opaque="true" name="start_location_text" v_pad="0" width="120">
Start Location:
</text>
<combo_box allow_text_entry="true" bevel_style="in" border_style="line" border_thickness="1"
follows="left|bottom" font="SansSerif" handle_edit_keys_directly="true"
height="20" hidden="false" left="619" bottom_delta="-24" max_chars="256" mouse_opaque="true"
height="20" hidden="false" left="529" bottom_delta="-24" max_chars="256" mouse_opaque="true"
name="regionuri_edit" select_all_on_focus_received="true" width="240" />
<combo_box allow_text_entry="true" bottom_delta="0" left="624" follows="left|bottom" height="20"
<combo_box allow_text_entry="true" bottom_delta="0" left="475" follows="left|bottom" height="20"
max_chars="128" mouse_opaque="true" name="start_location_combo" width="155">
<combo_item name="MyHome" value="My Home">
My Home
@@ -88,7 +80,7 @@
<button bottom_delta="-3" follows="left|bottom" font="SansSerif" halign="center"
height="24" label="Log In" label_selected="Log In"
left="782" mouse_opaque="true" name="connect_btn" scale_image="TRUE"
left="634" mouse_opaque="true" name="connect_btn" scale_image="TRUE"
width="100" />
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"