Skip to content
Snippets Groups Projects
Commit ae493ad7 authored by James Cook's avatar James Cook
Browse files

EXT-3118 disabled Alerts appear to be enabled in Preferences

Wasn't rebuilding the list of alerts on Preferences open
Cleaned up some formatting in llfloaterpreference.cpp
parent 0bfee2e4
Branches
Tags
No related merge requests found
...@@ -251,7 +251,7 @@ bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFlo ...@@ -251,7 +251,7 @@ bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFlo
{ {
floater->setAllIgnored(); floater->setAllIgnored();
LLFirstUse::disableFirstUse(); LLFirstUse::disableFirstUse();
LLFloaterPreference::buildLists(floater); floater->buildPopupLists();
} }
} }
return false; return false;
...@@ -266,7 +266,7 @@ bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLFl ...@@ -266,7 +266,7 @@ bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLFl
{ {
floater->resetAllIgnored(); floater->resetAllIgnored();
LLFirstUse::resetFirstUse(); LLFirstUse::resetFirstUse();
LLFloaterPreference::buildLists(floater); floater->buildPopupLists();
} }
} }
return false; return false;
...@@ -391,6 +391,7 @@ LLFloaterPreference::~LLFloaterPreference() ...@@ -391,6 +391,7 @@ LLFloaterPreference::~LLFloaterPreference()
ctrl_window_size->setCurrentByIndex(i); ctrl_window_size->setCurrentByIndex(i);
} }
} }
void LLFloaterPreference::draw() void LLFloaterPreference::draw()
{ {
BOOL has_first_selected = (getChildRef<LLScrollListCtrl>("disabled_popups").getFirstSelected()!=NULL); BOOL has_first_selected = (getChildRef<LLScrollListCtrl>("disabled_popups").getFirstSelected()!=NULL);
...@@ -548,17 +549,17 @@ void LLFloaterPreference::cancel() ...@@ -548,17 +549,17 @@ void LLFloaterPreference::cancel()
void LLFloaterPreference::onOpen(const LLSD& key) void LLFloaterPreference::onOpen(const LLSD& key)
{ {
gAgent.sendAgentUserInfoRequest(); gAgent.sendAgentUserInfoRequest();
/////////////////////////// From LLPanelGeneral ////////////////////////// /////////////////////////// From LLPanelGeneral //////////////////////////
// if we have no agent, we can't let them choose anything // if we have no agent, we can't let them choose anything
// if we have an agent, then we only let them choose if they have a choice // if we have an agent, then we only let them choose if they have a choice
bool canChoose = gAgent.getID().notNull() && bool can_choose_maturity =
(gAgent.isMature() || gAgent.isGodlike()); gAgent.getID().notNull() && (gAgent.isMature() || gAgent.isGodlike());
LLComboBox* maturity_combo = getChild<LLComboBox>("maturity_desired_combobox"); LLComboBox* maturity_combo = getChild<LLComboBox>("maturity_desired_combobox");
if (canChoose) if (can_choose_maturity)
{ {
// if they're not adult or a god, they shouldn't see the adult selection, so delete it // if they're not adult or a god, they shouldn't see the adult selection, so delete it
if (!gAgent.isAdult() && !gAgent.isGodlike()) if (!gAgent.isAdult() && !gAgent.isGodlike())
{ {
...@@ -569,7 +570,6 @@ void LLFloaterPreference::onOpen(const LLSD& key) ...@@ -569,7 +570,6 @@ void LLFloaterPreference::onOpen(const LLSD& key)
} }
childSetVisible("maturity_desired_combobox", true); childSetVisible("maturity_desired_combobox", true);
childSetVisible("maturity_desired_textbox", false); childSetVisible("maturity_desired_textbox", false);
} }
else else
{ {
...@@ -577,6 +577,10 @@ void LLFloaterPreference::onOpen(const LLSD& key) ...@@ -577,6 +577,10 @@ void LLFloaterPreference::onOpen(const LLSD& key)
childSetVisible("maturity_desired_combobox", false); childSetVisible("maturity_desired_combobox", false);
} }
// Enabled/disabled popups, might have been changed by user actions
// while preferences floater was closed.
buildPopupLists();
LLPanelLogin::setAlwaysRefresh(true); LLPanelLogin::setAlwaysRefresh(true);
refresh(); refresh();
...@@ -717,14 +721,6 @@ void LLFloaterPreference::updateMeterText(LLUICtrl* ctrl) ...@@ -717,14 +721,6 @@ void LLFloaterPreference::updateMeterText(LLUICtrl* ctrl)
m1->setVisible(two_digits); m1->setVisible(two_digits);
m2->setVisible(!two_digits); m2->setVisible(!two_digits);
} }
/*
void LLFloaterPreference::onClickClearCache()
{
// flag client cache for clearing next time the client runs
gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE);
LLNotificationsUtil::add("CacheWillClear");
}
*/
void LLFloaterPreference::onClickBrowserClearCache() void LLFloaterPreference::onClickBrowserClearCache()
{ {
...@@ -794,12 +790,13 @@ void LLFloaterPreference::refreshSkin(void* data) ...@@ -794,12 +790,13 @@ void LLFloaterPreference::refreshSkin(void* data)
self->getChild<LLRadioGroup>("skin_selection", true)->setValue(sSkin); self->getChild<LLRadioGroup>("skin_selection", true)->setValue(sSkin);
} }
// static
void LLFloaterPreference::buildLists(void* data) void LLFloaterPreference::buildPopupLists()
{ {
LLPanel*self = (LLPanel*)data; LLScrollListCtrl& disabled_popups =
LLScrollListCtrl& disabled_popups = self->getChildRef<LLScrollListCtrl>("disabled_popups"); getChildRef<LLScrollListCtrl>("disabled_popups");
LLScrollListCtrl& enabled_popups = self->getChildRef<LLScrollListCtrl>("enabled_popups"); LLScrollListCtrl& enabled_popups =
getChildRef<LLScrollListCtrl>("enabled_popups");
disabled_popups.deleteAllItems(); disabled_popups.deleteAllItems();
enabled_popups.deleteAllItems(); enabled_popups.deleteAllItems();
...@@ -862,7 +859,6 @@ void LLFloaterPreference::buildLists(void* data) ...@@ -862,7 +859,6 @@ void LLFloaterPreference::buildLists(void* data)
void LLFloaterPreference::refreshEnabledState() void LLFloaterPreference::refreshEnabledState()
{ {
LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections"); LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections");
LLRadioGroup* radio_reflection_detail = getChild<LLRadioGroup>("ReflectionDetailRadio"); LLRadioGroup* radio_reflection_detail = getChild<LLRadioGroup>("ReflectionDetailRadio");
...@@ -1111,7 +1107,7 @@ void LLFloaterPreference::onClickEnablePopup() ...@@ -1111,7 +1107,7 @@ void LLFloaterPreference::onClickEnablePopup()
LLUI::sSettingGroups["ignores"]->setBOOL(notification_name, TRUE); LLUI::sSettingGroups["ignores"]->setBOOL(notification_name, TRUE);
} }
buildLists(this); buildPopupLists();
} }
void LLFloaterPreference::onClickDisablePopup() void LLFloaterPreference::onClickDisablePopup()
...@@ -1128,8 +1124,9 @@ void LLFloaterPreference::onClickDisablePopup() ...@@ -1128,8 +1124,9 @@ void LLFloaterPreference::onClickDisablePopup()
LLUI::sSettingGroups["ignores"]->setBOOL(notification_name, FALSE); LLUI::sSettingGroups["ignores"]->setBOOL(notification_name, FALSE);
} }
buildLists(this); buildPopupLists();
} }
void LLFloaterPreference::resetAllIgnored() void LLFloaterPreference::resetAllIgnored()
{ {
for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin(); for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin();
...@@ -1428,17 +1425,11 @@ BOOL LLPanelPreference::postBuild() ...@@ -1428,17 +1425,11 @@ BOOL LLPanelPreference::postBuild()
} }
} }
////////////////////////Panel Popups/////////////////
if(hasChild("disabled_popups") && hasChild("enabled_popups"))
{
LLFloaterPreference::buildLists(this);
}
//////
if(hasChild("online_visibility") && hasChild("send_im_to_email")) if(hasChild("online_visibility") && hasChild("send_im_to_email"))
{ {
childSetText("email_address",getString("log_in_to_change") ); childSetText("email_address",getString("log_in_to_change") );
// childSetText("busy_response", getString("log_in_to_change")); // childSetText("busy_response", getString("log_in_to_change"));
} }
...@@ -1574,7 +1565,6 @@ void LLPanelPreference::saveSettings() ...@@ -1574,7 +1565,6 @@ void LLPanelPreference::saveSettings()
view_stack.push_back(*iter); view_stack.push_back(*iter);
} }
} }
} }
void LLPanelPreference::cancel() void LLPanelPreference::cancel()
...@@ -1607,4 +1597,3 @@ void LLPanelPreference::setControlFalse(const LLSD& user_data) ...@@ -1607,4 +1597,3 @@ void LLPanelPreference::setControlFalse(const LLSD& user_data)
if (control) if (control)
control->set(LLSD(FALSE)); control->set(LLSD(FALSE));
} }
...@@ -85,7 +85,6 @@ class LLFloaterPreference : public LLFloater ...@@ -85,7 +85,6 @@ class LLFloaterPreference : public LLFloater
void onBtnCancel(); void onBtnCancel();
void onBtnApply(); void onBtnApply();
// void onClickClearCache();
void onClickBrowserClearCache(); void onClickBrowserClearCache();
// if the custom settings box is clicked // if the custom settings box is clicked
...@@ -141,7 +140,7 @@ class LLFloaterPreference : public LLFloater ...@@ -141,7 +140,7 @@ class LLFloaterPreference : public LLFloater
static void initWindowSizeControls(LLPanel* panelp); static void initWindowSizeControls(LLPanel* panelp);
static void buildLists(void* data); void buildPopupLists();
static void refreshSkin(void* data); static void refreshSkin(void* data);
static void cleanupBadSetting(); static void cleanupBadSetting();
static F32 sAspectRatio; static F32 sAspectRatio;
...@@ -153,7 +152,6 @@ class LLFloaterPreference : public LLFloater ...@@ -153,7 +152,6 @@ class LLFloaterPreference : public LLFloater
bool mOriginalHideOnlineStatus; bool mOriginalHideOnlineStatus;
std::string mDirectoryVisibility; std::string mDirectoryVisibility;
}; };
class LLPanelPreference : public LLPanel class LLPanelPreference : public LLPanel
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment