From 4170230132fa7d1d1a5f87f8aebb8eb11b9076ea Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 18 Mar 2013 18:37:18 +0100 Subject: [PATCH] Undid FIRE-3948 and made "Block" button optional (Preferences -> Firestorm -> Protection -> Remove "Block" button from script dialogs) --- indra/newview/app_settings/settings.xml | 11 ++++++++ indra/newview/lltoastnotifypanel.cpp | 24 ++++++++++-------- .../xui/de/panel_preferences_firestorm.xml | 1 + .../xui/en/panel_preferences_firestorm.xml | 25 +++++++++++++------ 4 files changed, 42 insertions(+), 19 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9c619233f0..fec8c4bf53 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -20116,5 +20116,16 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSRemoveScriptBlockButton + + Comment + Removes the "block" from script dialogs. + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index b56746297a..619112d9ea 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -309,12 +309,12 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectorgetRect().getWidth(); LLButton* ignore_btn = NULL; - // LLButton* mute_btn = NULL; *spam protection is part of FS now. May be a debug setting in future* + LLButton* mute_btn = NULL; for (std::vector::const_iterator it = buttons.begin(); it != buttons.end(); it++) { if (-2 == it->first) { - // mute_btn = it->second; *Removing Mute Button* + mute_btn = it->second; continue; } if (it->first == -1) @@ -351,16 +351,18 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectorgetRect()); + // Undo the removal and make it optional after I was looking for the mute button on spammy dialogs! + //if (mIsScriptDialog && mute_btn != NULL) + if (mIsScriptDialog && mute_btn != NULL && !gSavedSettings.getBOOL("FSRemoveScriptBlockButton")) + { + LLRect mute_btn_rect(mute_btn->getRect()); // Place mute (Block) button to the left of the ignore button. - // S32 mute_btn_left = max_width - mute_btn_rect.getWidth() - ignore_btn_width - mute_btn_pad; - // mute_btn_rect.setOriginAndSize(mute_btn_left, BOTTOM_PAD,// always move mute button at the bottom - // mute_btn_rect.getWidth(), mute_btn_rect.getHeight()); - // mute_btn->setRect(mute_btn_rect); - // mControlPanel->addChild(mute_btn); - //} + S32 mute_btn_left = max_width - mute_btn_rect.getWidth() - ignore_btn_width - mute_btn_pad; + mute_btn_rect.setOriginAndSize(mute_btn_left, BOTTOM_PAD,// always move mute button at the bottom + mute_btn_rect.getWidth(), mute_btn_rect.getHeight()); + mute_btn->setRect(mute_btn_rect); + mControlPanel->addChild(mute_btn); + } } void LLToastNotifyPanel::adjustPanelForScriptNotice(S32 button_panel_width, S32 button_panel_height) { diff --git a/indra/newview/skins/default/xui/de/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/de/panel_preferences_firestorm.xml index d02aba16e1..f935694e15 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_firestorm.xml @@ -65,6 +65,7 @@