meow-7.2.2
Nicky 2016-04-21 16:17:38 +02:00
commit b9cbfdda53
22 changed files with 251 additions and 291 deletions

View File

@ -66,7 +66,10 @@
#endif
S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& error_msg)
// <FS:Ansariel> FIRE-17812: Increase sounds length to 60s on OpenSim
//S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& error_msg)
S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& error_msg, bool is_in_secondlife)
// </FS:Ansariel>
{
U16 num_channels = 0;
U32 sample_rate = 0;
@ -189,7 +192,10 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
F32 clip_length = (F32)raw_data_length/(F32)bytes_per_sec;
if (clip_length > LLVORBIS_CLIP_MAX_TIME)
// <FS:Ansariel> FIRE-17812: Increase sounds length to 60s on OpenSim
//if (clip_length > LLVORBIS_CLIP_MAX_TIME)
if (clip_length > (is_in_secondlife ? LLVORBIS_CLIP_MAX_TIME : LLVORBIS_CLIP_MAX_TIME_OPENSIM))
// </FS:Ansariel>
{
error_msg = "SoundFileInvalidTooLong";
return(LLVORBISENC_CLIP_TOO_LONG);
@ -198,7 +204,10 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
return(LLVORBISENC_NOERR);
}
S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname)
// <FS:Ansariel> FIRE-17812: Increase sounds length to 60s on OpenSim
//S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname)
S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname, bool is_in_secondlife)
// </FS:Ansariel>
{
#define READ_BUFFER 1024
unsigned char readbuffer[READ_BUFFER*4+44]; /* out of the data segment, not the stack */ /*Flawfinder: ignore*/
@ -222,7 +231,10 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
S32 format_error = 0;
std::string error_msg;
if ((format_error = check_for_invalid_wav_formats(in_fname, error_msg)))
// <FS:Ansariel> FIRE-17812: Increase sounds length to 60s on OpenSim
//if ((format_error = check_for_invalid_wav_formats(in_fname, error_msg)))
if ((format_error = check_for_invalid_wav_formats(in_fname, error_msg, is_in_secondlife)))
// </FS:Ansariel>
{
LL_WARNS() << error_msg << ": " << in_fname << LL_ENDL;
return(format_error);

View File

@ -41,6 +41,7 @@ const S32 LLVORBISENC_CLIP_TOO_LONG = 10; // source file is too l
const S32 LLVORBISENC_CHUNK_SIZE_ERR = 11; // chunk size is wrong
const F32 LLVORBIS_CLIP_MAX_TIME = 10.0f;
const F32 LLVORBIS_CLIP_MAX_TIME_OPENSIM = 60.0f; // <FS:Ansariel> FIRE-17812: Increase sounds length to 60s on OpenSim
const U8 LLVORBIS_CLIP_MAX_CHANNELS = 2;
const U32 LLVORBIS_CLIP_SAMPLE_RATE = 44100;
const U32 LLVORBIS_CLIP_MAX_SAMPLES_PER_CHANNEL = (U32)(LLVORBIS_CLIP_MAX_TIME * LLVORBIS_CLIP_SAMPLE_RATE);
@ -52,8 +53,12 @@ const size_t LLVORBIS_CLIP_MAX_SAMPLE_DATA = LLVORBIS_CLIP_MAX_SAMPL
const size_t LLVORBIS_CLIP_REJECT_SAMPLES = LLVORBIS_CLIP_MAX_SAMPLES * 3;
const size_t LLVORBIS_CLIP_REJECT_SIZE = LLVORBIS_CLIP_MAX_SAMPLE_DATA * 3;
S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& error_msg);
S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname);
// <FS:Ansariel> FIRE-17812: Increase sounds length to 60s on OpenSim
//S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& error_msg);
//S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname);
S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& error_msg, bool is_in_secondlife);
S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname, bool is_in_secondlife);
// </FS:Ansariel>
#endif

View File

