Merge DRTVWR-496

master
Ansariel 2020-01-28 18:18:12 +01:00
commit c8e0721bf5
8 changed files with 206 additions and 100 deletions

119
.clang-format Normal file
View File

@ -0,0 +1,119 @@
---
Language: Cpp
# BasedOnStyle: Microsoft
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 1000
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: Never
...

80
.gitignore vendored
View File

@ -1,80 +0,0 @@
# By extension
*.DS_Store
*.bak
*.diff
*.orig
*.pyc
*.rej
*.swp
*~
# Specific paths and/or names
LICENSES
build-darwin-*
build-linux-*
build-stamp
build-vc120*
build-vc150*
configure-stamp
debian/files
debian/secondlife-appearance-utility*
debian/secondlife-viewer*
indra/.distcc
indra/CMakeFiles
indra/build-vc[0-9]*
indra/lib/mono/1.0/*.dll
indra/lib/mono/indra/*.dll
indra/lib/mono/indra/*.exe
indra/lib/mono/indra/*.pdb
indra/lib/python/eventlet/
indra/lib/python/mulib.*
indra/llwindow/glh/glh_linear.h
indra/newview/app_settings/dictionaries
indra/newview/app_settings/mozilla
indra/newview/app_settings/mozilla-runtime-*
indra/newview/app_settings/mozilla_debug
indra/newview/app_settings/static_*.db2
indra/newview/avatar_icons_cache.txt
indra/newview/avatar_lad.log
indra/newview/browser_profile
indra/newview/character
indra/newview/dbghelp.dll
indra/newview/filters.xml
indra/newview/fmod.dll
indra/newview/fmod.log
indra/newview/mozilla-theme
indra/newview/mozilla-universal-darwin.tgz
indra/newview/pilot.txt
indra/newview/pilot.xml
indra/newview/res-sdl/ll_icon.*
indra/newview/res/ll_icon.*
indra/newview/search_history.txt
indra/newview/teleport_history.txt
indra/newview/typed_locations.txt
indra/newview/vivox-runtime
indra/server-linux-*
indra/temp
indra/test/linden_file.dat
indra/test_apps/llmediatest/dependencies/i686-win32
indra/test_apps/terrain_mule/*.dll
indra/viewer-linux-*
indra/web/dataservice/lib/shared/vault.*
indra/web/dataservice/locale.*
indra/web/dataservice/vendor.*
indra/web/doc/asset-upload/plugins/lsl_compiler/lslc
indra/web/doc/asset-upload/plugins/verify-notecard
indra/web/doc/asset-upload/plugins/verify-texture
installed.xml
libraries
tarfile_tmp
web/config.*
web/locale.*
web/secondlife.com.*
# Firestorm additions
indra/newview/exoflickrkeys.h
indra/newview/fsdiscordkey.h
my_autobuild.xml
.vscode
*Thumbs.db
logs

View File

@ -3825,7 +3825,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>package_description</key>
<map>
<key>canonical_repo</key>
<string>https://bitbucket.org/lindenlab/viewer-release</string>
<string>https://bitbucket.org/lindenlab/viewer</string>
<key>copyright</key>
<string>Copyright (c) 2020, The Phoenix Firestorm Project, Inc.</string>
<key>description</key>

View File

@ -259,6 +259,23 @@ then
export additional_packages=
fi
begin_section "select viewer channel"
# Look for a branch-specific viewer_channel setting
# changeset_branch is set in the sling-buildscripts
viewer_build_branch=$(echo -n "${changeset_branch:-$(repo_branch ${BUILDSCRIPTS_SRC:-$(pwd)})}" | tr -Cs 'A-Za-z0-9_' '_' | sed -E 's/^_+//; s/_+$//')
if [ -n "$viewer_build_branch" ]
then
branch_viewer_channel_var="${viewer_build_branch}_viewer_channel"
if [ -n "${!branch_viewer_channel_var}" ]
then
viewer_channel="${!branch_viewer_channel_var}"
record_event "Overriding viewer_channel for branch '$changeset_branch' to '$viewer_channel'"
else
record_event "No branch-specific viewer_channel for branch '$viewer_build_branch'; to set a branch build channel set '$branch_viewer_channel_var'"
fi
fi
end_section "select viewer channel"
python_cmd "$helpers/codeticket.py" addinput "Viewer Channel" "${viewer_channel}"
initialize_version # provided by buildscripts build.sh; sets version id

View File

@ -47,10 +47,18 @@ static LLDefaultChildRegistry::Register<LLCheckBoxCtrl> r("check_box");
template class LLCheckBoxCtrl* LLView::getChild<class LLCheckBoxCtrl>(
const std::string& name, BOOL recurse) const;
void LLCheckBoxCtrl::WordWrap::declareValues()
{
declare("none", EWordWrap::WRAP_NONE);
declare("down", EWordWrap::WRAP_DOWN);
declare("up", EWordWrap::WRAP_UP);
}
LLCheckBoxCtrl::Params::Params()
: initial_value("initial_value", false),
label_text("label_text"),
check_button("check_button"),
word_wrap("word_wrap", EWordWrap::WRAP_NONE),
// <FS:Ansariel> on_check callback parameter
on_check("on_check"),
// </FS:Ansariel>
@ -62,14 +70,14 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p)
: LLUICtrl(p),
mTextEnabledColor(p.label_text.text_color()),
mTextDisabledColor(p.label_text.text_readonly_color()),
mFont(p.font())
mFont(p.font()),
mWordWrap(p.word_wrap)
{
mViewModel->setValue(LLSD(p.initial_value));
mViewModel->resetDirty();
static LLUICachedControl<S32> llcheckboxctrl_spacing ("UICheckboxctrlSpacing", 0);
static LLUICachedControl<S32> llcheckboxctrl_hpad ("UICheckboxctrlHPad", 0);
static LLUICachedControl<S32> llcheckboxctrl_vpad ("UICheckboxctrlVPad", 0);
static LLUICachedControl<S32> llcheckboxctrl_btn_size ("UICheckboxctrlBtnSize", 0);
// must be big enough to hold all children
setUseBoundingRect(TRUE);
@ -88,17 +96,35 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p)
{
tbparams.font(p.font);
}
mLabel = LLUICtrlFactory::create<LLTextBox> (tbparams);
mLabel = LLUICtrlFactory::create<LLTextBox>(tbparams);
if (mWordWrap != WRAP_NONE)
{
// Not setWordWrap(mWordWrap != WRAP_NONE) because there might be some old lurking code that sets it manually
mLabel->setWordWrap(true);
S32 new_width = getRect().getWidth() - p.check_button.rect().getWidth() - llcheckboxctrl_hpad;
LLRect label_rect = mLabel->getRect();
label_rect.mRight = label_rect.mLeft + new_width;
mLabel->setRect(label_rect);
}
mLabel->reshapeToFitText();
LLRect label_rect = mLabel->getRect();
if (mLabel->getLineCount() > 1)
{
// reshapeToFitText uses LLView::reshape() which always reshapes
// from bottom to top, but we want to extend the bottom
// Note: might be better idea to use getRect().mTop of LLCheckBoxCtrl (+pad) as top point of new rect
S32 delta = ll_round((F32)mLabel->getFont()->getLineHeight() * mLabel->getLineSpacingMult()) - label_rect.getHeight();
label_rect.translate(0, delta);
mLabel->setRect(label_rect);
if (mWordWrap == WRAP_DOWN)
{
// reshapeToFitText uses LLView::reshape() which always reshapes
// from bottom to top, but we want to extend the bottom
// Note: might be better idea to use getRect().mTop of LLCheckBoxCtrl (+pad) as top point of new rect
S32 delta = ll_round((F32)mLabel->getFont()->getLineHeight() * mLabel->getLineSpacingMult()) - label_rect.getHeight();
label_rect.translate(0, delta);
mLabel->setRect(label_rect);
}
// else
// WRAP_UP is essentially done by reshapeToFitText() (extends from bottom to top)
// howhever it doesn't respect rect of checkbox
// todo: this should be fixed, but there are at least couple checkboxes that use this feature as is.
}
addChild(mLabel);
@ -175,7 +201,7 @@ void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent)
mLabel->reshapeToFitText();
LLRect label_rect = mLabel->getRect();
if (label_top != label_rect.mTop)
if (label_top != label_rect.mTop && mWordWrap == WRAP_DOWN)
{
// reshapeToFitText uses LLView::reshape() which always reshapes
// from bottom to top, but we want to extend the bottom so

View File

@ -50,6 +50,19 @@ class LLCheckBoxCtrl
, public ll::ui::SearchableControl
{
public:
enum EWordWrap
{
WRAP_NONE,
WRAP_UP,
WRAP_DOWN
};
struct WordWrap : public LLInitParam::TypeValuesHelper<EWordWrap, WordWrap>
{
static void declareValues();
};
struct Params
: public LLInitParam::Block<Params, LLUICtrl::Params>
{
@ -58,6 +71,8 @@ public:
Optional<LLTextBox::Params> label_text;
Optional<LLButton::Params> check_button;
Optional<EWordWrap, WordWrap> word_wrap;
// <FS:Ansariel> on_check callback parameter
Optional<EnableCallbackParam> on_check;
// </FS:Ansariel>
@ -145,6 +160,8 @@ protected:
LLUIColor mTextEnabledColor;
LLUIColor mTextDisabledColor;
EWordWrap mWordWrap; // off, shifts text up, shifts text down
};
// Build time optimization, generate once in .cpp file

View File

@ -551,16 +551,19 @@ void LLPanelLogin::populateFields(LLPointer<LLCredential> credential, bool remem
LL_WARNS() << "Attempted fillFields with no login view shown" << LL_ENDL;
return;
}
LLUICtrl* remember_check = sInstance->getChild<LLUICtrl>("remember_check");
remember_check->setValue(remember_psswrd);
if (sInstance->mFirstLoginThisInstall)
{
LLUICtrl* remember_check = sInstance->getChild<LLUICtrl>("remember_check");
remember_check->setValue(remember_psswrd);
// no list to populate
setFields(credential);
}
else
{
sInstance->getChild<LLUICtrl>("remember_name")->setValue(remember_user);
LLUICtrl* remember_password = sInstance->getChild<LLUICtrl>("remember_password");
remember_password->setValue(remember_psswrd);
remember_password->setEnabled(remember_user);
sInstance->populateUserList(credential);
}
}
@ -748,13 +751,14 @@ void LLPanelLogin::getFields(LLPointer<LLCredential>& credential,
}
}
credential = gSecAPIHandler->createCredential(LLGridManager::getInstance()->getGrid(), identifier, authenticator);
remember_psswrd = sInstance->getChild<LLUICtrl>("remember_check")->getValue();
if (!sInstance->mFirstLoginThisInstall)
{
remember_psswrd = sInstance->getChild<LLUICtrl>("remember_password")->getValue();
remember_user = sInstance->getChild<LLUICtrl>("remember_name")->getValue();
}
else
{
remember_psswrd = sInstance->getChild<LLUICtrl>("remember_check")->getValue();
remember_user = remember_psswrd; // on panel_login_first "remember_check" is named as 'remember me'
}
}
@ -1082,6 +1086,7 @@ void LLPanelLogin::onUserNameTextEnty(void*)
{
sInstance->mPasswordModified = true;
sInstance->getChild<LLUICtrl>("password_edit")->setValue(std::string());
sInstance->mPasswordLength = 0;
sInstance->addFavoritesToStartLocation(); //will call updateLoginButtons()
}
@ -1121,7 +1126,7 @@ void LLPanelLogin::onRememberUserCheck(void*)
if (sInstance && !sInstance->mFirstLoginThisInstall)
{
LLCheckBoxCtrl* remember_name(sInstance->getChild<LLCheckBoxCtrl>("remember_name"));
LLCheckBoxCtrl* remember_psswrd(sInstance->getChild<LLCheckBoxCtrl>("remember_check"));
LLCheckBoxCtrl* remember_psswrd(sInstance->getChild<LLCheckBoxCtrl>("remember_password"));
LLComboBox* user_combo(sInstance->getChild<LLComboBox>("username_combo"));
bool remember = remember_name->getValue().asBoolean();
@ -1181,6 +1186,8 @@ void LLPanelLogin::updateServer()
// restore creds
user_combo->setTextEntry(username);
pswd_edit->setValue(password);
sInstance->mUsernameLength = username.length();
sInstance->mPasswordLength = password.length();
}
else
{

View File

@ -135,10 +135,11 @@
bottom_delta="21"
height="24"
label="Remember me"
word_wrap="down"
check_button.bottom="3"
name="remember_name"
tool_tip="Already remembered user can be forgotten from Me &gt; Preferences &gt; Advanced &gt; Remembered Usernames."
width="145" />
width="198" />
<check_box
control_name="RememberPassword"
follows="left|top"
@ -148,11 +149,10 @@
left="408"
bottom_delta="0"
label="Remember password"
label_text.word_wrap="true"
label_text.width="150"
word_wrap="down"
check_button.bottom="3"
name="remember_check"
width="170" />
name="remember_password"
width="165" />
<combo_box
allow_text_entry="false"
font="SansSerifTiny"