Fixed location combobox not updating properly when a slurl link is clicked. Reset the location combobox when a different grid is selected (added setCurrentGridChangeCallback to hippogridmanager). Moved login panel elements into a layout_stack so hiding the grid or location columns no longer leaves big empty gaps.

This commit is contained in:
Shyotl
2013-07-05 02:28:36 -05:00
parent 624141a31a
commit bbb0bd54bf
12 changed files with 357 additions and 231 deletions

View File

@@ -646,6 +646,8 @@ HippoGridManager::HippoGridManager() :
HippoGridManager::~HippoGridManager()
{
cleanup();
if(mCurrentGridChangeSignal)
delete mCurrentGridChangeSignal;
}
@@ -805,6 +807,7 @@ void HippoGridManager::setDefaultGrid(const std::string& grid)
void HippoGridManager::setCurrentGrid(const std::string& grid)
{
HippoGridInfo* prevGrid = getGrid(mCurrentGrid);
GridIterator it = mGridInfo.find(grid);
if (it != mGridInfo.end())
{
@@ -815,6 +818,8 @@ void HippoGridManager::setCurrentGrid(const std::string& grid)
llwarns << "Unknown grid '" << grid << "'. Setting to default grid." << llendl;
mCurrentGrid = mDefaultGrid;
}
if(mCurrentGridChangeSignal)
(*mCurrentGridChangeSignal)(getGrid(mCurrentGrid),prevGrid);
}

View File

@@ -15,6 +15,8 @@
#include "expat/expat.h"
#endif
#include <boost/signals2.hpp>
class LLSD;
@@ -152,6 +154,8 @@ private:
class HippoGridManager
{
public:
typedef boost::signals2::signal<void (HippoGridInfo* pNewGrid, HippoGridInfo* pPrevGrid)> current_grid_change_signal_t;
HippoGridManager();
~HippoGridManager();
@@ -179,6 +183,13 @@ public:
GridIterator beginGrid() { return mGridInfo.begin(); }
GridIterator endGrid() { return mGridInfo.end(); }
boost::signals2::connection setCurrentGridChangeCallback( const current_grid_change_signal_t::slot_type& cb )
{
if(!mCurrentGridChangeSignal)
mCurrentGridChangeSignal = new current_grid_change_signal_t;
return mCurrentGridChangeSignal->connect(cb);
}
private:
friend class HippoGridInfo;
std::map<std::string, HippoGridInfo*> mGridInfo;
@@ -187,6 +198,8 @@ private:
HippoGridInfo* mConnectedGrid;
int mDefaultGridsVersion;
current_grid_change_signal_t* mCurrentGridChangeSignal;
void cleanup();
void loadFromFile();
void parseFile(const std::string& fileName, bool mergeIfNewer);

View File

@@ -227,7 +227,6 @@ void HippoPanelGridsImpl::apply()
// adding new grid did not fail
gHippoGridManager->setCurrentGrid(mCurGrid);
}
LLPanelLogin::refreshLoginPage();
gHippoGridManager->saveFile();
refresh();
// update render compatibility

View File

@@ -2332,7 +2332,6 @@ bool LLAppViewer::initConfiguration()
if(LLStartUp::getStartSLURL().getType() == LLSLURL::LOCATION)
{
gHippoGridManager->setCurrentGrid(LLStartUp::getStartSLURL().getGrid());
}
}
else if(clp.hasOption("slurl"))

View File

