void LLFloaterPreference::onClickDisablePopup() { LLScrollListCtrl& enabled_popups = getChildRef<LLScrollListCtrl>("enabled_popups"); std::vector<LLScrollListItem*> items = enabled_popups.getAllSelected(); std::vector<LLScrollListItem*>::iterator itor; for (itor = items.begin(); itor != items.end(); ++itor) { LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate(*(std::string*)((*itor)->getUserdata())); templatep->mForm->setIgnored(false); } buildPopupLists(); }
void LLFloaterPreference::onOpen(const LLSD& key) { gAgent.sendAgentUserInfoRequest(); /////////////////////////// From LLPanelGeneral ////////////////////////// // 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 bool can_choose_maturity = gAgent.getID().notNull() && (gAgent.isMature() || gAgent.isGodlike()); LLComboBox* maturity_combo = getChild<LLComboBox>("maturity_desired_combobox"); if (can_choose_maturity) { // if they're not adult or a god, they shouldn't see the adult selection, so delete it if (!gAgent.isAdult() && !gAgent.isGodlike()) { // we're going to remove the adult entry from the combo LLScrollListCtrl* maturity_list = maturity_combo->findChild<LLScrollListCtrl>("ComboBox"); if (maturity_list) { maturity_list->deleteItems(LLSD(SIM_ACCESS_ADULT)); } } childSetVisible("maturity_desired_combobox", true); childSetVisible("maturity_desired_textbox", false); } else { childSetText("maturity_desired_textbox", maturity_combo->getSelectedItemLabel()); childSetVisible("maturity_desired_combobox", false); } // Display selected maturity icons. onChangeMaturity(); // Enabled/disabled popups, might have been changed by user actions // while preferences floater was closed. buildPopupLists(); LLPanelLogin::setAlwaysRefresh(true); refresh(); // Make sure the current state of prefs are saved away when // when the floater is opened. That will make cancel do its // job saveSettings(); }
void LLFloaterPreference::onClickDisablePopup() { LLScrollListCtrl& enabled_popups = getChildRef<LLScrollListCtrl>("enabled_popups"); std::vector<LLScrollListItem*> items = enabled_popups.getAllSelected(); std::vector<LLScrollListItem*>::iterator itor; for (itor = items.begin(); itor != items.end(); ++itor) { LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate(*(std::string*)((*itor)->getUserdata())); //gSavedSettings.setWarning(templatep->mName, TRUE); std::string notification_name = templatep->mName; LLUI::sSettingGroups["ignores"]->setBOOL(notification_name, FALSE); } buildPopupLists(); }
void LLFloaterPreference::onOpen(const LLSD& key) { // this variable and if that follows it are used to properly handle busy mode response message static bool initialized = FALSE; // if user is logged in and we haven't initialized busy_response yet, do it if (!initialized && LLStartUp::getStartupState() == STATE_STARTED) { // Special approach is used for busy response localization, because "BusyModeResponse" is // in non-localizable xml, and also because it may be changed by user and in this case it shouldn't be localized. // To keep track of whether busy response is default or changed by user additional setting BusyResponseChanged // was added into per account settings. // initialization should happen once,so setting variable to TRUE initialized = TRUE; // this connection is needed to properly set "BusyResponseChanged" setting when user makes changes in // busy response message. gSavedPerAccountSettings.getControl("BusyModeResponse")->getSignal()->connect(boost::bind(&LLFloaterPreference::onBusyResponseChanged, this)); } gAgent.sendAgentUserInfoRequest(); /////////////////////////// From LLPanelGeneral ////////////////////////// // 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 bool can_choose_maturity = gAgent.getID().notNull() && (gAgent.isMature() || gAgent.isGodlike()); LLComboBox* maturity_combo = getChild<LLComboBox>("maturity_desired_combobox"); if (can_choose_maturity) { // if they're not adult or a god, they shouldn't see the adult selection, so delete it if (!gAgent.isAdult() && !gAgent.isGodlikeWithoutAdminMenuFakery()) { // we're going to remove the adult entry from the combo LLScrollListCtrl* maturity_list = maturity_combo->findChild<LLScrollListCtrl>("ComboBox"); if (maturity_list) { maturity_list->deleteItems(LLSD(SIM_ACCESS_ADULT)); } } getChildView("maturity_desired_combobox")->setVisible( true); getChildView("maturity_desired_textbox")->setVisible( false); } else { getChild<LLUICtrl>("maturity_desired_textbox")->setValue(maturity_combo->getSelectedItemLabel()); getChildView("maturity_desired_combobox")->setVisible( false); } // Display selected maturity icons. onChangeMaturity(); // Enabled/disabled popups, might have been changed by user actions // while preferences floater was closed. buildPopupLists(); LLPanelLogin::setAlwaysRefresh(true); refresh(); // Make sure the current state of prefs are saved away when // when the floater is opened. That will make cancel do its // job saveSettings(); }