diff options
author | Alexei Arabadji <aarabadji@productengine.com> | 2010-02-18 16:05:11 +0200 |
---|---|---|
committer | Alexei Arabadji <aarabadji@productengine.com> | 2010-02-18 16:05:11 +0200 |
commit | eec9f20d746805e772d38f8b338d882a6afb8df1 (patch) | |
tree | 7e53f1c927da7e120fcadaa370e0f3634305b5d0 /indra/newview | |
parent | f33a1d7ad994633f398c3e5ba9f668cf72d31099 (diff) |
fixed EXT-5006 “One inventory offer cause blinking of both Conversations and
Notifications wells”,
embedded inventory offer panel into IM window;
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llchathistory.cpp | 34 | ||||
-rw-r--r-- | indra/newview/llnotificationhandler.h | 5 | ||||
-rw-r--r-- | indra/newview/llnotificationhandlerutil.cpp | 27 | ||||
-rw-r--r-- | indra/newview/llnotificationofferhandler.cpp | 4 | ||||
-rw-r--r-- | indra/newview/lltoastnotifypanel.cpp | 3 | ||||
-rw-r--r-- | indra/newview/lltoastnotifypanel.h | 1 |
6 files changed, 25 insertions, 49 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index cf5ac6b2e6..8fb9decf7b 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -721,22 +721,26 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL notify_box->setFollowsRight(); notify_box->setFollowsTop(); - LLButton* accept_button = notify_box->getChild<LLButton> ("Accept", - TRUE); - if (accept_button != NULL) + ctrl_list_t ctrls = notify_box->getControlPanel()->getCtrlList(); + S32 offset = 0; + for (ctrl_list_t::iterator it = ctrls.begin(); it != ctrls.end(); it++) { - accept_button->setFollowsNone(); - accept_button->setOrigin(2*HPAD, accept_button->getRect().mBottom); - } - - LLButton* decline_button = notify_box->getChild<LLButton> ( - "Decline", TRUE); - if (accept_button != NULL && decline_button != NULL) - { - decline_button->setFollowsNone(); - decline_button->setOrigin(4*HPAD - + accept_button->getRect().getWidth(), - decline_button->getRect().mBottom); + LLButton * button = dynamic_cast<LLButton*> (*it); + if (button != NULL) + { + button->setOrigin( offset, + button->getRect().mBottom); + button->setLeftHPad(2 * HPAD); + button->setRightHPad(2 * HPAD); + // set zero width before perform autoResize() + button->setRect(LLRect(button->getRect().mLeft, + button->getRect().mTop, button->getRect().mLeft, + button->getRect().mBottom)); + button->setAutoResize(true); + button->autoResize(); + offset += 2 * HPAD + button->getRect().getWidth(); + button->setFollowsNone(); + } } LLTextEditor* text_editor = notify_box->getChild<LLTextEditor>("text_editor_box", TRUE); diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 5f4768e321..0d5c431d75 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -334,11 +334,6 @@ public: * Adds notification panel to the IM floater. */ static void addNotifPanelToIM(const LLNotificationPtr& notification); - - /** - * Reloads IM floater messages. - */ - static void reloadIMFloaterMessages(const LLNotificationPtr& notification); }; } diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 35569cffac..c30a4fb253 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -94,7 +94,8 @@ bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) // static bool LLHandlerUtil::canAddNotifPanelToIM(const LLNotificationPtr& notification) { - return OFFER_FRIENDSHIP == notification->getName(); + return OFFER_FRIENDSHIP == notification->getName() + || USER_GIVE_ITEM == notification->getName(); } @@ -269,27 +270,3 @@ void LLHandlerUtil::addNotifPanelToIM(const LLNotificationPtr& notification) LLIMFloater::show(session_id); } - -// static -void LLHandlerUtil::reloadIMFloaterMessages( - const LLNotificationPtr& notification) -{ - LLUUID from_id = notification->getPayload()["from_id"]; - LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, from_id); - LLIMFloater* im_floater = LLFloaterReg::findTypedInstance<LLIMFloater>( - "impanel", session_id); - if (im_floater != NULL) - { - LLIMModel::LLIMSession * session = LLIMModel::getInstance()->findIMSession( - session_id); - if(session != NULL) - { - session->mMsgs.clear(); - std::list<LLSD> chat_history; - LLLogChat::loadAllHistory(session->mHistoryFileName, chat_history); - session->addMessagesFromHistory(chat_history); - } - - im_floater->reloadMessages(); - } -} diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 8c13b0fafa..8ebd5de258 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -155,10 +155,6 @@ bool LLOfferHandler::processNotification(const LLSD& notify) } else { - if (LLHandlerUtil::canAddNotifPanelToIM(notification)) - { - LLHandlerUtil::reloadIMFloaterMessages(notification); - } mChannel->killToastByNotificationID(notification->getID()); } } diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index ef3535042c..c47c017143 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -346,4 +346,7 @@ void LLToastNotifyPanel::onClickButton(void* data) response[button_name] = true; } self->mNotification->respond(response); + + // disable all buttons + self->mControlPanel->setEnabled(FALSE); } diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h index 3d57c50386..e791eea469 100644 --- a/indra/newview/lltoastnotifypanel.h +++ b/indra/newview/lltoastnotifypanel.h @@ -55,6 +55,7 @@ class LLToastNotifyPanel: public LLToastPanel public: LLToastNotifyPanel(LLNotificationPtr&); virtual ~LLToastNotifyPanel(); + LLPanel * getControlPanel() { return mControlPanel; } protected: LLButton* createButton(const LLSD& form_element, BOOL is_option); |