@ -77,7 +77,6 @@
#include "llsdserialize.h"
const S32 BLACK_BORDER_HEIGHT = 160;
const S32 MAX_PASSWORD_SL = 16;
const S32 MAX_PASSWORD_OPENSIM = 255;
@ -177,9 +176,11 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
void (*callback)(S32 option, void* user_data),
void *cb_data)
: LLPanel(),
mLogoImage(),
mCallback(callback),
mCallbackData(cb_data),
mUsernameLength(0),
mPasswordLength(0),
mLocationLength(0),
mShowFavorites(false)
{
setBackgroundVisible(FALSE);
@ -194,9 +195,6 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
login_holder->addChild(this);
}
// Logo
mLogoImage = LLUI::getUIImage("startup_logo");
buildFromFile( "panel_fs_login.xml");
reshape(rect.getWidth(), rect.getHeight());
@ -211,13 +209,13 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
// change z sort of clickable text to be behind buttons
sendChildToBack(getChildView("forgot_password_text"));
LLComboBox* location_combo = getChild<LLComboBox>("start_location_combo");
LLComboBox* favorites_combo = getChild<LLComboBox>("start_location_combo");
updateLocationSelectorsVisibility(); // separate so that it can be called from preferences
location_combo->setFocusLostCallback(boost::bind(&FSPanelLogin::onLocationSLURL, this));
favorites_combo->setFocusLostCallback(boost::bind(&FSPanelLogin::onLocationSLURL, this));
LLComboBox* server_choice_combo = getChild<LLComboBox>("server_combo");
server_choice_combo->setCommitCallback(boost::bind(&FSPanelLogin::onSelectServer, this));
updateServer();
if(LLStartUp::getStartSLURL().getType() != LLSLURL::LOCATION)
{
@ -225,44 +223,18 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
LLStartUp::setStartSLURL(slurl);
}
childSetAction("remove_user_btn", onClickRemove, this);
childSetAction("connect_btn", onClickConnect, this);
getChild<LLPanel>("login")->setDefaultBtn(findChild<LLButton>("connect_btn"));
getChild<LLPanel>("start_location_panel")->setDefaultBtn(findChild<LLButton>("connect_btn"));
std::string channel = LLVersionInfo::getChannel();
std::string version = llformat("%s (%d)",
LLVersionInfo::getShortVersion().c_str(),
LLVersionInfo::getBuild());
LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text");
forgot_password_text->setClickedCallback(onClickForgotPassword, NULL);
LLTextBox* create_new_account_text = getChild<LLTextBox>("create_new_account_text");
create_new_account_text->setClickedCallback(onClickNewAccount, NULL);
LLTextBox* grid_mgr_help_text = getChild<LLTextBox>("grid_login_text");
grid_mgr_help_text->setClickedCallback(onClickGridMgrHelp, NULL);
// get the web browser control
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
web_browser->addObserver(this);
reshapeBrowser();
// Show last logged in user favorites in "Start at" combo.
LLComboBox* username_combo(getChild<LLComboBox>("username_combo"));
username_combo->setCommitCallback(boost::bind(&FSPanelLogin::onSelectUser, this));
username_combo->setFocusLostCallback(boost::bind(&FSPanelLogin::onSelectUser, this));
mPreviousUsername = username_combo->getValue().asString();
LLSLURL start_slurl(LLStartUp::getStartSLURL());
if ( !start_slurl.isSpatial() ) // has a start been established by the command line or NextLoginLocation ?
if ( !start_slurl.isSpatial() ) // has a start been established by the command line or NextLoginLocation ?
{
// no, so get the preference setting
// no, so get the preference setting
std::string defaultStartLocation = gSavedSettings.getString("LoginLocation");
LL_INFOS("AppInit") << "default LoginLocation '" << defaultStartLocation << "'" << LL_ENDL;
LL_INFOS("AppInit")<<"default LoginLocation '"<<defaultStartLocation<<"'"<<LL_ENDL;
LLSLURL defaultStart(defaultStartLocation);
if ( defaultStart.isSpatial() )
{
@ -280,7 +252,27 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
FSPanelLogin::onUpdateStartSLURL(start_slurl); // updates grid if needed
}
childSetAction("remove_user_btn", onClickRemove, this);
childSetAction("connect_btn", onClickConnect, this);
getChild<LLPanel>("login")->setDefaultBtn(findChild<LLButton>("connect_btn"));
getChild<LLPanel>("start_location_panel")->setDefaultBtn(findChild<LLButton>("connect_btn"));
std::string channel = LLVersionInfo::getChannel();
std::string version = llformat("%s (%d)",
LLVersionInfo::getShortVersion().c_str(),
LLVersionInfo::getBuild());
LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text");
forgot_password_text->setClickedCallback(onClickForgotPassword, NULL);
loadLoginPage();
LLComboBox* username_combo(getChild<LLComboBox>("username_combo"));
username_combo->setTextChangedCallback(boost::bind(&FSPanelLogin::onUsernameTextChanged, this));
username_combo->setCommitCallback(boost::bind(&FSPanelLogin::onSelectUser, this));
username_combo->setFocusLostCallback(boost::bind(&FSPanelLogin::onSelectUser, this));
mPreviousUsername = username_combo->getValue().asString();
}
void FSPanelLogin::addFavoritesToStartLocation()
@ -307,6 +299,8 @@ void FSPanelLogin::addFavoritesToStartLocation()
std::string current_user = canonical_user_name + " @ " + current_grid;
LL_DEBUGS("Favorites") << "Current user: \"" << current_user << "\"" << LL_ENDL;
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
mUsernameLength = current_user.length();
updateLoginButtons();
LLSD fav_llsd;
llifstream file;
@ -316,6 +310,7 @@ void FSPanelLogin::addFavoritesToStartLocation()
return;
}
LLSDSerialize::fromXML(fav_llsd, file);
for (LLSD::map_const_iterator iter = fav_llsd.beginMap();
iter != fav_llsd.endMap(); ++iter)
{
@ -349,21 +344,6 @@ void FSPanelLogin::addFavoritesToStartLocation()
LLFloaterPreference::updateShowFavoritesCheckbox(mShowFavorites);
}
// force the size to be correct (XML doesn't seem to be sufficient to do this)
// (with some padding so the other login screen doesn't show through)
void FSPanelLogin::reshapeBrowser()
{
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
LLRect rect = gViewerWindow->getWindowRectScaled();
LLRect html_rect;
html_rect.setCenterAndSize(
rect.getCenterX() - 2, rect.getCenterY() + 40,
rect.getWidth() + 6, rect.getHeight() - 78 );
web_browser->setRect( html_rect );
web_browser->reshape( html_rect.getWidth(), html_rect.getHeight(), TRUE );
reshape( rect.getWidth(), rect.getHeight(), 1 );
}
FSPanelLogin::~FSPanelLogin()
{
FSPanelLogin::sInstance = NULL;
@ -374,50 +354,6 @@ FSPanelLogin::~FSPanelLogin()
}
// virtual
void FSPanelLogin::draw()
{
gGL.pushMatrix();
{
F32 image_aspect = 1.333333f;
F32 view_aspect = (F32)getRect().getWidth() / (F32)getRect().getHeight();
// stretch image to maintain aspect ratio
if (image_aspect > view_aspect)
{
gGL.translatef(-0.5f * (image_aspect / view_aspect - 1.f) * getRect().getWidth(), 0.f, 0.f);
gGL.scalef(image_aspect / view_aspect, 1.f, 1.f);
}
S32 width = getRect().getWidth();
S32 height = getRect().getHeight();
if (getChild<LLView>("login_widgets")->getVisible())
{
// draw a background box in black
gl_rect_2d( 0, height - 264, width, 264, LLColor4::black );
// draw the bottom part of the background image
// just the blue background to the native client UI
mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight());
};
}
gGL.popMatrix();
LLPanel::draw();
}
// virtual
BOOL FSPanelLogin::handleKeyHere(KEY key, MASK mask)
{
if ( KEY_F1 == key )
{
LLViewerHelp* vhelp = LLViewerHelp::getInstance();
vhelp->showTopic(vhelp->f1HelpTopic());
return TRUE;
}
return LLPanel::handleKeyHere(key, mask);
}
// virtual
void FSPanelLogin::setFocus(BOOL b)
{
if(b != hasFocus())
@ -481,7 +417,7 @@ void FSPanelLogin::showLoginWidgets()
// It seems to be part of the defunct? reg-in-client project.
sInstance->getChildView("login_widgets")->setVisible( true);
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
sInstance->reshapeBrowser();
// *TODO: Append all the usual login parameters, like first_login=Y etc.
std::string splash_screen_url = LLGridManager::getInstance()->getLoginPage();
web_browser->navigateTo( splash_screen_url, HTTP_CONTENT_TEXT_HTML );
@ -495,17 +431,10 @@ void FSPanelLogin::show(const LLRect &rect,
void (*callback)(S32 option, void* user_data),
void* callback_data)
{
// instance management
if (FSPanelLogin::sInstance)
{
LL_WARNS("AppInit") << "Duplicate instance of login view deleted" << LL_ENDL;
// Don't leave bad pointer in gFocusMgr
gFocusMgr.setDefaultKeyboardFocus(NULL);
delete FSPanelLogin::sInstance;
}
new FSPanelLogin(rect, callback, callback_data);
if (!FSPanelLogin::sInstance)
{
new FSPanelLogin(rect, callback, callback_data);
}
if( !gFocusMgr.getKeyboardFocus() )
{
@ -557,17 +486,19 @@ void FSPanelLogin::setFields(LLPointer<LLCredential> credential, bool from_start
LLSD authenticator = credential->getAuthenticator();
LL_INFOS("Credentials") << "Setting authenticator field " << authenticator["type"].asString() << LL_ENDL;
bool remember;
if (authenticator.isMap() &&
authenticator.has("secret") &&
if(authenticator.isMap() &&
authenticator.has("secret") &&
(authenticator["secret"].asString().size() > 0))
{
// This is a MD5 hex digest of a password.
// We don't actually use the password input field,
// fill it with MAX_PASSWORD_SL characters so we get a
// nice row of asterixes.
// nice row of asterisks.
const std::string filler("123456789!123456");
sInstance->getChild<LLLineEditor>("password_edit")->setText(filler);
sInstance->mPasswordLength = filler.length();
sInstance->updateLoginButtons();
remember = true;
// We run into this case, if a user tries to login with a newly entered password
@ -584,6 +515,8 @@ void FSPanelLogin::setFields(LLPointer<LLCredential> credential, bool from_start
(stored_credential->getAuthenticator().has("secret") && stored_credential->getAuthenticator()["secret"].asString() != authenticator["secret"].asString()))
{
sInstance->getChild<LLLineEditor>("password_edit")->setText(sPassword);
sInstance->mPasswordLength = sPassword.length();
sInstance->updateLoginButtons();
sInstance->mPasswordModified = TRUE;
}
}
@ -591,6 +524,8 @@ void FSPanelLogin::setFields(LLPointer<LLCredential> credential, bool from_start
else
{
sInstance->getChild<LLLineEditor>("password_edit")->clear();
sInstance->mPasswordLength = 0;
sInstance->updateLoginButtons();
remember = false;
}
if (from_startup)
@ -672,7 +607,7 @@ void FSPanelLogin::getFields(LLPointer<LLCredential>& credential,
std::string last;
if (separator_index != username.npos)
{
last = username.substr(separator_index + 1, username.npos);
last = username.substr(separator_index+1, username.npos);
LLStringUtil::trim(last);
}
else
@ -728,7 +663,7 @@ BOOL FSPanelLogin::areCredentialFieldsDirty()
return true;
}
}
return false;
return false;
}
@ -784,6 +719,8 @@ void FSPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl)
updateServer(); // to change the links and splash screen
}
location_combo->setTextEntry(new_start_slurl.getLocationString());
sInstance->mLocationLength = new_start_slurl.getLocationString().length();
sInstance->updateLoginButtons();
}
else
{
@ -865,6 +802,13 @@ void FSPanelLogin::loadLoginPage()
LL_DEBUGS("AppInit") << "login_page: " << login_page << LL_ENDL;
// allow users (testers really) to specify a different login content URL
std::string force_login_url = gSavedSettings.getString("ForceLoginURL");
if ( force_login_url.length() > 0 )
{
login_page = LLURI(force_login_url);
}
// Language
params["lang"] = LLUI::getLanguage();
@ -889,6 +833,9 @@ void FSPanelLogin::loadLoginPage()
// sourceid
params["sourceid"] = gSavedSettings.getString("sourceid");
// login page (web) content version
params["login_content_version"] = gSavedSettings.getString("LoginContentVersion");
// Make an LLURI with this augmented info
LLURI login_uri(LLURI::buildHTTP(login_page.authority(),
login_page.path(),
@ -941,52 +888,44 @@ void FSPanelLogin::onClickConnect(void *)
std::string password = sInstance->getChild<LLUICtrl>("password_edit")->getValue().asString();
gSavedSettings.setString("UserLoginInfo", credentialName());
LLSD blocked = FSData::instance().allowedLogin();
if (!blocked.isMap()) //hack for testing for an empty LLSD
if(username.empty())
{
if(username.empty())
{
// user must type in something into the username field
LLNotificationsUtil::add("MustHaveAccountToLogIn");
}
else if(password.empty())
{
LLNotificationsUtil::add("MustEnterPasswordToLogIn");
}
else
{
LLPointer<LLCredential> cred;
BOOL remember;
getFields(cred, remember);
std::string identifier_type;
cred->identifierType(identifier_type);
LLSD allowed_credential_types;
LLGridManager::getInstance()->getLoginIdentifierTypes(allowed_credential_types);
// check the typed in credential type against the credential types expected by the server.
for(LLSD::array_iterator i = allowed_credential_types.beginArray();
i != allowed_credential_types.endArray();
i++)
{
if(i->asString() == identifier_type)
{
// yay correct credential type
sInstance->mCallback(0, sInstance->mCallbackData);
return;
}
}
// Right now, maingrid is the only thing that is picky about
// credential format, as it doesn't yet allow account (single username)
// format creds. - Rox. James, we wanna fix the message when we change
// this.
LLNotificationsUtil::add("InvalidCredentialFormat");
}
// user must type in something into the username field
LLNotificationsUtil::add("MustHaveAccountToLogIn");
}
else if(password.empty())
{
LLNotificationsUtil::add("MustEnterPasswordToLogIn");
}
else
{
LLNotificationsUtil::add("BlockLoginInfo", blocked);
LLPointer<LLCredential> cred;
BOOL remember;
getFields(cred, remember);
std::string identifier_type;
cred->identifierType(identifier_type);
LLSD allowed_credential_types;
LLGridManager::getInstance()->getLoginIdentifierTypes(allowed_credential_types);
// check the typed in credential type against the credential types expected by the server.
for(LLSD::array_iterator i = allowed_credential_types.beginArray();
i != allowed_credential_types.endArray();
i++)
{
if(i->asString() == identifier_type)
{
// yay correct credential type
sInstance->mCallback(0, sInstance->mCallbackData);
return;
}
}
// Right now, maingrid is the only thing that is picky about
// credential format, as it doesn't yet allow account (single username)
// format creds. - Rox. James, we wanna fix the message when we change
// this.
LLNotificationsUtil::add("InvalidCredentialFormat");
}
}
}
@ -1045,48 +984,58 @@ void FSPanelLogin::onClickHelp(void*)
// static
void FSPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
{
FSPanelLogin *This = (FSPanelLogin *) user_data;
This->mPasswordModified = TRUE;
FSPanelLogin *self = (FSPanelLogin *)user_data;
self->mPasswordModified = TRUE;
if (gKeyboard->getKeyDown(KEY_CAPSLOCK) && sCapslockDidNotification == FALSE)
{
// *TODO: use another way to notify user about enabled caps lock, see EXT-6858
sCapslockDidNotification = TRUE;
}
LLLineEditor* password_edit(self->getChild<LLLineEditor>("password_edit"));
self->mPasswordLength = password_edit->getText().length();
self->updateLoginButtons();
}
void FSPanelLogin::updateServer()
{
if (!sInstance)
if (sInstance)
{
return;
}
try
{
// if they've selected another grid, we should load the credentials
// for that grid and set them to the UI.
if(!sInstance->areCredentialFieldsDirty())
try
{
LLPointer<LLCredential> credential = gSecAPIHandler->loadCredential(credentialName());
sInstance->setFields(credential);
}
// if they've selected another grid, we should load the credentials
// for that grid and set them to the UI.
if(!sInstance->areCredentialFieldsDirty())
{
LLPointer<LLCredential> credential = gSecAPIHandler->loadCredential(credentialName());
sInstance->setFields(credential);
}
// grid changed so show new splash screen (possibly)
updateServerCombo();
loadLoginPage();
// grid changed so show new splash screen (possibly)
updateServerCombo();
loadLoginPage();
#ifdef OPENSIM
sInstance->getChild<LLLineEditor>("password_edit")->setMaxTextLength(LLGridManager::getInstance()->isInSecondLife() ? MAX_PASSWORD_SL : MAX_PASSWORD_OPENSIM);
sInstance->getChild<LLLineEditor>("password_edit")->setMaxTextLength(LLGridManager::getInstance()->isInSecondLife() ? MAX_PASSWORD_SL : MAX_PASSWORD_OPENSIM);
#endif
}
catch (LLInvalidGridName ex)
{
LL_WARNS("AppInit")<<"server '"<<ex.name()<<"' selection failed"<<LL_ENDL;
LLSD args;
args["GRID"] = ex.name();
LLNotificationsUtil::add("InvalidGrid", args);
return;
}
}
catch (LLInvalidGridName ex)
{
LL_WARNS("AppInit") << "server '" << ex.name() << "' selection failed"<<LL_ENDL;
LLSD args;
args["GRID"] = ex.name();
LLNotificationsUtil::add("InvalidGrid", args);
return;
}
}
void FSPanelLogin::updateLoginButtons()
{
LLButton* login_btn = getChild<LLButton>("connect_btn");
login_btn->setEnabled(mUsernameLength != 0 && mPasswordLength != 0);
}
void FSPanelLogin::onSelectServer()
@ -1131,9 +1080,10 @@ void FSPanelLogin::onSelectServer()
location_combo->setCurrentByIndex(0); // last location on the new grid
location_combo->setTextEntry(LLStringUtil::null);
}
}
}
break;
}
updateServer();
}
@ -1141,7 +1091,7 @@ void FSPanelLogin::onLocationSLURL()
{
LLComboBox* location_combo = getChild<LLComboBox>("start_location_combo");
std::string location = location_combo->getValue().asString();
LL_DEBUGS("AppInit") << location << LL_ENDL;
LL_DEBUGS("AppInit")<<location<<LL_ENDL;
LLStartUp::setStartSLURL(location); // calls onUpdateStartSLURL, above
}
@ -1320,6 +1270,8 @@ void FSPanelLogin::onSelectUser()
}
sInstance->addFavoritesToStartLocation();
sInstance->mPreviousUsername = combo->getValue().asString();
sInstance->mUsernameLength = combo->getValue().asString().length();
sInstance->updateLoginButtons();
sInstance->getChild<LLButton>("remove_user_btn")->setEnabled(FALSE);
return;
}
@ -1360,9 +1312,6 @@ void FSPanelLogin::updateServerCombo()
{
if (!sInstance) return;
#ifdef OPENSIM
LLGridManager::getInstance()->addGridListChangedCallback(&FSPanelLogin::gridListChanged);
#endif // OPENSIM
// We add all of the possible values, sorted, and then add a bar and the current value at the top
LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
server_choice_combo->removeall();
@ -1413,6 +1362,25 @@ void FSPanelLogin::gridListChanged(bool success)
updateServer();
}
// static
bool FSPanelLogin::getShowFavorites()
{
if (sInstance)
{
return sInstance->mShowFavorites;
}
else
{
return gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin");
}
}
void FSPanelLogin::onUsernameTextChanged()
{
mUsernameLength = getChild<LLUICtrl>("username_combo")->getValue().asString().length();
updateLoginButtons();
}
/////////////////////////
// Mode selector //
/////////////////////////
@ -1449,16 +1417,3 @@ void FSPanelLogin::onModeChangeConfirm(const LLSD& original_value, const LLSD& n
break;
}
}
// static
bool FSPanelLogin::getShowFavorites()
{
if (sInstance)
{
return sInstance->mShowFavorites;
}
else
{
return gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin");
}
}

