summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDenis Serdjuk <dserduk@productengine.com>2009-12-30 17:37:45 +0200
committerDenis Serdjuk <dserduk@productengine.com>2009-12-30 17:37:45 +0200
commit8da7889400a9dfeeefc5b9d7f9fb72aa093ae029 (patch)
tree40ab649f3907ba59f7e765800b079f991ffc4cab /indra/newview
parent5eb4d0b219ed0dd9928ecbcfbffe19fbaa318f22 (diff)
fixed bug EXT-3722 New IM & Notification buttons can be clicked on, even when there's nothing to see
Note: It was decided to handle an enabling of buttons from syswellwindow according to his empty state --HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llchiclet.cpp11
-rw-r--r--indra/newview/llchiclet.h4
-rw-r--r--indra/newview/llsyswellwindow.cpp14
-rw-r--r--indra/newview/llsyswellwindow.h3
4 files changed, 23 insertions, 9 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index c01202bb82..821b63ff04 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -225,6 +225,10 @@ void LLSysWellChiclet::setNewMessagesState(bool new_messages)
mIsNewMessagesState = new_messages;
}
+void LLSysWellChiclet::updateWidget(bool is_window_empty)
+{
+ mButton->setEnabled(!is_window_empty);
+}
// virtual
BOOL LLSysWellChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
@@ -374,6 +378,13 @@ void LLNotificationChiclet::createMenu()
LLViewerMenuHolderGL::child_registry_t::instance());
}
+/*virtual*/
+void LLNotificationChiclet::setCounter(S32 counter)
+{
+ LLSysWellChiclet::setCounter(counter);
+ updateWidget(getCounter() == 0);
+
+}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index ee9db10525..542fec2417 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -825,6 +825,8 @@ public:
void setToggleState(BOOL toggled);
void setNewMessagesState(bool new_messages);
+ //this method should change a widget according to state of the SysWellWindow
+ virtual void updateWidget(bool is_window_empty);
protected:
@@ -930,7 +932,7 @@ protected:
// methods for updating a number of unread System notifications
void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); }
void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications); }
-
+ /*virtual*/ void setCounter(S32 counter);
S32 mUreadSystemNotifications;
};
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp
index 26d8338b24..a46ca1f8ac 100644
--- a/indra/newview/llsyswellwindow.cpp
+++ b/indra/newview/llsyswellwindow.cpp
@@ -106,15 +106,15 @@ void LLSysWellWindow::onStartUpToastClick(S32 x, S32 y, MASK mask)
setVisible(TRUE);
}
-//---------------------------------------------------------------------------------
-LLSysWellWindow::~LLSysWellWindow()
-{
+void LLSysWellWindow::setSysWellChiclet(LLSysWellChiclet* chiclet)
+{
+ mSysWellChiclet = chiclet;
+ if(mSysWellChiclet)
+ mSysWellChiclet->updateWidget(isWindowEmpty());
}
-
//---------------------------------------------------------------------------------
-void LLSysWellWindow::clear()
+LLSysWellWindow::~LLSysWellWindow()
{
- mMessageList->clear();
}
//---------------------------------------------------------------------------------
@@ -281,6 +281,7 @@ void LLSysWellWindow::handleItemAdded(EItemType added_item_type)
setResizeLimits(min_width,min_height);
}
+ mSysWellChiclet->updateWidget(isWindowEmpty());
}
void LLSysWellWindow::handleItemRemoved(EItemType removed_item_type)
@@ -294,6 +295,7 @@ void LLSysWellWindow::handleItemRemoved(EItemType removed_item_type)
// refresh list to recalculate mSeparator position
mMessageList->reshape(mMessageList->getRect().getWidth(), mMessageList->getRect().getHeight());
}
+ mSysWellChiclet->updateWidget(isWindowEmpty());
}
bool LLSysWellWindow::anotherTypeExists(EItemType item_type)
diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h
index d21d095d1a..833e4dd504 100644
--- a/indra/newview/llsyswellwindow.h
+++ b/indra/newview/llsyswellwindow.h
@@ -62,7 +62,6 @@ public:
bool isWindowEmpty();
// Operating with items
- void clear( void );
void removeItemByID(const LLUUID& id);
// Operating with outfit
@@ -74,7 +73,7 @@ public:
void onStartUpToastClick(S32 x, S32 y, MASK mask);
- void setSysWellChiclet(LLSysWellChiclet* chiclet) { mSysWellChiclet = chiclet; }
+ void setSysWellChiclet(LLSysWellChiclet* chiclet);
// size constants for the window and for its elements
static const S32 MAX_WINDOW_HEIGHT = 200;