@@ -278,9 +278,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
{
LL_INFOS("AppInit")<<"no valid LoginLocation, using home"<<LL_ENDL;
LLSLURL homeStart(LLSLURL::SIM_LOCATION_HOME);
LLStartUp::setStartSLURL(homeStart);
LLStartUp::setStartSLURL(homeStart); // calls onUpdateStartSLURL
}
start_slurl = LLStartUp::getStartSLURL(); // calls onUpdateStartSLURL
}
else
{
@@ -319,9 +318,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
reshapeBrowser();
loadLoginPage();
refreshLoginPage();
gHippoGridManager->setCurrentGridChangeCallback(boost::bind(&LLPanelLogin::onCurGridChange,this,_1,_2));
}
void LLPanelLogin::setSiteIsAlive( bool alive )
@@ -631,7 +630,6 @@ void LLPanelLogin::setFields(const LLSavedLoginEntry& entry, bool takeFocus)
if(!grid.empty() && gHippoGridManager->getGrid(grid) && grid != gHippoGridManager->getCurrentGridName())
{
gHippoGridManager->setCurrentGrid(grid);
LLPanelLogin::refreshLoginPage();
}
if (entry.getPassword().empty())
@@ -702,13 +700,10 @@ void LLPanelLogin::updateLocationSelectorsVisibility()
#endif // RLV_EXTENSION_STARTLOCATION
// [/RLVa:KB]
sInstance->getChild<LLComboBox>("start_location_combo")->setVisible(show_start); // maintain ShowStartLocation if legacy
sInstance->getChild<LLTextBox>("start_location_text")->setVisible(show_start);
sInstance->getChildView("location_panel")->setVisible(show_start);
bool show_server = true;
sInstance->getChild<LLComboBox>("grids_combo")->setVisible(show_server);
sInstance->getChild<LLTextBox>("grids_text")->setVisible(show_server);
sInstance->getChild<LLButton>("grids_btn")->setVisible(show_server);
bool show_server = true;
sInstance->getChildView("grids_panel")->setVisible(show_server);
}
}
@@ -1030,6 +1025,17 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller)
}
}
void LLPanelLogin::onCurGridChange(HippoGridInfo* new_grid, HippoGridInfo* old_grid)
{
refreshLoginPage();
if(old_grid != new_grid) //Changed grid? Reset the location combobox
{
std::string defaultStartLocation = gSavedSettings.getString("LoginLocation");
LLSLURL defaultStart(defaultStartLocation);
LLStartUp::setStartSLURL(defaultStart.isSpatial() ? defaultStart : LLSLURL(LLSLURL::SIM_LOCATION_HOME)); // calls onUpdateStartSLURL
}
}
// static
//void LLPanelLogin::updateServer()
void LLPanelLogin::refreshLoginPage()
@@ -1074,7 +1080,6 @@ void LLPanelLogin::refreshLoginPage()
void LLPanelLogin::onSelectGrid(LLUICtrl *ctrl)
{
gHippoGridManager->setCurrentGrid(ctrl->getValue());
LLPanelLogin::refreshLoginPage();
}
void LLPanelLogin::onLocationSLURL()

View File

@@ -41,6 +41,7 @@
class LLUIImage;
class LLComboBox;
class HippoGridInfo;
class LLPanelLogin:
public LLPanel,
@@ -92,6 +93,7 @@ public:
void updateGridCombo();
void onCurGridChange(HippoGridInfo* new_grid, HippoGridInfo* old_grid);
static void loadLoginPage();
static void refreshLoginPage();
static void giveFocus();

View File

@@ -13,72 +13,81 @@
<string name="forgot_password_url">
http://secondlife.com/account/request.php
</string>
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="54" drop_shadow_visible="true" follows="left|bottom"
<layout_stack name="element_stack" border_size="0" left="28" right="800" top="70" bottom="10" follows="left|bottom" orientation="horizontal">
<layout_panel name="name_panel" left="0" user_resize="false" auto_resize="false" width="163" min_width="0">
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="44" drop_shadow_visible="true" follows="left|bottom"
font="SansSerif" h_pad="0" halign="left" height="16"
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="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="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="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"
left="4" 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="4"
max_chars="64" mouse_opaque="true" name="name_combo"
select_all_on_focus_received="true" width="155" allow_text_entry="true" />
<check_box bottom="0" control_name="RememberName"
follows="left|bottom" font="SansSerifSmall" height="16"
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="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"
initial_value="true" label="Remember name"
left="0" mouse_opaque="true" name="remember_name_check" width="158" />
</layout_panel>
<layout_panel name="password_panel" left="0" user_resize="false" auto_resize="false" width="134" min_width="0">
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="44" drop_shadow_visible="true" follows="left|bottom"
font="SansSerif" h_pad="0" halign="left" height="16"
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="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" />
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="54" drop_shadow_visible="true" follows="left|bottom"
left="4" 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="4" max_length="16" mouse_opaque="true"
name="password_edit" select_all_on_focus_received="true" width="120" />
<check_box bottom="0" control_name="RememberPassword"
follows="left|bottom" font="SansSerifSmall" height="16"
initial_value="false" label="Remember password"
left="0" mouse_opaque="true" name="remember_check" width="138" />
</layout_panel>
<layout_panel name="grids_panel" left="0" user_resize="false" auto_resize="false" width="129" min_width="0">
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="44" drop_shadow_visible="true" follows="left|bottom"
font="SansSerif" h_pad="0" halign="left" height="16"
left="475" mouse_opaque="true" name="start_location_text" v_pad="0" width="120">
Start Location:
</text>
<combo_box allow_text_entry="true" bottom_delta="-24" left="475" follows="left|bottom" height="20"
max_chars="128" mouse_opaque="true" name="start_location_combo" width="155">
<combo_item name="MyHome" value="home">
My Home
</combo_item>
<combo_item name="MyLastLocation" value="last">
My Last Location
</combo_item>
<combo_item name="Typeregionname" value="">
&lt;Type region name&gt;
</combo_item>
</combo_box>
<button bottom_delta="-3" follows="left|bottom" font="SansSerif" halign="center"
left="0" 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="0" 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" />
</layout_panel>
<layout_panel name="location_panel" left="0" user_resize="false" auto_resize="false" width="165" min_width="0">
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="44" drop_shadow_visible="true" follows="left|bottom"
font="SansSerif" h_pad="0" halign="left" height="16"
left="0" mouse_opaque="true" name="start_location_text" v_pad="0" width="120">
Start Location:
</text>
<combo_box allow_text_entry="true" bottom_delta="-24" left="0" follows="left|bottom" height="20"
max_chars="128" mouse_opaque="true" name="start_location_combo" width="155">
<combo_item name="MyHome" value="home">
My Home
</combo_item>
<combo_item name="MyLastLocation" value="last">
My Last Location
</combo_item>
<combo_item name="Typeregionname" value="">
&lt;Type region name&gt;
</combo_item>
</combo_box>
</layout_panel>
<layout_panel name="connect_panel" user_resize="false" auto_resize="true" width="100" min_width="100">
<button bottom="18" follows="left|bottom" font="SansSerif" halign="center"
height="24" label="Log In" label_selected="Log In"
left="634" mouse_opaque="true" name="connect_btn" scale_image="TRUE"
left="0" mouse_opaque="true" name="connect_btn" scale_image="TRUE"
width="100" />
</layout_panel>
</layout_stack>
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="45" drop_shadow_visible="true" follows="right|bottom"

