From 682aba9b3be58689c894062317358205b70b4241 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Thu, 29 Oct 2009 21:02:47 +0200 Subject: implemented task EXT-1334 Add \"Friends\" tab in Resident Chooser containing a full list of users contacts --HG-- branch : product-engine --- indra/newview/llfloateravatarpicker.cpp | 63 ++++++++++++++++++---- indra/newview/llfloateravatarpicker.h | 1 + .../skins/default/xui/en/floater_avatar_picker.xml | 46 ++++++++++++++++ 3 files changed, 101 insertions(+), 9 deletions(-) diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index ccfe7d4b64..8ac7f3fd7e 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -35,6 +35,7 @@ // Viewer includes #include "llagent.h" +#include "llcallingcard.h" #include "llfocusmgr.h" #include "llfloaterreg.h" #include "llviewercontrol.h" @@ -76,6 +77,7 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key) mCloseOnSelect(FALSE) { // LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_picker.xml"); + mCommitCallbackRegistrar.add("Refresh.FriendList", boost::bind(&LLFloaterAvatarPicker::populateFriend, this)); } BOOL LLFloaterAvatarPicker::postBuild() @@ -95,7 +97,11 @@ BOOL LLFloaterAvatarPicker::postBuild() LLScrollListCtrl* nearme = getChild("NearMe"); nearme->setDoubleClickCallback(onBtnSelect, this); childSetCommitCallback("NearMe", onList, this); - + + LLScrollListCtrl* friends = getChild("Friends"); + friends->setDoubleClickCallback(onBtnSelect, this); + childSetCommitCallback("Friends", onList, this); + childSetAction("Select", onBtnSelect, this); childDisable("Select"); @@ -119,6 +125,8 @@ BOOL LLFloaterAvatarPicker::postBuild() center(); + populateFriend(); + return TRUE; } @@ -159,25 +167,37 @@ void LLFloaterAvatarPicker::onBtnSelect(void* userdata) if(self->mCallback) { + std::string acvtive_panel_name; + LLScrollListCtrl* list = NULL; LLPanel* active_panel = self->childGetVisibleTab("ResidentChooserTabs"); - - if(active_panel == self->getChild("SearchPanel")) + if(active_panel) { - std::vector avatar_names; - std::vector avatar_ids; - getSelectedAvatarData(self->getChild("SearchResults"), avatar_names, avatar_ids); - self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata); + acvtive_panel_name = active_panel->getName(); + } + if(acvtive_panel_name == "SearchPanel") + { + list = self->getChild("SearchResults"); + } + else if(acvtive_panel_name == "NearMePanel") + { + list =self->getChild("NearMe"); + } + else if (acvtive_panel_name == "FriendsPanel") + { + list =self->getChild("Friends"); } - else if(active_panel == self->getChild("NearMePanel")) + + if(list) { std::vector avatar_names; std::vector avatar_ids; - getSelectedAvatarData(self->getChild("NearMe"), avatar_names, avatar_ids); + getSelectedAvatarData(list, avatar_names, avatar_ids); self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata); } } self->getChild("SearchResults")->deselectAllItems(TRUE); self->getChild("NearMe")->deselectAllItems(TRUE); + self->getChild("Friends")->deselectAllItems(TRUE); if(self->mCloseOnSelect) { self->mCloseOnSelect = FALSE; @@ -268,6 +288,26 @@ void LLFloaterAvatarPicker::populateNearMe() } } +void LLFloaterAvatarPicker::populateFriend() +{ + LLScrollListCtrl* friends_scroller = getChild("Friends"); + friends_scroller->deleteAllItems(); + LLCollectAllBuddies collector; + LLAvatarTracker::instance().applyFunctor(collector); + LLCollectAllBuddies::buddy_map_t::iterator it; + + + for(it = collector.mOnline.begin(); it!=collector.mOnline.end(); it++) + { + friends_scroller->addStringUUIDItem(it->first, it->second); + } + for(it = collector.mOffline.begin(); it!=collector.mOffline.end(); it++) + { + friends_scroller->addStringUUIDItem(it->first, it->second); + } + friends_scroller->sortByColumnIndex(0, TRUE); +} + void LLFloaterAvatarPicker::draw() { LLFloater::draw(); @@ -289,6 +329,10 @@ BOOL LLFloaterAvatarPicker::visibleItemsSelected() const { return getChild("NearMe")->getFirstSelectedIndex() >= 0; } + else if(active_panel == getChild("FriendsPanel")) + { + return getChild("Friends")->getFirstSelectedIndex() >= 0; + } return FALSE; } @@ -321,6 +365,7 @@ void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple) { getChild("SearchResults")->setAllowMultipleSelection(allow_multiple); getChild("NearMe")->setAllowMultipleSelection(allow_multiple); + getChild("Friends")->setAllowMultipleSelection(allow_multiple); } // static diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 85aacb68a5..b8ace985d9 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -67,6 +67,7 @@ private: void onTabChanged(); void populateNearMe(); + void populateFriend(); BOOL visibleItemsSelected() const; // Returns true if any items in the current tab are selected. void find(); diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml index 0542d4509e..f609ba9557 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml @@ -85,6 +85,52 @@ top="52" width="132" /> + + + Select a friend(s): + + + + Date: Thu, 29 Oct 2009 22:32:35 +0200 Subject: Implemented major task EXT-1695 (IM window should save profile image show/hide state). --HG-- branch : product-engine --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llimfloater.cpp | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6bc95b9cdb..5fc0cb6ff8 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3631,6 +3631,17 @@ Value 1 + IMShowControlPanel + + Comment + Show IM Control Panel + Persist + 1 + Type + Boolean + Value + 1 + IgnoreAllNotifications Comment diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index f3fec70ac9..b9c068b583 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -302,6 +302,8 @@ void LLIMFloater::onSlide() LLPanel* im_control_panel = getChild("panel_im_control_panel"); im_control_panel->setVisible(!im_control_panel->getVisible()); + gSavedSettings.setBOOL("IMShowControlPanel", im_control_panel->getVisible()); + getChild("slide_left_btn")->setVisible(im_control_panel->getVisible()); getChild("slide_right_btn")->setVisible(!im_control_panel->getVisible()); } @@ -344,6 +346,8 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) LLDockControl::TOP, boost::bind(&LLIMFloater::getAllowedRect, floater, _1))); } + floater->childSetVisible("panel_im_control_panel", gSavedSettings.getBOOL("IMShowControlPanel")); + return floater; } -- cgit v1.2.3 From 07dabef250596a68328fdadad4ba41b62d9b482b Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Fri, 30 Oct 2009 12:39:23 +0200 Subject: Fixed normal bug EXT-1972 Nearby chat: Please limit chat field with 254 characters for simple Latin; less for multi-byte characters --HG-- branch : product-engine --- indra/newview/llnearbychatbar.cpp | 1 - indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 217007fb15..32dc5e5927 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -224,7 +224,6 @@ BOOL LLNearbyChatBar::postBuild() mChatBox->setIgnoreTab(TRUE); mChatBox->setPassDelete(TRUE); mChatBox->setReplaceNewlinesWithSpaces(FALSE); - mChatBox->setMaxTextLength(1023); mChatBox->setEnableLineHistory(TRUE); mOutputMonitor = getChild("chat_zone_indicator"); diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index af00b96d27..2182163da5 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -23,6 +23,7 @@ layout="topleft" left_delta="7" left="0" + max_length="254" name="chat_box" tool_tip="Press Enter to say, Ctrl+Enter to shout" top="0" -- cgit v1.2.3 From f4424f8867eec64f770715d1d44ea4276c8129af Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Fri, 30 Oct 2009 13:24:49 +0200 Subject: fixed normal bug (EXT-1971) Add fade time period for nearby chat bubbles --HG-- branch : product-engine --- indra/newview/app_settings/settings.xml | 25 +++++++++++++++++++++- indra/newview/llnearbychathandler.cpp | 2 ++ indra/newview/lltoast.cpp | 6 ++++-- indra/newview/lltoast.h | 4 +++- .../skins/default/xui/en/panel_chat_item.xml | 6 +++--- 5 files changed, 36 insertions(+), 7 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5fc0cb6ff8..af702db5f0 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4886,7 +4886,7 @@ Value 10 - ToastOpaqueTime + ToastFadingTime Comment Number of seconds while a toast is fading @@ -4898,6 +4898,29 @@ 1 StartUpToastLifeTime + NearbyToastFadingTime + + Comment + Number of seconds while a nearby chat toast is fading + Persist + 1 + Type + S32 + Value + 3 + + NearbyToastLifeTime + + Comment + Number of seconds while a nearby chat toast exists + Persist + 1 + Type + S32 + Value + 23 + + StartUpToastLifeTime Comment Number of seconds while a StartUp toast exist diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 6b0d6d61e0..aef0886be4 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -162,6 +162,8 @@ bool LLNearbyChatScreenChannel::createPoolToast() LLToast::Params p; p.panel = panel; + p.lifetime_secs = gSavedSettings.getS32("NearbyToastLifeTime"); + p.fading_time_secs = gSavedSettings.getS32("NearbyToastFadingTime"); LLToast* toast = new LLToast(p); diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 24824a095c..903df21e78 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -49,13 +49,15 @@ LLToast::Params::Params() enable_hide_btn("enable_hide_btn", true), force_show("force_show", false), force_store("force_store", false), + fading_time_secs("fading_time_secs", gSavedSettings.getS32("ToastFadingTime")), lifetime_secs("lifetime_secs", gSavedSettings.getS32("NotificationToastLifeTime")) {}; LLToast::LLToast(const LLToast::Params& p) : LLModalDialog(LLSD(), p.is_modal), mPanel(p.panel), - mToastLifetime(p.lifetime_secs), + mToastLifetime(p.lifetime_secs), + mToastFadingTime(p.fading_time_secs), mNotificationID(p.notif_id), mSessionID(p.session_id), mCanFade(p.can_fade), @@ -127,7 +129,7 @@ bool LLToast::lifetimeHasExpired() if (mTimer.getStarted()) { F32 elapsed_time = mTimer.getElapsedTimeF32(); - if ((mToastLifetime - elapsed_time) <= gSavedSettings.getS32("ToastOpaqueTime")) + if ((mToastLifetime - elapsed_time) <= mToastFadingTime) { setBackgroundOpaque(FALSE); } diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 0698c94880..b670f47045 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -63,7 +63,8 @@ public: Optional notif_id, //notification ID session_id; //im session ID Optional notification; - Optional lifetime_secs; + Optional lifetime_secs, + fading_time_secs; // Number of seconds while a toast is fading Optional on_delete_toast, on_mouse_enter; Optional can_fade, @@ -157,6 +158,7 @@ private: // timer counts a lifetime of a toast LLTimer mTimer; F32 mToastLifetime; // in seconds + F32 mToastFadingTime; // in seconds LLPanel* mPanel; LLButton* mHideBtn; diff --git a/indra/newview/skins/default/xui/en/panel_chat_item.xml b/indra/newview/skins/default/xui/en/panel_chat_item.xml index 78f53562cd..05b04bbf8e 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_item.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_item.xml @@ -5,10 +5,10 @@ name="instant_message" width="300" height="180" - background_opaque="false" - background_visible="true" + background_opaque="true" + background_visible="false" follows="left|top|right|bottom" - bg_alpha_color="0.3 0.3 0.3 1.0"> + bg_alpha_color="0.3 0.3 0.3 0"> Date: Fri, 30 Oct 2009 14:18:07 +0200 Subject: fixed normal bug (EXT-1934) [BSI] Revert EXT-543 - Notification chiclet should not count IM/Group messages --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 21 ++------------------- indra/newview/llchiclet.h | 8 +++----- indra/newview/llimfloater.cpp | 2 -- indra/newview/llsyswellwindow.cpp | 1 - 4 files changed, 5 insertions(+), 27 deletions(-) diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 670f8717a2..bad61101c1 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -57,8 +57,6 @@ static LLDefaultChildRegistry::Register t4("chiclet_im_p2p"); static LLDefaultChildRegistry::Register t5("chiclet_im_group"); S32 LLNotificationChiclet::mUreadSystemNotifications = 0; -S32 LLNotificationChiclet::mUreadIMNotifications = 0; - boost::signals2::signal > > @@ -99,7 +97,6 @@ LLNotificationChiclet::LLNotificationChiclet(const Params& p) // connect counter handlers to the signals connectCounterUpdatersToSignal("notify"); connectCounterUpdatersToSignal("groupnotify"); - connectCounterUpdatersToSignal("notifytoast"); } LLNotificationChiclet::~LLNotificationChiclet() @@ -113,16 +110,8 @@ void LLNotificationChiclet::connectCounterUpdatersToSignal(std::string notificat LLNotificationsUI::LLEventHandler* n_handler = manager->getHandlerForNotification(notification_type); if(n_handler) { - if(notification_type == "notifytoast") - { - n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::updateUreadIMNotifications, this)); - n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::updateUreadIMNotifications, this)); - } - else - { - n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::incUreadSystemNotifications, this)); - n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::decUreadSystemNotifications, this)); - } + n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::incUreadSystemNotifications, this)); + n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::decUreadSystemNotifications, this)); } } @@ -147,12 +136,6 @@ void LLNotificationChiclet::setToggleState(BOOL toggled) { mButton->setToggleState(toggled); } -void LLNotificationChiclet::updateUreadIMNotifications() -{ - mUreadIMNotifications = gIMMgr->getNumberOfUnreadIM(); - setCounter(mUreadSystemNotifications + mUreadIMNotifications); -} - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index d1153a075d..6eefd9829f 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -608,10 +608,9 @@ public: /*virtual*/ ~ LLNotificationChiclet(); - // methods for updating a number of unread System or IM notifications - void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications + mUreadIMNotifications); } - void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications + mUreadIMNotifications); } - void updateUreadIMNotifications(); + // methods for updating a number of unread System notifications + void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); } + void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications); } void setToggleState(BOOL toggled); protected: @@ -622,7 +621,6 @@ protected: friend class LLUICtrlFactory; static S32 mUreadSystemNotifications; - static S32 mUreadIMNotifications; protected: LLButton* mButton; diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index b9c068b583..b21df87093 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -409,8 +409,6 @@ bool LLIMFloater::toggle(const LLUUID& session_id) { // ensure the list of messages is updated when floater is made visible show(session_id); - // update number of unread notifications in the SysWell - LLBottomTray::getInstance()->getSysWell()->updateUreadIMNotifications(); return true; } } diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 93a931dc78..419603e14e 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -427,7 +427,6 @@ void LLSysWellWindow::sessionRemoved(const LLUUID& sessionId) { delIMRow(sessionId); reshapeWindow(); - LLBottomTray::getInstance()->getSysWell()->updateUreadIMNotifications(); } void LLSysWellWindow::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) -- cgit v1.2.3 From 5d757d2b5f425bde269bd3ec310862bd5c22fe41 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 30 Oct 2009 14:23:32 +0200 Subject: Implemented normal task EXT-2014 (Places - Landmarks: Collapsed accordion panels should expand while filtering if they contain matched items) --HG-- branch : product-engine --- indra/newview/llpanellandmarks.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 3d0db71045..48a93f0d42 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -131,6 +131,9 @@ void LLLandmarksPanel::onSearchEdit(const std::string& string) { LLAccordionCtrlTab* tab = *iter; tab->setVisible(true); + + // expand accordion to see matched items in all ones. See EXT-2014. + tab->changeOpenClose(false); } } @@ -883,7 +886,7 @@ bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType carg return true; } - +// static void LLLandmarksPanel::doIdle(void* landmarks_panel) { LLLandmarksPanel* panel = (LLLandmarksPanel* ) landmarks_panel; -- cgit v1.2.3 From 0a6f3fadcf97d1055a5cf78ee9917469b22ea094 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Fri, 30 Oct 2009 14:29:13 +0200 Subject: fix normal bug EXT-1861 IM from Object to appear in Nearby Chat --HG-- branch : product-engine --- indra/newview/llnearbychathandler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 6b0d6d61e0..1668a6d999 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -326,6 +326,12 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg) initChannel(); } + //only messages from AGENTS + if(CHAT_SOURCE_OBJECT == chat_msg.mSourceType) + { + return;//dn't show toast for messages from objects + } + LLUUID id; id.generate(); -- cgit v1.2.3 From a1cc8e8a3370b3a44197cd364fefd2e0a71ae23c Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Fri, 30 Oct 2009 15:28:39 +0200 Subject: Fixed normal bug EXT-1970 Limit Profile info description for the following fields: Second/first life description and Second Life Groups to 512 chars --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_edit_profile.xml | 2 ++ indra/newview/skins/default/xui/en/panel_profile.xml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index b002034a08..fedc49ae87 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -136,6 +136,7 @@ layout="topleft" left="120" top="18" + max_length="512" name="sl_description_edit" width="173" word_wrap="true"> @@ -188,6 +189,7 @@ height="100" layout="topleft" left="120" + max_length="512" top="142" name="fl_description_edit" width="173" diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index 73a759a8ba..5af7d7d674 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -81,6 +81,7 @@ height="95" layout="topleft" left="107" + max_length="512" name="sl_description_edit" top_pad="-3" width="173" @@ -123,6 +124,7 @@ height="95" layout="topleft" left="107" + max_length="512" name="fl_description_edit" top_pad="-3" width="173" -- cgit v1.2.3 From ff97c319959da28ff9abd59a98a63307d6ed8d34 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Fri, 30 Oct 2009 17:00:23 +0200 Subject: fix task EXT-1960 Region messages, should they be displayed in the local chat? and working on EXT-239 Save chat window state and position between sessions (not finished) --HG-- branch : product-engine --- indra/llui/llfloater.cpp | 36 ++++++++++++++++++++++++++++++++++++ indra/llui/llfloater.h | 4 ++++ indra/llui/llfloaterreg.cpp | 20 ++++++++++++++++++++ indra/llui/llfloaterreg.h | 4 ++++ indra/newview/llviewermessage.cpp | 8 ++++++-- 5 files changed, 70 insertions(+), 2 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 021e2e94ac..e5f35f7137 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -189,6 +189,7 @@ LLFloater::Params::Params() can_close("can_close", true), can_drag_on_left("can_drag_on_left", false), can_tear_off("can_tear_off", true), + save_dock_state("save_dock_state", false), save_rect("save_rect", false), save_visibility("save_visibility", false), open_callback("open_callback"), @@ -483,6 +484,7 @@ LLFloater::~LLFloater() storeRectControl(); setVisible(false); // We're not visible if we're destroyed storeVisibilityControl(); + storeDockStateControl(); } void LLFloater::storeRectControl() @@ -501,6 +503,15 @@ void LLFloater::storeVisibilityControl() } } +void LLFloater::storeDockStateControl() +{ + if( !sQuitting && mDocStateControl.size() > 1 ) + { + LLUI::sSettingGroups["floater"]->setBOOL( mDocStateControl, isDocked() ); + } +} + + void LLFloater::setVisible( BOOL visible ) { LLPanel::setVisible(visible); // calls handleVisibilityChange() @@ -759,6 +770,16 @@ void LLFloater::applyRectControl() } } +void LLFloater::applyDockState() +{ + if (mDocStateControl.size() > 1) + { + bool dockState = LLUI::sSettingGroups["floater"]->getBOOL(mDocStateControl); + setDocked(dockState); + } + +} + void LLFloater::applyTitle() { if (!mDragHandle) @@ -1376,7 +1397,10 @@ void LLFloater::setDocked(bool docked, bool pop_on_undock) mButtonsEnabled[BUTTON_DOCK] = !mDocked; mButtonsEnabled[BUTTON_UNDOCK] = mDocked; updateButtons(); + + storeDockStateControl(); } + } // static @@ -2488,6 +2512,11 @@ void LLFloater::setInstanceName(const std::string& name) { mVisibilityControl = LLFloaterReg::declareVisibilityControl(mInstanceName); } + if(!mDocStateControl.empty()) + { + mDocStateControl = LLFloaterReg::declareDockStateControl(mInstanceName); + } + } } @@ -2555,6 +2584,11 @@ void LLFloater::initFromParams(const LLFloater::Params& p) { mVisibilityControl = "t"; // flag to build mVisibilityControl name once mInstanceName is set } + + if(p.save_dock_state) + { + mDocStateControl = "t"; // flag to build mDocStateControl name once mInstanceName is set + } // open callback if (p.open_callback.isProvided()) @@ -2616,6 +2650,8 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o moveResizeHandlesToFront(); + applyDockState(); + return true; // *TODO: Error checking } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 2fdaecf59a..3832f77adf 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -124,6 +124,7 @@ public: can_tear_off, save_rect, save_visibility, + save_dock_state, can_dock; Optional open_callback, @@ -277,8 +278,10 @@ protected: void setRectControl(const std::string& rectname) { mRectControl = rectname; }; void applyRectControl(); + void applyDockState(); void storeRectControl(); void storeVisibilityControl(); + void storeDockStateControl(); void setKey(const LLSD& key); void setInstanceName(const std::string& name); @@ -316,6 +319,7 @@ public: protected: std::string mRectControl; std::string mVisibilityControl; + std::string mDocStateControl; LLSD mKey; // Key used for retrieving instances; set (for now) by LLFLoaterReg LLDragHandle* mDragHandle; diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 3c5a8a6921..d60a879410 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -363,6 +363,26 @@ std::string LLFloaterReg::declareVisibilityControl(const std::string& name) return controlname; } +//static +std::string LLFloaterReg::declareDockStateControl(const std::string& name) +{ + std::string controlname = getDockStateControlName(name); + LLUI::sSettingGroups["floater"]->declareBOOL(controlname, FALSE, + llformat("Window Docking state for %s", name.c_str()), + TRUE); + return controlname; + +} + +//static +std::string LLFloaterReg::getDockStateControlName(const std::string& name) +{ + std::string res = std::string("floater_dock_") + name; + LLStringUtil::replaceChar( res, ' ', '_' ); + return res; +} + + //static void LLFloaterReg::registerControlVariables() { diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 451bd1dbe3..634a235926 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -121,6 +121,10 @@ public: static std::string declareRectControl(const std::string& name); static std::string getVisibilityControlName(const std::string& name); static std::string declareVisibilityControl(const std::string& name); + + static std::string declareDockStateControl(const std::string& name); + static std::string getDockStateControlName(const std::string& name); + static void registerControlVariables(); // Callback wrappers diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ec6ef92a54..8b7df63884 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1595,8 +1595,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Claim to be from a local agent so it doesn't go into // console. chat.mText = name + separator_string + message.substr(message_offset); - BOOL local_agent = TRUE; - LLFloaterChat::addChat(chat, FALSE, local_agent); + + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance("nearby_chat", LLSD()); + if(nearby_chat) + { + nearby_chat->addMessage(chat); + } } else { -- cgit v1.2.3