From 106967331113c15cf0aa7dcf8d16890c64f607bd Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Tue, 7 Jan 2020 15:34:08 -0700 Subject: [PATCH 1/7] Convert ignore file to git, add a .clang-format rules file --- .clang-format | 119 ++++++++++++++++++++++++++++++++++++++++ .hgignore => .gitignore | 84 +++++++++++++--------------- 2 files changed, 156 insertions(+), 47 deletions(-) create mode 100644 .clang-format rename .hgignore => .gitignore (64%) 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/.hgignore b/.gitignore similarity index 64% rename from .hgignore rename to .gitignore index 0d672e6ebc..27b629a578 100755 --- a/.hgignore +++ b/.gitignore @@ -1,45 +1,56 @@ -syntax: glob - -# WinMerge temp files -*.bak -# Compiled python bytecode -*.pyc -# Emacs temp files -*~ -.*.swp -#OSX image cache file +# By extension *.DS_Store -#*.orig +*.bak +*.diff +*.orig +*.pyc +*.rej +*.swp +*~ + +# Specific paths and/or names LICENSES -indra/.distcc -build-linux-* build-darwin-* -build-vc80/ -build-vc100/ -build-vc120/ -build-vc120-32/ -build-vc120-64/ -indra/build-vc[0-9]* +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/res/ll_icon.* +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 @@ -47,36 +58,15 @@ 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 -debian/secondlife-viewer* -debian/secondlife-appearance-utility* -debian/files -build-stamp -configure-stamp -^indra/lib/python/mulib.* -^web/locale.* -^web/secondlife.com.* -^web/config.* -^indra/web/dataservice/locale.* -^indra/web/dataservice/lib/shared/vault.* -^indra/web/dataservice/vendor.* -glob:indra/newview/dbghelp.dll -glob:*.cpp.orig -glob:*.cpp.bak -glob:*.h.bak -glob:*.h.orig -glob:indra/newview/typed_locations.txt -glob:indra/newview/teleport_history.txt -glob:indra/newview/search_history.txt -glob:indra/newview/filters.xml -glob:indra/newview/avatar_icons_cache.txt -glob:indra/newview/avatar_lad.log -glob:*.diff -indra/newview/pilot.txt -indra/newview/pilot.xml -*.rej +web/config.* +web/locale.* +web/secondlife.com.* \ No newline at end of file From c5be566a6fbf121d1ca140586a02cda18f83b11b Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 20 Jan 2020 14:43:48 +0200 Subject: [PATCH 2/7] SL-12596 Fixed incorectly enabled checkbox and enabled login button --- indra/newview/llpanellogin.cpp | 15 +++++++++++---- .../newview/skins/default/xui/en/panel_login.xml | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index cfa935cd01..7ef3685cdb 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -549,16 +549,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); } } @@ -746,13 +749,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' } } @@ -1080,6 +1084,7 @@ void LLPanelLogin::onUserNameTextEnty(void*) { sInstance->mPasswordModified = true; sInstance->getChild("password_edit")->setValue(std::string()); + sInstance->mPasswordLength = 0; sInstance->addFavoritesToStartLocation(); //will call updateLoginButtons() } @@ -1119,7 +1124,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(); @@ -1179,6 +1184,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..eab53c9985 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -151,7 +151,7 @@ label_text.word_wrap="true" label_text.width="150" check_button.bottom="3" - name="remember_check" + name="remember_password" width="170" /> Date: Mon, 20 Jan 2020 16:59:27 +0200 Subject: [PATCH 3/7] SL-12595 The checkbox overlaps buttons in the 'Delete selected item?' notification --- indra/llui/llcheckboxctrl.cpp | 46 +++++++++++++++---- indra/llui/llcheckboxctrl.h | 17 +++++++ .../skins/default/xui/en/panel_login.xml | 5 +- 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index f5b64d58b0..6a51c4240b 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), radio_style("radio_style") {} @@ -59,14 +67,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); @@ -85,17 +93,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); @@ -165,7 +191,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 07ae9c3b18..eb5bd5b6da 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; + Ignored radio_style; Params(); @@ -129,6 +144,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/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index eab53c9985..58352509c4 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -148,11 +148,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_password" - width="170" /> + width="165" /> Date: Mon, 20 Jan 2020 17:50:56 +0200 Subject: [PATCH 4/7] SL-9699 Enabled word-wrap for 'remember username' checkbox --- indra/newview/skins/default/xui/en/panel_login.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 58352509c4..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" /> Date: Tue, 28 Jan 2020 02:31:54 +0200 Subject: [PATCH 5/7] DRTVWR-496 Changed canonical_repo to lindenlab/viewer-dev --- autobuild.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autobuild.xml b/autobuild.xml index b182b7ae5d..4c2a105600 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3427,7 +3427,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors package_description canonical_repo - https://bitbucket.org/lindenlab/viewer-release + https://bitbucket.org/lindenlab/viewer-dev copyright Copyright (c) 2014, Linden Research, Inc. description From c5da1b0863871a22637d5281e3cf393e85467e9b Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 28 Jan 2020 18:28:07 +0200 Subject: [PATCH 6/7] DRTVWR-496 Changed canonical_repo to lindenlab/viewer --- autobuild.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autobuild.xml b/autobuild.xml index 4c2a105600..1f1db48bdc 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3427,7 +3427,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors package_description canonical_repo - https://bitbucket.org/lindenlab/viewer-dev + https://bitbucket.org/lindenlab/viewer copyright Copyright (c) 2014, Linden Research, Inc. description From 2c81050b689284886b30740ac226feaafeb54544 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 23 Jan 2020 11:35:09 -0500 Subject: [PATCH 7/7] SL-12615: Support a branch-specific setting for viewer_channel in TeamCity builds --- build.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build.sh b/build.sh index 1f9daa78b2..e35028ad6e 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