meow-7.2.2
Richard Linden 2010-09-21 09:34:56 -07:00
commit e07c373bd4
16 changed files with 68 additions and 34 deletions

View File

@ -628,6 +628,12 @@ void LLNotification::respond(const LLSD& response)
update();
}
void LLNotification::respondWithDefault()
{
respond(getResponseTemplate(WITH_DEFAULT_BUTTON));
}
const std::string& LLNotification::getName() const
{
return mTemplatep->mName;

View File

@ -441,6 +441,7 @@ public:
LLSD asLLSD();
void respond(const LLSD& sd);
void respondWithDefault();
void* getResponder() { return mResponderObj; }

View File

@ -1557,7 +1557,6 @@ void LLAgent::updateAgentPosition(const F32 dt, const F32 yaw_radians, const S32
if (mMoveTimer.getStarted() && mMoveTimer.getElapsedTimeF32() > gSavedSettings.getF32("NotMovingHintTimeout"))
{
LLFirstUse::notMoving();
mMoveTimer.stop();
}
propagate(dt);

View File

@ -30,12 +30,19 @@
#include "llnotificationhandler.h"
#include "llnotifications.h"
#include "llfloaterreg.h"
#include "llmediactrl.h"
using namespace LLNotificationsUI;
bool LLBrowserNotification::processNotification(const LLSD& notify)
{
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
if (!notification) return false;
// browser notifications are currently handled directly by the LLMediaCtrl instance that spawned them
LLMediaCtrl* media_instance = LLMediaCtrl::getInstance(notification->getPayload()["media_id"].asUUID());
if (media_instance)
{
media_instance->showNotification(notification);
}
return false;
}

View File

@ -130,12 +130,15 @@ void LLFirstUse::firstUseNotification(const std::string& control_var, bool enabl
if (enable)
{
LL_DEBUGS("LLFirstUse") << "Trigger first use notification " << notification_name << LL_ENDL;
if (gSavedSettings.getBOOL("EnableUIHints"))
{
LL_DEBUGS("LLFirstUse") << "Trigger first use notification " << notification_name << LL_ENDL;
// if notification doesn't already exist and this notification hasn't been disabled...
if (gWarningSettings.getBOOL(control_var))
{ // create new notification
LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload.with("control_var", control_var)));
// if notification doesn't already exist and this notification hasn't been disabled...
if (gWarningSettings.getBOOL(control_var))
{ // create new notification
LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload.with("control_var", control_var)));
}
}
}
else

View File

@ -310,26 +310,23 @@ std::map<LLNotificationPtr, class LLHintPopup*> LLHints::sHints;
//static
void LLHints::show(LLNotificationPtr hint)
{
if (gSavedSettings.getBOOL("EnableUIHints"))
LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>());
LLParamSDParser parser;
parser.readSD(hint->getPayload(), p, true);
p.notification = hint;
if (p.validateBlock())
{
LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>());
LLHintPopup* popup = new LLHintPopup(p);
LLParamSDParser parser;
parser.readSD(hint->getPayload(), p, true);
p.notification = hint;
sHints[hint] = popup;
if (p.validateBlock())
LLView* hint_holder = gViewerWindow->getHintHolder();
if (hint_holder)
{
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());
}
hint_holder->addChild(popup);
popup->centerWithin(hint_holder->getLocalRect());
}
}
}

View File

@ -115,7 +115,7 @@ bool LLIMHandler::processNotification(const LLSD& notify)
{
mChannel->killToastByNotificationID(notification->getID());
}
return true;
return false;
}
//--------------------------------------------------------------------------

View File

@ -77,6 +77,7 @@ LLMediaCtrl::Params::Params()
LLMediaCtrl::LLMediaCtrl( const Params& p) :
LLPanel( p ),
LLInstanceTracker(LLUUID::generateNewID()),
mTextureDepthBytes( 4 ),
mBorder(NULL),
mFrequentUpdates( true ),
@ -1032,7 +1033,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
LLNotification::Params notify_params;
notify_params.name = "PopupAttempt";
notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid);
notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid).with("media_id", getKey());
notify_params.functor.function = boost::bind(&LLMediaCtrl::onPopup, this, _1, _2);
if (mTrusted)
@ -1041,7 +1042,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
}
else
{
showNotification(LLNotifications::instance().add(notify_params));
LLNotifications::instance().add(notify_params);
}
break;
};

View File

@ -40,7 +40,8 @@ class LLUICtrlFactory;
class LLMediaCtrl :
public LLPanel,
public LLViewerMediaObserver,
public LLViewerMediaEventEmitter
public LLViewerMediaEventEmitter,
public LLInstanceTracker<LLMediaCtrl, LLUUID>
{
LOG_CLASS(LLMediaCtrl);
public:

View File

@ -133,7 +133,7 @@ bool LLAlertHandler::processNotification(const LLSD& notify)
if(channel)
channel->killToastByNotificationID(notification->getID());
}
return true;
return false;
}
//--------------------------------------------------------------------------

View File

@ -104,7 +104,7 @@ bool LLGroupHandler::processNotification(const LLSD& notify)
{
mChannel->killToastByNotificationID(notification->getID());
}
return true;
return false;
}
//--------------------------------------------------------------------------

View File

@ -179,7 +179,7 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
}
}
return true;
return false;
}
//--------------------------------------------------------------------------

View File

@ -130,7 +130,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify)
mChannel->killToastByNotificationID(notification->getID());
}
}
return true;
return false;
}
//--------------------------------------------------------------------------

View File

@ -96,7 +96,7 @@ bool LLTipHandler::processNotification(const LLSD& notify)
LLNearbyChat>("nearby_chat", LLSD());
if (nearby_chat->getVisible())
{
return true;
return false;
}
}
@ -121,7 +121,7 @@ bool LLTipHandler::processNotification(const LLSD& notify)
// don't spawn toast for inventory accepted/declined offers if respective IM window is open (EXT-5909)
if (!LLHandlerUtil::canSpawnToast(notification))
{
return true;
return false;
}
LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification);
@ -144,7 +144,7 @@ bool LLTipHandler::processNotification(const LLSD& notify)
{
mChannel->killToastByNotificationID(notification->getID());
}
return true;
return false;
}
//--------------------------------------------------------------------------

View File

@ -41,6 +41,7 @@
#include "llagent.h"
#include "llbutton.h"
#include "llfocusmgr.h"
#include "llnotifications.h"
#include "llprogressbar.h"
#include "llstartup.h"
#include "llviewercontrol.h"
@ -90,6 +91,8 @@ BOOL LLProgressView::postBuild()
// hidden initially, until we need it
LLPanel::setVisible(FALSE);
LLNotifications::instance().getChannel("AlertModal")->connectChanged(boost::bind(&LLProgressView::onAlertModal, this, _1));
sInstance = this;
return TRUE;
}
@ -289,3 +292,18 @@ bool LLProgressView::handleUpdate(const LLSD& event_data)
}
return false;
}
bool LLProgressView::onAlertModal(const LLSD& notify)
{
// if the progress view is visible, it will obscure the notification window
// in this case, we want to auto-accept WebLaunchExternalTarget notifications
if (isInVisibleChain())
{
LLNotificationPtr notifyp = LLNotifications::instance().find(notify["id"].asUUID());
if (notifyp && notifyp->getName() == "WebLaunchExternalTarget")
{
notifyp->respondWithDefault();
}
}
return false;
}

View File

@ -59,6 +59,7 @@ public:
static void onCancelButtonClicked( void* );
static void onClickMessage(void*);
bool onAlertModal(const LLSD& sd);
protected:
LLProgressBar* mProgressBar;