From 749cf1b257267dee5ba7339d5269b1b103f28dc0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 15 Apr 2015 14:15:43 +0300 Subject: MAINT-5024 new crash in LLInspectToast --- indra/newview/llinspecttoast.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp index d04378daaf..47560341e7 100755 --- a/indra/newview/llinspecttoast.cpp +++ b/indra/newview/llinspecttoast.cpp @@ -47,6 +47,7 @@ public: /*virtual*/ void onOpen(const LLSD& notification_id); /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); + /*virtual*/ void removeChild(LLView* child); private: void onToastDestroy(LLToast * toast); @@ -98,7 +99,7 @@ void LLInspectToast::onOpen(const LLSD& notification_id) panel->setMouseOpaque(FALSE); if(mPanel != NULL && mPanel->getParent() == this) { - removeChild(mPanel); + LLInspect::removeChild(mPanel); } addChild(panel); panel->setFocus(TRUE); @@ -121,6 +122,16 @@ BOOL LLInspectToast::handleToolTip(S32 x, S32 y, MASK mask) return LLFloater::handleToolTip(x, y, mask); } +// virtual +void LLInspectToast::removeChild(LLView* child) +{ + if (mPanel == child) + { + mPanel = NULL; + } + LLInspect::removeChild(child); +} + void LLInspectToast::onToastDestroy(LLToast * toast) { closeFloater(false); -- cgit v1.2.3 From b2200f06dacfde4fe62a8f7f252e941c65d71c72 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 22 Apr 2015 16:06:48 -0400 Subject: MAINT-5147: correct menu colors for test viewers --- indra/newview/llappviewer.cpp | 4 +-- indra/newview/llversioninfo.cpp | 40 ++++++++++++++++++++++++++++ indra/newview/llversioninfo.h | 9 +++++++ indra/newview/llviewerwindow.cpp | 56 +++++++++++++++++++++------------------- 4 files changed, 80 insertions(+), 29 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 54c5d1b9f4..2150955a32 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3088,8 +3088,8 @@ void LLAppViewer::initUpdater() U32 check_period = gSavedSettings.getU32("UpdaterServiceCheckPeriod"); bool willing_to_test; LL_DEBUGS("UpdaterService") << "channel " << channel << LL_ENDL; - static const boost::regex is_test_channel("\\bTest$"); - if (boost::regex_search(channel, is_test_channel)) + + if (LLVersionInfo::TEST_VIEWER == LLVersionInfo::getViewerMaturity()) { LL_INFOS("UpdaterService") << "Test build: overriding willing_to_test by sending testno" << LL_ENDL; willing_to_test = false; diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 6a8fad0134..178ea3d50e 100755 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -133,3 +133,43 @@ void LLVersionInfo::resetChannel(const std::string& channel) sWorkingChannelName = channel; sVersionChannel.clear(); // Reset version and channel string til next use. } + +//static +ViewerMaturity getViewerMaturity() +{ + ViewerMaturity maturity; + + std::string channel = getChannel(); + + static const boost::regex is_test_channel("\\bTest\\b"); + static const boost::regex is_beta_channel("\\bBeta\\b"); + static const boost::regex is_project_channel("\\bProject\\b"); + static const boost::regex is_release_channel("\\bRelease\\b"); + + if (boost::regex_search(channel, is_release_channel)) + { + maturity = RELEASE_VIEWER; + } + else if (boost::regex_search(channel, is_beta_channel)) + { + maturity = BETA_VIEWER; + } + else if (boost::regex_search(channel, is_project_channel)) + { + maturity = PROJECT_VIEWER; + } + else if (boost::regex_search(channel, is_test_channel)) + { + maturity = TEST_VIEWER; + } + else + { + LL_WARNS() << "Channel '" << channel + << "' does not follow naming convention, assuming Test" + << LL_ENDL; + maturity = TEST_VIEWER; + } + return maturity; +} + + diff --git a/indra/newview/llversioninfo.h b/indra/newview/llversioninfo.h index 077105cae8..4e75535ec5 100755 --- a/indra/newview/llversioninfo.h +++ b/indra/newview/llversioninfo.h @@ -68,6 +68,15 @@ public: /// reset the channel name used by the viewer. static void resetChannel(const std::string& channel); + + typedef enum + { + TEST_VIEWER, + PROJECT_VIEWER, + BETA_VIEWER, + RELEASE_VIEWER + } ViewerMaturity; + static ViewerMaturity getViewerMaturity(); }; #endif diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 756248a356..1f08641008 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2336,12 +2336,6 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid) LLSD args; LLColor4 new_bg_color; - // no l10n problem because channel is always an english string - std::string channel = LLVersionInfo::getChannel(); - static const boost::regex is_beta_channel("\\bBeta\\b"); - static const boost::regex is_project_channel("\\bProject\\b"); - static const boost::regex is_test_channel("\\bTest$"); - // god more important than project, proj more important than grid if ( god_mode ) { @@ -2354,27 +2348,35 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid) new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionGodBgColor" ); } } - else if (boost::regex_search(channel, is_beta_channel)) - { - new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBetaBgColor" ); - } - else if (boost::regex_search(channel, is_project_channel)) - { - new_bg_color = LLUIColorTable::instance().getColor( "MenuBarProjectBgColor" ); - } - else if (boost::regex_search(channel, is_test_channel)) - { - new_bg_color = LLUIColorTable::instance().getColor( "MenuBarTestBgColor" ); - } - else if(!LLGridManager::getInstance()->isInProductionGrid()) - { - new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" ); - } - else - { - new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBgColor" ); - } - + else + { + switch (LLVersionInfo::getViewerMaturity()) + { + case LLVersionInfo::TEST_VIEWER: + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarTestBgColor" ); + break; + + case LLVersionInfo::PROJECT_VIEWER: + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarProjectBgColor" ); + break; + + case LLVersionInfo::BETA_VIEWER: + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBetaBgColor" ); + break; + + case LLVersionInfo::RELEASE_VIEWER: + if(!LLGridManager::getInstance()->isInProductionGrid()) + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" ); + } + else + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBgColor" ); + } + break; + } + } + if(gMenuBarView) { gMenuBarView->setBackgroundColor( new_bg_color ); -- cgit v1.2.3 From a6a428910cccdbf4ef137399c09be185226dd8f5 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 28 Apr 2015 13:54:15 +0300 Subject: build fix --- indra/newview/llversioninfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index ec831738a9..e53de8be32 100755 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -29,6 +29,7 @@ #include #include #include "llversioninfo.h" +#include #if ! defined(LL_VIEWER_CHANNEL) \ || ! defined(LL_VIEWER_VERSION_MAJOR) \ @@ -133,7 +134,7 @@ void LLVersionInfo::resetChannel(const std::string& channel) } //static -ViewerMaturity getViewerMaturity() +LLVersionInfo::ViewerMaturity LLVersionInfo::getViewerMaturity() { ViewerMaturity maturity; -- cgit v1.2.3 From 6de01b2b12f12e3a31259dd040c0d1014b3bab60 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Tue, 5 May 2015 21:09:33 +0300 Subject: Hotfix for build on OSX with -Werror,-Wtautological-compare --- indra/llimage/llimage.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 7645034bd9..08462c7834 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -197,9 +197,7 @@ private: { pos = val >> 16; - if (pos < 0) - vp[j] = 0; - else if (pos >= (srcSz - 1)) + if (pos >= (srcSz - 1)) vp[j] = 0; else vp[j] = (val >> 8) - ((val >> 8) & 0xffffff00); -- cgit v1.2.3 From 4647dc6fe7aacccf089d214bf26b47f417bd7ae6 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Wed, 6 May 2015 16:55:32 +0300 Subject: Fixed Mac build after tools update - stripped unsused symbols --- indra/newview/llfloatersnapshot.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index bf127102c1..185765e390 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -56,7 +56,6 @@ LLSnapshotFloaterView* gSnapshotFloaterView = NULL; const F32 AUTO_SNAPSHOT_TIME_DELAY = 1.f; -const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512 static LLDefaultChildRegistry::Register r("snapshot_floater_view"); -- cgit v1.2.3 From 064d0fec06b49abeef5ddfaec5abd6fae7e0cf03 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Tue, 9 Jun 2015 20:01:53 +0300 Subject: MAINT-5259 FIXED Login screen displayed on English after installation on other language --- indra/newview/installers/windows/installer_template.nsi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 8c8b4971cf..95cdf90e99 100755 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -298,6 +298,11 @@ CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" \ CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ '"$INSTDIR\uninst.exe"' '' +# Create *.bat file to specify lang params on first run from installer - see MAINT-5259 +FileOpen $9 "$INSTDIR\autorun.bat" w +FileWrite $9 'start "$INSTDIR\$INSTEXE" "$INSTDIR\$INSTEXE" $SHORTCUT_LANG_PARAM$\r$\n' +FileClose $9 + # Write registry WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" "$INSTDIR" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" "${VERSION_LONG}" @@ -682,7 +687,7 @@ Call CheckWindowsServPack # Warn if not on the latest SP before asking to launc Push $R0 # Option value, unused StrCmp $SKIP_AUTORUN "true" +2; # Assumes SetOutPath $INSTDIR - Exec '"$WINDIR\explorer.exe" "$INSTDIR\$INSTEXE"' + Exec '"$WINDIR\explorer.exe" "$INSTDIR\autorun.bat"' Pop $R0 FunctionEnd -- cgit v1.2.3 From 604914a7bd309de176901b9d14991e525a90d649 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 7 May 2015 16:22:44 +0300 Subject: MAINT-4812 Restore sending snapshot as email from the viewer. --- indra/newview/CMakeLists.txt | 1 + indra/newview/llfloatersnapshot.cpp | 30 ++- indra/newview/llfloatersnapshot.h | 1 + indra/newview/llpanelsnapshotoptions.cpp | 7 + indra/newview/llpanelsnapshotpostcard.cpp | 244 +++++++++++++++++++++ indra/newview/llsnapshotlivepreview.cpp | 2 +- indra/newview/llsnapshotlivepreview.h | 2 +- indra/newview/llviewermessage.cpp | 1 + .../default/xui/de/panel_snapshot_postcard.xml | 21 ++ .../skins/default/xui/en/floater_snapshot.xml | 6 + .../default/xui/en/panel_snapshot_options.xml | 17 ++ .../default/xui/en/panel_snapshot_postcard.xml | 103 +++++++++ .../default/xui/es/panel_snapshot_postcard.xml | 18 ++ .../default/xui/fr/panel_snapshot_postcard.xml | 18 ++ .../default/xui/it/panel_snapshot_postcard.xml | 18 ++ .../default/xui/ja/panel_snapshot_postcard.xml | 18 ++ .../default/xui/pt/panel_snapshot_postcard.xml | 18 ++ .../default/xui/ru/panel_snapshot_postcard.xml | 18 ++ .../default/xui/tr/panel_snapshot_postcard.xml | 18 ++ .../default/xui/zh/panel_snapshot_postcard.xml | 18 ++ 20 files changed, 575 insertions(+), 4 deletions(-) create mode 100644 indra/newview/llpanelsnapshotpostcard.cpp create mode 100644 indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml create mode 100644 indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml create mode 100644 indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml create mode 100644 indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml create mode 100644 indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml create mode 100644 indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml create mode 100644 indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml create mode 100644 indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml create mode 100644 indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml create mode 100644 indra/newview/skins/default/xui/zh/panel_snapshot_postcard.xml (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 3d7fd5bc5e..13040ea423 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -464,6 +464,7 @@ set(viewer_SOURCE_FILES llpanelsnapshotinventory.cpp llpanelsnapshotlocal.cpp llpanelsnapshotoptions.cpp + llpanelsnapshotpostcard.cpp llpanelsnapshotprofile.cpp llpanelteleporthistory.cpp llpaneltiptoast.cpp diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 185765e390..16fa4684ab 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -56,6 +56,7 @@ LLSnapshotFloaterView* gSnapshotFloaterView = NULL; const F32 AUTO_SNAPSHOT_TIME_DELAY = 1.f; +const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512 static LLDefaultChildRegistry::Register r("snapshot_floater_view"); @@ -168,7 +169,11 @@ LLSnapshotLivePreview::ESnapshotType LLFloaterSnapshot::Impl::getActiveSnapshotT name = spanel->getName(); } - if (name == "panel_snapshot_inventory") + if (name == "panel_snapshot_postcard") + { + type = LLSnapshotLivePreview::SNAPSHOT_POSTCARD; + } + else if (name == "panel_snapshot_inventory") { type = LLSnapshotLivePreview::SNAPSHOT_TEXTURE; } @@ -419,6 +424,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) } LLSnapshotLivePreview* previewp = getPreviewView(floater); + BOOL got_bytes = previewp && previewp->getDataSize() > 0; BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); // *TODO: Separate maximum size for Web images from postcards @@ -441,7 +447,10 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) } floater->getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : floater->getString("unknown")); - floater->getChild("file_size_label")->setColor(LLUIColorTable::instance().getColor( "LabelTextColor" )); + floater->getChild("file_size_label")->setColor( + shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD + && got_bytes + && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" )); // Update the width and height spinners based on the corresponding resolution combos. (?) switch(shot_type) @@ -451,6 +460,11 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) floater->getChild("layer_types")->setValue("colors"); setResolution(floater, "profile_size_combo"); break; + case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: + layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; + floater->getChild("layer_types")->setValue("colors"); + setResolution(floater, "postcard_size_combo"); + break; case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; floater->getChild("layer_types")->setValue("colors"); @@ -1446,6 +1460,18 @@ const LLVector3d& LLFloaterSnapshot::getPosTakenGlobal() return previewp->getPosTakenGlobal(); } +// static +void LLFloaterSnapshot::setAgentEmail(const std::string& email) +{ + LLFloaterSnapshot* instance = findInstance(); + if (instance) + { + LLSideTrayPanelContainer* panel_container = instance->getChild("panel_container"); + LLPanel* postcard_panel = panel_container->getPanelByName("panel_snapshot_postcard"); + postcard_panel->notify(LLSD().with("agent-email", email)); + } +} + ///---------------------------------------------------------------------------- /// Class LLSnapshotFloaterView ///---------------------------------------------------------------------------- diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index 5bcf1d3099..0bb9474bb5 100755 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -63,6 +63,7 @@ public: static void postPanelSwitch(); static LLPointer getImageData(); static const LLVector3d& getPosTakenGlobal(); + static void setAgentEmail(const std::string& email); static const LLRect& getThumbnailPlaceholderRect() { return sThumbnailPlaceholder->getRect(); } diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp index f41bdd8881..0fc9ceec83 100755 --- a/indra/newview/llpanelsnapshotoptions.cpp +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -56,6 +56,7 @@ private: void updateUploadCost(); void openPanel(const std::string& panel_name); void onSaveToProfile(); + void onSaveToEmail(); void onSaveToInventory(); void onSaveToComputer(); void onSendToFacebook(); @@ -68,6 +69,7 @@ static LLPanelInjector panel_class("llpanelsnapshotoptio LLPanelSnapshotOptions::LLPanelSnapshotOptions() { mCommitCallbackRegistrar.add("Snapshot.SaveToProfile", boost::bind(&LLPanelSnapshotOptions::onSaveToProfile, this)); + mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToComputer", boost::bind(&LLPanelSnapshotOptions::onSaveToComputer, this)); mCommitCallbackRegistrar.add("Snapshot.SendToFacebook", boost::bind(&LLPanelSnapshotOptions::onSendToFacebook, this)); @@ -118,6 +120,11 @@ void LLPanelSnapshotOptions::onSaveToProfile() openPanel("panel_snapshot_profile"); } +void LLPanelSnapshotOptions::onSaveToEmail() +{ + openPanel("panel_snapshot_postcard"); +} + void LLPanelSnapshotOptions::onSaveToInventory() { openPanel("panel_snapshot_inventory"); diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp new file mode 100644 index 0000000000..8e37b1418c --- /dev/null +++ b/indra/newview/llpanelsnapshotpostcard.cpp @@ -0,0 +1,244 @@ +/** + * @file llpanelsnapshotpostcard.cpp + * @brief Postcard sending panel. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llcombobox.h" +#include "llnotificationsutil.h" +#include "llsidetraypanelcontainer.h" +#include "llsliderctrl.h" +#include "llspinctrl.h" +#include "lltexteditor.h" + +#include "llagent.h" +#include "llagentui.h" +#include "llfloatersnapshot.h" // FIXME: replace with a snapshot storage model +#include "llpanelsnapshot.h" +#include "llpostcard.h" +#include "llviewercontrol.h" // gSavedSettings +#include "llviewerwindow.h" + +#include + +/** + * Sends postcard via email. + */ +class LLPanelSnapshotPostcard +: public LLPanelSnapshot +{ + LOG_CLASS(LLPanelSnapshotPostcard); + +public: + LLPanelSnapshotPostcard(); + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ S32 notify(const LLSD& info); + +private: + /*virtual*/ std::string getWidthSpinnerName() const { return "postcard_snapshot_width"; } + /*virtual*/ std::string getHeightSpinnerName() const { return "postcard_snapshot_height"; } + /*virtual*/ std::string getAspectRatioCBName() const { return "postcard_keep_aspect_check"; } + /*virtual*/ std::string getImageSizeComboName() const { return "postcard_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const { return "postcard_image_size_lp"; } + /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; } + /*virtual*/ void updateControls(const LLSD& info); + + bool missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response); + void sendPostcard(); + + void onMsgFormFocusRecieved(); + void onFormatComboCommit(LLUICtrl* ctrl); + void onQualitySliderCommit(LLUICtrl* ctrl); + void onSend(); + + bool mHasFirstMsgFocus; + std::string mAgentEmail; +}; + +static LLPanelInjector panel_class("llpanelsnapshotpostcard"); + +LLPanelSnapshotPostcard::LLPanelSnapshotPostcard() +: mHasFirstMsgFocus(false) +{ + mCommitCallbackRegistrar.add("Postcard.Send", boost::bind(&LLPanelSnapshotPostcard::onSend, this)); + mCommitCallbackRegistrar.add("Postcard.Cancel", boost::bind(&LLPanelSnapshotPostcard::cancel, this)); + +} + +// virtual +BOOL LLPanelSnapshotPostcard::postBuild() +{ + // pick up the user's up-to-date email address + gAgent.sendAgentUserInfoRequest(); + + std::string name_string; + LLAgentUI::buildFullname(name_string); + getChild("name_form")->setValue(LLSD(name_string)); + + // For the first time a user focuses to .the msg box, all text will be selected. + getChild("msg_form")->setFocusChangedCallback(boost::bind(&LLPanelSnapshotPostcard::onMsgFormFocusRecieved, this)); + + getChild("to_form")->setFocus(TRUE); + + getChild("image_quality_slider")->setCommitCallback(boost::bind(&LLPanelSnapshotPostcard::onQualitySliderCommit, this, _1)); + + return LLPanelSnapshot::postBuild(); +} + +// virtual +void LLPanelSnapshotPostcard::onOpen(const LLSD& key) +{ + LLPanelSnapshot::onOpen(key); +} + +// virtual +S32 LLPanelSnapshotPostcard::notify(const LLSD& info) +{ + if (!info.has("agent-email")) + { + llassert(info.has("agent-email")); + return 0; + } + + if (mAgentEmail.empty()) + { + mAgentEmail = info["agent-email"].asString(); + } + + return 1; +} + +// virtual +void LLPanelSnapshotPostcard::updateControls(const LLSD& info) +{ + getChild("image_quality_slider")->setValue(gSavedSettings.getS32("SnapshotQuality")); + updateImageQualityLevel(); + + const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; + getChild("send_btn")->setEnabled(have_snapshot); +} + +bool LLPanelSnapshotPostcard::missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if(0 == option) + { + // User clicked OK + if((getChild("subject_form")->getValue().asString()).empty()) + { + // Stuff the subject back into the form. + getChild("subject_form")->setValue(getString("default_subject")); + } + + if (!mHasFirstMsgFocus) + { + // The user never switched focus to the message window. + // Using the default string. + getChild("msg_form")->setValue(getString("default_message")); + } + + sendPostcard(); + } + return false; +} + + +void LLPanelSnapshotPostcard::sendPostcard() +{ + std::string to(getChild("to_form")->getValue().asString()); + std::string subject(getChild("subject_form")->getValue().asString()); + + LLSD postcard = LLSD::emptyMap(); + postcard["pos-global"] = LLFloaterSnapshot::getPosTakenGlobal().getValue(); + postcard["to"] = to; + postcard["from"] = mAgentEmail; + postcard["name"] = getChild("name_form")->getValue().asString(); + postcard["subject"] = subject; + postcard["msg"] = getChild("msg_form")->getValue().asString(); + LLPostCard::send(LLFloaterSnapshot::getImageData(), postcard); + + // Give user feedback of the event. + gViewerWindow->playSnapshotAnimAndSound(); + + LLFloaterSnapshot::postSave(); +} + +void LLPanelSnapshotPostcard::onMsgFormFocusRecieved() +{ + LLTextEditor* msg_form = getChild("msg_form"); + if (msg_form->hasFocus() && !mHasFirstMsgFocus) + { + mHasFirstMsgFocus = true; + msg_form->setText(LLStringUtil::null); + } +} + +void LLPanelSnapshotPostcard::onFormatComboCommit(LLUICtrl* ctrl) +{ + // will call updateControls() + LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true)); +} + +void LLPanelSnapshotPostcard::onQualitySliderCommit(LLUICtrl* ctrl) +{ + updateImageQualityLevel(); + + LLSliderCtrl* slider = (LLSliderCtrl*)ctrl; + S32 quality_val = llfloor((F32)slider->getValue().asReal()); + LLSD info; + info["image-quality-change"] = quality_val; + LLFloaterSnapshot::getInstance()->notify(info); // updates the "SnapshotQuality" setting +} + +void LLPanelSnapshotPostcard::onSend() +{ + // Validate input. + std::string to(getChild("to_form")->getValue().asString()); + + boost::regex email_format("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})*"); + + if (to.empty() || !boost::regex_match(to, email_format)) + { + LLNotificationsUtil::add("PromptRecipientEmail"); + return; + } + + if (mAgentEmail.empty() || !boost::regex_match(mAgentEmail, email_format)) + { + LLNotificationsUtil::add("PromptSelfEmail"); + return; + } + + std::string subject(getChild("subject_form")->getValue().asString()); + if(subject.empty() || !mHasFirstMsgFocus) + { + LLNotificationsUtil::add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLPanelSnapshotPostcard::missingSubjMsgAlertCallback, this, _1, _2)); + return; + } + + // Send postcard. + sendPostcard(); +} diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 0b2831cfa4..0ae8a338e0 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -86,7 +86,7 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Param mNeedsFlash(TRUE), mSnapshotQuality(gSavedSettings.getS32("SnapshotQuality")), mDataSize(0), - mSnapshotType(SNAPSHOT_LOCAL), + mSnapshotType(SNAPSHOT_POSTCARD), mSnapshotFormat(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat"))), mSnapshotUpToDate(FALSE), mCameraPos(LLViewerCamera::getInstance()->getOrigin()), diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h index f479de59d4..fed33bf37c 100644 --- a/indra/newview/llsnapshotlivepreview.h +++ b/indra/newview/llsnapshotlivepreview.h @@ -42,7 +42,7 @@ class LLSnapshotLivePreview : public LLView public: enum ESnapshotType { - SNAPSHOT_POSTCARD_DEPRECIATED, + SNAPSHOT_POSTCARD, SNAPSHOT_TEXTURE, SNAPSHOT_LOCAL, SNAPSHOT_WEB diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 353dde162b..c5fbdea69c 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -7118,6 +7118,7 @@ void process_user_info_reply(LLMessageSystem* msg, void**) msg->getString( "UserData", "DirectoryVisibility", dir_visibility); LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email); + LLFloaterSnapshot::setAgentEmail(email); } diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml new file mode 100644 index 0000000000..ead56f2885 --- /dev/null +++ b/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml @@ -0,0 +1,21 @@ + + + + Postkarte aus [SECOND_LIFE]. + + + Sehen Sie mal! + + + Senden... + + + E-Mail + + + + + + + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml new file mode 100644 index 0000000000..975b08be05 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml @@ -0,0 +1,103 @@ + + + + Postcard from [SECOND_LIFE]. + + + Check this out! + + + Sending... + + + + E-mail + + + + + + + + + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml new file mode 100644 index 0000000000..81a067a81b --- /dev/null +++ b/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml @@ -0,0 +1,18 @@ + + + + Postal desde [SECOND_LIFE]. + + + ¡Mira esto! + + + Enviando... + + + Correo-e + + + + + diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml new file mode 100644 index 0000000000..3f5ef04022 --- /dev/null +++ b/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml @@ -0,0 +1,18 @@ + + + + Carte postale de [SECOND_LIFE]. + + + Ouvrez-moi ! + + + Envoi en cours... + + + E-mail + + + + + diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml new file mode 100644 index 0000000000..333ce5c12b --- /dev/null +++ b/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml @@ -0,0 +1,18 @@ + + + + Cartolina da [SECOND_LIFE]. + + + Dai un'occhiata! + + + Invio... + + + E-mail + + + + + diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml new file mode 100644 index 0000000000..756df9ecc2 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml @@ -0,0 +1,18 @@ + + + + [SECOND_LIFE] からのポストカードです。 + + + ぜひご覧ください! + + + 送信中... + + + メール + + + + + diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml new file mode 100644 index 0000000000..efcbec66ba --- /dev/null +++ b/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml @@ -0,0 +1,18 @@ + + + + Postal do [SECOND_LIFE]. + + + Confira! + + + Enviando... + + + E-mail + + + + + diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml new file mode 100644 index 0000000000..6e1b3a7516 --- /dev/null +++ b/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml @@ -0,0 +1,18 @@ + + + + Открытка из [SECOND_LIFE]. + + + Побывай здесь! + + + Отправка... + + + Электронное письмо + + + + + diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml new file mode 100644 index 0000000000..9b9e60d2e0 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml @@ -0,0 +1,18 @@ + + + + SECOND_LIFE]'dan posta kartı. + + + Buna bakın! + + + Gönderiyor... + + + E-posta + + + + + diff --git a/indra/newview/skins/default/xui/zh/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/zh/panel_snapshot_postcard.xml new file mode 100644 index 0000000000..6dfeaf2505 --- /dev/null +++ b/indra/newview/skins/default/xui/zh/panel_snapshot_postcard.xml @@ -0,0 +1,18 @@ + + + + 來自 [SECOND_LIFE] 的明信片。 + + + 快來看看這個! + + + 傳送中... + + + 電郵 + + + + + -- cgit v1.2.3 From 5fd8a51f149ba5f05af1e10585c3aee457dc0193 Mon Sep 17 00:00:00 2001 From: MNikolenko ProductEngine Date: Thu, 7 May 2015 19:51:52 +0300 Subject: MAINT-4812 Restore sending snapshot as email from the viewer. --- indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml | 1 + indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml | 1 + indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml | 1 + indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml | 1 + indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml | 1 + indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml | 1 + indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml | 1 + indra/newview/skins/default/xui/zh/panel_snapshot_postcard.xml | 1 + 8 files changed, 8 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml index 81a067a81b..3373c29821 100644 --- a/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml +++ b/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml @@ -15,4 +15,5 @@ + diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml index 3f5ef04022..19e7b02cf8 100644 --- a/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml +++ b/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml @@ -15,4 +15,5 @@ + diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml index 333ce5c12b..e79e7aecbc 100644 --- a/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml +++ b/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml @@ -15,4 +15,5 @@ + diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml index 756df9ecc2..000a59117e 100644 --- a/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml +++ b/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml @@ -15,4 +15,5 @@ + diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml index efcbec66ba..08bc60996d 100644 --- a/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml +++ b/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml @@ -15,4 +15,5 @@ + diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml index 6e1b3a7516..fa8ca1f9b4 100644 --- a/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml +++ b/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml @@ -15,4 +15,5 @@ + diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml index 9b9e60d2e0..e9b36b70a7 100644 --- a/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml +++ b/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml @@ -15,4 +15,5 @@ + diff --git a/indra/newview/skins/default/xui/zh/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/zh/panel_snapshot_postcard.xml index 6dfeaf2505..a360822af5 100644 --- a/indra/newview/skins/default/xui/zh/panel_snapshot_postcard.xml +++ b/indra/newview/skins/default/xui/zh/panel_snapshot_postcard.xml @@ -15,4 +15,5 @@ + -- cgit v1.2.3