View File

@@ -1,46 +1,48 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel name="panel_login">
<string name="real_url">
http://secondlife.com/app/login/
</string>
<string name="forgot_password_url">
http://secondlife.com/account/request.ph
</string>
<text name="name_label">
Nombre o Usuario:
</text>
<combo_box name="name_combo" />
<text name="password_text">
Contraseña:
</text>
<check_box label="Recordar Nombre" name="remember_name_check"/>
<check_box label="Recordar Contraseña" name="remember_check" width="138" />
<text name="grids_combo_text">
Grid:
</text>
<button name="grids_btn" label="Administrar Grid"/>
<text name="start_location_text" v_pad="0" width="120">
Posición Inicial:
</text>
<combo_box name="start_location_combo" width="155">
<combo_item name="MyHome" value="My Home">
Mi Base
</combo_item>
<combo_item name="MyLastLocation" value="My Last Location">
Mi Última Ubicación
</combo_item>
<combo_item name="Typeregionname">
&lt;Escribe el Nombre de la Región&gt;
</combo_item>
</combo_box>
<button label="Iniciar Sesión" label_selected="Iniciar Sesión" name="connect_btn" width="100" />
<text name="create_new_account_text" width="200">
<layout_stack name="element_stack">
<layout_panel name="name_panel">
<text name="name_label">
Nombre o Usuario:
</text>
<check_box label="Recordar Nombre" name="remember_name_check"/>
</layout_panel>
<layout_panel name="password_panel">
<text name="password_text">
Contraseña:
</text>
<check_box label="Recordar Contraseña" name="remember_check"/>
</layout_panel>
<layout_panel name="grids_panel">
<text name="grids_combo_text">
Grid:
</text>
<button name="grids_btn" label="Administrar Grid"/>
</layout_panel>
<layout_panel name="location_panel">
<text name="start_location_text">
Posición Inicial:
</text>
<combo_box name="start_location_combo">
<combo_item name="MyHome">
Mi Base
</combo_item>
<combo_item name="MyLastLocation">
Mi Última Ubicación
</combo_item>
<combo_item name="Typeregionname">
&lt;Escribe el Nombre de la Región&gt;
</combo_item>
</combo_box>
</layout_panel>
<layout_panel name="connect_panel">
<button label="Iniciar Sesión" label_selected="Iniciar Sesión" name="connect_btn"/>
</layout_panel>
</layout_stack>
<text name="create_new_account_text">
Registrate para obtener una Cuenta
</text>
<text name="forgot_password_text" width="200">
<text name="forgot_password_text">
¿Olvidaste tu Nombre o tu Contraseña?
</text>
<text name="channel_text">
[CHANNEL] [VERSION]
</text>
</panel>

View File

