diff options
-rw-r--r-- | ChangeLog.txt | 12 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterchatterbox.cpp | 54 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterchatterbox.h | 2 | ||||
-rw-r--r-- | linden/indra/newview/llimpanel.cpp | 36 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_chatterbox.xml | 6 |
5 files changed, 102 insertions, 8 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 2ee3574..c953e31 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt | |||
@@ -52,6 +52,18 @@ | |||
52 | Ditto. | 52 | Ditto. |
53 | * linden/indra/newview/skins/default/xui/en-us/floater_buy_land.xml: | 53 | * linden/indra/newview/skins/default/xui/en-us/floater_buy_land.xml: |
54 | Ditto. | 54 | Ditto. |
55 | |||
56 | |||
57 | 2009-04-24 McCabe Maxsted <hakushakukun@gmail.com> | ||
58 | |||
59 | * linden/indra/newview/llfloaterchatterbox.cpp: | ||
60 | Communicate window now shows the number of unread IMs. | ||
61 | * linden/indra/newview/llfloaterchatterbox.h: | ||
62 | Ditto. | ||
63 | * linden/indra/newview/llimpanel.cpp: | ||
64 | Ditto. | ||
65 | * linden/indra/newview/skins/default/xui/en-us/floater_chatterbox.xml: | ||
66 | Ditto. | ||
55 | 67 | ||
56 | 68 | ||
57 | 2009-04-22 McCabe Maxsted <hakushakukun@gmail.com> | 69 | 2009-04-22 McCabe Maxsted <hakushakukun@gmail.com> |
diff --git a/linden/indra/newview/llfloaterchatterbox.cpp b/linden/indra/newview/llfloaterchatterbox.cpp index 036c7c4..53a2cf5 100644 --- a/linden/indra/newview/llfloaterchatterbox.cpp +++ b/linden/indra/newview/llfloaterchatterbox.cpp | |||
@@ -88,6 +88,10 @@ void* LLFloaterMyFriends::createGroupsPanel(void* data) | |||
88 | // | 88 | // |
89 | // LLFloaterChatterBox | 89 | // LLFloaterChatterBox |
90 | // | 90 | // |
91 | |||
92 | static std::string sTitle = "Communicate"; | ||
93 | static int sUnreadCount = 0; | ||
94 | |||
91 | LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : | 95 | LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : |
92 | mActiveVoiceFloater(NULL) | 96 | mActiveVoiceFloater(NULL) |
93 | { | 97 | { |
@@ -122,6 +126,9 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : | |||
122 | addFloater(LLFloaterChat::getInstance(LLSD()), FALSE); | 126 | addFloater(LLFloaterChat::getInstance(LLSD()), FALSE); |
123 | } | 127 | } |
124 | mTabContainer->lockTabs(); | 128 | mTabContainer->lockTabs(); |
129 | |||
130 | sUnreadCount = 0; | ||
131 | sTitle = getTitle(); | ||
125 | } | 132 | } |
126 | 133 | ||
127 | LLFloaterChatterBox::~LLFloaterChatterBox() | 134 | LLFloaterChatterBox::~LLFloaterChatterBox() |
@@ -217,6 +224,53 @@ void LLFloaterChatterBox::setMinimized(BOOL minimized) | |||
217 | LLFloaterChat::getInstance()->updateConsoleVisibility(); | 224 | LLFloaterChat::getInstance()->updateConsoleVisibility(); |
218 | } | 225 | } |
219 | 226 | ||
227 | void LLFloaterChatterBox::markAsUnread(bool unread) | ||
228 | { | ||
229 | LLFloaterChatterBox* floater = LLFloaterChatterBox::getInstance(); | ||
230 | |||
231 | // Update IM unread count | ||
232 | if (unread) | ||
233 | { | ||
234 | sUnreadCount++; | ||
235 | } | ||
236 | else if (!unread) | ||
237 | { | ||
238 | sUnreadCount--; | ||
239 | } | ||
240 | |||
241 | if (floater) | ||
242 | { | ||
243 | // Update the title message with the number of unread IMs. | ||
244 | // Remove the message when we hit 0. | ||
245 | if (sUnreadCount > 0) | ||
246 | { | ||
247 | // Check for plurals | ||
248 | std::string unread_string; | ||
249 | if (sUnreadCount == 1) | ||
250 | { | ||
251 | unread_string = floater->getString("unread_count_string_singular"); | ||
252 | } | ||
253 | else | ||
254 | { | ||
255 | unread_string = floater->getString("unread_count_string_plural"); | ||
256 | } | ||
257 | |||
258 | std::ostringstream unread_count_message; | ||
259 | unread_count_message << sTitle << " (" << sUnreadCount << " " << unread_string << ")"; | ||
260 | |||
261 | // Update the floater title | ||
262 | floater->setTitle(unread_count_message.str()); | ||
263 | } | ||
264 | else | ||
265 | { | ||
266 | sUnreadCount = 0; | ||
267 | |||
268 | // Update the floater title | ||
269 | floater->setTitle(sTitle); | ||
270 | } | ||
271 | } | ||
272 | } | ||
273 | |||
220 | void LLFloaterChatterBox::removeFloater(LLFloater* floaterp) | 274 | void LLFloaterChatterBox::removeFloater(LLFloater* floaterp) |
221 | { | 275 | { |
222 | if (floaterp->getName() == "chat floater") | 276 | if (floaterp->getName() == "chat floater") |
diff --git a/linden/indra/newview/llfloaterchatterbox.h b/linden/indra/newview/llfloaterchatterbox.h index 57f07a0..39e1025 100644 --- a/linden/indra/newview/llfloaterchatterbox.h +++ b/linden/indra/newview/llfloaterchatterbox.h | |||
@@ -90,6 +90,8 @@ public: | |||
90 | VisibilityPolicy<LLFloater>::hide(instance, key); | 90 | VisibilityPolicy<LLFloater>::hide(instance, key); |
91 | } | 91 | } |
92 | 92 | ||
93 | static void markAsUnread(bool unread); | ||
94 | |||
93 | private: | 95 | private: |
94 | LLFloater* getFloater(const LLSD& key) | 96 | LLFloater* getFloater(const LLSD& key) |
95 | { | 97 | { |
diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index 16d64ac..f30ae8c 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp | |||
@@ -49,6 +49,7 @@ | |||
49 | #include "llconsole.h" | 49 | #include "llconsole.h" |
50 | #include "llfloater.h" | 50 | #include "llfloater.h" |
51 | #include "llfloatergroupinfo.h" | 51 | #include "llfloatergroupinfo.h" |
52 | #include "llfloaterchatterbox.h" | ||
52 | #include "llimview.h" | 53 | #include "llimview.h" |
53 | #include "llinventory.h" | 54 | #include "llinventory.h" |
54 | #include "llinventorymodel.h" | 55 | #include "llinventorymodel.h" |
@@ -1170,6 +1171,7 @@ void LLFloaterIMPanel::init(const std::string& session_label) | |||
1170 | FALSE); | 1171 | FALSE); |
1171 | 1172 | ||
1172 | setTitle(mSessionLabel); | 1173 | setTitle(mSessionLabel); |
1174 | |||
1173 | mInputEditor->setMaxTextLength(1023); | 1175 | mInputEditor->setMaxTextLength(1023); |
1174 | // enable line history support for instant message bar | 1176 | // enable line history support for instant message bar |
1175 | mInputEditor->setEnableLineHistory(TRUE); | 1177 | mInputEditor->setEnableLineHistory(TRUE); |
@@ -1498,7 +1500,21 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4 | |||
1498 | && hostp | 1500 | && hostp |
1499 | && source != gAgent.getID()) | 1501 | && source != gAgent.getID()) |
1500 | { | 1502 | { |
1501 | hostp->setFloaterFlashing(this, TRUE); | 1503 | // Only start flashing on first update so we can |
1504 | // get the proper unread number of unread tabs here | ||
1505 | if (!hostp->isFloaterFlashing(this)) | ||
1506 | { | ||
1507 | hostp->setFloaterFlashing(this, TRUE); | ||
1508 | LLFloaterChatterBox::markAsUnread(true); | ||
1509 | } | ||
1510 | |||
1511 | //// Only increment the number of unread IMs if they're from individuals | ||
1512 | //// We increment the first received for the rest during new IM creation. | ||
1513 | //if (mDialog == IM_SESSION_P2P_INVITE || | ||
1514 | // mDialog == IM_NOTHING_SPECIAL) | ||
1515 | //{ | ||
1516 | // LLFloaterChatterBox::markAsUnread(true); | ||
1517 | //} | ||
1502 | } | 1518 | } |
1503 | } | 1519 | } |
1504 | 1520 | ||
@@ -1566,13 +1582,17 @@ void LLFloaterIMPanel::setVisible(BOOL b) | |||
1566 | LLMultiFloater* hostp = getHost(); | 1582 | LLMultiFloater* hostp = getHost(); |
1567 | if( b && hostp ) | 1583 | if( b && hostp ) |
1568 | { | 1584 | { |
1569 | hostp->setFloaterFlashing(this, FALSE); | 1585 | if (hostp->isFloaterFlashing(this)) |
1570 | 1586 | { | |
1571 | /* Don't change containing floater title - leave it "Instant Message" JC | 1587 | hostp->setFloaterFlashing(this, FALSE); |
1572 | LLUIString title = sTitleString; | 1588 | LLFloaterChatterBox::markAsUnread(false); |
1573 | title.setArg("[NAME]", mSessionLabel); | 1589 | |
1574 | hostp->setTitle( title ); | 1590 | /* Don't change containing floater title - leave it "Instant Message" JC |
1575 | */ | 1591 | LLUIString title = sTitleString; |
1592 | title.setArg("[NAME]", mSessionLabel); | ||
1593 | hostp->setTitle( title ); | ||
1594 | */ | ||
1595 | } | ||
1576 | } | 1596 | } |
1577 | } | 1597 | } |
1578 | 1598 | ||
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_chatterbox.xml b/linden/indra/newview/skins/default/xui/en-us/floater_chatterbox.xml index 69f8286..150c570 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_chatterbox.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_chatterbox.xml | |||
@@ -8,5 +8,11 @@ | |||
8 | mouse_opaque="false" name="chatterbox_tab_container" width="391"></icon> | 8 | mouse_opaque="false" name="chatterbox_tab_container" width="391"></icon> |
9 | <tab_container bottom="2" follows="left|right|top|bottom" height="370" left="0" | 9 | <tab_container bottom="2" follows="left|right|top|bottom" height="370" left="0" |
10 | name="chatterbox_tabs" tab_position="bottom" tab_width="80" width="395" /> | 10 | name="chatterbox_tabs" tab_position="bottom" tab_width="80" width="395" /> |
11 | <string name="unread_count_string_singular"> | ||
12 | Unread IM | ||
13 | </string> | ||
14 | <string name="unread_count_string_plural"> | ||
15 | Unread IMs | ||
16 | </string> | ||
11 | </multi_floater> | 17 | </multi_floater> |
12 | 18 | ||