summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaternotificationsconsole.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaternotificationsconsole.cpp')
-rw-r--r--indra/newview/llfloaternotificationsconsole.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp
index 08475b1e55..42dc60f9e0 100644
--- a/indra/newview/llfloaternotificationsconsole.cpp
+++ b/indra/newview/llfloaternotificationsconsole.cpp
@@ -37,10 +37,10 @@
const S32 NOTIFICATION_PANEL_HEADER_HEIGHT = 20;
const S32 HEADER_PADDING = 38;
-class LLNotificationChannelPanel : public LLPanel
+class LLNotificationChannelPanel : public LLLayoutPanel
{
public:
- LLNotificationChannelPanel(const std::string& channel_name);
+ LLNotificationChannelPanel(const Params& p);
BOOL postBuild();
private:
@@ -52,14 +52,14 @@ private:
LLNotificationChannelPtr mChannelRejectsPtr;
};
-LLNotificationChannelPanel::LLNotificationChannelPanel(const std::string& channel_name)
- : LLPanel()
+LLNotificationChannelPanel::LLNotificationChannelPanel(const LLNotificationChannelPanel::Params& p)
+: LLLayoutPanel(p)
{
- mChannelPtr = LLNotifications::instance().getChannel(channel_name);
+ mChannelPtr = LLNotifications::instance().getChannel(p.name);
mChannelRejectsPtr = LLNotificationChannelPtr(
- LLNotificationChannel::buildChannel(channel_name + "rejects", mChannelPtr->getParentChannelName(),
+ LLNotificationChannel::buildChannel(p.name() + "rejects", mChannelPtr->getParentChannelName(),
!boost::bind(mChannelPtr->getFilter(), _1)));
- LLUICtrlFactory::instance().buildPanel(this, "panel_notifications_channel.xml");
+ buildFromFile( "panel_notifications_channel.xml");
}
BOOL LLNotificationChannelPanel::postBuild()
@@ -167,8 +167,6 @@ LLFloaterNotificationConsole::LLFloaterNotificationConsole(const LLSD& key)
: LLFloater(key)
{
mCommitCallbackRegistrar.add("ClickAdd", boost::bind(&LLFloaterNotificationConsole::onClickAdd, this));
-
- //LLUICtrlFactory::instance().buildFloater(this, "floater_notifications_console.xml");
}
BOOL LLFloaterNotificationConsole::postBuild()
@@ -203,8 +201,13 @@ BOOL LLFloaterNotificationConsole::postBuild()
void LLFloaterNotificationConsole::addChannel(const std::string& name, bool open)
{
LLLayoutStack& stack = getChildRef<LLLayoutStack>("notification_channels");
- LLNotificationChannelPanel* panelp = new LLNotificationChannelPanel(name);
- stack.addPanel(panelp, 0, NOTIFICATION_PANEL_HEADER_HEIGHT, S32_MAX, S32_MAX, TRUE, TRUE, LLLayoutStack::ANIMATE);
+ LLNotificationChannelPanel::Params p;
+ p.min_dim = NOTIFICATION_PANEL_HEADER_HEIGHT;
+ p.auto_resize = true;
+ p.user_resize = true;
+ p.name = name;
+ LLNotificationChannelPanel* panelp = new LLNotificationChannelPanel(p);
+ stack.addPanel(panelp, LLLayoutStack::ANIMATE);
LLButton& header_button = panelp->getChildRef<LLButton>("header");
header_button.setToggleState(!open);
@@ -248,7 +251,7 @@ LLFloaterNotification::LLFloaterNotification(LLNotification* note)
: LLFloater(LLSD()),
mNote(note)
{
- LLUICtrlFactory::instance().buildFloater(this, "floater_notification.xml", NULL);
+ buildFromFile("floater_notification.xml");
}
BOOL LLFloaterNotification::postBuild()