View File

@ -24,7 +24,7 @@
* $/LicenseInfo$
*/
// Original file: llpanellogin.cpp
// Original file: llpanellogin.h
#ifndef FS_PANELLOGIN_H
#define FS_PANELLOGIN_H
@ -32,11 +32,8 @@
#include "llpanel.h"
#include "llpointer.h" // LLPointer<>
#include "llmediactrl.h" // LLMediaCtrlObserver
#include <boost/scoped_ptr.hpp>
class LLLineEditor;
class LLUIImage;
class LLPanelLoginListener;
class LLSLURL;
class LLCredential;
@ -51,14 +48,8 @@ public:
void *callback_data);
~FSPanelLogin();
virtual BOOL handleKeyHere(KEY key, MASK mask);
virtual void draw();
virtual void setFocus( BOOL b );
// Show the XUI first name, last name, and password widgets. They are
// hidden on startup for reg-in-client
static void showLoginWidgets();
static void show(const LLRect &rect,
void (*callback)(S32 option, void* user_data),
void* callback_data);
@ -78,6 +69,8 @@ public:
void setSiteIsAlive( bool alive );
void showLoginWidgets();
static void loadLoginPage();
static void giveFocus();
static void setAlwaysRefresh(bool refresh);
@ -89,14 +82,12 @@ public:
/// to be called from LLStartUp::setStartSLURL
static void onUpdateStartSLURL(const LLSLURL& new_start_slurl);
// called from prefs when initializing pane
// called from prefs when initializing panel
static bool getShowFavorites();
static void clearPassword() { sPassword.clear(); }
private:
friend class LLPanelLoginListener;
void reshapeBrowser();
void addFavoritesToStartLocation();
void addUsersToCombo(BOOL show_server);
void onSelectUser();
@ -104,6 +95,7 @@ private:
void onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response);
void onSelectServer();
void onLocationSLURL();
void onUsernameTextChanged();
static void onClickConnect(void*);
static void onClickNewAccount(void*);
@ -119,19 +111,22 @@ private:
static std::string credentialName();
private:
LLPointer<LLUIImage> mLogoImage;
void updateLoginButtons();
void (*mCallback)(S32 option, void *userdata);
void* mCallbackData;
BOOL mPasswordModified;
BOOL mPasswordModified;
bool mShowFavorites;
static FSPanelLogin* sInstance;
static BOOL sCapslockDidNotification;
std::string mPreviousUsername;
unsigned int mUsernameLength;
unsigned int mPasswordLength;
unsigned int mLocationLength;
std::string mPreviousUsername;
static std::string sPassword;
};

