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
meow-7.2.2
Alexei Arabadji 2010-02-18 16:05:11 +02:00
parent f33a1d7ad9
commit eec9f20d74
7 changed files with 27 additions and 49 deletions

View File

@ -257,6 +257,8 @@ public:
void setForcePressedState(bool b) { mForcePressedState = b; }
void setAutoResize(bool auto_resize) { mAutoResize = auto_resize; }
protected:
LLPointer<LLUIImage> getImageUnselected() const { return mImageUnselected; }
LLPointer<LLUIImage> getImageSelected() const { return mImageSelected; }

View File

@ -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);

View File

@ -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);
};
}

View File

@ -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();
}
}

View File

@ -155,10 +155,6 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
}
else
{
if (LLHandlerUtil::canAddNotifPanelToIM(notification))
{
LLHandlerUtil::reloadIMFloaterMessages(notification);
}
mChannel->killToastByNotificationID(notification->getID());
}
}

View File

@ -346,4 +346,7 @@ void LLToastNotifyPanel::onClickButton(void* data)
response[button_name] = true;
}
self->mNotification->respond(response);
// disable all buttons
self->mControlPanel->setEnabled(FALSE);
}

View File

@ -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);