diff options
Diffstat (limited to 'indra/newview')
56 files changed, 938 insertions, 426 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 64bcf12b06..7d70b2a49b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -230,6 +230,7 @@ set(viewer_SOURCE_FILES llgroupiconctrl.cpp llgrouplist.cpp llgroupmgr.cpp + llhints.cpp llhomelocationresponder.cpp llhudeffect.cpp llhudeffectbeam.cpp @@ -300,6 +301,7 @@ set(viewer_SOURCE_FILES llnotificationalerthandler.cpp llnotificationgrouphandler.cpp llnotificationhandlerutil.cpp + llnotificationhinthandler.cpp llnotificationmanager.cpp llnotificationofferhandler.cpp llnotificationscripthandler.cpp @@ -754,6 +756,7 @@ set(viewer_HEADER_FILES llgroupiconctrl.h llgrouplist.h llgroupmgr.h + llhints.h llhomelocationresponder.h llhudeffect.h llhudeffectbeam.h @@ -1300,6 +1303,7 @@ set(viewer_APPSETTINGS_FILES app_settings/cmd_line.xml app_settings/grass.xml app_settings/high_graphics.xml + app_settings/ignorable_dialogs.xml app_settings/keys.ini app_settings/keywords.ini app_settings/logcontrol.xml diff --git a/indra/newview/app_settings/ignorable_dialogs.xml b/indra/newview/app_settings/ignorable_dialogs.xml index d0e1f62a84..0720ccee49 100644 --- a/indra/newview/app_settings/ignorable_dialogs.xml +++ b/indra/newview/app_settings/ignorable_dialogs.xml @@ -1,10 +1,10 @@ <?xml version="1.0" ?> <llsd> <map> - <key>FirstAppearance</key> + <key>FirstInventoryOffer</key> <map> <key>Comment</key> - <string>Enables FirstAppearance warning dialog</string> + <string>Shows hint when a person or object offers resident an inventory item</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -12,120 +12,54 @@ <key>Value</key> <integer>1</integer> </map> - <key>FirstAttach</key> - <map> - <key>Comment</key> - <string>Enables FirstAttach warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>FirstBalanceDecrease</key> - <map> - <key>Comment</key> - <string>Enables FirstBalanceDecrease warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>FirstBalanceIncrease</key> - <map> - <key>Comment</key> - <string>Enables FirstBalanceIncrease warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>FirstBuild</key> - <map> - <key>Comment</key> - <string>Enables FirstBuild warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>FirstDebugMenus</key> - <map> - <key>Comment</key> - <string>Enables FirstDebugMenus warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>FirstFlexible</key> - <map> - <key>Comment</key> - <string>Enables FirstFlexible warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>FirstGoTo</key> - <map> - <key>Comment</key> - <string>Enables FirstGoTo warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>FirstInventory</key> - <map> - <key>Comment</key> - <string>Enables FirstInventory warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>FirstLeftClickNoHit</key> - <map> - <key>Comment</key> - <string>Enables FirstLeftClickNoHit warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>FirstMap</key> - <map> - <key>Comment</key> - <string>Enables FirstMap warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>FirstMedia</key> + <key>FirstNotUseDestinationGuide</key> + <map> + <key>Comment</key> + <string>Shows hint when resident doesn't activate destination guide</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstNotUseSidePanel</key> + <map> + <key>Comment</key> + <string>Shows hint when resident doesn't activate side panel</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstNotMoving</key> + <map> + <key>Comment</key> + <string>Shows hint when resident doesn't move</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstReceiveLindens</key> + <map> + <key>Comment</key> + <string>Shows hint when resident receives linden dollars</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstOtherChatBeforeUser</key> <map> <key>Comment</key> - <string>Enables FirstMedia warning dialog</string> + <string>Shows hint when someone else chats first</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -155,43 +89,11 @@ <key>Value</key> <integer>1</integer> </map> - <key>FirstSculptedPrim</key> - <map> - <key>Comment</key> - <string>Enables FirstSculptedPrim warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> + <key>FirstSit</key> <map> <key>Comment</key> - <string>Enables FirstSit warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>FirstTeleport</key> - <map> - <key>Comment</key> - <string>Enables FirstTeleport warning dialog</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>FirstVoice</key> - <map> - <key>Comment</key> - <string>Enables FirstVoice warning dialog</string> + <string>Shows hint when someone sits for the first time</string> <key>Persist</key> <integer>1</integer> <key>Type</key> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4c52fb015f..12fb8741ca 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6425,6 +6425,17 @@ <key>Value</key> <real>1.0</real> </map> + <key>MediaBrowserWindowLimit</key> + <map> + <key>Comment</key> + <string>Maximum number of media brower windows that can be open at once (0 for no limit)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>5</integer> + </map> <key>MediaRollOffRate</key> <map> <key>Comment</key> @@ -11936,5 +11947,38 @@ <key>Value</key> <integer>10</integer> </map> + <key>NotMovingHintTimeout</key> + <map> + <key>Comment</key> + <string>Number of seconds to wait for resident to move before displaying move hint.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>120.0</real> + </map> + <key>DestinationGuideHintTimeout</key> + <map> + <key>Comment</key> + <string>Number of seconds to wait before telling resident about destination guide.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>600.0</real> + </map> + <key>SidePanelHintTimeout</key> + <map> + <key>Comment</key> + <string>Number of seconds to wait before telling resident about side panel.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>300.0</real> + </map> </map> </llsd> diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e85d108bb2..70bda3893e 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -44,6 +44,7 @@ #include "llcallingcard.h" #include "llchannelmanager.h" #include "llconsole.h" +#include "llfirstuse.h" #include "llfloatercamera.h" #include "llfloaterreg.h" #include "llfloatertools.h" @@ -232,8 +233,9 @@ LLAgent::LLAgent() : mControlsTakenPassedOnCount[i] = 0; } - mListener.reset(new LLAgentListener(*this)); + + mMoveTimer.stop(); } // Requires gSavedSettings to be initialized. @@ -242,6 +244,8 @@ LLAgent::LLAgent() : //----------------------------------------------------------------------------- void LLAgent::init() { + mMoveTimer.start(); + gSavedSettings.declareBOOL("SlowMotionAnimation", FALSE, "Declared in code", FALSE); gSavedSettings.getControl("SlowMotionAnimation")->getSignal()->connect(boost::bind(&handleSlowMotionAnimation, _2)); @@ -306,6 +310,9 @@ void LLAgent::ageChat() //----------------------------------------------------------------------------- void LLAgent::moveAt(S32 direction, bool reset) { + mMoveTimer.reset(); + LLFirstUse::notMoving(false); + // age chat timer so it fades more quickly when you are intentionally moving ageChat(); @@ -331,6 +338,9 @@ void LLAgent::moveAt(S32 direction, bool reset) //----------------------------------------------------------------------------- void LLAgent::moveAtNudge(S32 direction) { + mMoveTimer.reset(); + LLFirstUse::notMoving(false); + // age chat timer so it fades more quickly when you are intentionally moving ageChat(); @@ -353,6 +363,9 @@ void LLAgent::moveAtNudge(S32 direction) //----------------------------------------------------------------------------- void LLAgent::moveLeft(S32 direction) { + mMoveTimer.reset(); + LLFirstUse::notMoving(false); + // age chat timer so it fades more quickly when you are intentionally moving ageChat(); @@ -375,6 +388,9 @@ void LLAgent::moveLeft(S32 direction) //----------------------------------------------------------------------------- void LLAgent::moveLeftNudge(S32 direction) { + mMoveTimer.reset(); + LLFirstUse::notMoving(false); + // age chat timer so it fades more quickly when you are intentionally moving ageChat(); @@ -397,6 +413,9 @@ void LLAgent::moveLeftNudge(S32 direction) //----------------------------------------------------------------------------- void LLAgent::moveUp(S32 direction) { + mMoveTimer.reset(); + LLFirstUse::notMoving(false); + // age chat timer so it fades more quickly when you are intentionally moving ageChat(); @@ -1534,6 +1553,12 @@ void LLAgent::propagate(const F32 dt) //----------------------------------------------------------------------------- void LLAgent::updateAgentPosition(const F32 dt, const F32 yaw_radians, const S32 mouse_x, const S32 mouse_y) { + if (mMoveTimer.getStarted() && mMoveTimer.getElapsedTimeF32() > gSavedSettings.getF32("NotMovingHintTimeout")) + { + LLFirstUse::notMoving(); + mMoveTimer.stop(); + } + propagate(dt); // static S32 cameraUpdateCount = 0; diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 32f9b00135..0185f874f9 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -270,6 +270,7 @@ public: private: LLFrameTimer mFidgetTimer; LLFrameTimer mFocusObjectFadeTimer; + LLFrameTimer mMoveTimer; F32 mNextFidgetTime; S32 mCurrentFidget; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d222d94ec6..768be116f6 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -268,6 +268,7 @@ const F64 FRAME_STALL_THRESHOLD = 1.0; LLTimer gRenderStartTime; LLFrameTimer gForegroundTime; +LLFrameTimer gLoggedInTime; LLTimer gLogoutTimer; static const F32 LOGOUT_REQUEST_TIME = 6.f; // this will be cut short by the LogoutReply msg. F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME; @@ -597,6 +598,7 @@ LLAppViewer::LLAppViewer() : setupErrorHandling(); sInstance = this; + gLoggedInTime.stop(); } LLAppViewer::~LLAppViewer() @@ -4281,6 +4283,7 @@ void LLAppViewer::pingMainloopTimeout(const std::string& state, F32 secs) void LLAppViewer::handleLoginComplete() { + gLoggedInTime.start(); initMainloopTimeout("Mainloop Init"); // Store some data to DebugInfo in case of a freeze. diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 0b862a92a1..e5e27dc908 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -313,6 +313,7 @@ extern U32 gFrameStalls; extern LLTimer gRenderStartTime; extern LLFrameTimer gForegroundTime; +extern LLFrameTimer gLoggedInTime; extern F32 gLogoutMaxTime; extern LLTimer gLogoutTimer; diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 0e5e8d0fe7..e0b605a724 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -47,6 +47,7 @@ #include "llagentcamera.h" #include "llchiclet.h" #include "llfloatercamera.h" +#include "llhints.h" #include "llimfloater.h" // for LLIMFloater #include "llnearbychatbar.h" #include "llspeakbutton.h" @@ -68,10 +69,6 @@ template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance(); namespace { const std::string& PANEL_CHICLET_NAME = "chiclet_list_panel"; - const std::string& PANEL_CHATBAR_NAME = "chat_bar"; - const std::string& PANEL_MOVEMENT_NAME = "movement_panel"; - const std::string& PANEL_CAMERA_NAME = "cam_panel"; - const std::string& PANEL_GESTURE_NAME = "gesture_panel"; S32 get_panel_min_width(LLLayoutStack* stack, LLView* panel) { @@ -474,10 +471,12 @@ BOOL LLBottomTray::postBuild() mBottomTrayContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_bottomtray.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); gMenuHolder->addChild(mBottomTrayContextMenu); - mNearbyChatBar = getChild<LLNearbyChatBar>("chat_bar"); + LLHints::registerHintTarget("nearby_chat_bar", mNearbyChatBar->LLView::getHandle()); + mToolbarStack = getChild<LLLayoutStack>("toolbar_stack"); mMovementButton = getChild<LLButton>("movement_btn"); + LLHints::registerHintTarget("move_btn", mMovementButton->getHandle()); mCamButton = getChild<LLButton>("camera_btn"); setRightMouseDownCallback(boost::bind(&LLBottomTray::showBottomTrayContextMenu,this, _2, _3,_4)); diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 73fbe78298..96001a07a0 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -571,6 +571,10 @@ void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type, void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate) { + // as soon as we say something, we no longer care about teaching the user + // how to chat + gWarningSettings.setBOOL("FirstOtherChatBeforeUser", FALSE); + // Look for "/20 foo" channel chats. S32 channel = 0; LLWString out_text = stripChannelNumber(wtext, &channel); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 8bc3b5a75f..696ac4e6fa 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -123,7 +123,7 @@ BOOL LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask) { S32 bar_idx = MAX_VISIBLE_HISTORY - ((y - mBarRect.mBottom) * (MAX_VISIBLE_HISTORY + 2) / mBarRect.getHeight()); bar_idx = llclamp(bar_idx, 0, MAX_VISIBLE_HISTORY); - mPrintStats = bar_idx; + mPrintStats = LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - bar_idx; } return FALSE; } @@ -140,6 +140,17 @@ LLFastTimer::NamedTimer* LLFastTimerView::getLegendID(S32 y) return NULL; } +BOOL LLFastTimerView::handleDoubleClick(S32 x, S32 y, MASK mask) +{ + for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + it != end_timer_tree(); + ++it) + { + (*it)->setCollapsed(false); + } + return TRUE; +} + BOOL LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask) { @@ -953,7 +964,7 @@ void LLFastTimerView::draw() { legend_stat += ", "; } - first = true; + first = false; legend_stat += idp->getName(); if (idp->getCollapsed()) @@ -980,8 +991,7 @@ void LLFastTimerView::draw() U64 ticks; if (mPrintStats > 0) { - S32 hidx = (mPrintStats - 1) - mScrollIndex; - ticks = idp->getHistoricalCount(hidx); + ticks = idp->getHistoricalCount(mPrintStats); } else { diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index ac06990913..6f64248f78 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -54,6 +54,7 @@ private: public: virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index b3fdf60b11..15de138c95 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -36,7 +36,7 @@ // library includes #include "indra_constants.h" -#include "llnotificationsutil.h" +#include "llnotifications.h" // viewer includes #include "llagent.h" // for gAgent.inPrelude() @@ -45,9 +45,10 @@ #include "llappviewer.h" #include "lltracker.h" -/* + // static std::set<std::string> LLFirstUse::sConfigVariables; +std::map<std::string, LLNotificationPtr> LLFirstUse::sNotifications; // static void LLFirstUse::addConfigVariable(const std::string& var) @@ -76,211 +77,90 @@ void LLFirstUse::resetFirstUse() gWarningSettings.setBOOL(*iter, TRUE); } } -*/ -/* - -// Called whenever the viewer detects that your balance went up -void LLFirstUse::useBalanceIncrease(S32 delta) -{ - if (gWarningSettings.getBOOL("FirstBalanceIncrease")) - { - gWarningSettings.setBOOL("FirstBalanceIncrease", FALSE); - - LLSD args; - args["AMOUNT"] = llformat("%d",delta); - LLNotificationsUtil::add("FirstBalanceIncrease", args); - } -} - -// Called whenever the viewer detects your balance went down -void LLFirstUse::useBalanceDecrease(S32 delta) +// static +void LLFirstUse::useOverrideKeys() { - if (gWarningSettings.getBOOL("FirstBalanceDecrease")) + // Our orientation island uses key overrides to teach vehicle driving + // so don't show this message until you get off OI. JC + if (!gAgent.inPrelude()) { - gWarningSettings.setBOOL("FirstBalanceDecrease", FALSE); - - LLSD args; - args["AMOUNT"] = llformat("%d",-delta); - LLNotificationsUtil::add("FirstBalanceDecrease", args); + firstUseNotification("FirstOverrideKeys", true, "FirstOverrideKeys"); } } - -// static -void LLFirstUse::useSit() -{ - // Our orientation island uses sitting to teach vehicle driving - // so just never show this message. JC - //if (gWarningSettings.getBOOL("FirstSit")) - //{ - // gWarningSettings.setBOOL("FirstSit", FALSE); - // - // LLNotificationsUtil::add("FirstSit"); - //} -} - // static -void LLFirstUse::useMap() +void LLFirstUse::otherAvatarChatFirst(bool enable) { - if (gWarningSettings.getBOOL("FirstMap")) - { - gWarningSettings.setBOOL("FirstMap", FALSE); - - LLNotificationsUtil::add("FirstMap"); - } + firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "nearby_chat_bar").with("direction", "top")); } // static -void LLFirstUse::useGoTo() +void LLFirstUse::sit(bool enable) { - // nothing for now JC + firstUseNotification("FirstSit", enable, "HintSit", LLSD(), LLSD().with("target", "stand_btn").with("direction", "top")); } // static -void LLFirstUse::useBuild() +void LLFirstUse::inventoryOffer(bool enable) { - if (gWarningSettings.getBOOL("FirstBuild")) - { - gWarningSettings.setBOOL("FirstBuild", FALSE); - - LLNotificationsUtil::add("FirstBuild"); - } + firstUseNotification("FirstInventoryOffer", enable, "HintInventory", LLSD(), LLSD().with("target", "inventory_btn").with("direction", "left")); } - - */ -/* -// static -void LLFirstUse::useLeftClickNoHit() -{ - if (gWarningSettings.getBOOL("FirstLeftClickNoHit")) - { - gWarningSettings.setBOOL("FirstLeftClickNoHit", FALSE); - LLNotificationsUtil::add("FirstLeftClickNoHit"); - } -} -*/ -/* // static -void LLFirstUse::useTeleport() +void LLFirstUse::useSandbox() { - if (gWarningSettings.getBOOL("FirstTeleport")) - { - LLVector3d teleportDestination = LLTracker::getTrackedPositionGlobal(); - if(teleportDestination != LLVector3d::zero) - { - gWarningSettings.setBOOL("FirstTeleport", FALSE); - - LLNotificationsUtil::add("FirstTeleport"); - } - } + firstUseNotification("FirstSandbox", true, "FirstSandbox", LLSD().with("HOURS", SANDBOX_CLEAN_FREQ).with("TIME", SANDBOX_FIRST_CLEAN_HOUR)); } -*/ -// static -void LLFirstUse::useOverrideKeys() -{ - // Our orientation island uses key overrides to teach vehicle driving - // so don't show this message until you get off OI. JC - if (!gAgent.inPrelude()) - { - if (gWarningSettings.getBOOL("FirstOverrideKeys")) - { - gWarningSettings.setBOOL("FirstOverrideKeys", FALSE); - LLNotificationsUtil::add("FirstOverrideKeys"); - } - } -} -/* // static -void LLFirstUse::useAttach() +void LLFirstUse::notUsingDestinationGuide(bool enable) { - // nothing for now + // not doing this yet + //firstUseNotification("FirstNotUseDestinationGuide", enable, "HintDestinationGuide", LLSD(), LLSD().with("target", "dest_guide_btn").with("direction", "left")); } // static -void LLFirstUse::useAppearance() +void LLFirstUse::notUsingSidePanel(bool enable) { - if (gWarningSettings.getBOOL("FirstAppearance")) - { - gWarningSettings.setBOOL("FirstAppearance", FALSE); - - LLNotificationsUtil::add("FirstAppearance"); - } + // not doing this yet + //firstUseNotification("FirstNotUseSidePanel", enable, "HintSidePanel", LLSD(), LLSD().with("target", "side_panel_btn").with("direction", "left")); } // static -void LLFirstUse::useInventory() +void LLFirstUse::notMoving(bool enable) { - if (gWarningSettings.getBOOL("FirstInventory")) - { - gWarningSettings.setBOOL("FirstInventory", FALSE); - - LLNotificationsUtil::add("FirstInventory"); - } + firstUseNotification("FirstNotMoving", enable, "HintMove", LLSD(), LLSD().with("target", "move_btn").with("direction", "top")); } -*/ - // static -void LLFirstUse::useSandbox() +void LLFirstUse::receiveLindens(bool enable) { - if (gWarningSettings.getBOOL("FirstSandbox")) - { - gWarningSettings.setBOOL("FirstSandbox", FALSE); - - LLSD args; - args["HOURS"] = llformat("%d",SANDBOX_CLEAN_FREQ); - args["TIME"] = llformat("%d",SANDBOX_FIRST_CLEAN_HOUR); - LLNotificationsUtil::add("FirstSandbox", args); - } + firstUseNotification("FirstReceiveLindens", enable, "HintLindenDollar", LLSD(), LLSD().with("target", "linden_balance").with("direction", "bottom")); } -/* -// static -void LLFirstUse::useFlexible() -{ - if (gWarningSettings.getBOOL("FirstFlexible")) - { - gWarningSettings.setBOOL("FirstFlexible", FALSE); - LLNotificationsUtil::add("FirstFlexible"); - } -} -// static -void LLFirstUse::useDebugMenus() +//static +void LLFirstUse::firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args, LLSD payload) { - if (gWarningSettings.getBOOL("FirstDebugMenus")) - { - gWarningSettings.setBOOL("FirstDebugMenus", FALSE); + LLNotificationPtr notif = sNotifications[notification_name]; - LLNotificationsUtil::add("FirstDebugMenus"); - } -} - -// static -void LLFirstUse::useSculptedPrim() -{ - if (gWarningSettings.getBOOL("FirstSculptedPrim")) + if (enable) { - gWarningSettings.setBOOL("FirstSculptedPrim", FALSE); - - LLNotificationsUtil::add("FirstSculptedPrim"); - + if (!notif && gWarningSettings.getBOOL(control_var)) + { // create new notification + sNotifications[notification_name] = LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload)); + gWarningSettings.setBOOL(control_var, FALSE); + } + } + else + { // want to hide notification + if (notif) + { // cancel existing notification + LLNotifications::instance().cancel(notif); + sNotifications.erase(notification_name); + } + gWarningSettings.setBOOL(control_var, FALSE); } -} -// static -void LLFirstUse::useMedia() -{ - if (gWarningSettings.getBOOL("FirstMedia")) - { - gWarningSettings.setBOOL("FirstMedia", FALSE); - - // Popup removed as a short-term fix for EXT-1643. - // Ultimately, the plan is to kill all First Use dialogs - //LLNotificationsUtil::add("FirstMedia"); - } } -*/ diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h index 3c7551f6cb..48943cd9ab 100644 --- a/indra/newview/llfirstuse.h +++ b/indra/newview/llfirstuse.h @@ -76,10 +76,13 @@ object or from inventory. 14. First time you create/edit a sculpted prim. */ +class LLNotification; + + class LLFirstUse { public: -/* + // Add a config variable to be reset on resetFirstUse() static void addConfigVariable(const std::string& var); @@ -87,35 +90,20 @@ public: static void disableFirstUse(); static void resetFirstUse(); - // These methods are called each time the appropriate action is - // taken. The functions themselves handle only showing the dialog - // the first time, or subsequent times if the user wishes. - static void useBalanceIncrease(S32 delta); - static void useBalanceDecrease(S32 delta); - static void useSit(); - static void useMap(); - static void useGoTo(); - static void useBuild(); -// static void useLeftClickNoHit(); - static void useTeleport(); -*/ static void useOverrideKeys(); -/* - static void useAttach(); - static void useAppearance(); - static void useInventory(); - */ + static void otherAvatarChatFirst(bool enable = true); + static void sit(bool enable = true); + static void notUsingDestinationGuide(bool enable = true); + static void notUsingSidePanel(bool enable = true); + static void notMoving(bool enable = true); + static void inventoryOffer(bool enable = true); + static void receiveLindens(bool enable = true); static void useSandbox(); -/* - static void useFlexible(); - static void useDebugMenus(); - static void useSculptedPrim(); - static void useMedia(); - protected: + static void firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args = LLSD(), LLSD payload = LLSD()); static std::set<std::string> sConfigVariables; -*/ + static std::map<std::string, boost::shared_ptr<LLNotification> > sNotifications; }; #endif diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 43f158658a..834f517734 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -344,11 +344,10 @@ void LLPanelGroups::onGroupList(LLUICtrl* ctrl, void* userdata) if(self) self->enableButtons(); } -void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask) +void init_group_list(LLScrollListCtrl* group_list, const LLUUID& highlight_id, U64 powers_mask) { S32 count = gAgent.mGroups.count(); LLUUID id; - LLCtrlListInterface *group_list = ctrl->getListInterface(); if (!group_list) return; group_list->operateOnAll(LLCtrlListInterface::OP_DELETE); @@ -372,10 +371,12 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow element["columns"][0]["font"]["name"] = "SANSSERIF"; element["columns"][0]["font"]["style"] = style; - group_list->addElement(element, ADD_SORTED); + group_list->addElement(element); } } + group_list->sortOnce(0, TRUE); + // add "none" to list at top { std::string style = "NORMAL"; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 625b443abc..19e28720ae 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2440,7 +2440,7 @@ void LLPanelLandAccess::refresh() suffix.append(" " + parent_floater->getString("Remaining") + ")"); } if (mListAccess) - mListAccess->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix); + mListAccess->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix); } } @@ -2481,7 +2481,7 @@ void LLPanelLandAccess::refresh() } suffix.append(" " + parent_floater->getString("Remaining") + ")"); } - mListBanned->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix); + mListBanned->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix); } } diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index 3c8ee6eb9e..12d27b8790 100644 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -75,10 +75,9 @@ BOOL LLFloaterLandHoldings::postBuild() childSetAction("Show on Map", onClickMap, this); // Grant list - getChild<LLScrollListCtrl>("grant list")->setDoubleClickCallback(onGrantList, this); - - LLCtrlListInterface *list = childGetListInterface("grant list"); - if (!list) return TRUE; + LLScrollListCtrl* grant_list = getChild<LLScrollListCtrl>("grant list"); + grant_list->sortByColumnIndex(0, TRUE); + grant_list->setDoubleClickCallback(onGrantList, this); S32 count = gAgent.mGroups.count(); for(S32 i = 0; i < count; ++i) @@ -97,7 +96,7 @@ BOOL LLFloaterLandHoldings::postBuild() element["columns"][1]["value"] = areastr; element["columns"][1]["font"] = "SANSSERIF"; - list->addElement(element, ADD_SORTED); + grant_list->addElement(element); } center(); diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp index 5405de2f9a..90147ff650 100644 --- a/indra/newview/llfloatermediabrowser.cpp +++ b/indra/newview/llfloatermediabrowser.cpp @@ -63,6 +63,54 @@ LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& key) } +//static +void LLFloaterMediaBrowser::create(const std::string &url, const std::string& target) +{ + std::string tag = target; + + if(target.empty() || target == "_blank") + { + // create a unique tag for this instance + LLUUID id; + id.generate(); + tag = id.asString(); + } + + S32 browser_window_limit = gSavedSettings.getS32("MediaBrowserWindowLimit"); + + if(LLFloaterReg::findInstance("media_browser", tag) != NULL) + { + // There's already a media browser for this tag, so we won't be opening a new window. + } + else if(browser_window_limit != 0) + { + // showInstance will open a new window. Figure out how many media browsers are already open, + // and close the least recently opened one if this will put us over the limit. + + LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList("media_browser"); + lldebugs << "total instance count is " << instances.size() << llendl; + + for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++) + { + lldebugs << " " << (*iter)->getKey() << llendl; + } + + if(instances.size() >= (size_t)browser_window_limit) + { + // Destroy the least recently opened instance + (*instances.begin())->closeFloater(); + } + } + + LLFloaterMediaBrowser *browser = dynamic_cast<LLFloaterMediaBrowser*> (LLFloaterReg::showInstance("media_browser", tag)); + llassert(browser); + if(browser) + { + // tell the browser instance to load the specified URL + browser->openMedia(url); + } +} + void LLFloaterMediaBrowser::draw() { getChildView("go")->setEnabled(!mAddressCombo->getValue().asString().empty()); @@ -105,6 +153,7 @@ BOOL LLFloaterMediaBrowser::postBuild() mAddressCombo = getChild<LLComboBox>("address"); mAddressCombo->setCommitCallback(onEnterAddress, this); + mAddressCombo->sortByName(); childSetAction("back", onClickBack, this); childSetAction("forward", onClickForward, this); @@ -185,7 +234,7 @@ void LLFloaterMediaBrowser::setCurrentURL(const std::string& url) if (mCurrentURL != "about:blank") { mAddressCombo->remove(mCurrentURL); - mAddressCombo->add(mCurrentURL, ADD_SORTED); + mAddressCombo->add(mCurrentURL); mAddressCombo->selectByValue(mCurrentURL); // Serialize url history @@ -197,12 +246,6 @@ void LLFloaterMediaBrowser::setCurrentURL(const std::string& url) getChildView("reload")->setEnabled(TRUE); } -void LLFloaterMediaBrowser::onOpen(const LLSD& media_url) -{ - LLFloater::onOpen(media_url); - openMedia(media_url.asString()); -} - //static void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data) { diff --git a/indra/newview/llfloatermediabrowser.h b/indra/newview/llfloatermediabrowser.h index c315f9e797..4255d814c0 100644 --- a/indra/newview/llfloatermediabrowser.h +++ b/indra/newview/llfloatermediabrowser.h @@ -45,12 +45,14 @@ class LLFloaterMediaBrowser : public LLViewerMediaObserver { public: + LOG_CLASS(LLFloaterMediaBrowser); LLFloaterMediaBrowser(const LLSD& key); + static void create(const std::string &url, const std::string& target); + /*virtual*/ BOOL postBuild(); /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void draw(); - /*virtual*/ void onOpen(const LLSD& key); // inherited from LLViewerMediaObserver /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 7791c037d3..a4b45e04f2 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -826,13 +826,11 @@ void LLFloaterPreference::buildPopupLists() row["columns"][1]["font"] = "SANSSERIF_SMALL"; row["columns"][1]["width"] = 360; } - item = disabled_popups.addElement(row, - ADD_SORTED); + item = disabled_popups.addElement(row); } else { - item = enabled_popups.addElement(row, - ADD_SORTED); + item = enabled_popups.addElement(row); } if (item) diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index e0f646349e..a77fc4710a 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -712,38 +712,44 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) } } - LLSD element; + LLScrollListItem::Params item_params; + item_params.value = task_id; - element["id"] = task_id; - element["columns"][0]["column"] = "size"; - element["columns"][0]["value"] = llformat("%d", size); - element["columns"][0]["font"] = "SANSSERIF"; - element["columns"][1]["column"] = "urls"; - element["columns"][1]["value"] = llformat("%d", urls); - element["columns"][1]["font"] = "SANSSERIF"; - element["columns"][2]["column"] = "name"; - element["columns"][2]["value"] = name_buf; - element["columns"][2]["font"] = "SANSSERIF"; - element["columns"][3]["column"] = "owner"; - element["columns"][3]["value"] = owner_buf; - element["columns"][3]["font"] = "SANSSERIF"; - element["columns"][4]["column"] = "parcel"; - element["columns"][4]["value"] = parcel_name; - element["columns"][4]["font"] = "SANSSERIF"; - element["columns"][5]["column"] = "location"; - if(has_locations) - { - element["columns"][5]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z); - } - else - { - element["columns"][5]["value"] = ""; - } - element["columns"][5]["font"] = "SANSSERIF"; + LLScrollListCell::Params cell_params; + cell_params.font = LLFontGL::getFontSansSerif(); + + cell_params.column = "size"; + cell_params.value = size; + item_params.columns.add(cell_params); + + cell_params.column = "urls"; + cell_params.value = urls; + item_params.columns.add(cell_params); + + cell_params.column = "name"; + cell_params.value = name_buf; + item_params.columns.add(cell_params); - list->addElement(element, ADD_SORTED); + cell_params.column = "owner"; + cell_params.value = owner_buf; + item_params.columns.add(cell_params); + + cell_params.column = "parcel"; + cell_params.value = parcel_name; + item_params.columns.add(cell_params); + + cell_params.column = "location"; + cell_params.value = has_locations + ? llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z) + : ""; + item_params.columns.add(cell_params); + + list->addRow(item_params); + LLSD element; element["owner_id"] = owner_id; + + element["id"] = task_id; element["local_id"] = local_id; mObjectListItems.push_back(element); } diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp new file mode 100644 index 0000000000..14a9871a7d --- /dev/null +++ b/indra/newview/llhints.cpp @@ -0,0 +1,304 @@ +/** + * @file llhints.cpp + * @brief Hint popups for displaying context sensitive help in a UI overlay + * + * $LicenseInfo:firstyear=2000&license=viewergpl$ + * + * Copyright (c) 2000-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#include "llviewerprecompiledheaders.h" // must be first include + +#include "llhints.h" + +#include "llbutton.h" +#include "lltextbox.h" +#include "llviewerwindow.h" +#include "llsdparam.h" + +class LLHintPopup : public LLPanel +{ +public: + + typedef enum e_popup_direction + { + LEFT, + TOP, + RIGHT, + BOTTOM + } EPopupDirection; + + struct PopupDirections : public LLInitParam::TypeValuesHelper<LLHintPopup::EPopupDirection, PopupDirections> + { + static void declareValues() + { + declare("left", LLHintPopup::LEFT); + declare("right", LLHintPopup::RIGHT); + declare("top", LLHintPopup::TOP); + declare("bottom", LLHintPopup::BOTTOM); + } + }; + + struct Params : public LLInitParam::Block<Params, LLPanel::Params> + { + Mandatory<LLNotificationPtr> notification; + Optional<std::string> target; + Optional<EPopupDirection, PopupDirections> direction; + Optional<S32> distance; + Optional<LLUIImage*> left_arrow, + up_arrow, + right_arrow, + down_arrow; + Optional<S32> left_arrow_offset, + up_arrow_offset, + right_arrow_offset, + down_arrow_offset; + Optional<F32> fade_in_time, + fade_out_time; + + Params() + : direction("direction", TOP), + distance("distance", 24), + target("target"), + left_arrow("left_arrow", LLUI::getUIImage("hint_arrow_left")), + up_arrow("up_arrow", LLUI::getUIImage("hint_arrow_up")), + right_arrow("right_arrow", LLUI::getUIImage("hint_arrow_right")), + down_arrow("down_arrow", LLUI::getUIImage("hint_arrow_down")), + left_arrow_offset("left_arrow_offset", 3), + up_arrow_offset("up_arrow_offset", -2), + right_arrow_offset("right_arrow_offset", -3), + down_arrow_offset("down_arrow_offset", 5), + fade_in_time("fade_in_time", 0.2f), + fade_out_time("fade_out_time", 0.5f) + {} + }; + + LLHintPopup(const Params&); + + void setHintTarget(LLHandle<LLView> target) { mTarget = target; } + /*virtual*/ BOOL postBuild(); + + void onClickClose() { hide(); } + void draw(); + void hide() { if(!mHidden) {mHidden = true; mFadeTimer.reset();} } + +private: + LLNotificationPtr mNotification; + LLHandle<LLView> mTarget; + EPopupDirection mDirection; + S32 mDistance; + LLUIImagePtr mArrowLeft, + mArrowUp, + mArrowRight, + mArrowDown; + S32 mArrowLeftOffset, + mArrowUpOffset, + mArrowRightOffset, + mArrowDownOffset; + LLFrameTimer mFadeTimer; + F32 mFadeInTime, + mFadeOutTime; + bool mHidden; +}; + + + + +LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) +: mNotification(p.notification), + mDirection(p.direction), + mDistance(p.distance), + mTarget(LLHints::getHintTarget(p.target)), + mArrowLeft(p.left_arrow), + mArrowUp(p.up_arrow), + mArrowRight(p.right_arrow), + mArrowDown(p.down_arrow), + mArrowLeftOffset(p.left_arrow_offset), + mArrowUpOffset(p.up_arrow_offset), + mArrowRightOffset(p.right_arrow_offset), + mArrowDownOffset(p.down_arrow_offset), + mHidden(false), + mFadeInTime(p.fade_in_time), + mFadeOutTime(p.fade_out_time), + LLPanel(p) +{ + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_hint.xml"); +} + +BOOL LLHintPopup::postBuild() +{ + LLTextBox& hint_text = getChildRef<LLTextBox>("hint_text"); + hint_text.setText(mNotification->getMessage()); + + getChild<LLButton>("close")->setClickedCallback(boost::bind(&LLHintPopup::onClickClose, this)); + getChild<LLTextBox>("hint_title")->setText(mNotification->getLabel()); + + LLRect text_bounds = hint_text.getTextBoundingRect(); + S32 delta_height = text_bounds.getHeight() - hint_text.getRect().getHeight(); + reshape(getRect().getWidth(), getRect().getHeight() + delta_height); + return TRUE; +} + +void LLHintPopup::draw() +{ + F32 alpha = 1.f; + if (mHidden) + { + alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeOutTime, 1.f, 0.f); + if (alpha == 0.f) + { + die(); + } + } + else + { + alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeInTime, 0.f, 1.f); + } + LLViewDrawContext context(alpha); + + LLView* targetp = mTarget.get(); + if (!targetp || !targetp->isInVisibleChain()) + { + hide(); + } + else + { + LLRect target_rect; + targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent()); + + LLRect my_local_rect = getLocalRect(); + LLRect my_rect; + LLRect arrow_rect; + LLUIImagePtr arrow_imagep; + + switch(mDirection) + { + case LEFT: + my_rect.setCenterAndSize( target_rect.mLeft - (my_local_rect.getWidth() / 2 + mDistance), + target_rect.getCenterY(), + my_local_rect.getWidth(), + my_local_rect.getHeight()); + arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 + mArrowRightOffset, + my_local_rect.getCenterY(), + mArrowRight->getWidth(), + mArrowRight->getHeight()); + arrow_imagep = mArrowRight; + break; + case TOP: + my_rect.setCenterAndSize( target_rect.getCenterX(), + target_rect.mTop + (my_local_rect.getHeight() / 2 + mDistance), + my_local_rect.getWidth(), + my_local_rect.getHeight()); + arrow_rect.setCenterAndSize(my_local_rect.getCenterX(), + my_local_rect.mBottom - mArrowDown->getHeight() / 2 + mArrowDownOffset, + mArrowDown->getWidth(), + mArrowDown->getHeight()); + arrow_imagep = mArrowDown; + break; + case RIGHT: + my_rect.setCenterAndSize( target_rect.getCenterX(), + target_rect.mTop - (my_local_rect.getHeight() / 2 + mDistance), + my_local_rect.getWidth(), + my_local_rect.getHeight()); + arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + mArrowLeftOffset, + my_local_rect.getCenterY(), + mArrowLeft->getWidth(), + mArrowLeft->getHeight()); + arrow_imagep = mArrowLeft; + break; + case BOTTOM: + my_rect.setCenterAndSize( target_rect.getCenterX(), + target_rect.mBottom - (my_local_rect.getHeight() / 2 + mDistance), + my_local_rect.getWidth(), + my_local_rect.getHeight()); + arrow_rect.setCenterAndSize(my_local_rect.getCenterX(), + my_local_rect.mTop + mArrowUp->getHeight() / 2 + mArrowUpOffset, + mArrowUp->getWidth(), + mArrowUp->getHeight()); + arrow_imagep = mArrowUp; + break; + } + setShape(my_rect); + LLPanel::draw(); + + arrow_imagep->draw(arrow_rect, LLColor4(1.f, 1.f, 1.f, alpha)); + } +} + + +LLRegistry<std::string, LLHandle<LLView> > LLHints::sTargetRegistry; +std::map<LLNotificationPtr, class LLHintPopup*> LLHints::sHints; + +//static +void LLHints::show(LLNotificationPtr hint) +{ + LLHintPopup::Params p; + LLParamSDParser::instance().readSD(hint->getPayload(), p); + + p.notification = hint; + + LLHintPopup* popup = new LLHintPopup(p); + + sHints[hint] = popup; + + LLView* hint_holder = gViewerWindow->getHintHolder(); + if (hint_holder) + { + hint_holder->addChild(popup); + popup->centerWithin(hint_holder->getLocalRect()); + } +} + +void LLHints::hide(LLNotificationPtr hint) +{ + hint_map_t::iterator found_it = sHints.find(hint); + if (found_it != sHints.end()) + { + found_it->second->hide(); + sHints.erase(found_it); + } +} + +//static +void LLHints::registerHintTarget(const std::string& name, LLHandle<LLView> target) +{ + sTargetRegistry.defaultRegistrar().add(name, target); +} + +//static +LLHandle<LLView> LLHints::getHintTarget(const std::string& name) +{ + LLHandle<LLView>* handlep = sTargetRegistry.getValue(name); + if (handlep) + { + return *handlep; + } + else + { + return LLHandle<LLView>(); + } +} diff --git a/indra/newview/llhints.h b/indra/newview/llhints.h new file mode 100644 index 0000000000..d2580df012 --- /dev/null +++ b/indra/newview/llhints.h @@ -0,0 +1,54 @@ +/** + * @file llhints.h + * @brief Hint popups for displaying context sensitive help in a UI overlay + * + * $LicenseInfo:firstyear=2000&license=viewergpl$ + * + * Copyright (c) 2000-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLHINTS_H +#define LL_LLHINTS_H + +#include "llpanel.h" +#include "llnotifications.h" + + +class LLHints +{ +public: + static void show(LLNotificationPtr hint); + static void hide(LLNotificationPtr hint); + static void registerHintTarget(const std::string& name, LLHandle<LLView> target); + static LLHandle<LLView> getHintTarget(const std::string& name); +private: + static LLRegistry<std::string, LLHandle<LLView> > sTargetRegistry; + typedef std::map<LLNotificationPtr, class LLHintPopup*> hint_map_t; + static hint_map_t sHints; +}; + + +#endif diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index fc41137686..148a5786cb 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -45,7 +45,9 @@ #include "llvoavatarself.h" // to check gAgentAvatarp->isSitting() #include "llbottomtray.h" #include "llbutton.h" +#include "llfirstuse.h" #include "llfloaterreg.h" +#include "llhints.h" #include "lljoystickbutton.h" #include "lluictrlfactory.h" #include "llviewerwindow.h" @@ -167,6 +169,7 @@ void LLFloaterMove::setVisible(BOOL visible) if (visible) { + LLFirstUse::notMoving(false); // Attach the Stand/Stop Flying panel. LLPanelStandStopFlying* ssf_panel = LLPanelStandStopFlying::getInstance(); ssf_panel->reparent(this); @@ -566,6 +569,11 @@ void LLPanelStandStopFlying::setStandStopFlyingMode(EStandStopFlyingMode mode) { LLPanelStandStopFlying* panel = getInstance(); + if (mode == SSFM_STAND) + { + LLFirstUse::sit(); + LLFirstUse::notMoving(false); + } panel->mStandButton->setVisible(SSFM_STAND == mode); panel->mStopFlyingButton->setVisible(SSFM_STOP_FLYING == mode); @@ -596,6 +604,7 @@ BOOL LLPanelStandStopFlying::postBuild() mStandButton->setCommitCallback(boost::bind(&LLPanelStandStopFlying::onStandButtonClick, this)); mStandButton->setCommitCallback(boost::bind(&LLFloaterMove::enableInstance, TRUE)); mStandButton->setVisible(FALSE); + LLHints::registerHintTarget("stand_btn", mStandButton->getHandle()); mStopFlyingButton = getChild<LLButton>("stop_fly_btn"); //mStopFlyingButton->setCommitCallback(boost::bind(&LLFloaterMove::setFlyingMode, FALSE)); diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 6cfd810c10..41a19a54a8 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -38,6 +38,7 @@ #include "llfloaterreg.h" #include "lltrans.h" +#include "llfirstuse.h" #include "llnearbychatbar.h" #include "llbottomtray.h" #include "llagent.h" @@ -490,6 +491,7 @@ BOOL LLNearbyChatBar::matchChatTypeTrigger(const std::string& in_str, std::strin void LLNearbyChatBar::onChatBoxKeystroke(LLLineEditor* caller, void* userdata) { + LLFirstUse::otherAvatarChatFirst(false); LLNearbyChatBar* self = (LLNearbyChatBar *)userdata; diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 1fadb126e4..4011552112 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -37,6 +37,7 @@ #include "llbottomtray.h" #include "llchatitemscontainerctrl.h" +#include "llfirstuse.h" #include "llfloaterscriptdebug.h" #include "llnearbychat.h" #include "llrecentpeople.h" @@ -347,7 +348,13 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args) if(chat_msg.mMuted == TRUE) return; if(chat_msg.mSourceType == CHAT_SOURCE_AGENT && chat_msg.mFromID.notNull()) - LLRecentPeople::instance().add(chat_msg.mFromID); + { + LLRecentPeople::instance().add(chat_msg.mFromID); + if (chat_msg.mFromID != gAgentID) + { + LLFirstUse::otherAvatarChatFirst(); + } + } if(chat_msg.mText.empty()) return;//don't process empty messages diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 99a1fedcf3..7b8f530178 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -269,6 +269,20 @@ protected: void onRejectToast(LLUUID& id); }; +/** + * Handler for UI hints. + */ +class LLHintHandler : public LLSingleton<LLHintHandler> +{ +public: + LLHintHandler(); + virtual ~LLHintHandler(); + + // base interface functions + virtual bool processNotification(const LLSD& notify); +}; + + class LLHandlerUtil { public: diff --git a/indra/newview/llnotificationhinthandler.cpp b/indra/newview/llnotificationhinthandler.cpp new file mode 100644 index 0000000000..a9460821b0 --- /dev/null +++ b/indra/newview/llnotificationhinthandler.cpp @@ -0,0 +1,64 @@ +/** + * @file llnotificationhinthandler.cpp + * @brief Notification Handler Class for UI Hints + * + * $LicenseInfo:firstyear=2000&license=viewergpl$ + * + * Copyright (c) 2000-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#include "llviewerprecompiledheaders.h" // must be first include + +#include "llnotificationhandler.h" +#include "llhints.h" +#include "llnotifications.h" + +using namespace LLNotificationsUI; + +LLHintHandler::LLHintHandler() +{ +} + +LLHintHandler::~LLHintHandler() +{ +} + +bool LLHintHandler::processNotification(const LLSD& notify) +{ + LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); + + std::string sigtype = notify["sigtype"].asString(); + if (sigtype == "add" || sigtype == "load") + { + LLHints::show(notification); + } + else if (sigtype == "delete") + { + LLHints::hide(notification); + } + return false; +} diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp index 4401bb953f..86496c9d02 100644 --- a/indra/newview/llnotificationmanager.cpp +++ b/indra/newview/llnotificationmanager.cpp @@ -66,6 +66,7 @@ void LLNotificationManager::init() LLNotificationChannel::buildChannel("AlertModal", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alertmodal")); LLNotificationChannel::buildChannel("IM Notifications", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "notifytoast")); LLNotificationChannel::buildChannel("Offer", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "offer")); + LLNotificationChannel::buildChannel("Hints", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "hint")); LLNotifications::instance().getChannel("Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1)); LLNotifications::instance().getChannel("NotificationTips")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1)); @@ -74,6 +75,7 @@ void LLNotificationManager::init() LLNotifications::instance().getChannel("AlertModal")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1)); LLNotifications::instance().getChannel("IM Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1)); LLNotifications::instance().getChannel("Offer")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1)); + LLNotifications::instance().getChannel("Hints")->connectChanged(boost::bind(&LLHintHandler::processNotification, LLHintHandler::getInstance(), _1)); mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptHandler(NT_NOTIFY, LLSD())); mNotifyHandlers["notifytip"] = boost::shared_ptr<LLEventHandler>(new LLTipHandler(NT_NOTIFY, LLSD())); diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 2302772803..155e000bb8 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -746,7 +746,7 @@ void LLPanelGroupGeneral::updateMembers() sSDTime += sd_timer.getElapsedTimeF32(); element_timer.reset(); - LLScrollListItem* member_row = mListVisibleMembers->addElement(row);//, ADD_SORTED); + LLScrollListItem* member_row = mListVisibleMembers->addElement(row); if ( member->isOwner() ) { diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 1404cfcea2..16d5f8140d 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -528,7 +528,7 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) row["columns"][4]["column"] = "hidden"; row["columns"][4]["value"] = hidden; - mGroupParcelsp->addElement(row, ADD_SORTED); + mGroupParcelsp->addElement(row); } } } diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 7a28d10baf..efc797cfe9 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1631,7 +1631,7 @@ void LLPanelGroupMembersSubTab::updateMembers() row["columns"][2]["value"] = mMemberProgress->second->getOnlineStatus(); row["columns"][2]["font"] = "SANSSERIF_SMALL"; - LLScrollListItem* member = mMembersList->addElement(row);//, ADD_SORTED); + LLScrollListItem* member = mMembersList->addElement(row); LLUUID id = member->getUUID(); mHasMatch = TRUE; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 4b23e63f12..58ed01896a 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -1110,9 +1110,10 @@ void LLPanelLogin::updateServerCombo() { if (!grid_choice->first.empty()) { - server_choice_combo->add(grid_choice->second, grid_choice->first, ADD_SORTED); + server_choice_combo->add(grid_choice->second, grid_choice->first); } } + server_choice_combo->sortByName(); server_choice_combo->addSeparator(ADD_TOP); diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index abf2b94b09..c8a9176d92 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -42,6 +42,7 @@ #include "llcombobox.h" #include "llfiltereditor.h" +#include "llfirstuse.h" #include "llfloaterreg.h" #include "llnotificationsutil.h" #include "lltabcontainer.h" @@ -351,6 +352,8 @@ BOOL LLPanelPlaces::postBuild() void LLPanelPlaces::onOpen(const LLSD& key) { + LLFirstUse::notUsingDestinationGuide(false); + if (!mPlaceProfile || !mLandmarkInfo) return; diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 9cc775d427..583b41aa57 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -1178,7 +1178,7 @@ void LLPanelPrimMediaControls::setCurrentURL() // if (media_address_combo && mCurrentURL != "about:blank") // { // media_address_combo->remove(mCurrentURL); -// media_address_combo->add(mCurrentURL, ADD_SORTED); +// media_address_combo->add(mCurrentURL); // media_address_combo->selectByValue(mCurrentURL); // } #else // USE_COMBO_BOX_FOR_MEDIA_URL diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 0951586dd5..f9189bfb22 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -36,6 +36,7 @@ #include "llappearancemgr.h" #include "llavataractions.h" #include "llbutton.h" +#include "llfirstuse.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llinventorypanel.h" @@ -128,6 +129,8 @@ BOOL LLSidepanelInventory::postBuild() void LLSidepanelInventory::onOpen(const LLSD& key) { + LLFirstUse::inventoryOffer(false); + if(key.size() == 0) return; diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 7104f3934d..7cfc774883 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -37,6 +37,8 @@ #include "llagentcamera.h" #include "llappviewer.h" #include "llbottomtray.h" +#include "llfirstuse.h" +#include "llhints.h" #include "llsidetray.h" #include "llviewerwindow.h" #include "llaccordionctrl.h" @@ -422,6 +424,7 @@ void LLSideTray::createButtons () { mCollapseButton = createButton("",sidebar_tab->mImage,sidebar_tab->getTabTitle(), boost::bind(&LLSideTray::onToggleCollapse, this)); + LLHints::registerHintTarget("side_panel_btn", mCollapseButton->getHandle()); } else { @@ -430,6 +433,8 @@ void LLSideTray::createButtons () mTabButtons[name] = button; } } + LLHints::registerHintTarget("inventory_btn", mTabButtons["sidebar_inventory"]->getHandle()); + LLHints::registerHintTarget("dest_guide_btn", mTabButtons["sidebar_places"]->getHandle()); } void LLSideTray::processTriState () @@ -466,6 +471,7 @@ void LLSideTray::onTabButtonClick(string name) void LLSideTray::onToggleCollapse() { + LLFirstUse::notUsingSidePanel(false); if(mCollapsed) { expandSideBar(); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index a6bb4d4d5f..6a081a573e 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -39,6 +39,7 @@ #include "llagentcamera.h" #include "llbutton.h" #include "llcommandhandler.h" +#include "llfirstuse.h" #include "llviewercontrol.h" #include "llfloaterbuycurrency.h" #include "llbuycurrencyhtml.h" @@ -47,6 +48,7 @@ #include "llpanelvolumepulldown.h" #include "llfloaterregioninfo.h" #include "llfloaterscriptdebug.h" +#include "llhints.h" #include "llhudicon.h" #include "llnavigationbar.h" #include "llkeyboard.h" @@ -191,6 +193,8 @@ BOOL LLStatusBar::postBuild() mMediaToggle->setClickedCallback( &LLStatusBar::onClickMediaToggle, this ); mMediaToggle->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterNearbyMedia, this)); + LLHints::registerHintTarget("linden_balance", getChild<LLView>("balance_bg")->getHandle()); + gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); // Adding Net Stat Graph @@ -338,6 +342,11 @@ void LLStatusBar::creditBalance(S32 credit) void LLStatusBar::setBalance(S32 balance) { + if (balance > getBalance() && getBalance() != 0) + { + LLFirstUse::receiveLindens(); + } + std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance ); LLTextBox* balance_box = getChild<LLTextBox>("balance"); @@ -460,6 +469,7 @@ void LLStatusBar::onClickBuyCurrency() // open a currency floater - actual one open depends on // value specified in settings.xml LLBuyCurrencyHTML::openCurrencyFloater(); + LLFirstUse::receiveLindens(false); } void LLStatusBar::onMouseEnterVolume() diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 1f3785d733..d89ee13b95 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2826,25 +2826,18 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << plugin->getClickTarget() << "\", uri is " << plugin->getClickURL() << LL_ENDL; // retrieve the event parameters std::string url = plugin->getClickURL(); + std::string target = plugin->getClickTarget(); U32 target_type = plugin->getClickTargetType(); - + switch (target_type) { - case LLPluginClassMedia::TARGET_EXTERNAL: - // force url to external browser - LLWeb::loadURLExternal(url); - break; - case LLPluginClassMedia::TARGET_BLANK: - // open in SL media browser or external browser based on user pref - LLWeb::loadURL(url); - break; case LLPluginClassMedia::TARGET_NONE: // ignore this click and let media plugin handle it break; - case LLPluginClassMedia::TARGET_OTHER: - LL_WARNS("LinkTarget") << "Unsupported link target type" << LL_ENDL; + default: + // loadURL now handles distinguishing between _blank, _external, and other named targets. + LLWeb::loadURL(url, target); break; - default: break; } }; break; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a04c919310..9bb734a3d3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -56,6 +56,7 @@ #include "llagentcamera.h" #include "llcallingcard.h" #include "llbuycurrencyhtml.h" +#include "llfirstuse.h" #include "llfloaterbuyland.h" #include "llfloaterland.h" #include "llfloaterregioninfo.h" @@ -1763,6 +1764,8 @@ void inventory_offer_handler(LLOfferInfo* info) return; } + LLFirstUse::inventoryOffer(); + // Avoid the Accept/Discard dialog if the user so desires. JC if (gSavedSettings.getBOOL("AutoAcceptNewInventory") && (info->mType == LLAssetType::AT_NOTECARD diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b36af7d95b..cfb8b077e5 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -102,6 +102,7 @@ #include "llface.h" #include "llfeaturemanager.h" #include "llfilepicker.h" +#include "llfirstuse.h" #include "llfloater.h" #include "llfloaterbuildoptions.h" #include "llfloaterbuyland.h" @@ -1529,6 +1530,7 @@ void LLViewerWindow::initBase() mNonSideTrayView = main_view->getChildView("non_side_tray_view")->getHandle(); mFloaterViewHolder = main_view->getChildView("floater_view_holder")->getHandle(); mPopupView = main_view->getChild<LLPopupView>("popup_holder"); + mHintHolder = main_view->getChild<LLView>("hint_holder")->getHandle(); // Constrain floaters to inside the menu and status bar regions. gFloaterView = main_view->getChild<LLFloaterView>("Floater View"); @@ -2422,6 +2424,18 @@ void LLViewerWindow::updateUI() static std::string last_handle_msg; + if (gLoggedInTime.getStarted()) + { + if (gLoggedInTime.getElapsedTimeF32() > gSavedSettings.getF32("DestinationGuideHintTimeout")) + { + LLFirstUse::notUsingDestinationGuide(); + } + if (gLoggedInTime.getElapsedTimeF32() > gSavedSettings.getF32("SidePanelHintTimeout")) + { + LLFirstUse::notUsingSidePanel(); + } + } + LLConsole::updateClass(); // animate layout stacks so we have up to date rect for world view diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 1e0200a075..cd1ee8a5fd 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -294,6 +294,7 @@ public: void updateWorldViewRect(bool use_full_window=false); LLView* getNonSideTrayView() { return mNonSideTrayView.get(); } LLView* getFloaterViewHolder() { return mFloaterViewHolder.get(); } + LLView* getHintHolder() { return mHintHolder.get(); } BOOL handleKey(KEY key, MASK mask); void handleScrollWheel (S32 clicks); @@ -453,6 +454,7 @@ protected: LLHandle<LLView> mWorldViewPlaceholder; // widget that spans the portion of screen dedicated to rendering the 3d world LLHandle<LLView> mNonSideTrayView; // parent of world view + bottom bar, etc...everything but the side tray LLHandle<LLView> mFloaterViewHolder; // container for floater_view + LLHandle<LLView> mHintHolder; // container for hints LLPopupView* mPopupView; // container for transient popups class LLDebugText* mDebugText; // Internal class for debug text diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 5c9633c036..b61109d490 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -84,23 +84,23 @@ void LLWeb::initClass() // static -void LLWeb::loadURL(const std::string& url) +void LLWeb::loadURL(const std::string& url, const std::string& target) { - if (gSavedSettings.getBOOL("UseExternalBrowser")) + if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) { loadURLExternal(url); } else { - loadURLInternal(url); + loadURLInternal(url, target); } } // static -void LLWeb::loadURLInternal(const std::string &url) +void LLWeb::loadURLInternal(const std::string &url, const std::string& target) { - LLFloaterReg::showInstance("media_browser", url); + LLFloaterMediaBrowser::create(url, target); } diff --git a/indra/newview/llweb.h b/indra/newview/llweb.h index 1119b80bb4..20c7391dbf 100644 --- a/indra/newview/llweb.h +++ b/indra/newview/llweb.h @@ -49,11 +49,14 @@ public: static void initClass(); /// Load the given url in the user's preferred web browser - static void loadURL(const std::string& url); + static void loadURL(const std::string& url, const std::string& target); + static void loadURL(const std::string& url) { loadURL(url, LLStringUtil::null); } /// Load the given url in the user's preferred web browser - static void loadURL(const char* url) { loadURL( ll_safe_string(url) ); } + static void loadURL(const char* url, const std::string& target) { loadURL( ll_safe_string(url), target); } + static void loadURL(const char* url) { loadURL( ll_safe_string(url), LLStringUtil::null ); } /// Load the given url in the Second Life internal web browser - static void loadURLInternal(const std::string &url); + static void loadURLInternal(const std::string &url, const std::string& target); + static void loadURLInternal(const std::string &url) { loadURLInternal(url, LLStringUtil::null); } /// Load the given url in the operating system's web browser, async if we want to return immediately /// before browser has spawned static void loadURLExternal(const std::string& url); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 082b37d80b..9fbbfb1d2b 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -645,5 +645,11 @@ with the same filename but different name <texture name="buy_off" file_name="widgets/buy_off.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/> <texture name="buy_over" file_name="widgets/buy_over.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/> <texture name="buy_press" file_name="widgets/buy_press.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/> - + + <texture name="hint_background" file_name="windows/hint_background.png" preload="false" scale.left="8" scale.top="70" scale.right="195" scale.bottom="11"/> + <texture name="hint_arrow_left" file_name="windows/hint_arrow_left.png" preload="false"/> + <texture name="hint_arrow_right" file_name="windows/hint_arrow_right.png" preload="false"/> + <texture name="hint_arrow_up" file_name="windows/hint_arrow_up.png" preload="false"/> + <texture name="hint_arrow_down" file_name="windows/hint_arrow_down.png" preload="false"/> + </textures> diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_down.png b/indra/newview/skins/default/textures/windows/hint_arrow_down.png Binary files differnew file mode 100644 index 0000000000..11ab3c2d0c --- /dev/null +++ b/indra/newview/skins/default/textures/windows/hint_arrow_down.png diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_left.png b/indra/newview/skins/default/textures/windows/hint_arrow_left.png Binary files differnew file mode 100644 index 0000000000..e5c597a550 --- /dev/null +++ b/indra/newview/skins/default/textures/windows/hint_arrow_left.png diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_right.png b/indra/newview/skins/default/textures/windows/hint_arrow_right.png Binary files differnew file mode 100644 index 0000000000..3f89187e13 --- /dev/null +++ b/indra/newview/skins/default/textures/windows/hint_arrow_right.png diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_up.png b/indra/newview/skins/default/textures/windows/hint_arrow_up.png Binary files differnew file mode 100644 index 0000000000..1050097efb --- /dev/null +++ b/indra/newview/skins/default/textures/windows/hint_arrow_up.png diff --git a/indra/newview/skins/default/textures/windows/hint_background.png b/indra/newview/skins/default/textures/windows/hint_background.png Binary files differnew file mode 100644 index 0000000000..0839a95205 --- /dev/null +++ b/indra/newview/skins/default/textures/windows/hint_background.png diff --git a/indra/newview/skins/default/xui/en/floater_media_browser.xml b/indra/newview/skins/default/xui/en/floater_media_browser.xml index c02d607586..18f3b9ab06 100644 --- a/indra/newview/skins/default/xui/en/floater_media_browser.xml +++ b/indra/newview/skins/default/xui/en/floater_media_browser.xml @@ -9,7 +9,7 @@ name="floater_about" help_topic="floater_about" save_rect="true" - single_instance="true" + auto_tile="true" title="MEDIA BROWSER" width="820"> <floater.string diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index a1ca910cbb..0bf5717de8 100644 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -208,6 +208,13 @@ bottom="-1" height="11" /> </panel> + <view top="0" + left="0" + width="1024" + height="768" + name="hint_holder" + mouse_opaque="false" + follows="all"/> <menu_holder top="0" follows="all" height="768" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 609a9b09be..60b0b1e8dc 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6397,6 +6397,57 @@ Mute everyone? <unique/> </notification> + <notification + name="HintChat" + label="Chat" + type="hint"> + To join the conversation, type into the chat field below. + </notification> + + <notification + name="HintSit" + label="Stand" + type="hint"> + To stand up and exit the sitting position, click the Stand button. + </notification> + + <notification + name="HintDestinationGuide" + label="Explore the World" + type="hint"> + The Destination Guide contains thousands of new places to discover. Select a location and choose Teleport to start exploring. + </notification> + + <notification + name="HintSidePanel" + label="Side Panel" + type="hint"> + Get quick access to your inventory, outfits, profiles and more in the side panel. + <!--<unique/>--> + </notification> + + <notification + name="HintMove" + label="Move" + type="hint"> + To walk or run, open the Move Panel and use the directional arrows to navigate. You can also use the directional keys on your keyboard. + <!--<unique/>--> + </notification> + + <notification + name="HintInventory" + label="Inventory" + type="hint"> + Check your inventory to find items. Newest items can be easily found in the Recent tab. + </notification> + + <notification + name="HintLindenDollar" + label="You've got Linden Dollars!" + type="hint"> + Here's your current balance of L$. Click Buy L$ to purchase more Linden Dollars. + </notification> + <global name="UnsupportedCPU"> - Your CPU speed does not meet the minimum requirements. </global> diff --git a/indra/newview/skins/default/xui/en/panel_group_land_money.xml b/indra/newview/skins/default/xui/en/panel_group_land_money.xml index 76f7484c68..1e1d2d18ca 100644 --- a/indra/newview/skins/default/xui/en/panel_group_land_money.xml +++ b/indra/newview/skins/default/xui/en/panel_group_land_money.xml @@ -60,6 +60,8 @@ left="0" right="-1" top="0" + sort_column="0" + sort_ascending="true" name="group_parcel_list" width="313"> <scroll_list.columns diff --git a/indra/newview/skins/default/xui/en/panel_hint.xml b/indra/newview/skins/default/xui/en/panel_hint.xml new file mode 100644 index 0000000000..54ea08e5d4 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_hint.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + name="hint" + width="205" + height="100" + background_opaque="true" + background_visible="true" + layout="topleft" + bg_opaque_image="hint_background"> + <text name="hint_title" + font="SansSerifMedium" + left="8" + right="180" + top="8" + bottom="20" + follows="left|right|top" + text_color="White" + wrap="false"/> + <text name="hint_text" + left="8" + right="197" + top="26" + bottom="90" + follows="all" + text_color="White" + wrap="true"/> + <button right="197" + top="8" + width="16" + height="16" + name="close" + follows="right|top" + image_unselected="Icon_Close_Foreground" + image_selected="Icon_Close_Press"/> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml b/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml index 516457dd93..559df5bec9 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml @@ -57,6 +57,8 @@ left="10" multi_select="true" name="enabled_popups" + sort_column="0" + sort_ascending="true" width="495" /> <button enabled_control="FirstSelectedDisabledPopups" @@ -103,6 +105,8 @@ height="140" layout="topleft" left="10" + sort_column="0" + sort_ascending="true" multi_select="true" name="disabled_popups" width="495" /> diff --git a/indra/newview/skins/default/xui/en/panel_script_limits_region_memory.xml b/indra/newview/skins/default/xui/en/panel_script_limits_region_memory.xml index 9dff00fa0b..c5e8bf5803 100644 --- a/indra/newview/skins/default/xui/en/panel_script_limits_region_memory.xml +++ b/indra/newview/skins/default/xui/en/panel_script_limits_region_memory.xml @@ -79,6 +79,8 @@ layout="topleft" left_delta="0" multi_select="true" + sort_column="0" + sort_ascending="true" name="scripts_list" top_delta="16" width="460"> |