diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 002af391a649d689d28a1785e9cfd1415c94eba7..d80aa66257e998c2e345138388336c95adfbc515 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -70,10 +70,6 @@ LLBottomTray::LLBottomTray(const LLSD&) mChicletPanel = getChild<LLChicletPanel>("chiclet_list"); mNotificationWell = getChild<LLNotificationChiclet>("notification_well"); - // init mNotificationWell - // set handler for a Click operation - mNotificationWell->setClickCallback(boost::bind(&LLNotificationWellWindow::onChicletClick, LLNotificationWellWindow::getInstance())); - mChicletPanel->setChicletClickedCallback(boost::bind(&LLBottomTray::onChicletClick,this,_1)); LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraPresets, _2)); diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 6852cd78f98e7e0418a5ff5193b5954ce27f1baf..6b7c4049f43af99e094d7a4f88c8e174d44d7a16 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -90,12 +90,6 @@ BOOL LLSysWellWindow::postBuild() //--------------------------------------------------------------------------------- void LLSysWellWindow::setMinimized(BOOL minimize) { - // we don't show empty Message Well window - if (!minimize && isWindowEmpty()) - { - return; - } - LLDockableFloater::setMinimized(minimize); } @@ -117,11 +111,12 @@ void LLSysWellWindow::connectListUpdaterToSignal(std::string notification_type) //--------------------------------------------------------------------------------- void LLSysWellWindow::onStartUpToastClick(S32 x, S32 y, MASK mask) { - onChicletClick(); + // just set floater visible. Screen channels will be cleared. + setVisible(TRUE); } //--------------------------------------------------------------------------------- -void LLSysWellWindow::onChicletClick() +void LLSysWellWindow::clearScreenChannels() { // 1 - remove StartUp toast and channel if present if(!LLNotificationsUI::LLScreenChannel::getStartUpToastShown()) @@ -129,8 +124,11 @@ void LLSysWellWindow::onChicletClick() LLNotificationsUI::LLChannelManager::getInstance()->onStartUpToastClose(); } - // 2 - toggle instance of SysWell's chiclet-window - toggleWindow(); + // 2 - remove toasts in Notification channel + if(mChannel) + { + mChannel->removeAndStoreAllStorableToasts(); + } } //--------------------------------------------------------------------------------- @@ -243,57 +241,27 @@ void LLSysWellWindow::getAllowedRect(LLRect& rect) } //--------------------------------------------------------------------------------- -void LLSysWellWindow::toggleWindow() -{ - if (getDockControl() == NULL) - { - setDockControl(new LLDockControl( - LLBottomTray::getInstance()->getSysWell(), this, - getDockTongue(), LLDockControl::TOP, boost::bind(&LLSysWellWindow::getAllowedRect, this, _1))); - } - - if(!getVisible() || isMinimized()) - { - if(mChannel) - { - mChannel->removeAndStoreAllStorableToasts(); - } - if(isWindowEmpty()) - { - return; - } - setVisible(TRUE); - } - else if (isDocked()) - { - setVisible(FALSE); - } - else if(!isDocked()) - { - // bring to front undocked floater - setVisible(TRUE); - } -} //--------------------------------------------------------------------------------- void LLSysWellWindow::setVisible(BOOL visible) { - if(visible) + if (visible) { - if (LLBottomTray::instanceExists()) + if (NULL == getDockControl() && getDockTongue().notNull()) { - LLBottomTray::getInstance()->getSysWell()->setToggleState(TRUE); - } - } - else - { - if (LLBottomTray::instanceExists()) - { - LLBottomTray::getInstance()->getSysWell()->setToggleState(FALSE); + setDockControl(new LLDockControl( + LLBottomTray::getInstance()->getSysWell(), this, + getDockTongue(), LLDockControl::TOP, boost::bind(&LLSysWellWindow::getAllowedRect, this, _1))); } + + // when Notification channel is cleared, storable toasts will be added into the list. + clearScreenChannels(); } + // do not show empty window + if (NULL == mMessageList || isWindowEmpty()) visible = FALSE; + LLDockableFloater::setVisible(visible); // update notification channel state diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index fe0ac4b7408c5c4b901d88293149efc70cb26235..04596c0622729c4366b82a757c2ce5d7bd9ddf9d 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -66,8 +66,6 @@ class LLSysWellWindow : public LLDockableFloater, LLIMSessionObserver // Operating with outfit virtual void setVisible(BOOL visible); void adjustWindowPosition(); - void toggleWindow(); - /*virtual*/ BOOL canClose() { return FALSE; } /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); // override LLFloater's minimization according to EXT-1216 /*virtual*/ void setMinimized(BOOL minimize); @@ -76,7 +74,7 @@ class LLSysWellWindow : public LLDockableFloater, LLIMSessionObserver void onItemClick(LLSysWellItem* item); void onItemClose(LLSysWellItem* item); void onStoreToast(LLPanel* info_panel, LLUUID id); - void onChicletClick(); + void clearScreenChannels(); void onStartUpToastClick(S32 x, S32 y, MASK mask); // size constants for the window and for its elements @@ -154,11 +152,14 @@ class LLSysWellWindow : public LLDockableFloater, LLIMSessionObserver * * It contains a list of notifications that have not been responded to. */ -class LLNotificationWellWindow : public LLSysWellWindow +class LLNotificationWellWindow : public LLSysWellWindow, public LLInitClass<LLNotificationWellWindow> { public: LLNotificationWellWindow(const LLSD& key); static LLNotificationWellWindow* getInstance(const LLSD& key = LLSD()); + + static void initClass() { getInstance(); } + }; /** diff --git a/indra/newview/skins/default/xui/en/floater_sys_well.xml b/indra/newview/skins/default/xui/en/floater_sys_well.xml index be6d63716c521f9dad6025576fc996b15bb5c197..4e9388c2b2ee8b6ed75ead4e12ea11b8e3428de2 100644 --- a/indra/newview/skins/default/xui/en/floater_sys_well.xml +++ b/indra/newview/skins/default/xui/en/floater_sys_well.xml @@ -6,19 +6,20 @@ top="0" follows="right|bottom" layout="topleft" - name="notification_chiclet" + name="sys_well_window" help_topic="notification_chiclet" save_rect="true" title="NOTIFICATIONS" width="320" min_width="320" height="23" - can_minimize="true" + can_minimize="false" can_tear_off="false" can_resize="true" can_drag_on_left="false" - can_close="false" can_dock="true" + save_visibility="true" + single_instance="true" > <flat_list_view color="FloaterDefaultBackgroundColor" diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 9679d22e70346d73428c33bc491afe172d66c402..621dbdec61d6171b7155032223c8f81e5b228dc3 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -346,8 +346,11 @@ as for parent layout_panel (chiclet_list_panel) to resize bottom tray properly. image_overlay_alignment="right" pad_right="6" pad_left="6" - width="54" - /> + width="54" > + <button.init_callback + function="Button.SetDockableFloaterToggle" + parameter="notification_well_window" /> + </button> </chiclet_notification> </layout_panel> <icon