@@ -1,46 +1,44 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel name="panel_login">
<web_browser name="login_html" />
<string name="real_url">
http://secondlife.com/app/login/
</string>
<string name="forgot_password_url">
http://secondlife.com/account/request.php
</string>
<text left="32" name="name_label" width="120">
Nom:
</text>
<text name="password_text">
Mot de passe:
</text>
<text name="start_location_text">
Lieu d'arrivée:
</text>
<combo_box name="start_location_combo">
<combo_item name="MyHome">
Domicile
</combo_item>
<combo_item name="MyLastLocation">
Dernier emplacement
</combo_item>
<combo_item name="Typeregionname">
&lt;Nom de la région&gt;
</combo_item>
</combo_box>
<check_box bottom="10" label="Mémoriser le nom" left="28" name="remember_name_check" width="158"/>
<check_box label="Mémoriser mot de passe" name="remember_check"/>
<text bottom="54" left="339" name="grids_combo_text" width="120">
Grille:
</text>
<combo_box bottom_delta="-24" left="339" name="grids_combo" width="120" />
<button name="grids_btn" label="Choix de Grille" bottom_delta="-20" left_delta="10" width="100"/>
<text name="full_screen_text">
Le plein écran sera activé après identification.
</text>
<button label="Nouveau Compte" label_selected="Nouveau Compte" name="new_account_btn"/>
<button label="Connexion" label_selected="Me connecter" name="connect_btn"/>
<button label="Préférences" label_selected="Préférences" name="preferences_btn"/>
<button label="Quitter" label_selected="Quitter" name="quit_btn"/>
<layout_stack name="element_stack">
<layout_panel name="name_panel">
<text name="name_label">
Nom:
</text>
<check_box label="Mémoriser le nom" name="remember_name_check"/>
</layout_panel>
<layout_panel name="password_panel">
<text name="password_text">
Mot de passe:
</text>
<check_box label="Mémoriser mot de passe" name="remember_check"/>
</layout_panel>
<layout_panel name="grids_panel">
<text name="grids_combo_text">
Grille:
</text>
<button name="grids_btn" label="Choix de Grille"/>
</layout_panel>
<layout_panel name="location_panel">
<text name="start_location_text">
Lieu d'arrivée:
</text>
<combo_box name="start_location_combo">
<combo_item name="MyHome">
Domicile
</combo_item>
<combo_item name="MyLastLocation">
Dernier emplacement
</combo_item>
<combo_item name="Typeregionname">
&lt;Nom de la région&gt;
</combo_item>
</combo_box>
</layout_panel>
<layout_panel name="connect_panel">
<button label="Connexion" label_selected="Me connecter" name="connect_btn"/>
</layout_panel>
</layout_stack>
<text name="create_new_account_text">
Créer un compte
</text>

View File

@@ -1,30 +1,44 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_login">
<text name="first_name_text">
Primeiro nome:
</text>
<text name="last_name_text">
Sobrenome:
</text>
<text name="password_text">
Senha:
</text>
<text name="start_location_text">
Posição inicial:
</text>
<combo_box name="start_location_combo">
<combo_item name="MyHome">
Minha casa
</combo_item>
<combo_item name="MyLastLocation">
Minha última localização
</combo_item>
<combo_item name="Typeregionname">
&lt;Digite o nome da região&gt;
</combo_item>
</combo_box>
<check_box label="Lembrar senha" name="remember_check"/>
<button label="Entrar" label_selected="Entrar" name="connect_btn"/>
<layout_stack name="element_stack">
<layout_panel name="name_panel">
<text name="name_label">
Nome:
</text>
<check_box label="Lembre-se Nome" name="remember_name_check"/>
</layout_panel>
<layout_panel name="password_panel">
<text name="password_text">
Senha:
</text>
<check_box label="Lembrar senha" name="remember_check"/>
</layout_panel>
<layout_panel name="grids_panel">
<text name="grids_combo_text">
Grelha:
</text>
<!--<button name="grids_btn" label="Administrar Grid"/>-->
</layout_panel>
<layout_panel name="location_panel">
<text name="start_location_text">
Posição inicial:
</text>
<combo_box name="start_location_combo">
<combo_item name="MyHome">
Minha casa
</combo_item>
<combo_item name="MyLastLocation">
Minha última localização
</combo_item>
<combo_item name="Typeregionname">
&lt;Digite o nome da região&gt;
</combo_item>
</combo_box>
</layout_panel>
<layout_panel name="connect_panel">
<button label="Entrar" label_selected="Entrar" name="connect_btn"/>
</layout_panel>
</layout_stack>
<text name="create_new_account_text">
Registrar-se para uma conta
</text>