From eb19075c39a5f4466bde856ff59ee7a2993cd98e Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 12 Jan 2015 15:44:59 +0100 Subject: [PATCH] Transfer everything from old FS script editor prefs to new script editor preferences from V3 and remove old FS script editor prefs --- indra/newview/CMakeLists.txt | 2 - indra/newview/fsfloaterscripteditorprefs.cpp | 84 -- indra/newview/fsfloaterscripteditorprefs.h | 46 - indra/newview/llfloaterscriptedprefs.cpp | 30 + indra/newview/llfloaterscriptedprefs.h | 3 + indra/newview/llpreviewscript.cpp | 2 +- indra/newview/llviewerfloaterreg.cpp | 2 - ..._prefs.xml => floater_script_ed_prefs.xml} | 2 +- .../xui/en/floater_fs_script_editor_prefs.xml | 585 ------------- .../xui/en/floater_script_ed_prefs.xml | 801 ++++++++++++------ ..._prefs.xml => floater_script_ed_prefs.xml} | 2 +- ..._prefs.xml => floater_script_ed_prefs.xml} | 2 +- 12 files changed, 568 insertions(+), 993 deletions(-) delete mode 100644 indra/newview/fsfloaterscripteditorprefs.cpp delete mode 100644 indra/newview/fsfloaterscripteditorprefs.h rename indra/newview/skins/default/xui/de/{floater_fs_script_editor_prefs.xml => floater_script_ed_prefs.xml} (95%) delete mode 100644 indra/newview/skins/default/xui/en/floater_fs_script_editor_prefs.xml rename indra/newview/skins/default/xui/es/{floater_fs_script_editor_prefs.xml => floater_script_ed_prefs.xml} (95%) rename indra/newview/skins/default/xui/pl/{floater_fs_script_editor_prefs.xml => floater_script_ed_prefs.xml} (96%) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index fbe8032e07..4f4d6386dd 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -160,7 +160,6 @@ set(viewer_SOURCE_FILES fsfloaterposestand.cpp fsfloaterprofile.cpp fsfloaterradar.cpp - fsfloaterscripteditorprefs.cpp fsfloatersearch.cpp fsfloaterteleporthistory.cpp fsfloatervoicecontrols.cpp @@ -881,7 +880,6 @@ set(viewer_HEADER_FILES fsfloaterposestand.h fsfloaterprofile.h fsfloaterradar.h - fsfloaterscripteditorprefs.h fsfloatersearch.h fsfloaterteleporthistory.h fsfloatervoicecontrols.h diff --git a/indra/newview/fsfloaterscripteditorprefs.cpp b/indra/newview/fsfloaterscripteditorprefs.cpp deleted file mode 100644 index 9e2efbd257..0000000000 --- a/indra/newview/fsfloaterscripteditorprefs.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * @file fsfloaterscripteditorprefs.h - * @brief Script editor preferences - * - * $LicenseInfo:firstyear=2012&license=fsviewerlgpl$ - * Phoenix Firestorm Viewer Source Code - * Copyright (C) 2012, Cinder Roxley - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA - * http://www.firestormviewer.org - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" -#include "fsfloaterscripteditorprefs.h" - -#include "llbutton.h" -#include "llcolorswatch.h" -#include "lldirpicker.h" -#include "llviewercontrol.h" - -FSFloaterScriptEdPrefs::FSFloaterScriptEdPrefs(const LLSD& key) -: LLFloater(key) -{ - mCommitCallbackRegistrar.add("ScriptPref.applyUIColor", boost::bind(&FSFloaterScriptEdPrefs::applyUIColor, this ,_1, _2)); - mCommitCallbackRegistrar.add("ScriptPref.getUIColor", boost::bind(&FSFloaterScriptEdPrefs::getUIColor, this ,_1, _2)); - mCommitCallbackRegistrar.add("NACL.SetPreprocInclude", boost::bind(&FSFloaterScriptEdPrefs::setPreprocInclude, this)); -} - -FSFloaterScriptEdPrefs::~FSFloaterScriptEdPrefs() -{ -} - -BOOL FSFloaterScriptEdPrefs::postBuild() -{ - getChild("close_btn")->setClickedCallback(boost::bind(&FSFloaterScriptEdPrefs::closeFloater, this, false)); - - return TRUE; -} - -void FSFloaterScriptEdPrefs::applyUIColor(LLUICtrl* ctrl, const LLSD& param) -{ - LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue())); -} - -void FSFloaterScriptEdPrefs::getUIColor(LLUICtrl* ctrl, const LLSD& param) -{ - LLColorSwatchCtrl* color_swatch = (LLColorSwatchCtrl*) ctrl; - color_swatch->setOriginal(LLUIColorTable::instance().getColor(param.asString())); -} - -void FSFloaterScriptEdPrefs::setPreprocInclude() -{ - std::string cur_name(gSavedSettings.getString("_NACL_PreProcHDDIncludeLocation")); - - std::string proposed_name(cur_name); - - LLDirPicker& picker = LLDirPicker::instance(); - if (!picker.getDir(&proposed_name )) - { - return; //Canceled! - } - - std::string dir_name = picker.getDirName(); - if (!dir_name.empty() && dir_name != cur_name) - { - std::string new_top_folder(gDirUtilp->getBaseFileName(dir_name)); - gSavedSettings.setString("_NACL_PreProcHDDIncludeLocation", dir_name); - } -} diff --git a/indra/newview/fsfloaterscripteditorprefs.h b/indra/newview/fsfloaterscripteditorprefs.h deleted file mode 100644 index 671694e382..0000000000 --- a/indra/newview/fsfloaterscripteditorprefs.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * @file fsfloaterscripteditorprefs.h - * @brief Script editor preferences - * - * $LicenseInfo:firstyear=2012&license=fsviewerlgpl$ - * Phoenix Firestorm Viewer Source Code - * Copyright (C) 2012, Cinder Roxley - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA - * http://www.firestormviewer.org - * $/LicenseInfo$ - */ - -#ifndef FS_FLOATERSCRIPTEDITORPREFS_H -#define FS_FLOATERSCRIPTEDITORPREFS_H - -#include "llfloater.h" - -class FSFloaterScriptEdPrefs : public LLFloater -{ -public: - FSFloaterScriptEdPrefs(const LLSD& key); - BOOL postBuild(); - -private: - ~FSFloaterScriptEdPrefs(); - void applyUIColor(LLUICtrl* ctrl, const LLSD& param); - void getUIColor(LLUICtrl* ctrl, const LLSD& param); - void setPreprocInclude(); -}; - -#endif // FS_FLOATERSCRIPTEDITORPREFS_H diff --git a/indra/newview/llfloaterscriptedprefs.cpp b/indra/newview/llfloaterscriptedprefs.cpp index 2484a08626..ab90eee80f 100644 --- a/indra/newview/llfloaterscriptedprefs.cpp +++ b/indra/newview/llfloaterscriptedprefs.cpp @@ -30,6 +30,8 @@ #include "llcolorswatch.h" #include "llscripteditor.h" +#include "lldirpicker.h" +#include "llviewercontrol.h" LLFloaterScriptEdPrefs::LLFloaterScriptEdPrefs(const LLSD& key) @@ -38,6 +40,8 @@ LLFloaterScriptEdPrefs::LLFloaterScriptEdPrefs(const LLSD& key) { mCommitCallbackRegistrar.add("ScriptPref.applyUIColor", boost::bind(&LLFloaterScriptEdPrefs::applyUIColor, this ,_1, _2)); mCommitCallbackRegistrar.add("ScriptPref.getUIColor", boost::bind(&LLFloaterScriptEdPrefs::getUIColor, this ,_1, _2)); + // Port old FS script prefs + mCommitCallbackRegistrar.add("NACL.SetPreprocInclude", boost::bind(&LLFloaterScriptEdPrefs::setPreprocInclude, this)); } BOOL LLFloaterScriptEdPrefs::postBuild() @@ -48,6 +52,10 @@ BOOL LLFloaterScriptEdPrefs::postBuild() mEditor->initKeywords(); mEditor->loadKeywords(); } + + // Port old FS script prefs + getChild("close_btn")->setClickedCallback(boost::bind(&LLFloaterScriptEdPrefs::closeFloater, this, false)); + return TRUE; } @@ -63,3 +71,25 @@ void LLFloaterScriptEdPrefs::getUIColor(LLUICtrl* ctrl, const LLSD& param) LLColorSwatchCtrl* color_swatch = dynamic_cast(ctrl); color_swatch->setOriginal(LLUIColorTable::instance().getColor(param.asString())); } + +// Port old FS script prefs +void LLFloaterScriptEdPrefs::setPreprocInclude() +{ + std::string cur_name(gSavedSettings.getString("_NACL_PreProcHDDIncludeLocation")); + + std::string proposed_name(cur_name); + + LLDirPicker& picker = LLDirPicker::instance(); + if (!picker.getDir(&proposed_name )) + { + return; //Canceled! + } + + std::string dir_name = picker.getDirName(); + if (!dir_name.empty() && dir_name != cur_name) + { + std::string new_top_folder(gDirUtilp->getBaseFileName(dir_name)); + gSavedSettings.setString("_NACL_PreProcHDDIncludeLocation", dir_name); + } +} +// diff --git a/indra/newview/llfloaterscriptedprefs.h b/indra/newview/llfloaterscriptedprefs.h index 31df897aac..8c1a7e0643 100644 --- a/indra/newview/llfloaterscriptedprefs.h +++ b/indra/newview/llfloaterscriptedprefs.h @@ -45,6 +45,9 @@ private: void applyUIColor(LLUICtrl* ctrl, const LLSD& param); void getUIColor(LLUICtrl* ctrl, const LLSD& param); + // Port old FS script prefs + void setPreprocInclude(); + LLScriptEditor* mEditor; }; diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 98018a2b99..9a4a1ddd06 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -722,7 +722,7 @@ void LLScriptEdCore::updateButtonBar() //static void LLScriptEdCore::onBtnPrefs(void* userdata) { - LLFloaterReg::showInstance("fs_script_editor_prefs"); + LLFloaterReg::showInstance("script_colors"); } // diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index b6659699f4..dc1d2a37ad 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -175,7 +175,6 @@ #include "fsfloaterposestand.h" #include "fsfloaterprofile.h" #include "fsfloaterradar.h" -#include "fsfloaterscripteditorprefs.h" #include "fsfloatersearch.h" #include "fsfloaterteleporthistory.h" #include "fsfloatervoicecontrols.h" @@ -421,7 +420,6 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("fs_posestand", "floater_fs_posestand.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_placedetails", "floater_fs_placedetails.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_radar", "floater_fs_radar.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("fs_script_editor_prefs", "floater_fs_script_editor_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_teleporthistory", "floater_fs_teleporthistory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_voice_controls", "floater_fs_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_volume_controls", "floater_fs_volume_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/skins/default/xui/de/floater_fs_script_editor_prefs.xml b/indra/newview/skins/default/xui/de/floater_script_ed_prefs.xml similarity index 95% rename from indra/newview/skins/default/xui/de/floater_fs_script_editor_prefs.xml rename to indra/newview/skins/default/xui/de/floater_script_ed_prefs.xml index 589579ed59..80767186fa 100644 --- a/indra/newview/skins/default/xui/de/floater_fs_script_editor_prefs.xml +++ b/indra/newview/skins/default/xui/de/floater_script_ed_prefs.xml @@ -1,5 +1,5 @@ - + Gewünschte Farben auswählen: diff --git a/indra/newview/skins/default/xui/en/floater_fs_script_editor_prefs.xml b/indra/newview/skins/default/xui/en/floater_fs_script_editor_prefs.xml deleted file mode 100644 index 58ed088c57..0000000000 --- a/indra/newview/skins/default/xui/en/floater_fs_script_editor_prefs.xml +++ /dev/null @@ -1,585 +0,0 @@ - - - - Choose desired colors: - - - - - - - - Text - - - - - - - Cursor - - - - - - - Background - - - - - - - Sections - - - - - - - Data Types - - - - - - - Events - - - - - - - Comment - - - - - - - Function - - - - - - - String Literals - - - - - - - - Integer Const - - - - - - - String Const - - - - - - - Float Const - - - - - - - Compound - - - - - - - Flow Control - - - - - - - Preprocessor - - - - Script Editor Options: - - - - - - - - - Preprocessor include path: - - - - +