summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorRye Mutt <rye@alchemyviewer.org>2024-08-18 15:35:33 -0400
committerRye Mutt <rye@alchemyviewer.org>2024-08-18 15:35:33 -0400
commitba2b77d0882f8ca3ef0ae95ca9d388aa217f9a7a (patch)
treea22cecbf65ac1c34aef6711c4bdf891cad8b5d8a /indra/newview/llfloaterpreference.cpp
parent4c0f342c93b4716ad6f7fb2b2b04bf217c0b824d (diff)
Fix findChild during draw in preference floater
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r--indra/newview/llfloaterpreference.cpp49
1 files changed, 22 insertions, 27 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 5e5cfcecbf..3441fff7e8 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -430,6 +430,13 @@ void LLFloaterPreference::saveAvatarPropertiesCoro(const std::string cap_url, bo
bool LLFloaterPreference::postBuild()
{
+ mDeleteTranscriptsBtn = getChild<LLButton>("delete_transcripts");
+
+ mEnabledPopups = getChild<LLScrollListCtrl>("enabled_popups");
+ mDisabledPopups = getChild<LLScrollListCtrl>("disabled_popups");
+ mEnablePopupBtn = getChild<LLButton>("enable_this_popup");
+ mDisablePopupBtn = getChild<LLButton>("disable_this_popup");
+
gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLFloaterIMSessionTab::processChatHistoryStyleUpdate, false));
gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLViewerChat::signalChatFontChanged));
@@ -519,7 +526,7 @@ bool LLFloaterPreference::postBuild()
void LLFloaterPreference::updateDeleteTranscriptsButton()
{
- getChild<LLButton>("delete_transcripts")->setEnabled(LLLogChat::transcriptFilesExist());
+ mDeleteTranscriptsBtn->setEnabled(LLLogChat::transcriptFilesExist());
}
void LLFloaterPreference::onDoNotDisturbResponseChanged()
@@ -540,11 +547,11 @@ LLFloaterPreference::~LLFloaterPreference()
void LLFloaterPreference::draw()
{
- bool has_first_selected = (getChildRef<LLScrollListCtrl>("disabled_popups").getFirstSelected()!=NULL);
- gSavedSettings.setBOOL("FirstSelectedDisabledPopups", has_first_selected);
+ bool has_first_selected = (mDisabledPopups->getFirstSelected()!=NULL);
+ mEnablePopupBtn->setEnabled(has_first_selected);
- has_first_selected = (getChildRef<LLScrollListCtrl>("enabled_popups").getFirstSelected()!=NULL);
- gSavedSettings.setBOOL("FirstSelectedEnabledPopups", has_first_selected);
+ has_first_selected = (mEnabledPopups->getFirstSelected()!=NULL);
+ mDisablePopupBtn->setEnabled(has_first_selected);
LLFloater::draw();
}
@@ -1171,13 +1178,8 @@ void LLFloaterPreference::refreshSkin(void* data)
void LLFloaterPreference::buildPopupLists()
{
- LLScrollListCtrl& disabled_popups =
- getChildRef<LLScrollListCtrl>("disabled_popups");
- LLScrollListCtrl& enabled_popups =
- getChildRef<LLScrollListCtrl>("enabled_popups");
-
- disabled_popups.deleteAllItems();
- enabled_popups.deleteAllItems();
+ mDisabledPopups->deleteAllItems();
+ mEnabledPopups->deleteAllItems();
for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin();
iter != LLNotifications::instance().templatesEnd();
@@ -1219,11 +1221,11 @@ void LLFloaterPreference::buildPopupLists()
}
}
}
- item = disabled_popups.addElement(row);
+ item = mDisabledPopups->addElement(row);
}
else
{
- item = enabled_popups.addElement(row);
+ item = mEnabledPopups->addElement(row);
}
if (item)
@@ -1324,9 +1326,7 @@ void LLFloaterPreference::onClickSetSounds()
void LLFloaterPreference::onClickEnablePopup()
{
- LLScrollListCtrl& disabled_popups = getChildRef<LLScrollListCtrl>("disabled_popups");
-
- std::vector<LLScrollListItem*> items = disabled_popups.getAllSelected();
+ std::vector<LLScrollListItem*> items = mDisabledPopups->getAllSelected();
std::vector<LLScrollListItem*>::iterator itor;
for (itor = items.begin(); itor != items.end(); ++itor)
{
@@ -1345,9 +1345,7 @@ void LLFloaterPreference::onClickEnablePopup()
void LLFloaterPreference::onClickDisablePopup()
{
- LLScrollListCtrl& enabled_popups = getChildRef<LLScrollListCtrl>("enabled_popups");
-
- std::vector<LLScrollListItem*> items = enabled_popups.getAllSelected();
+ std::vector<LLScrollListItem*> items = mEnabledPopups->getAllSelected();
std::vector<LLScrollListItem*>::iterator itor;
for (itor = items.begin(); itor != items.end(); ++itor)
{
@@ -1796,11 +1794,9 @@ void LLFloaterPreference::onDeleteTranscriptsResponse(const LLSD& notification,
void LLFloaterPreference::onLogChatHistorySaved()
{
- LLButton * delete_transcripts_buttonp = getChild<LLButton>("delete_transcripts");
-
- if (!delete_transcripts_buttonp->getEnabled())
+ if (!mDeleteTranscriptsBtn->getEnabled())
{
- delete_transcripts_buttonp->setEnabled(true);
+ mDeleteTranscriptsBtn->setEnabled(true);
}
}
@@ -2334,7 +2330,6 @@ bool LLPanelPreferenceGraphics::postBuild()
void LLPanelPreferenceGraphics::draw()
{
- setPresetText();
LLPanelPreference::draw();
}
@@ -3315,8 +3310,8 @@ void LLFloaterPreference::onUpdateFilterTerm(bool force)
void LLFloaterPreference::filterIgnorableNotifications()
{
- bool visible = getChildRef<LLScrollListCtrl>("enabled_popups").highlightMatchingItems(mFilterEdit->getValue());
- visible |= getChildRef<LLScrollListCtrl>("disabled_popups").highlightMatchingItems(mFilterEdit->getValue());
+ bool visible = mEnabledPopups->highlightMatchingItems(mFilterEdit->getValue());
+ visible |= mDisabledPopups->highlightMatchingItems(mFilterEdit->getValue());
if (visible)
{