diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000..0b19cae838 --- /dev/null +++ b/.clang-format @@ -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 +... + diff --git a/.gitignore b/.gitignore deleted file mode 100755 index 5a1ac105cb..0000000000 --- a/.gitignore +++ /dev/null @@ -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 diff --git a/autobuild.xml b/autobuild.xml index f49b5626e6..25b577425a 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3825,7 +3825,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors package_description canonical_repo - https://bitbucket.org/lindenlab/viewer-release + https://bitbucket.org/lindenlab/viewer copyright Copyright (c) 2020, The Phoenix Firestorm Project, Inc. description diff --git a/build.sh b/build.sh index c1dcb94cea..96d1c32d08 100755 --- a/build.sh +++ b/build.sh @@ -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 diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 73c59bc62b..1421edf9f0 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -47,10 +47,18 @@ static LLDefaultChildRegistry::Register r("check_box"); template class LLCheckBoxCtrl* LLView::getChild( 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), // on_check callback parameter on_check("on_check"), // @@ -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 llcheckboxctrl_spacing ("UICheckboxctrlSpacing", 0); static LLUICachedControl llcheckboxctrl_hpad ("UICheckboxctrlHPad", 0); static LLUICachedControl llcheckboxctrl_vpad ("UICheckboxctrlVPad", 0); - static LLUICachedControl 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 (tbparams); + + mLabel = LLUICtrlFactory::create(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 diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h index 41110b9ae0..031a69a772 100644 --- a/indra/llui/llcheckboxctrl.h +++ b/indra/llui/llcheckboxctrl.h @@ -50,6 +50,19 @@ class LLCheckBoxCtrl , public ll::ui::SearchableControl { public: + + enum EWordWrap + { + WRAP_NONE, + WRAP_UP, + WRAP_DOWN + }; + + struct WordWrap : public LLInitParam::TypeValuesHelper + { + static void declareValues(); + }; + struct Params : public LLInitParam::Block { @@ -58,6 +71,8 @@ public: Optional label_text; Optional check_button; + Optional word_wrap; + // on_check callback parameter Optional on_check; // @@ -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 diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index d717b3dea4..35f96d8b18 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -551,16 +551,19 @@ void LLPanelLogin::populateFields(LLPointer credential, bool remem LL_WARNS() << "Attempted fillFields with no login view shown" << LL_ENDL; return; } - LLUICtrl* remember_check = sInstance->getChild("remember_check"); - remember_check->setValue(remember_psswrd); if (sInstance->mFirstLoginThisInstall) { + LLUICtrl* remember_check = sInstance->getChild("remember_check"); + remember_check->setValue(remember_psswrd); // no list to populate setFields(credential); } else { sInstance->getChild("remember_name")->setValue(remember_user); + LLUICtrl* remember_password = sInstance->getChild("remember_password"); + remember_password->setValue(remember_psswrd); + remember_password->setEnabled(remember_user); sInstance->populateUserList(credential); } } @@ -748,13 +751,14 @@ void LLPanelLogin::getFields(LLPointer& credential, } } credential = gSecAPIHandler->createCredential(LLGridManager::getInstance()->getGrid(), identifier, authenticator); - remember_psswrd = sInstance->getChild("remember_check")->getValue(); if (!sInstance->mFirstLoginThisInstall) { + remember_psswrd = sInstance->getChild("remember_password")->getValue(); remember_user = sInstance->getChild("remember_name")->getValue(); } else { + remember_psswrd = sInstance->getChild("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("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("remember_name")); - LLCheckBoxCtrl* remember_psswrd(sInstance->getChild("remember_check")); + LLCheckBoxCtrl* remember_psswrd(sInstance->getChild("remember_password")); LLComboBox* user_combo(sInstance->getChild("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 { diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 9da0c815ed..ade004f9d0 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -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 > Preferences > Advanced > Remembered Usernames." - width="145" /> + width="198" /> + name="remember_password" + width="165" />