View File

@ -4474,6 +4474,7 @@ void LLPanelPreferenceOpensim::onSelectGrid()
void LLPanelPreferenceOpensim::apply()
{
LLGridManager::getInstance()->saveGridList();
FSPanelLogin::updateServer();
}
void LLPanelPreferenceOpensim::cancel()
@ -4575,6 +4576,8 @@ bool LLPanelPreferenceOpensim::removeGridCB(const LLSD& notification, const LLSD
void LLPanelPreferenceOpensim::refreshGridList(bool success)
{
FSPanelLogin::updateServer();
getChild<LLUICtrl>("grid_management_panel")->setEnabled(TRUE);
if (!mGridListControl)

View File

@ -99,35 +99,6 @@ bool LLLoginHandler::handle(const LLSD& tokens,
return true;
}
// <FS:Ansariel> [FS Login Panel]
if (tokens.size() == 1
&& tokens[0].asString() == "show")
{
// We're using reg-in-client, so show the XUI login widgets
FSPanelLogin::showLoginWidgets();
return true;
}
if (tokens.size() == 1
&& tokens[0].asString() == "reg")
{
LLWindow* window = gViewerWindow->getWindow();
window->incBusyCount();
window->setCursor(UI_CURSOR_ARROW);
// Do this first, as it may be slow and we want to keep something
// on the user's screen as long as possible
LLWeb::loadURLExternal( "http://join.eniac15.lindenlab.com/" );
window->decBusyCount();
window->setCursor(UI_CURSOR_ARROW);
// Then hide the window
window->minimize();
return true;
}
// </FS:Ansariel> [FS Login Panel]
// Make sure window is visible
LLWindow* window = gViewerWindow->getWindow();
if (window->getMinimized())

View File

@ -1142,6 +1142,17 @@ bool idle_startup()
if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState())
{
// <FS:Ansariel> Login block
LLSD blocked = FSData::instance().allowedLogin();
if (blocked.isMap()) //hack for testing for an empty LLSD
{
LLNotificationsUtil::add("BlockLoginInfo", blocked, LLSD(), login_alert_done);
LLStartUp::setStartupState(STATE_LOGIN_CONFIRM_NOTIFICATON);
show_connect_box = true;
return FALSE;
}
// </FS:Ansariel>
// Post login screen, we should see if any settings have changed that may
// require us to either start/stop or change the socks proxy. As various communications
// past this point may require the proxy to be up.

View File

@ -51,6 +51,8 @@
#include "llpreviewgesture.h"
#include "llcoproceduremanager.h"
#include "llviewernetwork.h"
void dialog_refresh_all();
LLResourceUploadInfo::LLResourceUploadInfo(LLTransactionID transactId,
@ -392,7 +394,10 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile()
LL_INFOS() << "Attempting to encode wav as an ogg file" << LL_ENDL;
encodeResult = encode_vorbis_file(getFileName(), filename);
// <FS:Ansariel> FIRE-17812: Increase sounds length to 60s on OpenSim
//encodeResult = encode_vorbis_file(getFileName(), filename);
encodeResult = encode_vorbis_file(getFileName(), filename, LLGridManager::instance().isInSecondLife());
// </FS:Ansariel>
if (LLVORBISENC_NOERR != encodeResult)
{

View File

@ -80,6 +80,8 @@
#include "llinventorydefines.h"
#include "llviewernetwork.h"
class LLFileEnableUpload : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@ -465,11 +467,12 @@ static void show_floater_callback(const std::string& floater, const std::string&
{
// pre-qualify wavs to make sure the format is acceptable
std::string error_msg;
if (check_for_invalid_wav_formats(filename,error_msg))
if (check_for_invalid_wav_formats(filename, error_msg, LLGridManager::instance().isInSecondLife()))
{
LL_INFOS() << error_msg << ": " << filename << LL_ENDL;
LLSD args;
args["FILE"] = filename;
args["MAX_LENGTH"] = llformat("%.0f", (LLGridManager::instance().isInSecondLife() ? LLVORBIS_CLIP_MAX_TIME : LLVORBIS_CLIP_MAX_TIME_OPENSIM));
LLNotificationsUtil::add( error_msg, args );
return;
}

View File

@ -836,7 +836,7 @@ Erwartet wurde [VALIDS]
[FILE]
</notification>
<notification name="SoundFileInvalidTooLong">
Audiodatei ist zu lang (max. 10 Sekunden):
Audiodatei ist zu lang (max. [MAX_LENGTH] Sekunden):
[FILE]
</notification>
<notification name="ProblemWithFile">

View File

@ -2144,7 +2144,7 @@ Wrong chunk size in WAV file:
icon="alertmodal.tga"
name="SoundFileInvalidTooLong"
type="alertmodal">
Audio file is too long (10 second maximum):
Audio file is too long ([MAX_LENGTH] second maximum):
[FILE]
<tag>fail</tag>
</notification>

View File

@ -1,13 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
follows="all"
height="600"
height="768"
layout="topleft"
left="0"
name="panel_login"
focus_root="true"
top="600"
width="1130">
background_visible="true"
bg_opaque_color="0.16 0.16 0.16 1"
background_opaque="true"
width="1024">
<panel.string
name="real_url" translate="false">
http://phoenixviewer.com/app/loginV3/
@ -19,20 +21,18 @@
name="forgot_password_url">
http://secondlife.com/account/request.php
</panel.string>
<!-- *NOTE: Custom resize logic for login_html in llpanellogin.cpp -->
<web_browser
tab_stop="false"
trusted_content="true"
tab_stop="false"
trusted_content="true"
bg_opaque_color="Black"
border_visible="false"
bottom="600"
follows="all"
left="0"
name="login_html"
start_url=""
top="0"
height="600"
width="996"/>
top="18"
height="670"
width="1024" />
<layout_stack
animate="false"
clip="false"
@ -40,8 +40,8 @@
name="login_widgets"
layout="topleft"
orientation="horizontal"
top="519"
width="1130"
top="688"
width="1024"
height="80">
<layout_panel
auto_resize="false"
@ -116,7 +116,7 @@
width="128">
Password:
</text>
<!-- The max length might be changed in LLPanelLogin.cpp for Opensim! -->
<!-- The max length might be changed in FSPanelLogin.cpp for Opensim! -->
<line_editor
follows="left|bottom"
height="22"

View File

@ -839,7 +839,7 @@ Se admiten [VALIDS]
[FILE]
</notification>
<notification name="SoundFileInvalidTooLong">
El archivo de audio es demasiado largo (debe ser como máximo de10 segundos):
El archivo de audio es demasiado largo (debe ser como máximo de [MAX_LENGTH] segundos):
[FILE]
</notification>
<notification name="ProblemWithFile">

View File

@ -602,7 +602,7 @@ Wrong chunk size in WAV file:
[FILE]
</notification>
<notification name="SoundFileInvalidTooLong">
Audio file is too long (10 second maximum):
Audio file is too long ([MAX_LENGTH] second maximum):
[FILE]
</notification>
<notification name="ProblemWithFile">

View File

@ -796,7 +796,7 @@ Attese [VALIDS]
[FILE]
</notification>
<notification name="SoundFileInvalidTooLong">
Il file audio è troppo lungo (deve essere al massimo 10 secondi):
Il file audio è troppo lungo (deve essere al massimo [MAX_LENGTH] secondi):
[FILE]
</notification>
<notification name="ProblemWithFile">

View File

@ -834,7 +834,7 @@ L$ が不足しているのでこのグループに参加することができ
[FILE]
</notification>
<notification name="SoundFileInvalidTooLong">
オーディオファイルが長すぎます。(最大 10 秒):
オーディオファイルが長すぎます。(最大 [MAX_LENGTH] 秒):
[FILE]
</notification>
<notification name="ProblemWithFile">

View File

@ -759,7 +759,7 @@ Oczekiwane: [VALIDS]
[FILE]
</notification>
<notification name="SoundFileInvalidTooLong">
Plik audio jest zbyt długi (10 sekund maksimum):
Plik audio jest zbyt długi ([MAX_LENGTH] sekund maksimum):
[FILE]
</notification>
<notification name="ProblemWithFile">

View File

@ -792,7 +792,7 @@ Esperada [VALIDS]
[FILE]
</notification>
<notification name="SoundFileInvalidTooLong">
Arquivo de áudio é muito longo (no máximo 10 segundos):
Arquivo de áudio é muito longo (no máximo [MAX_LENGTH] segundos):
[FILE]
</notification>
<notification name="ProblemWithFile">

View File

@ -840,7 +840,7 @@
[FILE]
</notification>
<notification name="SoundFileInvalidTooLong">
Аудиофайл слишком длинный (максимум 10 секунд):
Аудиофайл слишком длинный (максимум [MAX_LENGTH] секунд):
[FILE]
</notification>
<notification name="ProblemWithFile">

View File

@ -798,7 +798,7 @@ Beklenen [VALIDS]
[FILE]
</notification>
<notification name="SoundFileInvalidTooLong">
Ses dosyası çok uzun (En fazla 10 saniye olmalı):
Ses dosyası çok uzun (En fazla [MAX_LENGTH] saniye olmalı):
[FILE]
</notification>
<notification name="ProblemWithFile">

View File

@ -798,7 +798,7 @@
[FILE]
</notification>
<notification name="SoundFileInvalidTooLong">
音頻檔太長(最大值 10 秒):
音頻檔太長(最大值 [MAX_LENGTH] 秒):
[FILE]
</notification>
<notification name="ProblemWithFile">

View File

@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
follows="all"
height="600"
height="768"
layout="topleft"
left="0"
name="panel_login"
focus_root="true"
focus_root="true"
background_visible="true"
top="600"
width="1130">
bg_opaque_color="0.16 0.16 0.16 1"
background_opaque="true"
width="1024">
<panel.string
name="real_url" translate="false">
http://phoenixviewer.com/app/loginV3/
@ -20,20 +21,18 @@
name="forgot_password_url">
http://secondlife.com/account/request.php
</panel.string>
<!-- *NOTE: Custom resize logic for login_html in llpanellogin.cpp -->
<web_browser
tab_stop="false"
trusted_content="true"
tab_stop="false"
trusted_content="true"
bg_opaque_color="Black"
border_visible="false"
bottom="600"
follows="all"
left="0"
name="login_html"
start_url=""
top="0"
height="600"
width="996"/>
top="18"
height="670"
width="1024" />
<layout_stack
animate="false"
clip="false"
@ -41,8 +40,8 @@
name="login_widgets"
layout="topleft"
orientation="horizontal"
top="519"
width="1130"
top="688"
width="1024"
height="80">
<layout_panel
auto_resize="false"
@ -116,6 +115,7 @@ tool_tip="The account name you chose when you registered, like bobsmith420 or St
width="128">
Password:
</text>
<!-- The max length might be changed in FSPanelLogin.cpp for Opensim! -->
<line_editor
follows="left|bottom"
height="22"
@ -155,16 +155,16 @@ tool_tip="The account name you chose when you registered, like bobsmith420 or St
name="start_location_combo"
width="165">
<combo_box.item
label="Last location"
label="Last location"
name="MyLastLocation"
value="last" />
<combo_box.item
label="Home"
label="Home"
name="MyHome"
value="home" />
<combo_box.item
label="&lt;Type region name&gt;"
name="Typeregionname" value="" />
name="Typeregionname" value="" />
</combo_box>
</layout_panel>
<layout_panel