From 9ec432034dc3c45d7ce763eb02dae4cc7f6b8da8 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Sun, 21 Jun 2009 08:04:56 +0000 Subject: merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3 ignore-dead-branch --- indra/newview/llfloaterscriptdebug.cpp | 84 ++++++++++------------------------ 1 file changed, 25 insertions(+), 59 deletions(-) (limited to 'indra/newview/llfloaterscriptdebug.cpp') diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp index bc774e77ac..b2bb343681 100644 --- a/indra/newview/llfloaterscriptdebug.cpp +++ b/indra/newview/llfloaterscriptdebug.cpp @@ -52,12 +52,17 @@ // LLFloaterScriptDebug* LLFloaterScriptDebug::sInstance = NULL; +void* getOutputWindow(void* data); + // // Member Functions // -LLFloaterScriptDebug::LLFloaterScriptDebug() : - LLMultiFloater() +LLFloaterScriptDebug::LLFloaterScriptDebug(const std::string& filename) + : LLMultiFloater() { + mFactoryMap["all_scripts"] = LLCallbackMap(getOutputWindow, NULL); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_script_debug.xml"); + // avoid resizing of the window to match // the initial size of the tabbed-childs, whenever a tab is opened or closed mAutoResize = FALSE; @@ -73,8 +78,11 @@ void LLFloaterScriptDebug::show(const LLUUID& object_id) LLFloater* floaterp = addOutputWindow(object_id); if (sInstance) { - sInstance->open(); /* Flawfinder: ignore */ - sInstance->showFloater(floaterp); + sInstance->openFloater(object_id); + if (object_id.notNull()) + sInstance->showFloater(floaterp, LLTabContainer::END); +// else // Jump to [All scripts], but keep it on the left +// sInstance->showFloater(floaterp, LLTabContainer::START); } } @@ -95,25 +103,19 @@ BOOL LLFloaterScriptDebug::postBuild() void* getOutputWindow(void* data) { - return new LLFloaterScriptDebugOutput(); + return new LLFloaterScriptDebugOutput(LLUUID::null); } LLFloater* LLFloaterScriptDebug::addOutputWindow(const LLUUID &object_id) { if (!sInstance) { - sInstance = new LLFloaterScriptDebug(); - LLCallbackMap::map_t factory_map; - factory_map["all_scripts"] = LLCallbackMap(getOutputWindow, NULL); - LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_script_debug.xml", &factory_map); + sInstance = new LLFloaterScriptDebug("floater_script_debug.xml"); sInstance->setVisible(FALSE); } - LLFloater* floaterp = NULL; LLFloater::setFloaterHost(sInstance); - { - floaterp = LLFloaterScriptDebugOutput::show(object_id); - } + LLFloater* floaterp = LLFloaterScriptDebugOutput::show(object_id); LLFloater::setFloaterHost(NULL); // Tabs sometimes overlap resize handle @@ -155,54 +157,19 @@ void LLFloaterScriptDebug::addScriptLine(const std::string &utf8mesg, const std: std::map LLFloaterScriptDebugOutput::sInstanceMap; -LLFloaterScriptDebugOutput::LLFloaterScriptDebugOutput() -: mObjectID(LLUUID::null) -{ - sInstanceMap[mObjectID] = this; -} - LLFloaterScriptDebugOutput::LLFloaterScriptDebugOutput(const LLUUID& object_id) -: LLFloater(std::string("script instance floater"), LLRect(0, 200, 200, 0), std::string("Script"), TRUE), mObjectID(object_id) + : LLFloater(), + mObjectID(object_id) { - S32 y = getRect().getHeight() - LLFLOATER_HEADER_SIZE - LLFLOATER_VPAD; - S32 x = LLFLOATER_HPAD; - // History editor - // Give it a border on the top - LLRect history_editor_rect( - x, - y, - getRect().getWidth() - LLFLOATER_HPAD, - LLFLOATER_VPAD ); - mHistoryEditor = new LLViewerTextEditor( std::string("Chat History Editor"), - history_editor_rect, S32_MAX, LLStringUtil::null, LLFontGL::getFontSansSerif()); - mHistoryEditor->setWordWrap( TRUE ); - mHistoryEditor->setFollowsAll(); - mHistoryEditor->setEnabled( FALSE ); - mHistoryEditor->setTabStop( TRUE ); // We want to be able to cut or copy from the history. - addChild(mHistoryEditor); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_script_debug_panel.xml"); + sInstanceMap[object_id] = this; } -void LLFloaterScriptDebugOutput::initFloater(const std::string& title, BOOL resizable, - S32 min_width, S32 min_height, BOOL drag_on_left, - BOOL minimizable, BOOL close_btn) +BOOL LLFloaterScriptDebugOutput::postBuild() { - LLFloater::initFloater(title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn); - S32 y = getRect().getHeight() - LLFLOATER_HEADER_SIZE - LLFLOATER_VPAD; - S32 x = LLFLOATER_HPAD; - // History editor - // Give it a border on the top - LLRect history_editor_rect( - x, - y, - getRect().getWidth() - LLFLOATER_HPAD, - LLFLOATER_VPAD ); - mHistoryEditor = new LLViewerTextEditor( std::string("Chat History Editor"), - history_editor_rect, S32_MAX, LLStringUtil::null, LLFontGL::getFontSansSerif()); - mHistoryEditor->setWordWrap( TRUE ); - mHistoryEditor->setFollowsAll(); - mHistoryEditor->setEnabled( FALSE ); - mHistoryEditor->setTabStop( TRUE ); // We want to be able to cut or copy from the history. - addChild(mHistoryEditor); + LLFloater::postBuild(); + mHistoryEditor = getChild("Chat History Editor"); + return TRUE; } LLFloaterScriptDebugOutput::~LLFloaterScriptDebugOutput() @@ -214,13 +181,13 @@ void LLFloaterScriptDebugOutput::addLine(const std::string &utf8mesg, const std: { if (mObjectID.isNull()) { - //setTitle("[All scripts]"); setCanTearOff(FALSE); setCanClose(FALSE); } else { setTitle(user_name); + setShortTitle(user_name); } mHistoryEditor->appendColoredText(utf8mesg, false, true, color); @@ -234,8 +201,7 @@ LLFloaterScriptDebugOutput* LLFloaterScriptDebugOutput::show(const LLUUID& objec if (found_it == sInstanceMap.end()) { floaterp = new LLFloaterScriptDebugOutput(object_id); - sInstanceMap[object_id] = floaterp; - floaterp->open(); /* Flawfinder: ignore*/ + floaterp->openFloater(); } else { -- cgit v1.2.3 From 77f56a3f3db72b2938eadb0868fc7be975dabafa Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 10 Jul 2009 22:02:26 +0000 Subject: merge QAR-1579: texture-cleanup-1. --- indra/newview/llfloaterscriptdebug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterscriptdebug.cpp') diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp index b2bb343681..6cca4927a9 100644 --- a/indra/newview/llfloaterscriptdebug.cpp +++ b/indra/newview/llfloaterscriptdebug.cpp @@ -45,7 +45,7 @@ #include "llviewertexteditor.h" #include "llviewercontrol.h" #include "llviewerobjectlist.h" -#include "llviewerimagelist.h" +#include "llviewertexturelist.h" // // Statics @@ -131,7 +131,7 @@ void LLFloaterScriptDebug::addScriptLine(const std::string &utf8mesg, const std: if (objectp) { - objectp->setIcon(gImageList.getImageFromFile("script_error.j2c", TRUE, TRUE)); + objectp->setIcon(LLViewerTextureManager::getFetchedTextureFromFile("script_error.j2c", TRUE, TRUE)); floater_label = llformat("%s(%.2f, %.2f)", user_name.c_str(), objectp->getPositionRegion().mV[VX], objectp->getPositionRegion().mV[VY]); } else -- cgit v1.2.3 From eb853f55c07ae4a3c3f2aa05fbabcf2e4b4dc115 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Tue, 4 Aug 2009 01:12:59 +0000 Subject: svn merge -r 128442:129343 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-18 into svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3 --- indra/newview/llfloaterscriptdebug.cpp | 104 +++++++++------------------------ 1 file changed, 27 insertions(+), 77 deletions(-) (limited to 'indra/newview/llfloaterscriptdebug.cpp') diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp index 6cca4927a9..c8690de68c 100644 --- a/indra/newview/llfloaterscriptdebug.cpp +++ b/indra/newview/llfloaterscriptdebug.cpp @@ -32,9 +32,10 @@ #include "llviewerprecompiledheaders.h" -#include "lluictrlfactory.h" #include "llfloaterscriptdebug.h" +#include "llfloaterreg.h" +#include "lluictrlfactory.h" #include "llfontgl.h" #include "llrect.h" #include "llerror.h" @@ -50,19 +51,15 @@ // // Statics // -LLFloaterScriptDebug* LLFloaterScriptDebug::sInstance = NULL; - -void* getOutputWindow(void* data); // // Member Functions // -LLFloaterScriptDebug::LLFloaterScriptDebug(const std::string& filename) - : LLMultiFloater() +LLFloaterScriptDebug::LLFloaterScriptDebug(const LLSD& key) + : LLMultiFloater(key) { - mFactoryMap["all_scripts"] = LLCallbackMap(getOutputWindow, NULL); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_script_debug.xml"); - +// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_script_debug.xml"); + // avoid resizing of the window to match // the initial size of the tabbed-childs, whenever a tab is opened or closed mAutoResize = FALSE; @@ -70,20 +67,11 @@ LLFloaterScriptDebug::LLFloaterScriptDebug(const std::string& filename) LLFloaterScriptDebug::~LLFloaterScriptDebug() { - sInstance = NULL; } void LLFloaterScriptDebug::show(const LLUUID& object_id) { - LLFloater* floaterp = addOutputWindow(object_id); - if (sInstance) - { - sInstance->openFloater(object_id); - if (object_id.notNull()) - sInstance->showFloater(floaterp, LLTabContainer::END); -// else // Jump to [All scripts], but keep it on the left -// sInstance->showFloater(floaterp, LLTabContainer::START); - } + addOutputWindow(object_id); } BOOL LLFloaterScriptDebug::postBuild() @@ -101,26 +89,16 @@ BOOL LLFloaterScriptDebug::postBuild() return FALSE; } -void* getOutputWindow(void* data) -{ - return new LLFloaterScriptDebugOutput(LLUUID::null); -} - LLFloater* LLFloaterScriptDebug::addOutputWindow(const LLUUID &object_id) { - if (!sInstance) - { - sInstance = new LLFloaterScriptDebug("floater_script_debug.xml"); - sInstance->setVisible(FALSE); - } + LLMultiFloater* host = LLFloaterReg::showTypedInstance("script_debug", LLSD()); + if (!host) + return NULL; - LLFloater::setFloaterHost(sInstance); - LLFloater* floaterp = LLFloaterScriptDebugOutput::show(object_id); + LLFloater::setFloaterHost(host); + LLFloater* floaterp = LLFloaterReg::showInstance("script_debug_output", object_id); LLFloater::setFloaterHost(NULL); - // Tabs sometimes overlap resize handle - sInstance->moveResizeHandlesToFront(); - return floaterp; } @@ -143,26 +121,29 @@ void LLFloaterScriptDebug::addScriptLine(const std::string &utf8mesg, const std: addOutputWindow(source_id); // add to "All" floater - LLFloaterScriptDebugOutput* floaterp = LLFloaterScriptDebugOutput::getFloaterByID(LLUUID::null); - floaterp->addLine(utf8mesg, user_name, color); - + LLFloaterScriptDebugOutput* floaterp = LLFloaterReg::getTypedInstance("script_debug_output", LLUUID::null); + if (floaterp) + { + floaterp->addLine(utf8mesg, user_name, color); + } + // add to specific script instance floater - floaterp = LLFloaterScriptDebugOutput::getFloaterByID(source_id); - floaterp->addLine(utf8mesg, floater_label, color); + floaterp = LLFloaterReg::getTypedInstance("script_debug_output", source_id); + if (floaterp) + { + floaterp->addLine(utf8mesg, floater_label, color); + } } // // LLFloaterScriptDebugOutput // -std::map LLFloaterScriptDebugOutput::sInstanceMap; - -LLFloaterScriptDebugOutput::LLFloaterScriptDebugOutput(const LLUUID& object_id) - : LLFloater(), - mObjectID(object_id) +LLFloaterScriptDebugOutput::LLFloaterScriptDebugOutput(const LLSD& object_id) + : LLFloater(LLSD(object_id)), + mObjectID(object_id.asUUID()) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_script_debug_panel.xml"); - sInstanceMap[object_id] = this; + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_script_debug_panel.xml"); } BOOL LLFloaterScriptDebugOutput::postBuild() @@ -174,7 +155,6 @@ BOOL LLFloaterScriptDebugOutput::postBuild() LLFloaterScriptDebugOutput::~LLFloaterScriptDebugOutput() { - sInstanceMap.erase(mObjectID); } void LLFloaterScriptDebugOutput::addLine(const std::string &utf8mesg, const std::string &user_name, const LLColor4& color) @@ -193,33 +173,3 @@ void LLFloaterScriptDebugOutput::addLine(const std::string &utf8mesg, const std: mHistoryEditor->appendColoredText(utf8mesg, false, true, color); } -//static -LLFloaterScriptDebugOutput* LLFloaterScriptDebugOutput::show(const LLUUID& object_id) -{ - LLFloaterScriptDebugOutput* floaterp = NULL; - instance_map_t::iterator found_it = sInstanceMap.find(object_id); - if (found_it == sInstanceMap.end()) - { - floaterp = new LLFloaterScriptDebugOutput(object_id); - floaterp->openFloater(); - } - else - { - floaterp = found_it->second; - } - - return floaterp; -} - -//static -LLFloaterScriptDebugOutput* LLFloaterScriptDebugOutput::getFloaterByID(const LLUUID& object_id) -{ - LLFloaterScriptDebugOutput* floaterp = NULL; - instance_map_t::iterator found_it = sInstanceMap.find(object_id); - if (found_it != sInstanceMap.end()) - { - floaterp = found_it->second; - } - - return floaterp; -} -- cgit v1.2.3 From 138bf1132262c479dbbd5c95195db46b1efd065f Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 24 Aug 2009 20:04:52 +0000 Subject: merge -r 130399-131510 skinning-21 -> viewer-2.0.0-3 DEV-11254 DEV-11254 DEV-2003: DEV-21567 DEV-37301 EXT-104 EXT-138 EXT-217 EXT-256 EXT-259 EXT-259 EXT-328 EXT-348 EXT-386 EXT-399 EXT-403 EXT-460 EXT-492 EXT-492 EXT-531 EXT-537 EXT-684 improved text editor (handles multiple fonts simultaneously as well as inline widgets) --- indra/newview/llfloaterscriptdebug.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llfloaterscriptdebug.cpp') diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp index c8690de68c..328fb6450e 100644 --- a/indra/newview/llfloaterscriptdebug.cpp +++ b/indra/newview/llfloaterscriptdebug.cpp @@ -80,9 +80,6 @@ BOOL LLFloaterScriptDebug::postBuild() if (mTabContainer) { - // *FIX: apparantly fails for tab containers? -// mTabContainer->requires("all_scripts"); -// mTabContainer->checkRequirements(); return TRUE; } -- cgit v1.2.3