diff options
Diffstat (limited to 'indra/newview')
198 files changed, 4293 insertions, 3912 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 899d0a8293..0be84e2ab9 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -89,6 +89,7 @@ set(viewer_SOURCE_FILES llcapabilitylistener.cpp llcaphttpsender.cpp llchannelmanager.cpp + llchatbar.cpp llchatitemscontainerctrl.cpp llchatmsgbox.cpp llchiclet.cpp @@ -151,13 +152,11 @@ set(viewer_SOURCE_FILES llfloatercamera.cpp llfloaterchat.cpp llfloaterchatterbox.cpp - llfloaterclassified.cpp llfloatercolorpicker.cpp llfloatercustomize.cpp llfloaterdaycycle.cpp llfloaterdirectory.cpp llfloaterenvsettings.cpp - llfloaterevent.cpp llfloaterfirsttimetip.cpp llfloaterfriends.cpp llfloaterfonttest.cpp @@ -186,7 +185,6 @@ set(viewer_SOURCE_FILES llfloatermute.cpp llfloaternamedesc.cpp llfloaternotificationsconsole.cpp - llfloaterobjectiminfo.cpp llfloateropenobject.cpp llfloaterparcel.cpp llfloaterperms.cpp @@ -283,6 +281,7 @@ set(viewer_SOURCE_FILES lloverlaybar.cpp llpanelavatar.cpp llpanelavatarrow.cpp + llpanelavatartag.cpp llpanelclassified.cpp llsidetraypanelcontainer.cpp llpanelcontents.cpp @@ -531,6 +530,7 @@ set(viewer_HEADER_FILES llcapabilityprovider.h llcaphttpsender.h llchannelmanager.h + llchatbar.h llchatitemscontainerctrl.h llchatmsgbox.h llchiclet.h @@ -594,13 +594,11 @@ set(viewer_HEADER_FILES llfloatercamera.h llfloaterchat.h llfloaterchatterbox.h - llfloaterclassified.h llfloatercolorpicker.h llfloatercustomize.h llfloaterdaycycle.h llfloaterdirectory.h llfloaterenvsettings.h - llfloaterevent.h llfloaterfirsttimetip.h llfloaterfonttest.h llfloaterfriends.h @@ -629,7 +627,6 @@ set(viewer_HEADER_FILES llfloatermute.h llfloaternamedesc.h llfloaternotificationsconsole.h - llfloaterobjectiminfo.h llfloateropenobject.h llfloaterparcel.h llfloaterpostcard.h @@ -725,6 +722,7 @@ set(viewer_HEADER_FILES lloverlaybar.h llpanelavatar.h llpanelavatarrow.h + llpanelavatartag.h llpanelclassified.h llsidetraypanelcontainer.h llpanelcontents.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3baf37826f..fa6ce4f1d8 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -584,17 +584,6 @@ <key>Value</key> <integer>40</integer> </map> - <key>BeaconAlwaysOn</key> - <map> - <key>Comment</key> - <string>Beacons / highlighting always on</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>BottomPanelNew</key> <map> <key>Comment</key> @@ -4593,7 +4582,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> <key>NearMeRange</key> <map> @@ -7203,7 +7192,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>ShowTangentBasis</key> <map> @@ -8289,7 +8278,7 @@ <key>Type</key> <string>S32</string> <key>Value</key> - <real>16</real> + <real>15</real> </map> <key>UISliderctrlHeight</key> <map> diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 7834e7b2ef..a1484b3c52 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -678,13 +678,15 @@ bool LLAppViewer::init() // Setup paths and LLTrans after LLUI::initClass has been called LLUI::setupPaths(); LLTrans::parseStrings("strings.xml", default_trans_args); - + LLTrans::parseLanguageStrings("language_settings.xml"); LLWeb::initClass(); // do this after LLUI LLTextEditor::setURLCallbacks(&LLWeb::loadURL, &LLURLDispatcher::dispatchFromTextEditor, &LLURLDispatcher::dispatchFromTextEditor); - + + // Load translations for tooltips + LLFloater::initClass(); ///////////////////////////////////////////////// @@ -1739,7 +1741,7 @@ bool LLAppViewer::initConfiguration() LLUI::setupPaths(); // setup paths for LLTrans based on settings files only LLTrans::parseStrings("strings.xml", default_trans_args); - + LLTrans::parseLanguageStrings("language_settings.xml"); // - set procedural settings // Note: can't use LL_PATH_PER_SL_ACCOUNT for any of these since we haven't logged in yet gSavedSettings.setString("ClientSettingsFile", @@ -1794,6 +1796,7 @@ bool LLAppViewer::initConfiguration() LLControlGroupCLP clp; std::string cmd_line_config = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "cmd_line.xml"); + clp.configure(cmd_line_config, &gSavedSettings); if(!initParseCommandLine(clp)) @@ -3435,7 +3438,7 @@ void LLAppViewer::idle() { // Handle pending gesture processing - gGestureManager.update(); + LLGestureManager::instance().update(); gAgent.updateAgentPosition(gFrameDTClamped, yaw, current_mouse.mX, current_mouse.mY); } diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 802c90f531..bb3b9087a1 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -465,10 +465,10 @@ void LLUpdateAgentInventoryResponder::uploadComplete(const LLSD& content) { // If this gesture is active, then we need to update the in-memory // active map with the new pointer. - if (gGestureManager.isGestureActive(item_id)) + if (LLGestureManager::instance().isGestureActive(item_id)) { LLUUID asset_id = new_item->getAssetUUID(); - gGestureManager.replaceGesture(item_id, asset_id); + LLGestureManager::instance().replaceGesture(item_id, asset_id); gInventory.notifyObservers(); } diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 8e1ae7d4f2..9eb8369c4c 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -40,13 +40,14 @@ #include "llnearbychatbar.h" #include "llsplitbutton.h" #include "llfloatercamera.h" +#include "llimpanel.h" LLBottomTray::LLBottomTray(const LLSD&) - : mChicletPanel(NULL) - , mIMWell(NULL) - , mSysWell(NULL) - , mTalkBtn(NULL) - , mNearbyChatBar(NULL) +: mChicletPanel(NULL), + mIMWell(NULL), + mSysWell(NULL), + mTalkBtn(NULL), + mNearbyChatBar(NULL) { mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); @@ -72,6 +73,13 @@ LLBottomTray::LLBottomTray(const LLSD&) setFocusRoot(TRUE); } +BOOL LLBottomTray::postBuild() +{ + mNearbyChatBar = getChild<LLNearbyChatBar>("chat_bar"); + + return TRUE; +} + LLBottomTray::~LLBottomTray() { if (!LLSingleton<LLIMMgr>::destroyed()) @@ -87,24 +95,18 @@ void LLBottomTray::onChicletClick(LLUICtrl* ctrl) { // Until you can type into an IM Window and have a conversation, // still show the old communicate window - LLFloaterReg::showInstance("communicate", chiclet->getSessionId()); - // DISABLED IN VIEWER-2 BRANCH UNTIL FEATURE IS DONE -- James - //// Show after comm window so it is frontmost (and hence will not - //// auto-hide) - //LLIMFloater::show(chiclet->getSessionId()); + //LLFloaterReg::showInstance("communicate", chiclet->getSessionId()); + + // Show after comm window so it is frontmost (and hence will not + // auto-hide) + LLIMFloater::show(chiclet->getSessionId()); chiclet->setCounter(0); } } void* LLBottomTray::createNearbyChatBar(void* userdata) { - LLBottomTray *bt = LLBottomTray::getInstance(); - if (!bt) - return NULL; - - bt->mNearbyChatBar = new LLNearbyChatBar(); - - return bt->mNearbyChatBar; + return new LLNearbyChatBar(); } //virtual diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index a100124e02..ffb0f9ae4f 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -43,21 +43,22 @@ class LLTalkButton; class LLNearbyChatBar; class LLBottomTray - : public LLUISingleton<LLBottomTray> + : public LLSingleton<LLBottomTray> , public LLPanel , public LLIMSessionObserver { - friend class LLUISingleton<LLBottomTray>; + friend class LLSingleton<LLBottomTray>; public: ~LLBottomTray(); + BOOL postBuild(); + LLChicletPanel* getChicletPanel() {return mChicletPanel;} LLNotificationChiclet* getIMWell() {return mIMWell;} LLNotificationChiclet* getSysWell() {return mSysWell;} LLNearbyChatBar* getNearbyChatBar() {return mNearbyChatBar;} void onCommitGesture(LLUICtrl* ctrl); - void refreshGestures(); // LLIMSessionObserver observe triggers virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp new file mode 100644 index 0000000000..46a2179e8d --- /dev/null +++ b/indra/newview/llchatbar.cpp @@ -0,0 +1,694 @@ +/** + * @file llchatbar.cpp + * @brief LLChatBar class implementation + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llchatbar.h" + +#include "imageids.h" +#include "llfontgl.h" +#include "llrect.h" +#include "llerror.h" +#include "llparcel.h" +#include "llstring.h" +#include "message.h" +#include "llfocusmgr.h" + +#include "llagent.h" +#include "llbutton.h" +#include "llcombobox.h" +#include "llcommandhandler.h" // secondlife:///app/chat/ support +#include "llviewercontrol.h" +#include "llfloaterchat.h" +#include "llgesturemgr.h" +#include "llkeyboard.h" +#include "lllineeditor.h" +#include "llstatusbar.h" +#include "lltextbox.h" +#include "lluiconstants.h" +#include "llviewergesture.h" // for triggering gestures +#include "llviewermenu.h" // for deleting object with DEL key +#include "llviewerstats.h" +#include "llviewerwindow.h" +#include "llframetimer.h" +#include "llresmgr.h" +#include "llworld.h" +#include "llinventorymodel.h" +#include "llmultigesture.h" +#include "llui.h" +#include "llviewermenu.h" +#include "lluictrlfactory.h" +#include "llbottomtray.h" + +// +// Globals +// +const F32 AGENT_TYPING_TIMEOUT = 5.f; // seconds + +LLChatBar *gChatBar = NULL; + +class LLChatBarGestureObserver : public LLGestureManagerObserver +{ +public: + LLChatBarGestureObserver(LLChatBar* chat_barp) : mChatBar(chat_barp){} + virtual ~LLChatBarGestureObserver() {} + virtual void changed() { mChatBar->refreshGestures(); } +private: + LLChatBar* mChatBar; +}; + + +extern void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); + +// +// Functions +// + +LLChatBar::LLChatBar() +: LLPanel(), + mInputEditor(NULL), + mGestureLabelTimer(), + mLastSpecialChatChannel(0), + mIsBuilt(FALSE), + mGestureCombo(NULL), + mObserver(NULL) +{ + setIsChrome(TRUE); + +#if !LL_RELEASE_FOR_DOWNLOAD + childDisplayNotFound(); +#endif +} + + +LLChatBar::~LLChatBar() +{ + LLGestureManager::instance().removeObserver(mObserver); + delete mObserver; + mObserver = NULL; + // LLView destructor cleans up children +} + +BOOL LLChatBar::postBuild() +{ + getChild<LLUICtrl>("Say")->setCommitCallback(boost::bind(&LLChatBar::onClickSay, this, _1)); + + // attempt to bind to an existing combo box named gesture + setGestureCombo(getChild<LLComboBox>( "Gesture", TRUE, FALSE)); + + mInputEditor = getChild<LLLineEditor>("Chat Editor"); + mInputEditor->setKeystrokeCallback(&onInputEditorKeystroke, this); + mInputEditor->setFocusLostCallback(&onInputEditorFocusLost, this); + mInputEditor->setFocusReceivedCallback( &onInputEditorGainFocus, this ); + mInputEditor->setCommitOnFocusLost( FALSE ); + mInputEditor->setRevertOnEsc( FALSE ); + mInputEditor->setIgnoreTab(TRUE); + mInputEditor->setPassDelete(TRUE); + mInputEditor->setReplaceNewlinesWithSpaces(FALSE); + + mInputEditor->setMaxTextLength(1023); + mInputEditor->setEnableLineHistory(TRUE); + + mIsBuilt = TRUE; + + return TRUE; +} + +//----------------------------------------------------------------------- +// Overrides +//----------------------------------------------------------------------- + +// virtual +BOOL LLChatBar::handleKeyHere( KEY key, MASK mask ) +{ + BOOL handled = FALSE; + + // ALT-RETURN is reserved for windowed/fullscreen toggle + if( KEY_RETURN == key ) + { + if (mask == MASK_CONTROL) + { + // shout + sendChat(CHAT_TYPE_SHOUT); + handled = TRUE; + } + else if (mask == MASK_NONE) + { + // say + sendChat( CHAT_TYPE_NORMAL ); + handled = TRUE; + } + } + // only do this in main chatbar + else if ( KEY_ESCAPE == key && gChatBar == this) + { + stopChat(); + + handled = TRUE; + } + + return handled; +} + +void LLChatBar::refresh() +{ + // HACK: Leave the name of the gesture in place for a few seconds. + const F32 SHOW_GESTURE_NAME_TIME = 2.f; + if (mGestureLabelTimer.getStarted() && mGestureLabelTimer.getElapsedTimeF32() > SHOW_GESTURE_NAME_TIME) + { + LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL; + if (gestures) gestures->selectFirstItem(); + mGestureLabelTimer.stop(); + } + + if ((gAgent.getTypingTime() > AGENT_TYPING_TIMEOUT) && (gAgent.getRenderState() & AGENT_STATE_TYPING)) + { + gAgent.stopTyping(); + } + + childSetEnabled("Say", mInputEditor->getText().size() > 0); + +} + +void LLChatBar::refreshGestures() +{ + if (mGestureCombo) + { + //store current selection so we can maintain it + std::string cur_gesture = mGestureCombo->getValue().asString(); + mGestureCombo->selectFirstItem(); + std::string label = mGestureCombo->getValue().asString();; + // clear + mGestureCombo->clearRows(); + + // collect list of unique gestures + std::map <std::string, BOOL> unique; + LLGestureManager::item_map_t::iterator it; + for (it = LLGestureManager::instance().mActive.begin(); it != LLGestureManager::instance().mActive.end(); ++it) + { + LLMultiGesture* gesture = (*it).second; + if (gesture) + { + if (!gesture->mTrigger.empty()) + { + unique[gesture->mTrigger] = TRUE; + } + } + } + + // add unique gestures + std::map <std::string, BOOL>::iterator it2; + for (it2 = unique.begin(); it2 != unique.end(); ++it2) + { + mGestureCombo->addSimpleElement((*it2).first); + } + + mGestureCombo->sortByName(); + // Insert label after sorting, at top, with separator below it + mGestureCombo->addSeparator(ADD_TOP); + mGestureCombo->addSimpleElement(getString("gesture_label"), ADD_TOP); + + if (!cur_gesture.empty()) + { + mGestureCombo->selectByValue(LLSD(cur_gesture)); + } + else + { + mGestureCombo->selectFirstItem(); + } + } +} + +// Move the cursor to the correct input field. +void LLChatBar::setKeyboardFocus(BOOL focus) +{ + if (focus) + { + if (mInputEditor) + { + mInputEditor->setFocus(TRUE); + mInputEditor->selectAll(); + } + } + else if (gFocusMgr.childHasKeyboardFocus(this)) + { + if (mInputEditor) + { + mInputEditor->deselect(); + } + setFocus(FALSE); + } +} + + +// Ignore arrow keys in chat bar +void LLChatBar::setIgnoreArrowKeys(BOOL b) +{ + if (mInputEditor) + { + mInputEditor->setIgnoreArrowKeys(b); + } +} + +BOOL LLChatBar::inputEditorHasFocus() +{ + return mInputEditor && mInputEditor->hasFocus(); +} + +std::string LLChatBar::getCurrentChat() +{ + return mInputEditor ? mInputEditor->getText() : LLStringUtil::null; +} + +void LLChatBar::setGestureCombo(LLComboBox* combo) +{ + mGestureCombo = combo; + if (mGestureCombo) + { + mGestureCombo->setCommitCallback(boost::bind(&LLChatBar::onCommitGesture, this, _1)); + + // now register observer since we have a place to put the results + mObserver = new LLChatBarGestureObserver(this); + LLGestureManager::instance().addObserver(mObserver); + + // refresh list from current active gestures + refreshGestures(); + } +} + +//----------------------------------------------------------------------- +// Internal functions +//----------------------------------------------------------------------- + +// If input of the form "/20foo" or "/20 foo", returns "foo" and channel 20. +// Otherwise returns input and channel 0. +LLWString LLChatBar::stripChannelNumber(const LLWString &mesg, S32* channel) +{ + if (mesg[0] == '/' + && mesg[1] == '/') + { + // This is a "repeat channel send" + *channel = mLastSpecialChatChannel; + return mesg.substr(2, mesg.length() - 2); + } + else if (mesg[0] == '/' + && mesg[1] + && LLStringOps::isDigit(mesg[1])) + { + // This a special "/20" speak on a channel + S32 pos = 0; + + // Copy the channel number into a string + LLWString channel_string; + llwchar c; + do + { + c = mesg[pos+1]; + channel_string.push_back(c); + pos++; + } + while(c && pos < 64 && LLStringOps::isDigit(c)); + + // Move the pointer forward to the first non-whitespace char + // Check isspace before looping, so we can handle "/33foo" + // as well as "/33 foo" + while(c && iswspace(c)) + { + c = mesg[pos+1]; + pos++; + } + + mLastSpecialChatChannel = strtol(wstring_to_utf8str(channel_string).c_str(), NULL, 10); + *channel = mLastSpecialChatChannel; + return mesg.substr(pos, mesg.length() - pos); + } + else + { + // This is normal chat. + *channel = 0; + return mesg; + } +} + + +void LLChatBar::sendChat( EChatType type ) +{ + if (mInputEditor) + { + LLWString text = mInputEditor->getConvertedText(); + if (!text.empty()) + { + // store sent line in history, duplicates will get filtered + if (mInputEditor) mInputEditor->updateHistory(); + // Check if this is destined for another channel + S32 channel = 0; + stripChannelNumber(text, &channel); + + std::string utf8text = wstring_to_utf8str(text); + // Try to trigger a gesture, if not chat to a script. + std::string utf8_revised_text; + if (0 == channel) + { + // discard returned "found" boolean + LLGestureManager::instance().triggerAndReviseString(utf8text, &utf8_revised_text); + } + else + { + utf8_revised_text = utf8text; + } + + utf8_revised_text = utf8str_trim(utf8_revised_text); + + if (!utf8_revised_text.empty()) + { + // Chat with animation + sendChatFromViewer(utf8_revised_text, type, TRUE); + } + } + } + + childSetValue("Chat Editor", LLStringUtil::null); + + gAgent.stopTyping(); + + // If the user wants to stop chatting on hitting return, lose focus + // and go out of chat mode. + if (gChatBar == this && gSavedSettings.getBOOL("CloseChatOnReturn")) + { + stopChat(); + } +} + + +//----------------------------------------------------------------------- +// Static functions +//----------------------------------------------------------------------- + +// static +void LLChatBar::startChat(const char* line) +{ + //TODO* remove DUMMY chat + //if(gBottomTray && gBottomTray->getChatBox()) + //{ + // gBottomTray->setVisible(TRUE); + // gBottomTray->getChatBox()->setFocus(TRUE); + //} + + // *TODO Vadim: Why was this code commented out? + +// gChatBar->setVisible(TRUE); +// gChatBar->setKeyboardFocus(TRUE); +// gSavedSettings.setBOOL("ChatVisible", TRUE); +// +// if (line && gChatBar->mInputEditor) +// { +// std::string line_string(line); +// gChatBar->mInputEditor->setText(line_string); +// } +// // always move cursor to end so users don't obliterate chat when accidentally hitting WASD +// gChatBar->mInputEditor->setCursorToEnd(); +} + + +// Exit "chat mode" and do the appropriate focus changes +// static +void LLChatBar::stopChat() +{ + //TODO* remove DUMMY chat + //if(gBottomTray && gBottomTray->getChatBox()) + ///{ + // gBottomTray->getChatBox()->setFocus(FALSE); + //} + + // *TODO Vadim: Why was this code commented out? + +// // In simple UI mode, we never release focus from the chat bar +// gChatBar->setKeyboardFocus(FALSE); +// +// // If we typed a movement key and pressed return during the +// // same frame, the keyboard handlers will see the key as having +// // gone down this frame and try to move the avatar. +// gKeyboard->resetKeys(); +// gKeyboard->resetMaskKeys(); +// +// // stop typing animation +// gAgent.stopTyping(); +// +// // hide chat bar so it doesn't grab focus back +// gChatBar->setVisible(FALSE); +// gSavedSettings.setBOOL("ChatVisible", FALSE); +} + +// static +void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata ) +{ + LLChatBar* self = (LLChatBar *)userdata; + + LLWString raw_text; + if (self->mInputEditor) raw_text = self->mInputEditor->getWText(); + + // Can't trim the end, because that will cause autocompletion + // to eat trailing spaces that might be part of a gesture. + LLWStringUtil::trimHead(raw_text); + + S32 length = raw_text.length(); + + if( (length > 0) && (raw_text[0] != '/') ) // forward slash is used for escape (eg. emote) sequences + { + gAgent.startTyping(); + } + else + { + gAgent.stopTyping(); + } + + /* Doesn't work -- can't tell the difference between a backspace + that killed the selection vs. backspace at the end of line. + if (length > 1 + && text[0] == '/' + && key == KEY_BACKSPACE) + { + // the selection will already be deleted, but we need to trim + // off the character before + std::string new_text = raw_text.substr(0, length-1); + self->mInputEditor->setText( new_text ); + self->mInputEditor->setCursorToEnd(); + length = length - 1; + } + */ + + KEY key = gKeyboard->currentKey(); + + // Ignore "special" keys, like backspace, arrows, etc. + if (length > 1 + && raw_text[0] == '/' + && key < KEY_SPECIAL) + { + // we're starting a gesture, attempt to autocomplete + + std::string utf8_trigger = wstring_to_utf8str(raw_text); + std::string utf8_out_str(utf8_trigger); + + if (LLGestureManager::instance().matchPrefix(utf8_trigger, &utf8_out_str)) + { + if (self->mInputEditor) + { + std::string rest_of_match = utf8_out_str.substr(utf8_trigger.size()); + self->mInputEditor->setText(utf8_trigger + rest_of_match); // keep original capitalization for user-entered part + S32 outlength = self->mInputEditor->getLength(); // in characters + + // Select to end of line, starting from the character + // after the last one the user typed. + self->mInputEditor->setSelection(length, outlength); + } + } + + //llinfos << "GESTUREDEBUG " << trigger + // << " len " << length + // << " outlen " << out_str.getLength() + // << llendl; + } +} + +// static +void LLChatBar::onInputEditorFocusLost( LLFocusableElement* caller, void* userdata) +{ + // stop typing animation + gAgent.stopTyping(); +} + +// static +void LLChatBar::onInputEditorGainFocus( LLFocusableElement* caller, void* userdata ) +{ + LLFloaterChat::setHistoryCursorAndScrollToEnd(); +} + +void LLChatBar::onClickSay( LLUICtrl* ctrl ) +{ + std::string cmd = ctrl->getValue().asString(); + e_chat_type chat_type = CHAT_TYPE_NORMAL; + if (cmd == "shout") + { + chat_type = CHAT_TYPE_SHOUT; + } + else if (cmd == "whisper") + { + chat_type = CHAT_TYPE_WHISPER; + } + sendChat(chat_type); +} + +void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate) +{ + sendChatFromViewer(utf8str_to_wstring(utf8text), type, animate); +} + +void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate) +{ + // Look for "/20 foo" channel chats. + S32 channel = 0; + LLWString out_text = stripChannelNumber(wtext, &channel); + std::string utf8_out_text = wstring_to_utf8str(out_text); + std::string utf8_text = wstring_to_utf8str(wtext); + + utf8_text = utf8str_trim(utf8_text); + if (!utf8_text.empty()) + { + utf8_text = utf8str_truncate(utf8_text, MAX_STRING - 1); + } + + // Don't animate for chats people can't hear (chat to scripts) + if (animate && (channel == 0)) + { + if (type == CHAT_TYPE_WHISPER) + { + lldebugs << "You whisper " << utf8_text << llendl; + gAgent.sendAnimationRequest(ANIM_AGENT_WHISPER, ANIM_REQUEST_START); + } + else if (type == CHAT_TYPE_NORMAL) + { + lldebugs << "You say " << utf8_text << llendl; + gAgent.sendAnimationRequest(ANIM_AGENT_TALK, ANIM_REQUEST_START); + } + else if (type == CHAT_TYPE_SHOUT) + { + lldebugs << "You shout " << utf8_text << llendl; + gAgent.sendAnimationRequest(ANIM_AGENT_SHOUT, ANIM_REQUEST_START); + } + else + { + llinfos << "send_chat_from_viewer() - invalid volume" << llendl; + return; + } + } + else + { + if (type != CHAT_TYPE_START && type != CHAT_TYPE_STOP) + { + lldebugs << "Channel chat: " << utf8_text << llendl; + } + } + + send_chat_from_viewer(utf8_out_text, type, channel); +} +/* +void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel) +{ + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_ChatFromViewer); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_ChatData); + msg->addStringFast(_PREHASH_Message, utf8_out_text); + msg->addU8Fast(_PREHASH_Type, type); + msg->addS32("Channel", channel); + + gAgent.sendReliableMessage(); + + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT); +} +*/ + +void LLChatBar::onCommitGesture(LLUICtrl* ctrl) +{ + LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL; + if (gestures) + { + S32 index = gestures->getFirstSelectedIndex(); + if (index == 0) + { + return; + } + const std::string& trigger = gestures->getSelectedValue().asString(); + + // pretend the user chatted the trigger string, to invoke + // substitution and logging. + std::string text(trigger); + std::string revised_text; + LLGestureManager::instance().triggerAndReviseString(text, &revised_text); + + revised_text = utf8str_trim(revised_text); + if (!revised_text.empty()) + { + // Don't play nodding animation + sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, FALSE); + } + } + mGestureLabelTimer.start(); + if (mGestureCombo != NULL) + { + // free focus back to chat bar + mGestureCombo->setFocus(FALSE); + } +} + +class LLChatHandler : public LLCommandHandler +{ +public: + // not allowed from outside the app + LLChatHandler() : LLCommandHandler("chat", true) { } + + // Your code here + bool handle(const LLSD& tokens, const LLSD& query_map, + LLWebBrowserCtrl* web) + { + if (tokens.size() < 2) return false; + S32 channel = tokens[0].asInteger(); + std::string mesg = tokens[1].asString(); + send_chat_from_viewer(mesg, CHAT_TYPE_NORMAL, channel); + return true; + } +}; + +// Creating the object registers with the dispatcher. +//LLChatHandler gChatHandler; diff --git a/indra/newview/llchatbar.h b/indra/newview/llchatbar.h new file mode 100644 index 0000000000..a41947218d --- /dev/null +++ b/indra/newview/llchatbar.h @@ -0,0 +1,118 @@ +/** + * @file llchatbar.h + * @brief LLChatBar class definition + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLCHATBAR_H +#define LL_LLCHATBAR_H + +#include "llpanel.h" +#include "llframetimer.h" +#include "llchat.h" + +class LLLineEditor; +class LLMessageSystem; +class LLUICtrl; +class LLUUID; +class LLFrameTimer; +class LLChatBarGestureObserver; +class LLComboBox; + + +class LLChatBar +: public LLPanel +{ +public: + // constructor for inline chat-bars (e.g. hosted in chat history window) + LLChatBar(); + ~LLChatBar(); + virtual BOOL postBuild(); + + virtual BOOL handleKeyHere(KEY key, MASK mask); + + void refresh(); + void refreshGestures(); + + // Move cursor into chat input field. + void setKeyboardFocus(BOOL b); + + // Ignore arrow keys for chat bar + void setIgnoreArrowKeys(BOOL b); + + BOOL inputEditorHasFocus(); + std::string getCurrentChat(); + + // since chat bar logic is reused for chat history + // gesture combo box might not be a direct child + void setGestureCombo(LLComboBox* combo); + + // Send a chat (after stripping /20foo channel chats). + // "Animate" means the nodding animation for regular text. + void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate); + void sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate); + + // If input of the form "/20foo" or "/20 foo", returns "foo" and channel 20. + // Otherwise returns input and channel 0. + LLWString stripChannelNumber(const LLWString &mesg, S32* channel); + + // callbacks + void onClickSay(LLUICtrl* ctrl); + + static void onTabClick( void* userdata ); + static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata); + static void onInputEditorFocusLost(LLFocusableElement* caller,void* userdata); + static void onInputEditorGainFocus(LLFocusableElement* caller,void* userdata); + + void onCommitGesture(LLUICtrl* ctrl); + + static void startChat(const char* line); + static void stopChat(); + +protected: + void sendChat(EChatType type); + void updateChat(); + +protected: + LLLineEditor* mInputEditor; + + LLFrameTimer mGestureLabelTimer; + + // Which non-zero channel did we last chat on? + S32 mLastSpecialChatChannel; + + BOOL mIsBuilt; + LLComboBox* mGestureCombo; + + LLChatBarGestureObserver* mObserver; +}; + +extern LLChatBar *gChatBar; + +#endif diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index f71ea9f8ad..3b88bcfe20 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -40,6 +40,7 @@ #include "llimpanel.h" // LLFloaterIMPanel #include "llimview.h" #include "llfloatergroupinfo.h" +#include "llfloaterreg.h" #include "llmenugl.h" #include "lloutputmonitorctrl.h" #include "lltextbox.h" @@ -203,7 +204,6 @@ LLIMChiclet::LLIMChiclet(const Params& p) , mSpeakerCtrl(NULL) , mShowSpeaker(p.show_speaker) , mPopupMenu(NULL) -, mDockTongueVisible(false) { LLChicletAvatarIconCtrl::Params avatar_params = p.avatar_icon; mAvatarCtrl = LLUICtrlFactory::create<LLChicletAvatarIconCtrl>(avatar_params); @@ -228,10 +228,6 @@ LLIMChiclet::~LLIMChiclet() } -void LLIMChiclet::setDockTongueVisible(bool visible) -{ - mDockTongueVisible = visible; -} void LLIMChiclet::setCounter(S32 counter) { @@ -326,14 +322,20 @@ void LLIMChiclet::setShowSpeaker(bool show) void LLIMChiclet::draw() { LLUICtrl::draw(); - gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.0f,0.0f,0.0f,1.f), FALSE); - if (mDockTongueVisible) + //if we have a docked floater, we want to position it relative to us + LLIMFloater* im_floater = LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", getSessionId()); + + if (im_floater && im_floater->isDocked()) { - LLUIImagePtr flyout_tongue = LLUI::getUIImage("windows/Flyout_Pointer.png"); - // was previously AVATAR_WIDTH-16 and CHICLET_HEIGHT-6 - flyout_tongue->draw( getRect().getWidth()-31, getRect().getHeight()-5); + S32 x, y; + getParent()->localPointToScreen(getRect().getCenterX(), 0, &x, &y); + im_floater->translate(x - im_floater->getRect().getCenterX(), 10 - im_floater->getRect().mBottom); + //set this so the docked floater knows it's been positioned and can now draw + im_floater->setPositioned(true); } + + gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.0f,0.0f,0.0f,1.f), FALSE); } BOOL LLIMChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) @@ -890,7 +892,8 @@ LLTalkButton::Params::Params() show_button.image_unselected(LLUI::getUIImage("ComboButton_Off")); monitor.name("monitor"); - monitor.rect(LLRect(0, 10, 16, 0)); + // *TODO: Make this data driven. + monitor.rect(LLRect(0, 18, 18, 0)); } LLTalkButton::LLTalkButton(const Params& p) @@ -953,6 +956,8 @@ void LLTalkButton::draw() // Always provide speaking feedback. User can trigger speaking // with keyboard or middle-mouse shortcut. mOutputMonitor->setPower(gVoiceClient->getCurrentPower(gAgent.getID())); + mOutputMonitor->setIsTalking( gVoiceClient->getUserPTTState() ); + mSpeakBtn->setToggleState( gVoiceClient->getUserPTTState() ); LLUICtrl::draw(); } diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index c20c81e052..a748141a14 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -41,6 +41,7 @@ class LLVoiceControlPanel; class LLMenuGL; +class LLIMFloater; /* * Class for displaying amount of messages/notifications(unread). @@ -267,8 +268,6 @@ public: */ virtual void setShowSpeaker(bool show); - void setDockTongueVisible(bool visible); - /* * Returns voice chat status control visibility. */ @@ -335,7 +334,6 @@ protected: LLMenuGL* mPopupMenu; bool mShowSpeaker; - bool mDockTongueVisible; }; /* diff --git a/indra/newview/lldebugmessagebox.cpp b/indra/newview/lldebugmessagebox.cpp index 9eee3b239c..786473eb9b 100644 --- a/indra/newview/lldebugmessagebox.cpp +++ b/indra/newview/lldebugmessagebox.cpp @@ -50,7 +50,7 @@ std::map<std::string, LLDebugVarMessageBox*> LLDebugVarMessageBox::sInstances; LLDebugVarMessageBox::LLDebugVarMessageBox(const std::string& title, EDebugVarType var_type, void *var) : - LLFloater(), + LLFloater(LLSD()), mVarType(var_type), mVarData(var), mAnimate(FALSE) { setRect(LLRect(10,160,400,10)); @@ -250,11 +250,6 @@ void LLDebugVarMessageBox::onAnimateClicked(const LLSD& data) mAnimateButton->setToggleState(mAnimate); } -void LLDebugVarMessageBox::onClose(bool app_quitting) -{ - setVisible(FALSE); -} - void LLDebugVarMessageBox::draw() { std::string text; diff --git a/indra/newview/lldebugmessagebox.h b/indra/newview/lldebugmessagebox.h index 76e128cfc1..0def0ee7af 100644 --- a/indra/newview/lldebugmessagebox.h +++ b/indra/newview/lldebugmessagebox.h @@ -76,7 +76,6 @@ public: static void show(const std::string& title, LLVector3 *var, LLVector3 max_value = LLVector3(100.f, 100.f, 100.f), LLVector3 increment = LLVector3(0.1f, 0.1f, 0.1f)); //static void show(const std::string& title, LLVector4 *var, LLVector4 max_value = LLVector4(100.f, 100.f, 100.f, 100.f), LLVector4 increment = LLVector4(0.1f, 0.1f, 0.1f, 0.1f)); - virtual void onClose(bool app_quitting); virtual void draw(); protected: diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index f22114d3c8..0aef3123d6 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -80,7 +80,7 @@ static timer_tree_iterator_t end_timer_tree() } LLFastTimerView::LLFastTimerView(const LLRect& rect) -: LLFloater(), +: LLFloater(LLSD()), mHoverTimer(NULL) { setRect(rect); diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 72bfac70fc..3964fbfa74 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -374,7 +374,7 @@ void LLFavoritesBarCtrl::showDropDownMenu() { if (mPopupMenuHandle.isDead()) { - LLMenuGL::Params menu_p; + LLToggleableMenu::Params menu_p; menu_p.name("favorites menu"); menu_p.can_tear_off(false); menu_p.visible(false); diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index 979c5543e7..dec27db74b 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -37,6 +37,7 @@ #include "llbvhloader.h" #include "lldatapacker.h" #include "lldir.h" +#include "lleconomy.h" #include "llvfile.h" #include "llapr.h" #include "llstring.h" @@ -69,8 +70,6 @@ #include "lluictrlfactory.h" #include "lltrans.h" -S32 LLFloaterAnimPreview::sUploadAmount = 10; - const S32 PREVIEW_BORDER_WIDTH = 2; const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH; const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; @@ -197,7 +196,6 @@ BOOL LLFloaterAnimPreview::postBuild() childSetCommitCallback("name_form", onCommitName, this); - childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",sUploadAmount)); childSetAction("ok_btn", onBtnOK, this); setDefaultBtn(); @@ -733,7 +731,7 @@ void LLFloaterAnimPreview::onCommitName(LLUICtrl* ctrl, void* data) motionp->setName(previewp->childGetValue("name_form").asString()); } - LLFloaterNameDesc::doCommit(ctrl, data); + previewp->doCommit(); } //----------------------------------------------------------------------------- @@ -984,7 +982,7 @@ void LLFloaterAnimPreview::onBtnOK(void* userdata) std::string name = floaterp->childGetValue("name_form").asString(); std::string desc = floaterp->childGetValue("description_form").asString(); LLAssetStorage::LLStoreAssetCallback callback = NULL; - S32 expected_upload_cost = sUploadAmount; + S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); void *userdata = NULL; upload_new_resource(floaterp->mTransactionID, // tid LLAssetType::AT_ANIMATION, diff --git a/indra/newview/llfloateranimpreview.h b/indra/newview/llfloateranimpreview.h index 7031e9a716..f1c4a6b0d0 100644 --- a/indra/newview/llfloateranimpreview.h +++ b/indra/newview/llfloateranimpreview.h @@ -88,7 +88,6 @@ public: static void onBtnPlay(void*); static void onBtnStop(void*); - static void setUploadAmount(S32 amount) { sUploadAmount = amount; } static void onSliderMove(LLUICtrl*, void*); static void onCommitBaseAnim(LLUICtrl*, void*); static void onCommitLoop(LLUICtrl*, void*); @@ -129,8 +128,6 @@ protected: LLAnimPauseRequest mPauseRequest; std::map<std::string, LLUUID> mIDList; - - static S32 sUploadAmount; }; #endif // LL_LLFLOATERANIMPREVIEW_H diff --git a/indra/newview/llfloaterauction.h b/indra/newview/llfloaterauction.h index 86de0ae966..1acc08057c 100644 --- a/indra/newview/llfloaterauction.h +++ b/indra/newview/llfloaterauction.h @@ -51,7 +51,6 @@ class LLFloaterAuction : public LLFloater friend class LLFloaterReg; public: // LLFloater interface - /*virtual*/ void onClose(bool app_quitting) { setVisible(FALSE); } /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void draw(); diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 92ce44fa42..91b9bcfe72 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -36,6 +36,7 @@ // Viewer includes #include "llagent.h" #include "llfocusmgr.h" +#include "llfloaterreg.h" #include "llfloaterinventory.h" #include "llfoldervieweventlistener.h" #include "llinventorymodel.h" @@ -53,49 +54,33 @@ #include "lluictrlfactory.h" #include "message.h" -// static -LLFloaterAvatarPicker* LLFloaterAvatarPicker::sInstance = NULL; - - LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback, void* userdata, BOOL allow_multiple, BOOL closeOnSelect) { - // TODO: This class should not be a singleton as it's used in multiple places - // and therefore can't be used simultaneously. -MG - if (!sInstance) - { - sInstance = new LLFloaterAvatarPicker(); - sInstance->mCallback = callback; - sInstance->mCallbackUserdata = userdata; - sInstance->mCloseOnSelect = FALSE; - - sInstance->openFloater(); - sInstance->center(); - sInstance->setAllowMultiple(allow_multiple); - } - else - { - sInstance->openFloater(); - sInstance->mCallback = callback; - sInstance->mCallbackUserdata = userdata; - sInstance->setAllowMultiple(allow_multiple); - } + // *TODO: Use a key to allow this not to be an effective singleton + LLFloaterAvatarPicker* floater = LLFloaterReg::showTypedInstance<LLFloaterAvatarPicker>("avatar_picker"); + + floater->mCallback = callback; + floater->mCallbackUserdata = userdata; + floater->setAllowMultiple(allow_multiple); + floater->mNearMeListComplete = FALSE; + floater->mCloseOnSelect = closeOnSelect; - sInstance->mNearMeListComplete = FALSE; - sInstance->mCloseOnSelect = closeOnSelect; - return sInstance; + return floater; } // Default constructor -LLFloaterAvatarPicker::LLFloaterAvatarPicker() - : LLFloater(), +LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key) + : LLFloater(key), mResultsReturned(FALSE), mCallback(NULL), - mCallbackUserdata(NULL) + mCallbackUserdata(NULL), + mNearMeListComplete(FALSE), + mCloseOnSelect(FALSE) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_picker.xml"); +// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_picker.xml"); } BOOL LLFloaterAvatarPicker::postBuild() @@ -143,7 +128,9 @@ BOOL LLFloaterAvatarPicker::postBuild() boost::bind(&LLFloaterAvatarPicker::onTabChanged, this)); setAllowMultiple(FALSE); - + + center(); + return TRUE; } @@ -156,8 +143,6 @@ void LLFloaterAvatarPicker::onTabChanged() LLFloaterAvatarPicker::~LLFloaterAvatarPicker() { gFocusMgr.releaseFocusIfNeeded( this ); - - sInstance = NULL; } void LLFloaterAvatarPicker::onBtnFind(void* userdata) @@ -408,23 +393,21 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* // Not for us if (agent_id != gAgent.getID()) return; - - // Dialog already closed - LLFloaterAvatarPicker *self = sInstance; - if (!self) return; + + LLFloaterAvatarPicker* floater = LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker"); // these are not results from our last request - if (query_id != self->mQueryID) + if (query_id != floater->mQueryID) { return; } - LLScrollListCtrl* search_results = self->getChild<LLScrollListCtrl>("SearchResults"); + LLScrollListCtrl* search_results = floater->getChild<LLScrollListCtrl>("SearchResults"); // clear "Searching" label on first results search_results->deleteAllItems(); - self->mResultsReturned = TRUE; + floater->mResultsReturned = TRUE; BOOL found_one = FALSE; S32 num_new_rows = msg->getNumberOfBlocks("Data"); @@ -438,10 +421,10 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* if (avatar_id.isNull()) { LLStringUtil::format_map_t map; - map["[TEXT]"] = self->childGetText("Edit"); - avatar_name = self->getString("not_found", map); + map["[TEXT]"] = floater->childGetText("Edit"); + avatar_name = floater->getString("not_found", map); search_results->setEnabled(FALSE); - self->childDisable("Select"); + floater->childDisable("Select"); } else { @@ -457,9 +440,9 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* if (found_one) { - self->childEnable("Select"); + floater->childEnable("Select"); search_results->selectFirstItem(); - self->onList(search_results, self); + floater->onList(search_results, floater); search_results->setFocus(TRUE); } } diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 0f28d8250b..63896bef9f 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -48,6 +48,10 @@ public: void* userdata, BOOL allow_multiple = FALSE, BOOL closeOnSelect = FALSE); + + LLFloaterAvatarPicker(const LLSD& key); + virtual ~LLFloaterAvatarPicker(); + virtual BOOL postBuild(); static void processAvatarPickerReply(class LLMessageSystem* msg, void**); @@ -84,13 +88,6 @@ private: void (*mCallback)(const std::vector<std::string>& name, const std::vector<LLUUID>& id, void* userdata); void* mCallbackUserdata; - - static LLFloaterAvatarPicker* sInstance; - -private: - // do not call these directly - LLFloaterAvatarPicker(); - virtual ~LLFloaterAvatarPicker(); }; #endif diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp index e2f13088eb..3976e25ba4 100644 --- a/indra/newview/llfloateravatartextures.cpp +++ b/indra/newview/llfloateravatartextures.cpp @@ -42,29 +42,15 @@ using namespace LLVOAvatarDefines; -LLFloaterAvatarTextures* LLFloaterAvatarTextures::sInstance = NULL; -LLFloaterAvatarTextures::LLFloaterAvatarTextures(const LLUUID& id) - : LLFloater(), - mID(id) +LLFloaterAvatarTextures::LLFloaterAvatarTextures(const LLSD& id) + : LLFloater(id), + mID(id.asUUID()) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_textures.xml"); +// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_textures.xml"); } LLFloaterAvatarTextures::~LLFloaterAvatarTextures() { - sInstance = NULL; -} - -LLFloaterAvatarTextures* LLFloaterAvatarTextures::show(const LLUUID &id) -{ - if (!sInstance) - { - sInstance = new LLFloaterAvatarTextures(id); - gFloaterView->addChild(sInstance); - gFloaterView->adjustToFitScreen(sInstance, FALSE); - } - sInstance->openFloater(); - return sInstance; } BOOL LLFloaterAvatarTextures::postBuild() diff --git a/indra/newview/llfloateravatartextures.h b/indra/newview/llfloateravatartextures.h index 3ec0e7cb03..e27484d26f 100644 --- a/indra/newview/llfloateravatartextures.h +++ b/indra/newview/llfloateravatartextures.h @@ -43,7 +43,7 @@ class LLTextureCtrl; class LLFloaterAvatarTextures : public LLFloater { public: - LLFloaterAvatarTextures(const LLUUID& id); + LLFloaterAvatarTextures(const LLSD& id); virtual ~LLFloaterAvatarTextures(); /*virtual*/ BOOL postBuild(); @@ -51,8 +51,6 @@ public: void refresh(); - static LLFloaterAvatarTextures* show(const LLUUID& id); - private: static void onClickDump(void*); @@ -60,7 +58,6 @@ private: LLUUID mID; std::string mTitle; LLTextureCtrl* mTextures[LLVOAvatarDefines::TEX_NUM_INDICES]; - static LLFloaterAvatarTextures* sInstance; }; #endif diff --git a/indra/newview/llfloaterbeacons.cpp b/indra/newview/llfloaterbeacons.cpp index 1c7ef77718..13a7888f60 100644 --- a/indra/newview/llfloaterbeacons.cpp +++ b/indra/newview/llfloaterbeacons.cpp @@ -64,21 +64,6 @@ BOOL LLFloaterBeacons::postBuild() return TRUE; } -// Needed to make the floater visibility toggle the beacons. -// Too bad we can't just add control_name="BeaconAlwaysOn" to the XML. -void LLFloaterBeacons::onOpen(const LLSD& key) -{ - gSavedSettings.setBOOL( "BeaconAlwaysOn", TRUE); -} -void LLFloaterBeacons::onClose(bool app_quitting) -{ - destroy(); - if(!app_quitting) - { - gSavedSettings.setBOOL( "BeaconAlwaysOn", FALSE); - } -} - // Callback attached to each check box control to both affect their main purpose // and to implement the couple screwy interdependency rules that some have. diff --git a/indra/newview/llfloaterbeacons.h b/indra/newview/llfloaterbeacons.h index 94f853978a..c175cb3ef4 100644 --- a/indra/newview/llfloaterbeacons.h +++ b/indra/newview/llfloaterbeacons.h @@ -46,8 +46,6 @@ public: // Needed to make the floater visibility toggle the beacons. // Too bad we can't just add control_name="BeaconAlwaysOn" to the XML. - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); void onClickUICheck(LLUICtrl *ctrl); private: diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp index 29b91cab95..a73ebf4e06 100644 --- a/indra/newview/llfloaterbulkpermission.cpp +++ b/indra/newview/llfloaterbulkpermission.cpp @@ -165,7 +165,7 @@ void LLFloaterBulkPermission::onApplyBtn() void LLFloaterBulkPermission::onCloseBtn() { - onClose(false); + closeFloater(); } //static diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index 6cae4b8abc..a7aaf71ef6 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -43,6 +43,7 @@ #include "llagent.h" // for agent id #include "llalertdialog.h" #include "llinventorymodel.h" // for gInventory +#include "llfloaterreg.h" #include "llfloaterinventory.h" // for get_item_icon #include "llselectmgr.h" #include "llscrolllistctrl.h" @@ -51,13 +52,10 @@ #include "llviewerwindow.h" #include "lltrans.h" -LLFloaterBuy* LLFloaterBuy::sInstance = NULL; - -LLFloaterBuy::LLFloaterBuy() -: LLFloater() +LLFloaterBuy::LLFloaterBuy(const LLSD& key) +: LLFloater(key) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_buy_object.xml"); - +// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_buy_object.xml"); } BOOL LLFloaterBuy::postBuild() @@ -65,16 +63,23 @@ BOOL LLFloaterBuy::postBuild() childDisable("object_list"); childDisable("item_list"); - childSetAction("cancel_btn", onClickCancel, this); - childSetAction("buy_btn", onClickBuy, this); + getChild<LLUICtrl>("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuy::onClickCancel, this)); + getChild<LLUICtrl>("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuy::onClickBuy, this)); setDefaultBtn("cancel_btn"); // to avoid accidental buy (SL-43130) + + // Always center the dialog. User can change the size, + // but purchases are important and should be center screen. + // This also avoids problems where the user resizes the application window + // mid-session and the saved rect is off-center. + center(); + return TRUE; } LLFloaterBuy::~LLFloaterBuy() { - sInstance = NULL; + mObjectSelection = NULL; } void LLFloaterBuy::reset() @@ -96,47 +101,34 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) LLNotifications::instance().add("BuyOneObjectOnly"); return; } - - // Create a new instance only if one doesn't exist - if (sInstance) - { - // Clean up the lists... - sInstance->reset(); - } - else - { - sInstance = new LLFloaterBuy(); - } - sInstance->openFloater(); - sInstance->setFocus(TRUE); - sInstance->mSaleInfo = sale_info; - sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); - - // Always center the dialog. User can change the size, - // but purchases are important and should be center screen. - // This also avoids problems where the user resizes the application window - // mid-session and the saved rect is off-center. - sInstance->center(); - + LLFloaterBuy* floater = LLFloaterReg::showTypedInstance<LLFloaterBuy>("buy_object"); + if (!floater) + return; + + // Clean up the lists... + floater->reset(); + floater->mSaleInfo = sale_info; + floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); + LLSelectNode* node = selection->getFirstRootNode(); if (!node) return; - + // Set title based on sale type LLUIString title; switch (sale_info.getSaleType()) { case LLSaleInfo::FS_ORIGINAL: - title = sInstance->getString("title_buy_text"); + title = floater->getString("title_buy_text"); break; case LLSaleInfo::FS_COPY: default: - title = sInstance->getString("title_buy_copy_text"); + title = floater->getString("title_buy_copy_text"); break; } title.setArg("[NAME]", node->mName); - sInstance->setTitle(title); + floater->setTitle(title); LLUUID owner_id; std::string owner_name; @@ -147,7 +139,7 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) return; } - LLCtrlListInterface *object_list = sInstance->childGetListInterface("object_list"); + LLCtrlListInterface *object_list = floater->childGetListInterface("object_list"); if (!object_list) { return; @@ -172,15 +164,15 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) std::string text = node->mName; if (!(next_owner_mask & PERM_COPY)) { - text.append(sInstance->getString("no_copy_text")); + text.append(floater->getString("no_copy_text")); } if (!(next_owner_mask & PERM_MODIFY)) { - text.append(sInstance->getString("no_modify_text")); + text.append(floater->getString("no_modify_text")); } if (!(next_owner_mask & PERM_TRANSFER)) { - text.append(sInstance->getString("no_transfer_text")); + text.append(floater->getString("no_transfer_text")); } row["columns"][1]["column"] = "text"; @@ -190,15 +182,15 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) // Add after columns added so appropriate heights are correct. object_list->addElement(row); - sInstance->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice())); - sInstance->childSetTextArg("buy_text", "[NAME]", owner_name); + floater->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice())); + floater->childSetTextArg("buy_text", "[NAME]", owner_name); // Must do this after the floater is created, because // sometimes the inventory is already there and // the callback is called immediately. LLViewerObject* obj = selection->getFirstRootObject(); - sInstance->registerVOInventoryListener(obj,NULL); - sInstance->requestVOInventory(); + floater->registerVOInventoryListener(obj,NULL); + floater->requestVOInventory(); } void LLFloaterBuy::inventoryChanged(LLViewerObject* obj, @@ -296,15 +288,8 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj, removeVOInventoryListener(); } -// static -void LLFloaterBuy::onClickBuy(void*) +void LLFloaterBuy::onClickBuy() { - if (!sInstance) - { - llinfos << "LLFloaterBuy::onClickBuy no sInstance!" << llendl; - return; - } - // Put the items where we put new folders. LLUUID category_id; category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); @@ -312,24 +297,13 @@ void LLFloaterBuy::onClickBuy(void*) // *NOTE: doesn't work for multiple object buy, which UI does not // currently support sale info is used for verification only, if // it doesn't match region info then sale is canceled. - LLSelectMgr::getInstance()->sendBuy(gAgent.getID(), category_id, sInstance->mSaleInfo ); + LLSelectMgr::getInstance()->sendBuy(gAgent.getID(), category_id, mSaleInfo ); - sInstance->closeFloater(); + closeFloater(); } -// static -void LLFloaterBuy::onClickCancel(void*) +void LLFloaterBuy::onClickCancel() { - if (sInstance) - { - sInstance->closeFloater(); - } -} - -void LLFloaterBuy::onClose(bool app_quitting) -{ - // drop reference to current selection so selection goes away - mObjectSelection = NULL; - destroy(); + closeFloater(); } diff --git a/indra/newview/llfloaterbuy.h b/indra/newview/llfloaterbuy.h index ffd3fa30c8..ee54303267 100644 --- a/indra/newview/llfloaterbuy.h +++ b/indra/newview/llfloaterbuy.h @@ -52,13 +52,14 @@ class LLFloaterBuy : public LLFloater, public LLVOInventoryListener { public: + LLFloaterBuy(const LLSD& key); + ~LLFloaterBuy(); + + /*virtual*/ BOOL postBuild(); + static void show(const LLSaleInfo& sale_info); protected: - LLFloaterBuy(); - ~LLFloaterBuy(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); void reset(); void requestObjectInventories(); @@ -67,12 +68,10 @@ protected: S32 serial_num, void* data); - static void onClickBuy(void*); - static void onClickCancel(void*); + void onClickBuy(); + void onClickCancel(); private: - static LLFloaterBuy* sInstance; - LLSafeHandle<LLObjectSelection> mObjectSelection; LLSaleInfo mSaleInfo; }; diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index db4547e5bc..3a4171c6be 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -46,6 +46,7 @@ #include "llalertdialog.h" #include "llcheckboxctrl.h" #include "llinventorymodel.h" // for gInventory +#include "llfloaterreg.h" #include "llfloaterinventory.h" // for get_item_icon #include "llselectmgr.h" #include "llscrolllistctrl.h" @@ -54,31 +55,35 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" -LLFloaterBuyContents* LLFloaterBuyContents::sInstance = NULL; - -LLFloaterBuyContents::LLFloaterBuyContents() -: LLFloater() +LLFloaterBuyContents::LLFloaterBuyContents(const LLSD& key) +: LLFloater(key) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_buy_contents.xml"); - +// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_buy_contents.xml"); } + BOOL LLFloaterBuyContents::postBuild() { - childSetAction("cancel_btn", onClickCancel, this); - childSetAction("buy_btn", onClickBuy, this); + getChild<LLUICtrl>("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuyContents::onClickCancel, this)); + getChild<LLUICtrl>("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyContents::onClickBuy, this)); childDisable("item_list"); childDisable("buy_btn"); childDisable("wear_check"); setDefaultBtn("cancel_btn"); // to avoid accidental buy (SL-43130) + + // Always center the dialog. User can change the size, + // but purchases are important and should be center screen. + // This also avoids problems where the user resizes the application window + // mid-session and the saved rect is off-center. + center(); + return TRUE; } LLFloaterBuyContents::~LLFloaterBuyContents() { - sInstance = NULL; } @@ -92,27 +97,16 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) LLNotifications::instance().add("BuyContentsOneOnly"); return; } + + LLFloaterBuyContents* floater = LLFloaterReg::showTypedInstance<LLFloaterBuyContents>("buy_object_contents"); + if (!floater) + return; + + LLScrollListCtrl* list = floater->getChild<LLScrollListCtrl>("item_list"); + if (list) + list->deleteAllItems(); - // Create a new instance only if needed - if (sInstance) - { - LLScrollListCtrl* list = sInstance->getChild<LLScrollListCtrl>("item_list"); - if (list) list->deleteAllItems(); - } - else - { - sInstance = new LLFloaterBuyContents(); - } - - sInstance->openFloater(); - sInstance->setFocus(TRUE); - sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); - - // Always center the dialog. User can change the size, - // but purchases are important and should be center screen. - // This also avoids problems where the user resizes the application window - // mid-session and the saved rect is off-center. - sInstance->center(); + floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); LLUUID owner_id; std::string owner_name; @@ -123,7 +117,7 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) return; } - sInstance->mSaleInfo = sale_info; + floater->mSaleInfo = sale_info; // Update the display LLSelectNode* node = selection->getFirstRootNode(); @@ -133,16 +127,16 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) gCacheName->getGroupName(owner_id, owner_name); } - sInstance->childSetTextArg("contains_text", "[NAME]", node->mName); - sInstance->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice())); - sInstance->childSetTextArg("buy_text", "[NAME]", owner_name); + floater->childSetTextArg("contains_text", "[NAME]", node->mName); + floater->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice())); + floater->childSetTextArg("buy_text", "[NAME]", owner_name); // Must do this after the floater is created, because // sometimes the inventory is already there and // the callback is called immediately. LLViewerObject* obj = selection->getFirstRootObject(); - sInstance->registerVOInventoryListener(obj,NULL); - sInstance->requestVOInventory(); + floater->registerVOInventoryListener(obj,NULL); + floater->requestVOInventory(); } @@ -272,20 +266,19 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, } -// static -void LLFloaterBuyContents::onClickBuy(void*) +void LLFloaterBuyContents::onClickBuy() { // Make sure this wasn't selected through other mechanisms // (ie, being the default button and pressing enter. - if(!sInstance->childIsEnabled("buy_btn")) + if(!childIsEnabled("buy_btn")) { // We shouldn't be enabled. Just close. - sInstance->closeFloater(); + closeFloater(); return; } // We may want to wear this item - if (sInstance->childGetValue("wear_check")) + if (childGetValue("wear_check")) { LLFloaterInventory::sWearNewClothing = TRUE; } @@ -297,14 +290,12 @@ void LLFloaterBuyContents::onClickBuy(void*) // *NOTE: doesn't work for multiple object buy, which UI does not // currently support sale info is used for verification only, if // it doesn't match region info then sale is canceled. - LLSelectMgr::getInstance()->sendBuy(gAgent.getID(), category_id, sInstance->mSaleInfo); + LLSelectMgr::getInstance()->sendBuy(gAgent.getID(), category_id, mSaleInfo); - sInstance->closeFloater(); + closeFloater(); } - -// static -void LLFloaterBuyContents::onClickCancel(void*) +void LLFloaterBuyContents::onClickCancel() { - sInstance->closeFloater(); + closeFloater(); } diff --git a/indra/newview/llfloaterbuycontents.h b/indra/newview/llfloaterbuycontents.h index 52114811bf..8045a46c9f 100644 --- a/indra/newview/llfloaterbuycontents.h +++ b/indra/newview/llfloaterbuycontents.h @@ -52,22 +52,21 @@ class LLFloaterBuyContents public: static void show(const LLSaleInfo& sale_info); -protected: - LLFloaterBuyContents(); + LLFloaterBuyContents(const LLSD& key); ~LLFloaterBuyContents(); /*virtual*/ BOOL postBuild(); + +protected: void requestObjectInventories(); /*virtual*/ void inventoryChanged(LLViewerObject* obj, InventoryObjectList* inv, S32 serial_num, void* data); - - static void onClickBuy(void*); - static void onClickCancel(void*); + + void onClickBuy(); + void onClickCancel(); protected: - static LLFloaterBuyContents* sInstance; - LLSafeHandle<LLObjectSelection> mObjectSelection; LLSaleInfo mSaleInfo; }; diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 4274650f2c..0107cb6fe2 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -37,6 +37,7 @@ // viewer includes #include "llcurrencyuimanager.h" #include "llfloater.h" +#include "llfloaterreg.h" #include "llstatusbar.h" #include "lltextbox.h" #include "llviewchildren.h" @@ -53,12 +54,7 @@ class LLFloaterBuyCurrencyUI : public LLFloater { public: - static LLFloaterBuyCurrencyUI* soleInstance(bool createIfNeeded); - -private: - static LLFloaterBuyCurrencyUI* sInstance; - - LLFloaterBuyCurrencyUI(); + LLFloaterBuyCurrencyUI(const LLSD& key); virtual ~LLFloaterBuyCurrencyUI(); @@ -81,30 +77,17 @@ public: virtual void draw(); virtual BOOL canClose(); - static void onClickBuy(void* data); - static void onClickCancel(void* data); - static void onClickErrorWeb(void* data); + void onClickBuy(); + void onClickCancel(); + void onClickErrorWeb(); }; - -// static -LLFloaterBuyCurrencyUI* LLFloaterBuyCurrencyUI::sInstance = NULL; - -// static -LLFloaterBuyCurrencyUI* LLFloaterBuyCurrencyUI::soleInstance(bool createIfNeeded) +LLFloater* LLFloaterBuyCurrency::buildFloater(const LLSD& key) { - if (!sInstance && createIfNeeded) - { - sInstance = new LLFloaterBuyCurrencyUI(); - - LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_buy_currency.xml"); - sInstance->center(); - } - - return sInstance; + LLFloaterBuyCurrencyUI* floater = new LLFloaterBuyCurrencyUI(key); + return floater; } - #if LL_WINDOWS // passing 'this' during construction generates a warning. The callee // only uses the pointer to hold a reference to 'this' which is @@ -112,8 +95,8 @@ LLFloaterBuyCurrencyUI* LLFloaterBuyCurrencyUI::soleInstance(bool createIfNeeded // warning so that we can compile without generating a warning. #pragma warning(disable : 4355) #endif -LLFloaterBuyCurrencyUI::LLFloaterBuyCurrencyUI() -: LLFloater(), +LLFloaterBuyCurrencyUI::LLFloaterBuyCurrencyUI(const LLSD& key) +: LLFloater(key), mChildren(*this), mManager(*this) { @@ -121,10 +104,6 @@ LLFloaterBuyCurrencyUI::LLFloaterBuyCurrencyUI() LLFloaterBuyCurrencyUI::~LLFloaterBuyCurrencyUI() { - if (sInstance == this) - { - sInstance = NULL; - } } @@ -156,11 +135,14 @@ BOOL LLFloaterBuyCurrencyUI::postBuild() { mManager.prepare(); - childSetAction("buy_btn", onClickBuy, this); - childSetAction("cancel_btn", onClickCancel, this); - childSetAction("error_web", onClickErrorWeb, this); - + getChild<LLUICtrl>("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickBuy, this)); + getChild<LLUICtrl>("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickCancel, this)); + getChild<LLUICtrl>("error_web")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickErrorWeb, this)); + + center(); + updateUI(); + return TRUE; } @@ -312,57 +294,41 @@ void LLFloaterBuyCurrencyUI::updateUI() } } -// static -void LLFloaterBuyCurrencyUI::onClickBuy(void* data) +void LLFloaterBuyCurrencyUI::onClickBuy() { - LLFloaterBuyCurrencyUI* self = LLFloaterBuyCurrencyUI::soleInstance(false); - if (self) - { - self->mManager.buy(self->getString("buy_currency")); - self->updateUI(); - // JC: updateUI() doesn't get called again until progress is made - // with transaction processing, so the "Purchase" button would be - // left enabled for some time. Pre-emptively disable. - self->childSetEnabled("buy_btn", false); - } + mManager.buy(getString("buy_currency")); + updateUI(); + // JC: updateUI() doesn't get called again until progress is made + // with transaction processing, so the "Purchase" button would be + // left enabled for some time. Pre-emptively disable. + childSetEnabled("buy_btn", false); } -// static -void LLFloaterBuyCurrencyUI::onClickCancel(void* data) +void LLFloaterBuyCurrencyUI::onClickCancel() { - LLFloaterBuyCurrencyUI* self = LLFloaterBuyCurrencyUI::soleInstance(false); - if (self) - { - self->closeFloater(); - } + closeFloater(); } -// static -void LLFloaterBuyCurrencyUI::onClickErrorWeb(void* data) +void LLFloaterBuyCurrencyUI::onClickErrorWeb() { - LLFloaterBuyCurrencyUI* self = LLFloaterBuyCurrencyUI::soleInstance(false); - if (self) - { - LLWeb::loadURLExternal(self->mManager.errorURI()); - self->closeFloater(); - } + LLWeb::loadURLExternal(mManager.errorURI()); + closeFloater(); } // static void LLFloaterBuyCurrency::buyCurrency() { - LLFloaterBuyCurrencyUI* ui = LLFloaterBuyCurrencyUI::soleInstance(true); + LLFloaterBuyCurrencyUI* ui = LLFloaterReg::showTypedInstance<LLFloaterBuyCurrencyUI>("buy_currency"); ui->noTarget(); ui->updateUI(); - ui->openFloater(); } +// static void LLFloaterBuyCurrency::buyCurrency(const std::string& name, S32 price) { - LLFloaterBuyCurrencyUI* ui = LLFloaterBuyCurrencyUI::soleInstance(true); + LLFloaterBuyCurrencyUI* ui = LLFloaterReg::showTypedInstance<LLFloaterBuyCurrencyUI>("buy_currency"); ui->target(name, price); ui->updateUI(); - ui->openFloater(); } diff --git a/indra/newview/llfloaterbuycurrency.h b/indra/newview/llfloaterbuycurrency.h index 756acd2f0c..9b3f9b43d0 100644 --- a/indra/newview/llfloaterbuycurrency.h +++ b/indra/newview/llfloaterbuycurrency.h @@ -35,6 +35,8 @@ #include "stdtypes.h" +class LLFloater; + class LLFloaterBuyCurrency { public: @@ -46,6 +48,8 @@ public: "Uploading costs" a space and the price will be appended */ + + static LLFloater* buildFloater(const LLSD& key); }; diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 3fbee83c7b..3d1b7965a1 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -43,6 +43,7 @@ #include "llconfirmationmanager.h" #include "llcurrencyuimanager.h" #include "llfloater.h" +#include "llfloaterreg.h" #include "llfloatertools.h" #include "llframetimer.h" #include "lliconctrl.h" @@ -75,10 +76,22 @@ const F64 CURRENCY_ESTIMATE_FREQUENCY = 0.5; class LLFloaterBuyLandUI : public LLFloater { -private: - LLFloaterBuyLandUI(); +public: + LLFloaterBuyLandUI(const LLSD& key); virtual ~LLFloaterBuyLandUI(); - + +private: + class SelectionObserver : public LLParcelObserver + { + public: + SelectionObserver(LLFloaterBuyLandUI* floater) : mFloater(floater) {} + virtual void changed(); + private: + LLFloaterBuyLandUI* mFloater; + }; + +private: + SelectionObserver mParcelSelectionObserver; LLViewerRegion* mRegion; LLParcelSelectionHandle mParcel; bool mIsClaim; @@ -144,11 +157,7 @@ private: LLViewerParcelMgr::ParcelBuyInfo* mParcelBuyInfo; - static LLFloaterBuyLandUI* sInstance; - public: - static LLFloaterBuyLandUI* soleInstance(bool createIfNeeded); - void setForGroup(bool is_for_group); void setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel); @@ -156,10 +165,10 @@ public: void updateParcelInfo(); void updateCovenantInfo(); static void onChangeAgreeCovenant(LLUICtrl* ctrl, void* user_data); - void updateCovenantText(const std::string& string, const LLUUID &asset_id); - void updateEstateName(const std::string& name); - void updateLastModified(const std::string& text); - void updateEstateOwnerName(const std::string& name); + void updateFloaterCovenantText(const std::string& string, const LLUUID &asset_id); + void updateFloaterEstateName(const std::string& name); + void updateFloaterLastModified(const std::string& text); + void updateFloaterEstateOwnerName(const std::string& name); void updateWebSiteInfo(); void finishWebSiteInfo(); @@ -171,7 +180,7 @@ public: void refreshUI(); - void startTransaction(TransactionType type, LLXMLRPCValue params); + void startTransaction(TransactionType type, const LLXMLRPCValue& params); bool checkTransaction(); void tellUserError(const std::string& message, const std::string& uri); @@ -181,26 +190,21 @@ public: void startBuyPreConfirm(); void startBuyPostConfirm(const std::string& password); - static void onClickBuy(void* data); - static void onClickCancel(void* data); - static void onClickErrorWeb(void* data); + void onClickBuy(); + void onClickCancel(); + void onClickErrorWeb(); virtual void draw(); virtual BOOL canClose(); - /*virtual*/ void setMinimized(BOOL b); + + void onVisibilityChange ( const LLSD& new_visibility ); -private: - class SelectionObserver : public LLParcelObserver - { - public: - virtual void changed(); - }; }; static void cacheNameUpdateRefreshesBuyLand(const LLUUID&, const std::string&, const std::string&, BOOL) { - LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(false); + LLFloaterBuyLandUI* ui = LLFloaterReg::findTypedInstance<LLFloaterBuyLandUI>("buy_land"); if (ui) { ui->updateNames(); @@ -217,101 +221,64 @@ void LLFloaterBuyLand::buyLand( return; } - LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(true); - ui->setForGroup(is_for_group); - ui->setParcel(region, parcel); - ui->openFloater(); + LLFloaterBuyLandUI* ui = LLFloaterReg::showTypedInstance<LLFloaterBuyLandUI>("buy_land"); + if (ui) + { + ui->setForGroup(is_for_group); + ui->setParcel(region, parcel); + } } // static void LLFloaterBuyLand::updateCovenantText(const std::string& string, const LLUUID &asset_id) { - LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::soleInstance(FALSE); + LLFloaterBuyLandUI* floater = LLFloaterReg::findTypedInstance<LLFloaterBuyLandUI>("buy_land"); if (floater) { - floater->updateCovenantText(string, asset_id); + floater->updateFloaterCovenantText(string, asset_id); } } // static void LLFloaterBuyLand::updateEstateName(const std::string& name) { - LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::soleInstance(FALSE); + LLFloaterBuyLandUI* floater = LLFloaterReg::findTypedInstance<LLFloaterBuyLandUI>("buy_land"); if (floater) { - floater->updateEstateName(name); + floater->updateFloaterEstateName(name); } } // static void LLFloaterBuyLand::updateLastModified(const std::string& text) { - LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::soleInstance(FALSE); + LLFloaterBuyLandUI* floater = LLFloaterReg::findTypedInstance<LLFloaterBuyLandUI>("buy_land"); if (floater) { - floater->updateLastModified(text); + floater->updateFloaterLastModified(text); } } // static void LLFloaterBuyLand::updateEstateOwnerName(const std::string& name) { - LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::soleInstance(FALSE); + LLFloaterBuyLandUI* floater = LLFloaterReg::findTypedInstance<LLFloaterBuyLandUI>("buy_land"); if (floater) { - floater->updateEstateOwnerName(name); + floater->updateFloaterEstateOwnerName(name); } } // static -BOOL LLFloaterBuyLand::isOpen() +LLFloater* LLFloaterBuyLand::buildFloater(const LLSD& key) { - LLFloaterBuyLandUI* floater = LLFloaterBuyLandUI::soleInstance(FALSE); - if (floater) - { - return floater->getVisible(); - } - return FALSE; -} - -// static -LLFloaterBuyLandUI* LLFloaterBuyLandUI::sInstance = NULL; - -// static -LLFloaterBuyLandUI* LLFloaterBuyLandUI::soleInstance(bool createIfNeeded) -{ -#if !LL_RELEASE_FOR_DOWNLOAD - if (createIfNeeded) - { - delete sInstance; - sInstance = NULL; - } -#endif - if (!sInstance && createIfNeeded) - { - sInstance = new LLFloaterBuyLandUI(); - - LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_buy_land.xml"); - sInstance->center(); - - static bool observingCacheName = false; - if (!observingCacheName) - { - gCacheName->addObserver(&cacheNameUpdateRefreshesBuyLand); - observingCacheName = true; - } - - static SelectionObserver* parcelSelectionObserver = NULL; - if (!parcelSelectionObserver) - { - parcelSelectionObserver = new SelectionObserver; - LLViewerParcelMgr::getInstance()->addObserver(parcelSelectionObserver); - } - } - - return sInstance; + LLFloaterBuyLandUI* floater = new LLFloaterBuyLandUI(key); + return floater; } +//---------------------------------------------------------------------------- +// LLFloaterBuyLandUI +//---------------------------------------------------------------------------- #if LL_WINDOWS // passing 'this' during construction generates a warning. The callee @@ -320,42 +287,45 @@ LLFloaterBuyLandUI* LLFloaterBuyLandUI::soleInstance(bool createIfNeeded) // warning so that we can compile without generating a warning. #pragma warning(disable : 4355) #endif -LLFloaterBuyLandUI::LLFloaterBuyLandUI() -: LLFloater(), +LLFloaterBuyLandUI::LLFloaterBuyLandUI(const LLSD& key) +: LLFloater(LLSD()), + mParcelSelectionObserver(this), mParcel(0), mBought(false), mParcelValid(false), mSiteValid(false), mChildren(*this), mCurrency(*this), mTransaction(0), mParcelBuyInfo(0) { + static bool observingCacheName = false; + if (!observingCacheName) + { + gCacheName->addObserver(&cacheNameUpdateRefreshesBuyLand); + observingCacheName = true; + } + + LLViewerParcelMgr::getInstance()->addObserver(&mParcelSelectionObserver); + +// LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_buy_land.xml"); } LLFloaterBuyLandUI::~LLFloaterBuyLandUI() { - delete mTransaction; - + LLViewerParcelMgr::getInstance()->removeObserver(&mParcelSelectionObserver); LLViewerParcelMgr::getInstance()->deleteParcelBuy(mParcelBuyInfo); - if (sInstance == this) - { - sInstance = NULL; - } + delete mTransaction; } void LLFloaterBuyLandUI::SelectionObserver::changed() { - LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(false); - if (ui) + if (LLViewerParcelMgr::getInstance()->selectionEmpty()) { - if (LLViewerParcelMgr::getInstance()->selectionEmpty()) - { - ui->closeFloater(); - } - else { - ui->setParcel( - LLViewerParcelMgr::getInstance()->getSelectionRegion(), - LLViewerParcelMgr::getInstance()->getParcelSelection()); - } + mFloater->closeFloater(); + } + else + { + mFloater->setParcel(LLViewerParcelMgr::getInstance()->getSelectionRegion(), + LLViewerParcelMgr::getInstance()->getParcelSelection()); } } @@ -593,7 +563,7 @@ void LLFloaterBuyLandUI::onChangeAgreeCovenant(LLUICtrl* ctrl, void* user_data) } } -void LLFloaterBuyLandUI::updateCovenantText(const std::string &string, const LLUUID& asset_id) +void LLFloaterBuyLandUI::updateFloaterCovenantText(const std::string &string, const LLUUID& asset_id) { LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("covenant_editor"); if (editor) @@ -625,19 +595,19 @@ void LLFloaterBuyLandUI::updateCovenantText(const std::string &string, const LLU } } -void LLFloaterBuyLandUI::updateEstateName(const std::string& name) +void LLFloaterBuyLandUI::updateFloaterEstateName(const std::string& name) { LLTextBox* box = getChild<LLTextBox>("estate_name_text"); if (box) box->setText(name); } -void LLFloaterBuyLandUI::updateLastModified(const std::string& text) +void LLFloaterBuyLandUI::updateFloaterLastModified(const std::string& text) { LLTextBox* editor = getChild<LLTextBox>("covenant_timestamp_text"); if (editor) editor->setText(text); } -void LLFloaterBuyLandUI::updateEstateOwnerName(const std::string& name) +void LLFloaterBuyLandUI::updateFloaterEstateOwnerName(const std::string& name) { LLTextBox* box = getChild<LLTextBox>("estate_owner_text"); if (box) box->setText(name); @@ -834,8 +804,7 @@ void LLFloaterBuyLandUI::updateNames() } -void LLFloaterBuyLandUI::startTransaction(TransactionType type, - LLXMLRPCValue params) +void LLFloaterBuyLandUI::startTransaction(TransactionType type, const LLXMLRPCValue& params) { delete mTransaction; mTransaction = NULL; @@ -916,11 +885,15 @@ void LLFloaterBuyLandUI::tellUserError( // virtual BOOL LLFloaterBuyLandUI::postBuild() { + mVisibleSignal.connect(boost::bind(&LLFloaterBuyLandUI::onVisibilityChange, this, _2)); + mCurrency.prepare(); - childSetAction("buy_btn", onClickBuy, this); - childSetAction("cancel_btn", onClickCancel, this); - childSetAction("error_web", onClickErrorWeb, this); + getChild<LLUICtrl>("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyLandUI::onClickBuy, this)); + getChild<LLUICtrl>("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuyLandUI::onClickCancel, this)); + getChild<LLUICtrl>("error_web")->setCommitCallback( boost::bind(&LLFloaterBuyLandUI::onClickErrorWeb, this)); + + center(); return TRUE; } @@ -986,12 +959,9 @@ BOOL LLFloaterBuyLandUI::canClose() return can_close; } -// virtual -void LLFloaterBuyLandUI::setMinimized(BOOL minimize) +void LLFloaterBuyLandUI::onVisibilityChange ( const LLSD& new_visibility ) { - bool restored = (isMinimized() && !minimize); - LLFloater::setMinimized(minimize); - if (restored) + if (new_visibility.asBoolean()) { refreshUI(); } @@ -1346,26 +1316,20 @@ void LLFloaterBuyLandUI::startBuyPostConfirm(const std::string& password) } -// static -void LLFloaterBuyLandUI::onClickBuy(void* data) +void LLFloaterBuyLandUI::onClickBuy() { - LLFloaterBuyLandUI* self = (LLFloaterBuyLandUI*)data; - self->startBuyPreConfirm(); + startBuyPreConfirm(); } -// static -void LLFloaterBuyLandUI::onClickCancel(void* data) +void LLFloaterBuyLandUI::onClickCancel() { - LLFloaterBuyLandUI* self = (LLFloaterBuyLandUI*)data; - self->closeFloater(); + closeFloater(); } -// static -void LLFloaterBuyLandUI::onClickErrorWeb(void* data) +void LLFloaterBuyLandUI::onClickErrorWeb() { - LLFloaterBuyLandUI* self = (LLFloaterBuyLandUI*)data; - LLWeb::loadURLExternal(self->mCannotBuyURI); - self->closeFloater(); + LLWeb::loadURLExternal(mCannotBuyURI); + closeFloater(); } diff --git a/indra/newview/llfloaterbuyland.h b/indra/newview/llfloaterbuyland.h index 82e59a0bcc..7df07f752d 100644 --- a/indra/newview/llfloaterbuyland.h +++ b/indra/newview/llfloaterbuyland.h @@ -33,6 +33,7 @@ #ifndef LL_LLFLOATERBUYLAND_H #define LL_LLFLOATERBUYLAND_H +class LLFloater; class LLViewerRegion; class LLViewerTextEditor; class LLParcelSelection; @@ -47,7 +48,8 @@ public: static void updateEstateName(const std::string& name); static void updateLastModified(const std::string& text); static void updateEstateOwnerName(const std::string& name); - static BOOL isOpen(); + + static LLFloater* buildFloater(const LLSD& key); }; #endif diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 1ecbdd8e16..8fcb7b985f 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -54,6 +54,7 @@ //#include "lllineeditor.h" #include "llmutelist.h" //#include "llresizehandle.h" +#include "llchatbar.h" #include "llrecentpeople.h" #include "llstatusbar.h" #include "llviewertexteditor.h" @@ -98,6 +99,7 @@ LLFloaterChat::LLFloaterChat(const LLSD& seed) : LLFloater(seed), mPanel(NULL) { + mFactoryMap["chat_panel"] = LLCallbackMap(createChatPanel, NULL); mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, NULL); //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_chat_history.xml"); @@ -108,23 +110,27 @@ LLFloaterChat::~LLFloaterChat() // Children all cleaned up by default view destructor. } -void LLFloaterChat::setVisible(BOOL visible) -{ - LLFloater::setVisible( visible ); -} - void LLFloaterChat::draw() { // enable say and shout only when text available childSetValue("toggle_active_speakers_btn", childIsVisible("active_speakers_panel")); + LLChatBar* chat_barp = findChild<LLChatBar>("chat_panel", TRUE); + if (chat_barp) + { + chat_barp->refresh(); + } + mPanel->refreshSpeakers(); LLFloater::draw(); } BOOL LLFloaterChat::postBuild() { + // Hide the chat overlay when our history is visible. + mVisibleSignal.connect(boost::bind(&LLFloaterChat::updateConsoleVisibility, this)); + mPanel = (LLPanelActiveSpeakers*)getChild<LLPanel>("active_speakers_panel"); childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes @@ -134,34 +140,6 @@ BOOL LLFloaterChat::postBuild() return TRUE; } -// public virtual -void LLFloaterChat::onClose(bool app_quitting) -{ - if (getHost()) - { - getHost()->setVisible(FALSE); - } - else - { - setVisible(FALSE); - } -} - -void LLFloaterChat::onVisibilityChange(BOOL new_visibility) -{ - // Hide the chat overlay when our history is visible. - updateConsoleVisibility(); - - LLFloater::onVisibilityChange(new_visibility); -} - -void LLFloaterChat::setMinimized(BOOL minimized) -{ - LLFloater::setMinimized(minimized); - updateConsoleVisibility(); -} - - void LLFloaterChat::updateConsoleVisibility() { // determine whether we should show console due to not being visible @@ -526,6 +504,13 @@ void* LLFloaterChat::createSpeakersPanel(void* data) return new LLPanelActiveSpeakers(LLLocalSpeakerMgr::getInstance(), TRUE); } +//static +void* LLFloaterChat::createChatPanel(void* data) +{ + LLChatBar* chatp = new LLChatBar(); + return chatp; +} + // static void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) { diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h index b299d1ad10..e8af48d095 100644 --- a/indra/newview/llfloaterchat.h +++ b/indra/newview/llfloaterchat.h @@ -65,12 +65,9 @@ public: LLFloaterChat(const LLSD& seed); ~LLFloaterChat(); - virtual void setVisible( BOOL b ); virtual void draw(); virtual BOOL postBuild(); - virtual void onClose(bool app_quitting); - virtual void onVisibilityChange(BOOL cur_visibility); - virtual void setMinimized(BOOL); + void updateConsoleVisibility(); static void setHistoryCursorAndScrollToEnd(); @@ -90,6 +87,7 @@ public: static void chatFromLogFile(LLLogChat::ELogLineType type,std::string line, void* userdata); static void loadHistory(); static void* createSpeakersPanel(void* data); + static void* createChatPanel(void* data); static LLFloaterChat* getInstance(); // *TODO:Skinning Deprecate diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp index 3389770b2f..05ea800d0e 100644 --- a/indra/newview/llfloaterchatterbox.cpp +++ b/indra/newview/llfloaterchatterbox.cpp @@ -50,7 +50,7 @@ // LLFloaterMyFriends::LLFloaterMyFriends(const LLSD& seed) - : LLFloater() + : LLFloater(seed) { mFactoryMap["friends_panel"] = LLCallbackMap(LLFloaterMyFriends::createFriendsPanel, NULL); mFactoryMap["groups_panel"] = LLCallbackMap(LLFloaterMyFriends::createGroupsPanel, NULL); @@ -78,11 +78,6 @@ void LLFloaterMyFriends::onOpen(const LLSD& key) } } -void LLFloaterMyFriends::onClose(bool app_quitting) -{ - setVisible(FALSE); -} - //static void* LLFloaterMyFriends::createFriendsPanel(void* data) { @@ -105,8 +100,8 @@ LLFloaterMyFriends* LLFloaterMyFriends::getInstance() // LLFloaterChatterBox // LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) - : LLMultiFloater(), - mActiveVoiceFloater(NULL) +: LLMultiFloater(seed), + mActiveVoiceFloater(NULL) { mAutoResize = FALSE; @@ -119,6 +114,8 @@ LLFloaterChatterBox::~LLFloaterChatterBox() BOOL LLFloaterChatterBox::postBuild() { + mVisibleSignal.connect(boost::bind(&LLFloaterChatterBox::onVisibilityChange, this, _2)); + if (gSavedSettings.getBOOL("ContactsTornOff")) { LLFloaterMyFriends* floater_contacts = LLFloaterMyFriends::getInstance(); @@ -245,14 +242,8 @@ void LLFloaterChatterBox::onOpen(const LLSD& key) } } -void LLFloaterChatterBox::onClose(bool app_quitting) +void LLFloaterChatterBox::onVisibilityChange ( const LLSD& new_visibility ) { - setVisible(FALSE); -} - -void LLFloaterChatterBox::setMinimized(BOOL minimized) -{ - LLFloater::setMinimized(minimized); // HACK: potentially need to toggle console LLFloaterChat* instance = LLFloaterChat::getInstance(); if(instance) @@ -332,7 +323,7 @@ void LLFloaterChatterBox::addFloater(LLFloater* floaterp, else { LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point); - openFloater(floaterp->getKey()); + // openFloater(floaterp->getKey()); } // make sure active voice icon shows up for new tab diff --git a/indra/newview/llfloaterchatterbox.h b/indra/newview/llfloaterchatterbox.h index e6a2e30ba6..3929e6e36c 100644 --- a/indra/newview/llfloaterchatterbox.h +++ b/indra/newview/llfloaterchatterbox.h @@ -52,8 +52,6 @@ public: /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ void draw(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void setMinimized(BOOL minimized); /*virtual*/ void removeFloater(LLFloater* floaterp); /*virtual*/ void addFloater(LLFloater* floaterp, @@ -64,6 +62,8 @@ public: static LLFloater* getCurrentVoiceFloater(); protected: + void onVisibilityChange ( const LLSD& new_visibility ); + LLFloater* mActiveVoiceFloater; }; @@ -76,7 +76,6 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); static LLFloaterMyFriends* getInstance(); // *TODO:Skinning Deprecate diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index c140518759..8e385fca78 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -79,7 +79,7 @@ const F32 CONTEXT_FADE_TIME = 0.08f; ////////////////////////////////////////////////////////////////////////////// LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate ) - : LLFloater(), + : LLFloater(LLSD()), mComponents ( 3 ), mMouseDownInLumRegion ( FALSE ), mMouseDownInHueRegion ( FALSE ), @@ -113,6 +113,9 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show mCanApplyImmediately ( show_apply_immediate ), mContextConeOpacity ( 0.f ) { + // build the majority of the gui using the factory builder + LLUICtrlFactory::getInstance()->buildFloater ( this, "floater_color_picker.xml", NULL ); + // create user interface for this picker createUI (); @@ -133,10 +136,6 @@ LLFloaterColorPicker::~LLFloaterColorPicker() // void LLFloaterColorPicker::createUI () { - // build the majority of the gui using the factory builder - LLUICtrlFactory::getInstance()->buildFloater ( this, "floater_color_picker.xml" ); - setVisible ( FALSE ); - // create RGB type area (not really RGB but it's got R,G & B in it.,.. LLPointer<LLImageRaw> raw = new LLImageRaw ( mRGBViewerImageWidth, mRGBViewerImageHeight, mComponents ); diff --git a/indra/newview/llfloaterdaycycle.cpp b/indra/newview/llfloaterdaycycle.cpp index a448df792e..7f3b988dfe 100644 --- a/indra/newview/llfloaterdaycycle.cpp +++ b/indra/newview/llfloaterdaycycle.cpp @@ -59,14 +59,13 @@ #include "llfloaterwindlight.h" -LLFloaterDayCycle* LLFloaterDayCycle::sDayCycle = NULL; std::map<std::string, LLWLSkyKey> LLFloaterDayCycle::sSliderToKey; const F32 LLFloaterDayCycle::sHoursPerDay = 24.0f; -LLFloaterDayCycle::LLFloaterDayCycle() - : LLFloater() +LLFloaterDayCycle::LLFloaterDayCycle(const LLSD& key) +: LLFloater(key) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_day_cycle_options.xml"); + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_day_cycle_options.xml"); } BOOL LLFloaterDayCycle::postBuild() @@ -95,6 +94,10 @@ BOOL LLFloaterDayCycle::postBuild() // load it up initCallbacks(); + + syncMenu(); + syncSliderTrack(); + return TRUE; } @@ -102,17 +105,14 @@ LLFloaterDayCycle::~LLFloaterDayCycle() { } -void LLFloaterDayCycle::onClickHelp(void* data) +void LLFloaterDayCycle::onClickHelp(std::string xml_alert) { - LLFloaterDayCycle* self = LLFloaterDayCycle::instance(); - - std::string xml_alert = *(std::string *) data; - LLNotifications::instance().add(self->contextualNotification(xml_alert)); + LLNotifications::instance().add(contextualNotification(xml_alert)); } void LLFloaterDayCycle::initHelpBtn(const std::string& name, const std::string& xml_alert) { - childSetAction(name, onClickHelp, new std::string(xml_alert)); + getChild<LLButton>(name)->setClickedCallback(boost::bind(&LLFloaterDayCycle::onClickHelp, this, xml_alert)); } void LLFloaterDayCycle::initCallbacks(void) @@ -120,24 +120,24 @@ void LLFloaterDayCycle::initCallbacks(void) initHelpBtn("WLDayCycleHelp", "HelpDayCycle"); // WL Day Cycle - childSetCommitCallback("WLTimeSlider", onTimeSliderMoved, NULL); - childSetCommitCallback("WLDayCycleKeys", onKeyTimeMoved, NULL); - childSetCommitCallback("WLCurKeyHour", onKeyTimeChanged, NULL); - childSetCommitCallback("WLCurKeyMin", onKeyTimeChanged, NULL); - childSetCommitCallback("WLKeyPresets", onKeyPresetChanged, NULL); - - childSetCommitCallback("WLLengthOfDayHour", onTimeRateChanged, NULL); - childSetCommitCallback("WLLengthOfDayMin", onTimeRateChanged, NULL); - childSetCommitCallback("WLLengthOfDaySec", onTimeRateChanged, NULL); - childSetAction("WLUseLindenTime", onUseLindenTime, NULL); - childSetAction("WLAnimSky", onRunAnimSky, NULL); - childSetAction("WLStopAnimSky", onStopAnimSky, NULL); - - childSetAction("WLLoadDayCycle", onLoadDayCycle, NULL); - childSetAction("WLSaveDayCycle", onSaveDayCycle, NULL); - - childSetAction("WLAddKey", onAddKey, NULL); - childSetAction("WLDeleteKey", onDeleteKey, NULL); + getChild<LLUICtrl>("WLTimeSlider")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onTimeSliderMoved, this, _1)); + getChild<LLUICtrl>("WLDayCycleKeys")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onKeyTimeMoved, this, _1)); + getChild<LLUICtrl>("WLCurKeyHour")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onKeyTimeChanged, this, _1)); + getChild<LLUICtrl>("WLCurKeyMin")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onKeyTimeChanged, this, _1)); + getChild<LLUICtrl>("WLKeyPresets")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onKeyPresetChanged, this, _1)); + + getChild<LLUICtrl>("WLLengthOfDayHour")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onTimeRateChanged, this, _1)); + getChild<LLUICtrl>("WLLengthOfDayMin")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onTimeRateChanged, this, _1)); + getChild<LLUICtrl>("WLLengthOfDaySec")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onTimeRateChanged, this, _1)); + getChild<LLUICtrl>("WLUseLindenTime")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onUseLindenTime, this, _1)); + getChild<LLUICtrl>("WLAnimSky")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onRunAnimSky, this, _1)); + getChild<LLUICtrl>("WLStopAnimSky")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onStopAnimSky, this, _1)); + + getChild<LLUICtrl>("WLLoadDayCycle")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onLoadDayCycle, this, _1)); + getChild<LLUICtrl>("WLSaveDayCycle")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onSaveDayCycle, this, _1)); + + getChild<LLUICtrl>("WLAddKey")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onAddKey, this, _1)); + getChild<LLUICtrl>("WLDeleteKey")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onDeleteKey, this, _1)); } void LLFloaterDayCycle::syncMenu() @@ -145,12 +145,12 @@ void LLFloaterDayCycle::syncMenu() // std::map<std::string, LLVector4> & currentParams = LLWLParamManager::instance()->mCurParams.mParamValues; // set time - LLMultiSliderCtrl* sldr = LLFloaterDayCycle::sDayCycle->getChild<LLMultiSliderCtrl>("WLTimeSlider"); + LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLTimeSlider"); sldr->setCurSliderValue((F32)LLWLParamManager::instance()->mAnimator.getDayTime() * sHoursPerDay); - LLSpinCtrl* secSpin = sDayCycle->getChild<LLSpinCtrl>("WLLengthOfDaySec"); - LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>("WLLengthOfDayMin"); - LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>("WLLengthOfDayHour"); + LLSpinCtrl* secSpin = getChild<LLSpinCtrl>("WLLengthOfDaySec"); + LLSpinCtrl* minSpin = getChild<LLSpinCtrl>("WLLengthOfDayMin"); + LLSpinCtrl* hourSpin = getChild<LLSpinCtrl>("WLLengthOfDayHour"); F32 curRate; F32 hours, min, sec; @@ -170,18 +170,18 @@ void LLFloaterDayCycle::syncMenu() // turn off Use Estate Time button if it's already being used if( LLWLParamManager::instance()->mAnimator.mUseLindenTime == true) { - LLFloaterDayCycle::sDayCycle->childDisable("WLUseLindenTime"); + childDisable("WLUseLindenTime"); } else { - LLFloaterDayCycle::sDayCycle->childEnable("WLUseLindenTime"); + childEnable("WLUseLindenTime"); } } void LLFloaterDayCycle::syncSliderTrack() { // clear the slider - LLMultiSliderCtrl* kSldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); + LLMultiSliderCtrl* kSldr = getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); kSldr->clear(); sSliderToKey.clear(); @@ -204,12 +204,12 @@ void LLFloaterDayCycle::syncTrack() } LLMultiSliderCtrl* sldr; - sldr = sDayCycle->getChild<LLMultiSliderCtrl>( + sldr = getChild<LLMultiSliderCtrl>( "WLDayCycleKeys"); llassert_always(sSliderToKey.size() == sldr->getValue().size()); LLMultiSliderCtrl* tSldr; - tSldr = sDayCycle->getChild<LLMultiSliderCtrl>( + tSldr = getChild<LLMultiSliderCtrl>( "WLTimeSlider"); // create a new animation track @@ -231,50 +231,7 @@ void LLFloaterDayCycle::syncTrack() LLWLParamManager::instance()->mCurParams); } -// static -LLFloaterDayCycle* LLFloaterDayCycle::instance() -{ - if (!sDayCycle) - { - sDayCycle = new LLFloaterDayCycle(); - sDayCycle->openFloater(); - sDayCycle->setFocus(TRUE); - } - return sDayCycle; -} - -bool LLFloaterDayCycle::isOpen() -{ - if (sDayCycle != NULL) - { - return true; - } - return false; -} - -void LLFloaterDayCycle::show() -{ - LLFloaterDayCycle* dayCycle = instance(); - dayCycle->syncMenu(); - syncSliderTrack(); - - // comment in if you want the menu to rebuild each time - //LLUICtrlFactory::getInstance()->buildFloater(dayCycle, "floater_day_cycle_options.xml"); - //dayCycle->initCallbacks(); - - dayCycle->openFloater(); -} - -// virtual -void LLFloaterDayCycle::onClose(bool app_quitting) -{ - if (sDayCycle) - { - sDayCycle->setVisible(FALSE); - } -} - -void LLFloaterDayCycle::onRunAnimSky(void* userData) +void LLFloaterDayCycle::onRunAnimSky(LLUICtrl* ctrl) { // if no keys, do nothing if(sSliderToKey.size() == 0) @@ -283,11 +240,11 @@ void LLFloaterDayCycle::onRunAnimSky(void* userData) } LLMultiSliderCtrl* sldr; - sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); + sldr = getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); llassert_always(sSliderToKey.size() == sldr->getValue().size()); LLMultiSliderCtrl* tSldr; - tSldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLTimeSlider"); + tSldr = getChild<LLMultiSliderCtrl>("WLTimeSlider"); // turn off linden time LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; @@ -299,7 +256,7 @@ void LLFloaterDayCycle::onRunAnimSky(void* userData) llassert_always(LLWLParamManager::instance()->mAnimator.mTimeTrack.size() == sldr->getValue().size()); } -void LLFloaterDayCycle::onStopAnimSky(void* userData) +void LLFloaterDayCycle::onStopAnimSky(LLUICtrl* ctrl) { // if no keys, do nothing if(sSliderToKey.size() == 0) { @@ -311,17 +268,16 @@ void LLFloaterDayCycle::onStopAnimSky(void* userData) LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; } -void LLFloaterDayCycle::onUseLindenTime(void* userData) +void LLFloaterDayCycle::onUseLindenTime(LLUICtrl* ctrl) { - LLFloaterWindLight* wl = LLFloaterWindLight::instance(); - LLComboBox* box = wl->getChild<LLComboBox>("WLPresetsCombo"); + LLComboBox* box = getChild<LLComboBox>("WLPresetsCombo"); box->selectByValue(""); LLWLParamManager::instance()->mAnimator.mIsRunning = true; LLWLParamManager::instance()->mAnimator.mUseLindenTime = true; } -void LLFloaterDayCycle::onLoadDayCycle(void* userData) +void LLFloaterDayCycle::onLoadDayCycle(LLUICtrl* ctrl) { LLWLParamManager::instance()->mDay.loadDayCycle("Default.xml"); @@ -331,7 +287,7 @@ void LLFloaterDayCycle::onLoadDayCycle(void* userData) // set the param manager's track to the new one LLMultiSliderCtrl* tSldr; - tSldr = sDayCycle->getChild<LLMultiSliderCtrl>( + tSldr = getChild<LLMultiSliderCtrl>( "WLTimeSlider"); LLWLParamManager::instance()->resetAnimator( tSldr->getCurSliderValue() / sHoursPerDay, false); @@ -341,15 +297,15 @@ void LLFloaterDayCycle::onLoadDayCycle(void* userData) LLWLParamManager::instance()->mCurParams); } -void LLFloaterDayCycle::onSaveDayCycle(void* userData) +void LLFloaterDayCycle::onSaveDayCycle(LLUICtrl* ctrl) { LLWLParamManager::instance()->mDay.saveDayCycle("Default.xml"); } -void LLFloaterDayCycle::onTimeSliderMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterDayCycle::onTimeSliderMoved(LLUICtrl* ctrl) { - LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>( + LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>( "WLTimeSlider"); /// get the slider value @@ -365,12 +321,12 @@ void LLFloaterDayCycle::onTimeSliderMoved(LLUICtrl* ctrl, void* userData) LLWLParamManager::instance()->mCurParams); } -void LLFloaterDayCycle::onKeyTimeMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterDayCycle::onKeyTimeMoved(LLUICtrl* ctrl) { - LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>("WLKeyPresets"); - LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); - LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyHour"); - LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyMin"); + LLComboBox* comboBox = getChild<LLComboBox>("WLKeyPresets"); + LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); + LLSpinCtrl* hourSpin = getChild<LLSpinCtrl>("WLCurKeyHour"); + LLSpinCtrl* minSpin = getChild<LLSpinCtrl>("WLCurKeyMin"); if(sldr->getValue().size() == 0) { return; @@ -408,18 +364,18 @@ void LLFloaterDayCycle::onKeyTimeMoved(LLUICtrl* ctrl, void* userData) } -void LLFloaterDayCycle::onKeyTimeChanged(LLUICtrl* ctrl, void* userData) +void LLFloaterDayCycle::onKeyTimeChanged(LLUICtrl* ctrl) { // if no keys, skipped if(sSliderToKey.size() == 0) { return; } - LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>( + LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>( "WLDayCycleKeys"); - LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>( + LLSpinCtrl* hourSpin = getChild<LLSpinCtrl>( "WLCurKeyHour"); - LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>( + LLSpinCtrl* minSpin = getChild<LLSpinCtrl>( "WLCurKeyMin"); F32 hour = hourSpin->get(); @@ -437,12 +393,12 @@ void LLFloaterDayCycle::onKeyTimeChanged(LLUICtrl* ctrl, void* userData) syncTrack(); } -void LLFloaterDayCycle::onKeyPresetChanged(LLUICtrl* ctrl, void* userData) +void LLFloaterDayCycle::onKeyPresetChanged(LLUICtrl* ctrl) { // get the time - LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>( + LLComboBox* comboBox = getChild<LLComboBox>( "WLKeyPresets"); - LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>( + LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>( "WLDayCycleKeys"); // do nothing if no sliders @@ -464,16 +420,16 @@ void LLFloaterDayCycle::onKeyPresetChanged(LLUICtrl* ctrl, void* userData) syncTrack(); } -void LLFloaterDayCycle::onTimeRateChanged(LLUICtrl* ctrl, void* userData) +void LLFloaterDayCycle::onTimeRateChanged(LLUICtrl* ctrl) { // get the time - LLSpinCtrl* secSpin = sDayCycle->getChild<LLSpinCtrl>( + LLSpinCtrl* secSpin = getChild<LLSpinCtrl>( "WLLengthOfDaySec"); - LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>( + LLSpinCtrl* minSpin = getChild<LLSpinCtrl>( "WLLengthOfDayMin"); - LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>( + LLSpinCtrl* hourSpin = getChild<LLSpinCtrl>( "WLLengthOfDayHour"); F32 hour; @@ -492,13 +448,13 @@ void LLFloaterDayCycle::onTimeRateChanged(LLUICtrl* ctrl, void* userData) syncTrack(); } -void LLFloaterDayCycle::onAddKey(void* userData) +void LLFloaterDayCycle::onAddKey(LLUICtrl* ctrl) { - LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>( + LLComboBox* comboBox = getChild<LLComboBox>( "WLKeyPresets"); - LLMultiSliderCtrl* kSldr = sDayCycle->getChild<LLMultiSliderCtrl>( + LLMultiSliderCtrl* kSldr = getChild<LLMultiSliderCtrl>( "WLDayCycleKeys"); - LLMultiSliderCtrl* tSldr = sDayCycle->getChild<LLMultiSliderCtrl>( + LLMultiSliderCtrl* tSldr = getChild<LLMultiSliderCtrl>( "WLTimeSlider"); llassert_always(sSliderToKey.size() == kSldr->getValue().size()); @@ -514,7 +470,7 @@ void LLFloaterDayCycle::onAddKey(void* userData) void LLFloaterDayCycle::addSliderKey(F32 time, const std::string & presetName) { - LLMultiSliderCtrl* kSldr = sDayCycle->getChild<LLMultiSliderCtrl>( + LLMultiSliderCtrl* kSldr = getChild<LLMultiSliderCtrl>( "WLDayCycleKeys"); // make a slider @@ -539,7 +495,7 @@ void LLFloaterDayCycle::addSliderKey(F32 time, const std::string & presetName) void LLFloaterDayCycle::deletePreset(std::string& presetName) { - LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); + LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); /// delete any reference std::map<std::string, LLWLSkyKey>::iterator curr_preset, next_preset; @@ -555,15 +511,15 @@ void LLFloaterDayCycle::deletePreset(std::string& presetName) } } -void LLFloaterDayCycle::onDeleteKey(void* userData) +void LLFloaterDayCycle::onDeleteKey(LLUICtrl* ctrl) { if(sSliderToKey.size() == 0) { return; } - LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>( + LLComboBox* comboBox = getChild<LLComboBox>( "WLKeyPresets"); - LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); + LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); // delete from map const std::string& sldrName = sldr->getCurSlider(); @@ -580,8 +536,8 @@ void LLFloaterDayCycle::onDeleteKey(void* userData) comboBox->selectByValue(sSliderToKey[name].presetName); F32 time = sSliderToKey[name].time; - LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyHour"); - LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyMin"); + LLSpinCtrl* hourSpin = getChild<LLSpinCtrl>("WLCurKeyHour"); + LLSpinCtrl* minSpin = getChild<LLSpinCtrl>("WLCurKeyMin"); // now set the spinners F32 hour = (F32)((S32)time); diff --git a/indra/newview/llfloaterdaycycle.h b/indra/newview/llfloaterdaycycle.h index a03a7f749a..43c347d4f2 100644 --- a/indra/newview/llfloaterdaycycle.h +++ b/indra/newview/llfloaterdaycycle.h @@ -56,87 +56,69 @@ class LLFloaterDayCycle : public LLFloater { public: - LLFloaterDayCycle(); + LLFloaterDayCycle(const LLSD& key); virtual ~LLFloaterDayCycle(); /*virtual*/ BOOL postBuild(); /// help button stuff - static void onClickHelp(void* data); + void onClickHelp(std::string xml_alert); void initHelpBtn(const std::string& name, const std::string& xml_alert); /// initialize all void initCallbacks(void); - /// one and one instance only - static LLFloaterDayCycle* instance(); - /// on time slider moved - static void onTimeSliderMoved(LLUICtrl* ctrl, void* userData); + void onTimeSliderMoved(LLUICtrl* ctrl); /// what happens when you move the key frame - static void onKeyTimeMoved(LLUICtrl* ctrl, void* userData); + void onKeyTimeMoved(LLUICtrl* ctrl); /// what happens when you change the key frame's time - static void onKeyTimeChanged(LLUICtrl* ctrl, void* userData); + void onKeyTimeChanged(LLUICtrl* ctrl); /// if you change the combo box, change the frame - static void onKeyPresetChanged(LLUICtrl* ctrl, void* userData); + void onKeyPresetChanged(LLUICtrl* ctrl); /// run this when user says to run the sky animation - static void onRunAnimSky(void* userData); + void onRunAnimSky(LLUICtrl* ctrl); /// run this when user says to stop the sky animation - static void onStopAnimSky(void* userData); + void onStopAnimSky(LLUICtrl* ctrl); /// if you change the combo box, change the frame - static void onTimeRateChanged(LLUICtrl* ctrl, void* userData); + void onTimeRateChanged(LLUICtrl* ctrl); /// add a new key on slider - static void onAddKey(void* userData); + void onAddKey(LLUICtrl* ctrl); /// delete any and all reference to a preset void deletePreset(std::string& presetName); /// delete a key frame - static void onDeleteKey(void* userData); + void onDeleteKey(LLUICtrl* ctrl); /// button to load day - static void onLoadDayCycle(void* userData); + void onLoadDayCycle(LLUICtrl* ctrl); /// button to save day - static void onSaveDayCycle(void* userData); + void onSaveDayCycle(LLUICtrl* ctrl); /// toggle for Linden time - static void onUseLindenTime(void* userData); - - - //// menu management - - /// show off our menu - static void show(); - - /// return if the menu exists or not - static bool isOpen(); - - /// stuff to do on exit - virtual void onClose(bool app_quitting); + void onUseLindenTime(LLUICtrl* ctrl); /// sync up sliders with day cycle structure - static void syncMenu(); + void syncMenu(); // makes sure key slider has what's in day cycle - static void syncSliderTrack(); + void syncSliderTrack(); /// makes sure day cycle data structure has what's in menu - static void syncTrack(); + void syncTrack(); /// add a slider to the track - static void addSliderKey(F32 time, const std::string& presetName); + void addSliderKey(F32 time, const std::string& presetName); private: - // one instance on the inside - static LLFloaterDayCycle* sDayCycle; - // map of sliders to parameters static std::map<std::string, LLWLSkyKey> sSliderToKey; diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index cfdf49373e..a520df36de 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -34,6 +34,7 @@ #include "llfloaterenvsettings.h" +#include "llfloaterreg.h" #include "llfloaterwindlight.h" #include "llfloaterwater.h" #include "lluictrlfactory.h" @@ -52,12 +53,10 @@ #include <sstream> -LLFloaterEnvSettings* LLFloaterEnvSettings::sEnvSettings = NULL; - -LLFloaterEnvSettings::LLFloaterEnvSettings() - : LLFloater() +LLFloaterEnvSettings::LLFloaterEnvSettings(const LLSD& key) + : LLFloater(key) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_env_settings.xml"); + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_env_settings.xml"); } // virtual LLFloaterEnvSettings::~LLFloaterEnvSettings() @@ -68,31 +67,29 @@ BOOL LLFloaterEnvSettings::postBuild() { // load it up initCallbacks(); + syncMenu(); return TRUE; } -void LLFloaterEnvSettings::onClickHelp(void* data) +void LLFloaterEnvSettings::onClickHelp() { - LLFloaterEnvSettings* self = (LLFloaterEnvSettings*)data; - LLNotifications::instance().add(self->contextualNotification("EnvSettingsHelpButton")); + LLNotifications::instance().add(contextualNotification("EnvSettingsHelpButton")); } void LLFloaterEnvSettings::initCallbacks(void) { // our three sliders - childSetCommitCallback("EnvTimeSlider", onChangeDayTime, NULL); - childSetCommitCallback("EnvCloudSlider", onChangeCloudCoverage, NULL); - childSetCommitCallback("EnvWaterFogSlider", onChangeWaterFogDensity, - &LLWaterParamManager::instance()->mFogDensity); + getChild<LLUICtrl>("EnvTimeSlider")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onChangeDayTime, this, _1)); + getChild<LLUICtrl>("EnvCloudSlider")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onChangeCloudCoverage, this, _1)); + getChild<LLUICtrl>("EnvWaterFogSlider")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onChangeWaterFogDensity, this, _1, &LLWaterParamManager::instance()->mFogDensity)); // color picker - childSetCommitCallback("EnvWaterColor", onChangeWaterColor, - &LLWaterParamManager::instance()->mFogColor); + getChild<LLUICtrl>("EnvWaterColor")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onChangeWaterColor, this, _1, &LLWaterParamManager::instance()->mFogColor)); // WL Top - childSetAction("EnvAdvancedSkyButton", onOpenAdvancedSky, NULL); - childSetAction("EnvAdvancedWaterButton", onOpenAdvancedWater, NULL); - childSetAction("EnvUseEstateTimeButton", onUseEstateTime, NULL); - childSetAction("EnvSettingsHelpButton", onClickHelp, this); + getChild<LLUICtrl>("EnvAdvancedSkyButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onOpenAdvancedSky, this)); + getChild<LLUICtrl>("EnvAdvancedWaterButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onOpenAdvancedWater, this)); + getChild<LLUICtrl>("EnvUseEstateTimeButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onUseEstateTime, this)); + getChild<LLUICtrl>("EnvSettingsHelpButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onClickHelp, this)); } @@ -101,14 +98,14 @@ void LLFloaterEnvSettings::initCallbacks(void) void LLFloaterEnvSettings::syncMenu() { LLSliderCtrl* sldr; - sldr = sEnvSettings->getChild<LLSliderCtrl>("EnvTimeSlider"); + sldr = getChild<LLSliderCtrl>("EnvTimeSlider"); // sync the clock F32 val = (F32)LLWLParamManager::instance()->mAnimator.getDayTime(); std::string timeStr = timeToString(val); LLTextBox* textBox; - textBox = sEnvSettings->getChild<LLTextBox>("EnvTimeText"); + textBox = getChild<LLTextBox>("EnvTimeText"); textBox->setValue(timeStr); @@ -127,7 +124,7 @@ void LLFloaterEnvSettings::syncMenu() LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); // sync water params LLColor4 col = param_mgr->getFogColor(); - LLColorSwatchCtrl* colCtrl = sEnvSettings->getChild<LLColorSwatchCtrl>("EnvWaterColor"); + LLColorSwatchCtrl* colCtrl = getChild<LLColorSwatchCtrl>("EnvWaterColor"); col.mV[3] = 1.0f; colCtrl->set(col); @@ -171,53 +168,9 @@ void LLFloaterEnvSettings::syncMenu() } } - -// static instance of it -LLFloaterEnvSettings* LLFloaterEnvSettings::instance() -{ - if (!sEnvSettings) - { - sEnvSettings = new LLFloaterEnvSettings(); - sEnvSettings->openFloater(); - sEnvSettings->setFocus(TRUE); - } - return sEnvSettings; -} -void LLFloaterEnvSettings::show() +void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl) { - LLFloaterEnvSettings* envSettings = instance(); - envSettings->syncMenu(); - - // comment in if you want the menu to rebuild each time - //LLUICtrlFactory::getInstance()->buildFloater(envSettings, "floater_env_settings.xml"); - //envSettings->initCallbacks(); - - envSettings->openFloater(); -} - -bool LLFloaterEnvSettings::isOpen() -{ - if (sEnvSettings != NULL) - { - return true; - } - return false; -} - -// virtual -void LLFloaterEnvSettings::onClose(bool app_quitting) -{ - if (sEnvSettings) - { - sEnvSettings->setVisible(FALSE); - } -} - - -void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl, void* userData) -{ - LLSliderCtrl* sldr; - sldr = sEnvSettings->getChild<LLSliderCtrl>("EnvTimeSlider"); + LLSliderCtrl* sldr = static_cast<LLSliderCtrl*>(ctrl); // deactivate animator LLWLParamManager::instance()->mAnimator.mIsRunning = false; @@ -234,10 +187,9 @@ void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl, void* userData) LLWLParamManager::instance()->mCurParams); } -void LLFloaterEnvSettings::onChangeCloudCoverage(LLUICtrl* ctrl, void* userData) +void LLFloaterEnvSettings::onChangeCloudCoverage(LLUICtrl* ctrl) { - LLSliderCtrl* sldr; - sldr = sEnvSettings->getChild<LLSliderCtrl>("EnvCloudSlider"); + LLSliderCtrl* sldr = static_cast<LLSliderCtrl*>(ctrl); // deactivate animator //LLWLParamManager::instance()->mAnimator.mIsRunning = false; @@ -247,17 +199,10 @@ void LLFloaterEnvSettings::onChangeCloudCoverage(LLUICtrl* ctrl, void* userData) LLWLParamManager::instance()->mCurParams.set("cloud_shadow", val); } -void LLFloaterEnvSettings::onChangeWaterFogDensity(LLUICtrl* ctrl, void* userData) +void LLFloaterEnvSettings::onChangeWaterFogDensity(LLUICtrl* ctrl, WaterExpFloatControl* expFloatControl) { LLSliderCtrl* sldr; - sldr = sEnvSettings->getChild<LLSliderCtrl>("EnvWaterFogSlider"); - - if(NULL == userData) - { - return; - } - - WaterExpFloatControl * expFloatControl = static_cast<WaterExpFloatControl *>(userData); + sldr = getChild<LLSliderCtrl>("EnvWaterFogSlider"); F32 val = sldr->getValueF32(); expFloatControl->mExp = val; @@ -267,10 +212,9 @@ void LLFloaterEnvSettings::onChangeWaterFogDensity(LLUICtrl* ctrl, void* userDat LLWaterParamManager::instance()->propagateParameters(); } -void LLFloaterEnvSettings::onChangeWaterColor(LLUICtrl* ctrl, void* userData) +void LLFloaterEnvSettings::onChangeWaterColor(LLUICtrl* ctrl, WaterColorControl* colorControl) { LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl); - WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); *colorControl = swatch->get(); colorControl->update(LLWaterParamManager::instance()->mCurParams); @@ -278,23 +222,22 @@ void LLFloaterEnvSettings::onChangeWaterColor(LLUICtrl* ctrl, void* userData) } -void LLFloaterEnvSettings::onOpenAdvancedSky(void* userData) +void LLFloaterEnvSettings::onOpenAdvancedSky() { - LLFloaterWindLight::show(); + LLFloaterReg::showInstance("env_windlight"); } -void LLFloaterEnvSettings::onOpenAdvancedWater(void* userData) +void LLFloaterEnvSettings::onOpenAdvancedWater() { - LLFloaterWater::show(); + LLFloaterReg::showInstance("env_water"); } -void LLFloaterEnvSettings::onUseEstateTime(void* userData) +void LLFloaterEnvSettings::onUseEstateTime() { - if(LLFloaterWindLight::isOpen()) + LLFloaterWindLight* wl = LLFloaterReg::findTypedInstance<LLFloaterWindLight>("env_windlight"); + if(wl) { - // select the blank value in - LLFloaterWindLight* wl = LLFloaterWindLight::instance(); LLComboBox* box = wl->getChild<LLComboBox>("WLPresetsCombo"); box->selectByValue(""); } diff --git a/indra/newview/llfloaterenvsettings.h b/indra/newview/llfloaterenvsettings.h index 725fb9ed45..083e3636d1 100644 --- a/indra/newview/llfloaterenvsettings.h +++ b/indra/newview/llfloaterenvsettings.h @@ -39,59 +39,46 @@ #include "llfloater.h" +struct WaterColorControl; +struct WaterExpFloatControl; /// Menuing system for all of windlight's functionality class LLFloaterEnvSettings : public LLFloater { public: - LLFloaterEnvSettings(); + LLFloaterEnvSettings(const LLSD& key); /*virtual*/ ~LLFloaterEnvSettings(); /*virtual*/ BOOL postBuild(); /// initialize all the callbacks for the menu void initCallbacks(void); - /// one and one instance only - static LLFloaterEnvSettings* instance(); - /// callback for the menus help button - static void onClickHelp(void* data); + void onClickHelp(); /// handle if time of day is changed - static void onChangeDayTime(LLUICtrl* ctrl, void* userData); + void onChangeDayTime(LLUICtrl* ctrl); /// handle if cloud coverage is changed - static void onChangeCloudCoverage(LLUICtrl* ctrl, void* userData); + void onChangeCloudCoverage(LLUICtrl* ctrl); /// handle change in water fog density - static void onChangeWaterFogDensity(LLUICtrl* ctrl, void* userData); - - /// handle change in under water fog density - static void onChangeUnderWaterFogMod(LLUICtrl* ctrl, void* userData); + void onChangeWaterFogDensity(LLUICtrl* ctrl, WaterExpFloatControl* expFloatControl); /// handle change in water fog color - static void onChangeWaterColor(LLUICtrl* ctrl, void* userData); + void onChangeWaterColor(LLUICtrl* ctrl, WaterColorControl* colorControl); /// open the advanced sky settings menu - static void onOpenAdvancedSky(void* userData); + void onOpenAdvancedSky(); /// open the advanced water settings menu - static void onOpenAdvancedWater(void* userData); + void onOpenAdvancedWater(); /// sync time with the server - static void onUseEstateTime(void* userData); + void onUseEstateTime(); //// menu management - /// show off our menu - static void show(); - - /// return if the menu exists or not - static bool isOpen(); - - /// stuff to do on exit - virtual void onClose(bool app_quitting); - /// sync up sliders with parameters void syncMenu(); @@ -99,8 +86,6 @@ public: std::string timeToString(F32 curTime); private: - // one instance on the inside - static LLFloaterEnvSettings* sEnvSettings; }; diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp deleted file mode 100644 index 6f84807564..0000000000 --- a/indra/newview/llfloaterevent.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @file llfloaterevent.cpp - * @brief Event information as shown in a floating window from - * secondlife:// command handler. - * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterevent.h" - -// viewer project includes -#include "llcommandhandler.h" -#include "llpanelevent.h" - -// linden library includes -#include "lluuid.h" -#include "lluictrlfactory.h" - -//////////////////////////////////////////////////////////////////////////// -// LLFloaterEventInfo - -//----------------------------------------------------------------------------- -// Globals -//----------------------------------------------------------------------------- - -LLMap< U32, LLFloaterEventInfo* > gEventInfoInstances; - -class LLEventHandler : public LLCommandHandler -{ -public: - // requires trusted browser to trigger - LLEventHandler() : LLCommandHandler("event", true) { } - bool handle(const LLSD& tokens, const LLSD& query_map, - LLWebBrowserCtrl* web) - { - if (tokens.size() < 2) - { - return false; - } - U32 event_id = tokens[0].asInteger(); - if (tokens[1].asString() == "about") - { - LLFloaterEventInfo::show(event_id); - return true; - } - return false; - } -}; -LLEventHandler gEventHandler; - -LLFloaterEventInfo::LLFloaterEventInfo(const U32 event_id) -: LLFloater(), - mEventID( event_id ) -{ - - mFactoryMap["event_details_panel"] = LLCallbackMap(LLFloaterEventInfo::createEventDetail, this); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_event.xml"); - gEventInfoInstances.addData(event_id, this); -} - -LLFloaterEventInfo::~LLFloaterEventInfo() -{ - // child views automatically deleted - gEventInfoInstances.removeData(mEventID); -} - -void LLFloaterEventInfo::displayEventInfo(const U32 event_id) -{ - mPanelEventp->setEventID(event_id); - this->setFrontmost(true); -} - -// static -void* LLFloaterEventInfo::createEventDetail(void* userdata) -{ - LLFloaterEventInfo *self = (LLFloaterEventInfo*)userdata; - self->mPanelEventp = new LLPanelEvent(); - LLUICtrlFactory::getInstance()->buildPanel(self->mPanelEventp, "panel_event.xml"); - - return self->mPanelEventp; -} - -// static -LLFloaterEventInfo* LLFloaterEventInfo::show(const U32 event_id) -{ - LLFloaterEventInfo *floater; - if (gEventInfoInstances.checkData(event_id)) - { - // ...bring that window to front - floater = gEventInfoInstances.getData(event_id); - floater->openFloater(); - floater->setFrontmost(true); - } - else - { - floater = new LLFloaterEventInfo( event_id ); - floater->center(); - floater->openFloater(); - floater->displayEventInfo(event_id); - floater->setFrontmost(true); - } - - return floater; -} diff --git a/indra/newview/llfloaterevent.h b/indra/newview/llfloaterevent.h deleted file mode 100644 index 563ecc49da..0000000000 --- a/indra/newview/llfloaterevent.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file llfloaterevent.h - * @brief Event information as shown in a floating window from - * secondlife:// command handler. - * Just a wrapper for LLPanelEvent. - * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLFLOATEREVENT_H -#define LL_LLFLOATEREVENT_H - -#include "llfloater.h" - -class LLPanelEvent; - -class LLFloaterEventInfo : public LLFloater -{ -public: - LLFloaterEventInfo( const U32 event_id ); - /*virtual*/ ~LLFloaterEventInfo(); - - void displayEventInfo(const U32 event_id); - - static LLFloaterEventInfo* show(const U32 event_id); - - static void* createEventDetail(void* userdata); - -private: - U32 mEventID; // for which event is this window? - LLPanelEvent* mPanelEventp; - -}; - -#endif // LL_LLFLOATEREVENT_H diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 5a4de579c2..431bc09d86 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -61,10 +61,6 @@ #include "llvoavatar.h" #include "llviewercontrol.h" -// static -LLFloaterGesture* LLFloaterGesture::sInstance = NULL; -LLFloaterGestureObserver* LLFloaterGesture::sObserver = NULL; - BOOL item_name_precedes( LLInventoryItem* a, LLInventoryItem* b ) { return LLStringUtil::precedesDict( a->getName(), b->getName() ); @@ -73,29 +69,31 @@ BOOL item_name_precedes( LLInventoryItem* a, LLInventoryItem* b ) class LLFloaterGestureObserver : public LLGestureManagerObserver { public: - LLFloaterGestureObserver() {} + LLFloaterGestureObserver(LLFloaterGesture* floater) : mFloater(floater) {} virtual ~LLFloaterGestureObserver() {} - virtual void changed() { LLFloaterGesture::refreshAll(); } + virtual void changed() { mFloater->refreshAll(); } + +private: + LLFloaterGesture* mFloater; }; //--------------------------------------------------------------------------- // LLFloaterGesture //--------------------------------------------------------------------------- -LLFloaterGesture::LLFloaterGesture() -: LLFloater() +LLFloaterGesture::LLFloaterGesture(const LLSD& key) + : LLFloater(key) { - sObserver = new LLFloaterGestureObserver; - gGestureManager.addObserver(sObserver); + mObserver = new LLFloaterGestureObserver(this); + LLGestureManager::instance().addObserver(mObserver); + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_gesture.xml"); } // virtual LLFloaterGesture::~LLFloaterGesture() { - gGestureManager.removeObserver(sObserver); - delete sObserver; - sObserver = NULL; - - sInstance = NULL; + LLGestureManager::instance().removeObserver(mObserver); + delete mObserver; + mObserver = NULL; } // virtual @@ -107,45 +105,27 @@ BOOL LLFloaterGesture::postBuild() setTitle(label); - childSetCommitCallback("gesture_list", onCommitList, this); - getChild<LLScrollListCtrl>("gesture_list")->setDoubleClickCallback(onClickPlay, this); + getChild<LLUICtrl>("gesture_list")->setCommitCallback(boost::bind(&LLFloaterGesture::onCommitList, this)); + getChild<LLScrollListCtrl>("gesture_list")->setDoubleClickCallback(boost::bind(&LLFloaterGesture::onClickPlay, this)); - childSetAction("inventory_btn", onClickInventory, this); + getChild<LLUICtrl>("inventory_btn")->setCommitCallback(boost::bind(&LLFloaterGesture::onClickInventory, this)); - childSetAction("edit_btn", onClickEdit, this); + getChild<LLUICtrl>("edit_btn")->setCommitCallback(boost::bind(&LLFloaterGesture::onClickEdit, this)); - childSetAction("play_btn", onClickPlay, this); - childSetAction("stop_btn", onClickPlay, this); + getChild<LLUICtrl>("play_btn")->setCommitCallback(boost::bind(&LLFloaterGesture::onClickPlay, this)); + getChild<LLUICtrl>("stop_btn")->setCommitCallback(boost::bind(&LLFloaterGesture::onClickPlay, this)); - childSetAction("new_gesture_btn", onClickNew, this); + getChild<LLUICtrl>("new_gesture_btn")->setCommitCallback(boost::bind(&LLFloaterGesture::onClickNew, this)); childSetVisible("play_btn", true); childSetVisible("stop_btn", false); setDefaultBtn("play_btn"); + + buildGestureList(); + + childSetFocus("gesture_list"); - return TRUE; -} - - -// static -void LLFloaterGesture::show() -{ - if (sInstance) - { - sInstance->openFloater(); - return; - } - - sInstance = new LLFloaterGesture(); - - // Builds and adds to gFloaterView - LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_gesture.xml"); - - sInstance->buildGestureList(); - - sInstance->childSetFocus("gesture_list"); - - LLCtrlListInterface *list = sInstance->childGetListInterface("gesture_list"); + LLCtrlListInterface *list = childGetListInterface("gesture_list"); if (list) { const BOOL ascending = TRUE; @@ -153,51 +133,34 @@ void LLFloaterGesture::show() list->selectFirstItem(); } - sInstance->mSelectedID = LLUUID::null; - // Update button labels - onCommitList(NULL, sInstance); - sInstance->openFloater(); + onCommitList(); + + return TRUE; } -// static -void LLFloaterGesture::toggleVisibility() -{ - if(sInstance && sInstance->getVisible()) - { - sInstance->closeFloater(); - } - else - { - show(); - } -} -// static void LLFloaterGesture::refreshAll() { - if (sInstance) - { - sInstance->buildGestureList(); + buildGestureList(); - LLCtrlListInterface *list = sInstance->childGetListInterface("gesture_list"); - if (!list) return; + LLCtrlListInterface *list = childGetListInterface("gesture_list"); + if (!list) return; - if (sInstance->mSelectedID.isNull()) + if (mSelectedID.isNull()) + { + list->selectFirstItem(); + } + else + { + if (! list->setCurrentByID(mSelectedID)) { list->selectFirstItem(); } - else - { - if (! list->setCurrentByID(sInstance->mSelectedID)) - { - list->selectFirstItem(); - } - } - - // Update button labels - onCommitList(NULL, sInstance); } + + // Update button labels + onCommitList(); } void LLFloaterGesture::buildGestureList() @@ -214,7 +177,7 @@ void LLFloaterGesture::buildGestureList() list->operateOnAll(LLCtrlListInterface::OP_DELETE); LLGestureManager::item_map_t::iterator it; - for (it = gGestureManager.mActive.begin(); it != gGestureManager.mActive.end(); ++it) + for (it = LLGestureManager::instance().mActive.begin(); it != LLGestureManager::instance().mActive.end(); ++it) { const LLUUID& item_id = (*it).first; LLMultiGesture* gesture = (*it).second; @@ -313,12 +276,9 @@ void LLFloaterGesture::buildGestureList() scroll->setScrollPos(current_scroll_pos); } -// static -void LLFloaterGesture::onClickInventory(void* data) +void LLFloaterGesture::onClickInventory() { - LLFloaterGesture* self = (LLFloaterGesture*)data; - - LLCtrlListInterface *list = self->childGetListInterface("gesture_list"); + LLCtrlListInterface *list = childGetListInterface("gesture_list"); if (!list) return; const LLUUID& item_id = list->getCurrentID(); @@ -327,22 +287,19 @@ void LLFloaterGesture::onClickInventory(void* data) inv->getPanel()->setSelection(item_id, TRUE); } -// static -void LLFloaterGesture::onClickPlay(void* data) +void LLFloaterGesture::onClickPlay() { - LLFloaterGesture* self = (LLFloaterGesture*)data; - - LLCtrlListInterface *list = self->childGetListInterface("gesture_list"); + LLCtrlListInterface *list = childGetListInterface("gesture_list"); if (!list) return; const LLUUID& item_id = list->getCurrentID(); - if (gGestureManager.isGesturePlaying(item_id)) + if (LLGestureManager::instance().isGesturePlaying(item_id)) { - gGestureManager.stopGesture(item_id); + LLGestureManager::instance().stopGesture(item_id); } else { - gGestureManager.playGesture(item_id); + LLGestureManager::instance().playGesture(item_id); } } @@ -355,8 +312,7 @@ public: } }; -// static -void LLFloaterGesture::onClickNew(void* data) +void LLFloaterGesture::onClickNew() { LLPointer<LLInventoryCallback> cb = new GestureShowCallback(); create_inventory_item(gAgent.getID(), gAgent.getSessionID(), @@ -365,12 +321,9 @@ void LLFloaterGesture::onClickNew(void* data) } -// static -void LLFloaterGesture::onClickEdit(void* data) +void LLFloaterGesture::onClickEdit() { - LLFloaterGesture* self = (LLFloaterGesture*)data; - - LLCtrlListInterface *list = self->childGetListInterface("gesture_list"); + LLCtrlListInterface *list = childGetListInterface("gesture_list"); if (!list) return; const LLUUID& item_id = list->getCurrentID(); @@ -380,26 +333,23 @@ void LLFloaterGesture::onClickEdit(void* data) LLPreviewGesture* previewp = LLPreviewGesture::show(item_id, LLUUID::null); if (!previewp->getHost()) { - previewp->setRect(gFloaterView->findNeighboringPosition(self, previewp)); + previewp->setRect(gFloaterView->findNeighboringPosition(this, previewp)); } } -// static -void LLFloaterGesture::onCommitList(LLUICtrl* ctrl, void* data) +void LLFloaterGesture::onCommitList() { - LLFloaterGesture* self = (LLFloaterGesture*)data; - - const LLUUID& item_id = self->childGetValue("gesture_list").asUUID(); + const LLUUID& item_id = childGetValue("gesture_list").asUUID(); - self->mSelectedID = item_id; - if (gGestureManager.isGesturePlaying(item_id)) + mSelectedID = item_id; + if (LLGestureManager::instance().isGesturePlaying(item_id)) { - self->childSetVisible("play_btn", false); - self->childSetVisible("stop_btn", true); + childSetVisible("play_btn", false); + childSetVisible("stop_btn", true); } else { - self->childSetVisible("play_btn", true); - self->childSetVisible("stop_btn", false); + childSetVisible("play_btn", true); + childSetVisible("stop_btn", false); } } diff --git a/indra/newview/llfloatergesture.h b/indra/newview/llfloatergesture.h index f7c4e558ac..9c1ab27cb0 100644 --- a/indra/newview/llfloatergesture.h +++ b/indra/newview/llfloatergesture.h @@ -56,32 +56,28 @@ class LLFloaterGesture : public LLFloater { public: - LLFloaterGesture(); + LLFloaterGesture(const LLSD& key); virtual ~LLFloaterGesture(); virtual BOOL postBuild(); - static void show(); - static void toggleVisibility(); - static void refreshAll(); + void refreshAll(); protected: // Reads from the gesture manager's list of active gestures // and puts them in this list. void buildGestureList(); - static void onClickInventory(void* data); - static void onClickEdit(void* data); - static void onClickPlay(void* data); - static void onClickNew(void* data); - static void onCommitList(LLUICtrl* ctrl, void* data); + void onClickInventory(); + void onClickEdit(); + void onClickPlay(); + void onClickNew(); + void onCommitList(); protected: LLUUID mSelectedID; - static LLFloaterGesture* sInstance; - static LLFloaterGestureObserver* sObserver; - static LLFloaterGestureInventoryObserver* sInventoryObserver; + LLFloaterGestureObserver* mObserver; }; diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 6d603fa5c8..886f5ec924 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -186,15 +186,6 @@ void LLFloaterGodTools::updatePopup(LLCoordGL center, MASK mask) } // virtual -void LLFloaterGodTools::onClose(bool app_quitting) -{ - LLFloaterGodTools* god_tools = LLFloaterReg::getTypedInstance<LLFloaterGodTools>("god_tools"); - if(!god_tools) return; - god_tools->setVisible(FALSE); - -} - -// virtual void LLFloaterGodTools::draw() { if (mCurrentHost == LLHost::invalid) diff --git a/indra/newview/llfloatergodtools.h b/indra/newview/llfloatergodtools.h index 2564b15b37..ebab1fde11 100644 --- a/indra/newview/llfloatergodtools.h +++ b/indra/newview/llfloatergodtools.h @@ -81,7 +81,6 @@ public: void showPanel(const std::string& panel_name); virtual void onOpen(const LLSD& key); - virtual void onClose(bool app_quitting); virtual void draw(); diff --git a/indra/newview/llfloatergroupinvite.cpp b/indra/newview/llfloatergroupinvite.cpp index 92db0b0926..3598479305 100644 --- a/indra/newview/llfloatergroupinvite.cpp +++ b/indra/newview/llfloatergroupinvite.cpp @@ -79,7 +79,7 @@ void LLFloaterGroupInvite::impl::closeFloater(void* data) // Implementation //----------------------------------------------------------------------------- LLFloaterGroupInvite::LLFloaterGroupInvite(const LLUUID& group_id) -: LLFloater() +: LLFloater(group_id) { static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); LLRect contents; diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index a967a1833f..7f03d63b3e 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -53,9 +53,6 @@ using namespace LLOldEvents; -// static -std::map<const LLUUID, LLFloaterGroupPicker*> LLFloaterGroupPicker::sInstances; - // helper functions void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask = GP_ALL_POWERS); @@ -63,36 +60,16 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow /// Class LLFloaterGroupPicker ///---------------------------------------------------------------------------- -// static -LLFloaterGroupPicker* LLFloaterGroupPicker::findInstance(const LLSD& seed) -{ - instance_map_t::iterator found_it = sInstances.find(seed.asUUID()); - if (found_it != sInstances.end()) - { - return found_it->second; - } - return NULL; -} - -// static -LLFloaterGroupPicker* LLFloaterGroupPicker::createInstance(const LLSD &seed) -{ - LLFloaterGroupPicker* pickerp = new LLFloaterGroupPicker(seed); - return pickerp; -} - LLFloaterGroupPicker::LLFloaterGroupPicker(const LLSD& seed) -: LLFloater(), - mPowersMask(GP_ALL_POWERS) +: LLFloater(seed), + mPowersMask(GP_ALL_POWERS), + mID(seed.asUUID()) { - mID = seed.asUUID(); - sInstances.insert(std::make_pair(mID, this)); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_choose_group.xml"); +// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_choose_group.xml"); } LLFloaterGroupPicker::~LLFloaterGroupPicker() { - sInstances.erase(mID); } void LLFloaterGroupPicker::setPowersMask(U64 powers_mask) diff --git a/indra/newview/llfloatergroups.h b/indra/newview/llfloatergroups.h index 0425b81294..489238356d 100644 --- a/indra/newview/llfloatergroups.h +++ b/indra/newview/llfloatergroups.h @@ -56,10 +56,10 @@ class LLScrollListCtrl; class LLButton; class LLFloaterGroupPicker; -class LLFloaterGroupPicker : public LLFloater, public LLUIFactory<LLFloaterGroupPicker, LLFloaterGroupPicker, VisibilityPolicy<LLFloater> > +class LLFloaterGroupPicker : public LLFloater { - friend class LLUIFactory<LLFloaterGroupPicker>; public: + LLFloaterGroupPicker(const LLSD& seed); ~LLFloaterGroupPicker(); // Note: Don't return connection; use boost::bind + boost::signals2::trackable to disconnect slots @@ -73,7 +73,6 @@ public: static LLFloaterGroupPicker* createInstance(const LLSD& seed); protected: - LLFloaterGroupPicker(const LLSD& seed); void ok(); static void onBtnOK(void* userdata); static void onBtnCancel(void* userdata); diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 8121a1cc10..3c3508b65c 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -49,12 +49,10 @@ #include "llwindow.h" #include "llslider.h" -LLFloaterHardwareSettings* LLFloaterHardwareSettings::sHardwareSettings = NULL; - -LLFloaterHardwareSettings::LLFloaterHardwareSettings() - : LLFloater() +LLFloaterHardwareSettings::LLFloaterHardwareSettings(const LLSD& key) + : LLFloater(key) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hardware_settings.xml"); + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hardware_settings.xml"); } LLFloaterHardwareSettings::~LLFloaterHardwareSettings() @@ -109,48 +107,6 @@ void LLFloaterHardwareSettings::refreshEnabledState() } -// static instance of it -LLFloaterHardwareSettings* LLFloaterHardwareSettings::instance() -{ - if (!sHardwareSettings) - { - sHardwareSettings = new LLFloaterHardwareSettings(); - sHardwareSettings->closeFloater(); - } - return sHardwareSettings; -} -void LLFloaterHardwareSettings::show() -{ - LLFloaterHardwareSettings* hardSettings = instance(); - hardSettings->refresh(); - hardSettings->center(); - - // comment in if you want the menu to rebuild each time - //LLUICtrlFactory::getInstance()->buildFloater(hardSettings, "floater_hardware_settings.xml"); - //hardSettings->initCallbacks(); - - hardSettings->openFloater(); -} - -bool LLFloaterHardwareSettings::isOpen() -{ - if (sHardwareSettings != NULL) - { - return true; - } - return false; -} - -// virtual -void LLFloaterHardwareSettings::onClose(bool app_quitting) -{ - if (sHardwareSettings) - { - sHardwareSettings->setVisible(FALSE); - } -} - - //============================================================================ BOOL LLFloaterHardwareSettings::postBuild() @@ -158,6 +114,7 @@ BOOL LLFloaterHardwareSettings::postBuild() childSetAction("OK", onBtnOK, this); refresh(); + center(); // load it up initCallbacks(); diff --git a/indra/newview/llfloaterhardwaresettings.h b/indra/newview/llfloaterhardwaresettings.h index ec99638740..3f19d89cbb 100644 --- a/indra/newview/llfloaterhardwaresettings.h +++ b/indra/newview/llfloaterhardwaresettings.h @@ -42,7 +42,7 @@ class LLFloaterHardwareSettings : public LLFloater public: - LLFloaterHardwareSettings(); + LLFloaterHardwareSettings(const LLSD& key); /*virtual*/ ~LLFloaterHardwareSettings(); /*virtual*/ BOOL postBuild(); @@ -50,9 +50,6 @@ public: /// initialize all the callbacks for the menu void initCallbacks(void); - /// one and one instance only - static LLFloaterHardwareSettings* instance(); - /// callback for the menus help button static void onClickHelp(void* data); @@ -67,9 +64,6 @@ public: /// return if the menu exists or not static bool isOpen(); - /// stuff to do on exit - virtual void onClose(bool app_quitting); - /// sync up menu with parameters void refresh(); @@ -92,8 +86,6 @@ protected: BOOL mProbeHardwareOnStartup; private: - // one instance on the inside - static LLFloaterHardwareSettings* sHardwareSettings; }; #endif diff --git a/indra/newview/llfloaterhud.cpp b/indra/newview/llfloaterhud.cpp index dd70560bb7..4dcf726c9a 100644 --- a/indra/newview/llfloaterhud.cpp +++ b/indra/newview/llfloaterhud.cpp @@ -101,12 +101,3 @@ BOOL LLFloaterHUD::postBuild() LLFloaterHUD::~LLFloaterHUD() { } -// Save our visibility state on close in case the user accidentally -// quit the application while the tutorial was visible. -// virtual -void LLFloaterHUD::onClose(bool app_quitting) -{ - bool stay_visible = app_quitting; - gSavedSettings.setBOOL("ShowTutorial", stay_visible); - destroy(); -} diff --git a/indra/newview/llfloaterhud.h b/indra/newview/llfloaterhud.h index 33ed9faa67..4772735afc 100644 --- a/indra/newview/llfloaterhud.h +++ b/indra/newview/llfloaterhud.h @@ -42,8 +42,6 @@ class LLFloaterHUD : public LLFloater friend class LLFloaterReg; public: - // Save our visibility state during close - /*virtual*/ void onClose(bool app_quitting); BOOL postBuild(); private: diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 26b969224e..07dbf98a1e 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -59,9 +59,6 @@ #include "llviewertexturelist.h" #include "llstring.h" -//static -S32 LLFloaterImagePreview::sUploadAmount = 10; - const S32 PREVIEW_BORDER_WIDTH = 2; const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH; const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; @@ -93,9 +90,7 @@ BOOL LLFloaterImagePreview::postBuild() { return FALSE; } - - childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",sUploadAmount)); - + LLCtrlSelectionInterface* iface = childGetSelectionInterface("clothing_type_combo"); if (iface) { @@ -130,7 +125,9 @@ BOOL LLFloaterImagePreview::postBuild() childDisable("clothing_type_combo"); childDisable("ok_btn"); } - + + getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this)); + return TRUE; } diff --git a/indra/newview/llfloaterimagepreview.h b/indra/newview/llfloaterimagepreview.h index e2781b8231..f007697e88 100644 --- a/indra/newview/llfloaterimagepreview.h +++ b/indra/newview/llfloaterimagepreview.h @@ -121,7 +121,6 @@ public: BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); static void onMouseCaptureLostImagePreview(LLMouseHandler*); - static void setUploadAmount(S32 amount) { sUploadAmount = amount; } void clearAllPreviewTextures(); @@ -139,7 +138,6 @@ protected: LLRectf mPreviewImageRect; LLPointer<LLViewerTexture> mImagep ; - static S32 sUploadAmount; }; #endif // LL_LLFLOATERIMAGEPREVIEW_H diff --git a/indra/newview/llfloaterinventory.cpp b/indra/newview/llfloaterinventory.cpp index 1118dd8f69..a486ef565a 100644 --- a/indra/newview/llfloaterinventory.cpp +++ b/indra/newview/llfloaterinventory.cpp @@ -95,11 +95,11 @@ LLUUID LLFloaterInventory::sWearNewClothingTransactionID; ///---------------------------------------------------------------------------- LLFloaterInventoryFinder::LLFloaterInventoryFinder(LLFloaterInventory* inventory_view) -: LLFloater(), +: LLFloater(LLSD()), mFloaterInventory(inventory_view), mFilter(inventory_view->mActivePanel->getFilter()) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inventory_view_finder.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inventory_view_finder.xml", NULL); updateElementsFromFilter(); } @@ -297,21 +297,6 @@ void LLFloaterInventoryFinder::draw() LLFloater::draw(); } -void LLFloaterInventoryFinder::onClose(bool app_quitting) -{ - gSavedSettings.setBOOL("Inventory.ShowFilters", FALSE); - // If you want to reset the filter on close, do it here. This functionality was - // hotly debated - Paulm -#if 0 - if (mFloaterInventory) - { - LLFloaterInventory::onResetFilter((void *)mFloaterInventory); - } -#endif - destroy(); -} - - BOOL LLFloaterInventoryFinder::getCheckShowEmpty() { return childGetValue("check_show_empty"); @@ -450,7 +435,7 @@ LLFloaterInventory::LLFloaterInventory(const LLSD& key) mCommitCallbackRegistrar.add("Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLAssetType::AT_TRASH)); mCommitCallbackRegistrar.add("Inventory.EmptyLostAndFound", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLAssetType::AT_LOST_AND_FOUND)); mCommitCallbackRegistrar.add("Inventory.DoCreate", boost::bind(&LLFloaterInventory::doCreate, this, _2)); - mCommitCallbackRegistrar.add("Inventory.NewWindow", boost::bind(&LLFloaterInventory::newWindow, this)); +// mCommitCallbackRegistrar.add("Inventory.NewWindow", boost::bind(&LLFloaterInventory::newWindow, this)); mCommitCallbackRegistrar.add("Inventory.ShowFilters", boost::bind(&LLFloaterInventory::toggleFindOptions, this)); mCommitCallbackRegistrar.add("Inventory.ResetFilters", boost::bind(&LLFloaterInventory::resetFilters, this)); mCommitCallbackRegistrar.add("Inventory.SetSortBy", boost::bind(&LLFloaterInventory::setSortBy, this, _2)); @@ -462,7 +447,6 @@ LLFloaterInventory::LLFloaterInventory(const LLSD& key) BOOL sort_folders_by_name = ( sort_order & LLInventoryFilter::SO_FOLDERS_BY_NAME ); BOOL sort_system_folders_to_top = ( sort_order & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP ); - gSavedSettings.declareBOOL("Inventory.ShowFilters", FALSE, "Declared in code", FALSE); gSavedSettings.declareBOOL("Inventory.SortByName", sort_by_name, "Declared in code", FALSE); gSavedSettings.declareBOOL("Inventory.SortByDate", !sort_by_name, "Declared in code", FALSE); gSavedSettings.declareBOOL("Inventory.FoldersAlwaysByName", sort_folders_by_name, "Declared in code", FALSE); @@ -597,10 +581,6 @@ void LLFloaterInventory::draw() title << mFilterText; setTitle(title.str()); } - if (mActivePanel && mFilterEditor) - { - mFilterEditor->setText(mActivePanel->getFilterSubString()); - } LLFloater::draw(); } @@ -678,36 +658,11 @@ void LLFloaterInventory::startSearch() } } -// virtual, from LLView -void LLFloaterInventory::setVisible( BOOL visible ) -{ - LLFloater::setVisible(visible); -} - void LLFloaterInventory::onOpen(const LLSD& key) { LLFirstUse::useInventory(); } -// Destroy all but the last floater, which is made invisible. -void LLFloaterInventory::onClose(bool app_quitting) -{ - if (getKey().asInteger() != 0) - { - destroy(); - } - else - { - // clear filters, but save user's folder state first - if (!mActivePanel->getRootFolder()->isFilterModified()) - { - mSavedFolderState->setApply(FALSE); - mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState); - } - setVisible(FALSE); - } -} - BOOL LLFloaterInventory::handleKeyHere(KEY key, MASK mask) { LLFolderView* root_folder = mActivePanel ? mActivePanel->getRootFolder() : NULL; @@ -754,14 +709,6 @@ void LLFloaterInventory::changed(U32 mask) } -//static -LLFloaterInventory* LLFloaterInventory::newInstance() -{ - LLMemType mt(LLMemType::MTYPE_INVENTORY_VIEW_SHOW); - static S32 inst_count = 1; - return LLFloaterReg::getTypedInstance<LLFloaterInventory>("inventory", LLSD(inst_count++)); -} - //---------------------------------------------------------------------------- // menu callbacks @@ -780,17 +727,6 @@ void LLFloaterInventory::doCreate(const LLSD& userdata) menu_create_inventory_item(getPanel()->getRootFolder(), NULL, userdata); } -void LLFloaterInventory::newWindow() -{ - LLFloaterInventory* iv = newInstance(); - iv->getActivePanel()->setFilterTypes(getActivePanel()->getFilterTypes()); - iv->getActivePanel()->setFilterSubString(getActivePanel()->getFilterSubString()); - iv->openFloater(); - - // force onscreen - gFloaterView->adjustToFitScreen(iv, FALSE); -} - void LLFloaterInventory::resetFilters() { LLFloaterInventoryFinder *finder = getFinder(); @@ -920,14 +856,10 @@ void LLFloaterInventory::toggleFindOptions() // start background fetch of folders gInventory.startBackgroundFetch(); - - gSavedSettings.setBOOL("Inventory.ShowFilters", TRUE); } else { floater->closeFloater(); - - gSavedSettings.setBOOL("Inventory.ShowFilters", FALSE); } } @@ -978,8 +910,7 @@ void LLFloaterInventory::onFilterEdit(const std::string& search_string ) gInventory.startBackgroundFetch(); - std::string filter_text = search_string; - std::string uppercase_search_string = filter_text; + std::string uppercase_search_string = search_string; LLStringUtil::toUpper(uppercase_search_string); if (mActivePanel->getFilterSubString().empty() && uppercase_search_string.empty()) { diff --git a/indra/newview/llfloaterinventory.h b/indra/newview/llfloaterinventory.h index 35ac1ab380..734ab5032e 100644 --- a/indra/newview/llfloaterinventory.h +++ b/indra/newview/llfloaterinventory.h @@ -188,7 +188,6 @@ class LLFloaterInventoryFinder : public LLFloater public: LLFloaterInventoryFinder( LLFloaterInventory* inventory_view); virtual void draw(); - virtual void onClose(bool app_quitting); /*virtual*/ BOOL postBuild(); void changeFilter(LLInventoryFilter* filter); void updateElementsFromFilter(); @@ -226,9 +225,6 @@ public: void setFilterTextFromFilter() { mFilterText = mActivePanel->getFilter()->getFilterText(); } void startSearch(); - // Spawn a new inventory view - static LLFloaterInventory* newInstance(); - // This method makes sure that an inventory view exists, is // visible, and has focus. The view chosen is returned. static LLFloaterInventory* showAgentInventory(); @@ -248,8 +244,6 @@ public: // LLView & LLFloater functionality virtual void onOpen(const LLSD& key); - virtual void onClose(bool app_quitting); - virtual void setVisible(BOOL visible); virtual void draw(); virtual BOOL handleKeyHere(KEY key, MASK mask); @@ -278,7 +272,6 @@ public: void doToSelected(const LLSD& userdata); void closeAllFolders(); void doCreate(const LLSD& userdata); - void newWindow(); void resetFilters(); void setSortBy(const LLSD& userdata); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 149df61b35..63ac44da4f 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -204,21 +204,16 @@ void LLFloaterLand::onOpen(const LLSD& key) refresh(); } - -// virtual -void LLFloaterLand::onClose(bool app_quitting) +void LLFloaterLand::onVisibilityChange(const LLSD& visible) { - LLViewerParcelMgr::getInstance()->removeObserver( sObserver ); - delete sObserver; - sObserver = NULL; - - // Might have been showing owned objects - LLSelectMgr::getInstance()->unhighlightAll(); - - // Save which panel we had open - sLastTab = mTabLand->getCurrentPanelIndex(); + if (!visible.asBoolean()) + { + // Might have been showing owned objects + LLSelectMgr::getInstance()->unhighlightAll(); - destroy(); + // Save which panel we had open + sLastTab = mTabLand->getCurrentPanelIndex(); + } } @@ -239,7 +234,9 @@ LLFloaterLand::LLFloaterLand(const LLSD& seed) } BOOL LLFloaterLand::postBuild() -{ +{ + mVisibleSignal.connect(boost::bind(&LLFloaterLand::onVisibilityChange, this, _2)); + LLTabContainer* tab = getChild<LLTabContainer>("landtab"); mTabLand = (LLTabContainer*) tab; @@ -256,6 +253,9 @@ BOOL LLFloaterLand::postBuild() // virtual LLFloaterLand::~LLFloaterLand() { + LLViewerParcelMgr::getInstance()->removeObserver( sObserver ); + delete sObserver; + sObserver = NULL; } // public @@ -781,18 +781,18 @@ void LLPanelLandGeneral::draw() void LLPanelLandGeneral::onClickSetGroup() { - LLFloaterGroupPicker* fg; - LLFloater* parent_floater = gFloaterView->getParentFloater(this); - fg = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); - fg->setSelectGroupCallback( boost::bind(&LLPanelLandGeneral::setGroup, this, _1 )); - - if (parent_floater) + LLFloaterGroupPicker* fg = LLFloaterReg::showTypedInstance<LLFloaterGroupPicker>("group_picker", LLSD(gAgent.getID())); + if (fg) { - LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, fg); - fg->setOrigin(new_rect.mLeft, new_rect.mBottom); - parent_floater->addDependentFloater(fg); + fg->setSelectGroupCallback( boost::bind(&LLPanelLandGeneral::setGroup, this, _1 )); + if (parent_floater) + { + LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, fg); + fg->setOrigin(new_rect.mLeft, new_rect.mBottom); + parent_floater->addDependentFloater(fg); + } } } diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 8f86766e3d..7fc5ed0c9e 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -81,8 +81,6 @@ public: static LLPanelLandObjects* getCurrentPanelLandObjects(); static LLPanelLandCovenant* getCurrentPanelLandCovenant(); - // Destroys itself on close. - virtual void onClose(bool app_quitting); virtual void onOpen(const LLSD& key); virtual BOOL postBuild(); @@ -91,6 +89,8 @@ private: // to allocate or destroy. LLFloaterLand(const LLSD& seed); virtual ~LLFloaterLand(); + + void onVisibilityChange(const LLSD& visible); protected: diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index fbefd40c60..de3cd5d4e3 100644 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -56,46 +56,16 @@ #include "llviewermessage.h" #include "lluictrlfactory.h" -// statics -LLFloaterLandHoldings* LLFloaterLandHoldings::sInstance = NULL; - - -// static -void LLFloaterLandHoldings::show(void*) -{ - LLFloaterLandHoldings* floater = new LLFloaterLandHoldings(); - LLUICtrlFactory::getInstance()->buildFloater(floater, "floater_land_holdings.xml"); - floater->center(); - - // query_id null is known to be us - const LLUUID& query_id = LLUUID::null; - - // look only for parcels we own - U32 query_flags = DFQ_AGENT_OWNED; - - send_places_query(query_id, - LLUUID::null, - "", - query_flags, - LLParcel::C_ANY, - ""); - - // TODO: request updated L$ balance? - floater->openFloater(); -} - - // protected -LLFloaterLandHoldings::LLFloaterLandHoldings() -: LLFloater(), +LLFloaterLandHoldings::LLFloaterLandHoldings(const LLSD& key) +: LLFloater(key), mActualArea(0), mBillableArea(0), mFirstPacketReceived(FALSE), mSortColumn(""), mSortAscending(TRUE) { - // Instance management. - sInstance = this; +// LLUICtrlFactory::getInstance()->buildFloater(floater, "floater_land_holdings.xml"); } BOOL LLFloaterLandHoldings::postBuild() @@ -128,7 +98,9 @@ BOOL LLFloaterLandHoldings::postBuild() list->addElement(element, ADD_SORTED); } - + + center(); + return TRUE; } @@ -136,9 +108,23 @@ BOOL LLFloaterLandHoldings::postBuild() // protected LLFloaterLandHoldings::~LLFloaterLandHoldings() { - sInstance = NULL; } +void LLFloaterLandHoldings::onOpen(const LLSD& key) +{ + // query_id null is known to be us + const LLUUID& query_id = LLUUID::null; + + // look only for parcels we own + U32 query_flags = DFQ_AGENT_OWNED; + + send_places_query(query_id, + LLUUID::null, + "", + query_flags, + LLParcel::C_ANY, + ""); +} void LLFloaterLandHoldings::draw() { @@ -168,7 +154,7 @@ void LLFloaterLandHoldings::refresh() // static void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**) { - LLFloaterLandHoldings* self = sInstance; + LLFloaterLandHoldings* self = LLFloaterReg::findTypedInstance<LLFloaterLandHoldings>("land_holdings"); // Is this packet from an old, closed window? if (!self) @@ -224,50 +210,53 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**) land_type = LLTrans::getString("land_type_unknown"); } - self->mActualArea += actual_area; - self->mBillableArea += billable_area; - - S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; - S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; - - std::string location; - location = llformat("%s (%d, %d)", sim_name.c_str(), region_x, region_y); - - std::string area; - if(billable_area == actual_area) + if(owner_id.notNull()) { - area = llformat("%d", billable_area); + self->mActualArea += actual_area; + self->mBillableArea += billable_area; + + S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; + S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; + + std::string location; + location = llformat("%s (%d, %d)", sim_name.c_str(), region_x, region_y); + + std::string area; + if(billable_area == actual_area) + { + area = llformat("%d", billable_area); + } + else + { + area = llformat("%d / %d", billable_area, actual_area); + } + + std::string hidden; + hidden = llformat("%f %f", global_x, global_y); + + LLSD element; + element["columns"][0]["column"] = "name"; + element["columns"][0]["value"] = name; + element["columns"][0]["font"] = "SANSSERIF"; + + element["columns"][1]["column"] = "location"; + element["columns"][1]["value"] = location; + element["columns"][1]["font"] = "SANSSERIF"; + + element["columns"][2]["column"] = "area"; + element["columns"][2]["value"] = area; + element["columns"][2]["font"] = "SANSSERIF"; + + element["columns"][3]["column"] = "type"; + element["columns"][3]["value"] = land_type; + element["columns"][3]["font"] = "SANSSERIF"; + + // hidden is always last column + element["columns"][4]["column"] = "hidden"; + element["columns"][4]["value"] = hidden; + + list->addElement(element); } - else - { - area = llformat("%d / %d", billable_area, actual_area); - } - - std::string hidden; - hidden = llformat("%f %f", global_x, global_y); - - LLSD element; - element["columns"][0]["column"] = "name"; - element["columns"][0]["value"] = name; - element["columns"][0]["font"] = "SANSSERIF"; - - element["columns"][1]["column"] = "location"; - element["columns"][1]["value"] = location; - element["columns"][1]["font"] = "SANSSERIF"; - - element["columns"][2]["column"] = "area"; - element["columns"][2]["value"] = area; - element["columns"][2]["font"] = "SANSSERIF"; - - element["columns"][3]["column"] = "type"; - element["columns"][3]["value"] = land_type; - element["columns"][3]["font"] = "SANSSERIF"; - - // hidden is always last column - element["columns"][4]["column"] = "hidden"; - element["columns"][4]["value"] = hidden; - - list->addElement(element); } self->refreshAggregates(); diff --git a/indra/newview/llfloaterlandholdings.h b/indra/newview/llfloaterlandholdings.h index def77cf2a8..471ddf7f44 100644 --- a/indra/newview/llfloaterlandholdings.h +++ b/indra/newview/llfloaterlandholdings.h @@ -44,10 +44,11 @@ class LLFloaterLandHoldings : public LLFloater { public: - BOOL postBuild(); - - static void show(void*); - + LLFloaterLandHoldings(const LLSD& key); + virtual ~LLFloaterLandHoldings(); + + virtual BOOL postBuild(); + virtual void onOpen(const LLSD& key); virtual void draw(); void refresh(); @@ -63,14 +64,9 @@ public: static void onGrantList(void* data); protected: - LLFloaterLandHoldings(); - virtual ~LLFloaterLandHoldings(); - void refreshAggregates(); protected: - static LLFloaterLandHoldings* sInstance; - // Sum up as packets arrive the total holdings S32 mActualArea; S32 mBillableArea; diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index 6ef72d4c1a..ed7d2c71ea 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -69,15 +69,12 @@ const S32 PREF_BUTTON_HEIGHT = 16; //----------------------------------------------------------------------------- // LLFloaterNameDesc() //----------------------------------------------------------------------------- -LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename ) - : LLFloater() +LLFloaterNameDesc::LLFloaterNameDesc(const LLSD& filename ) + : LLFloater(filename), + mIsAudio(FALSE) { - setTitle("Name/Description Floater"); - mFilenameAndPath = filename; - mFilename = gDirUtilp->getBaseFileName(filename, false); - // SL-5521 Maintain capitalization of filename when making the inventory item. JC - //LLStringUtil::toLower(mFilename); - mIsAudio = FALSE; + mFilenameAndPath = filename.asString(); + mFilename = gDirUtilp->getBaseFileName(mFilenameAndPath, false); } //----------------------------------------------------------------------------- @@ -93,11 +90,6 @@ BOOL LLFloaterNameDesc::postBuild() LLStringUtil::stripNonprintable(asset_name); LLStringUtil::trim(asset_name); - std::string exten = gDirUtilp->getExtension(asset_name); - if (exten == "wav") - { - mIsAudio = TRUE; - } asset_name = gDirUtilp->getBaseFileName(asset_name, true); // no extsntion setTitle(mFilename); @@ -112,7 +104,7 @@ BOOL LLFloaterNameDesc::postBuild() r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT ); - childSetCommitCallback("name_form", doCommit, this); + getChild<LLUICtrl>("name_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this)); childSetValue("name_form", LLSD(asset_name)); LLLineEditor *NameEditor = getChild<LLLineEditor>("name_form"); @@ -126,7 +118,7 @@ BOOL LLFloaterNameDesc::postBuild() y -= PREVIEW_LINE_HEIGHT; r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT ); - childSetCommitCallback("description_form", doCommit, this); + getChild<LLUICtrl>("description_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this)); LLLineEditor *DescEditor = getChild<LLLineEditor>("description_form"); if (DescEditor) { @@ -137,12 +129,12 @@ BOOL LLFloaterNameDesc::postBuild() y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f); // Cancel button - childSetAction("cancel_btn", onBtnCancel, this); + getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnCancel, this)); - // OK button - childSetAction("ok_btn", onBtnOK, this); + childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() )); + setDefaultBtn("ok_btn"); - + return TRUE; } @@ -162,45 +154,59 @@ void LLFloaterNameDesc::onCommit() { } -// static //----------------------------------------------------------------------------- // onCommit() //----------------------------------------------------------------------------- -void LLFloaterNameDesc::doCommit( class LLUICtrl *, void* userdata ) +void LLFloaterNameDesc::doCommit() { - LLFloaterNameDesc* self = (LLFloaterNameDesc*) userdata; - self->onCommit(); + onCommit(); } -// static //----------------------------------------------------------------------------- // onBtnOK() //----------------------------------------------------------------------------- -void LLFloaterNameDesc::onBtnOK( void* userdata ) +void LLFloaterNameDesc::onBtnOK( ) { - LLFloaterNameDesc *fp =(LLFloaterNameDesc *)userdata; - - fp->childDisable("ok_btn"); // don't allow inadvertent extra uploads + childDisable("ok_btn"); // don't allow inadvertent extra uploads LLAssetStorage::LLStoreAssetCallback callback = NULL; S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass). void *nruserdata = NULL; std::string display_name = LLStringUtil::null; - upload_new_resource(fp->mFilenameAndPath, // file - fp->childGetValue("name_form").asString(), - fp->childGetValue("description_form").asString(), + upload_new_resource(mFilenameAndPath, // file + childGetValue("name_form").asString(), + childGetValue("description_form").asString(), 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE, LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(), display_name, callback, expected_upload_cost, nruserdata); - fp->closeFloater(false); + closeFloater(false); } -// static //----------------------------------------------------------------------------- // onBtnCancel() //----------------------------------------------------------------------------- -void LLFloaterNameDesc::onBtnCancel( void* userdata ) +void LLFloaterNameDesc::onBtnCancel() { - LLFloaterNameDesc *fp =(LLFloaterNameDesc *)userdata; - fp->closeFloater(false); + closeFloater(false); +} + + +//----------------------------------------------------------------------------- +// LLFloaterSoundPreview() +//----------------------------------------------------------------------------- + +LLFloaterSoundPreview::LLFloaterSoundPreview(const LLSD& filename ) + : LLFloaterNameDesc(filename) +{ + mIsAudio = TRUE; +} + +BOOL LLFloaterSoundPreview::postBuild() +{ + if (!LLFloaterNameDesc::postBuild()) + { + return FALSE; + } + getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this)); + return TRUE; } diff --git a/indra/newview/llfloaternamedesc.h b/indra/newview/llfloaternamedesc.h index 6aa19eba40..2cc7f1101d 100644 --- a/indra/newview/llfloaternamedesc.h +++ b/indra/newview/llfloaternamedesc.h @@ -44,11 +44,14 @@ class LLRadioGroup; class LLFloaterNameDesc : public LLFloater { public: - LLFloaterNameDesc(const std::string& filename); + LLFloaterNameDesc(const LLSD& filename); virtual ~LLFloaterNameDesc(); virtual BOOL postBuild(); - - static void doCommit(class LLUICtrl *, void* userdata); + + void onBtnOK(); + void onBtnCancel(); + void doCommit(); + protected: virtual void onCommit(); @@ -57,9 +60,13 @@ protected: std::string mFilenameAndPath; std::string mFilename; - - static void onBtnOK(void*); - static void onBtnCancel(void*); }; +class LLFloaterSoundPreview : public LLFloaterNameDesc +{ +public: + LLFloaterSoundPreview(const LLSD& filename ); + virtual BOOL postBuild(); +}; + #endif // LL_LLFLOATERNAMEDESC_H diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index f06af5ca1e..7042882084 100644 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -168,13 +168,6 @@ LLFloaterNotificationConsole::LLFloaterNotificationConsole(const LLSD& key) //LLUICtrlFactory::instance().buildFloater(this, "floater_notifications_console.xml"); } -void LLFloaterNotificationConsole::onClose(bool app_quitting) -{ - setVisible(FALSE); - //destroy(); -} - - BOOL LLFloaterNotificationConsole::postBuild() { // these are in the order of processing @@ -251,10 +244,10 @@ void LLFloaterNotificationConsole::onClickAdd() //=============== LLFloaterNotification ================ LLFloaterNotification::LLFloaterNotification(LLNotification* note) -: LLFloater(), +: LLFloater(LLSD()), mNote(note) { - LLUICtrlFactory::instance().buildFloater(this, "floater_notification.xml"); + LLUICtrlFactory::instance().buildFloater(this, "floater_notification.xml", NULL); } BOOL LLFloaterNotification::postBuild() diff --git a/indra/newview/llfloaternotificationsconsole.h b/indra/newview/llfloaternotificationsconsole.h index fe161e66f0..7349ff1d8f 100644 --- a/indra/newview/llfloaternotificationsconsole.h +++ b/indra/newview/llfloaternotificationsconsole.h @@ -46,7 +46,6 @@ public: // LLPanel BOOL postBuild(); - void onClose(bool app_quitting); void addChannel(const std::string& type, bool open = false); void updateResizeLimits(LLLayoutStack &stack); @@ -71,7 +70,6 @@ public: // LLPanel BOOL postBuild(); void respond(); - void onClose(bool app_quitting) { setVisible(FALSE); } private: static void onCommitResponse(LLUICtrl* ctrl, void* data) { ((LLFloaterNotification*)data)->respond(); } diff --git a/indra/newview/llfloaterparcel.cpp b/indra/newview/llfloaterparcel.cpp index fa7403874e..af42ce4f4a 100644 --- a/indra/newview/llfloaterparcel.cpp +++ b/indra/newview/llfloaterparcel.cpp @@ -35,6 +35,8 @@ #include "llfloaterparcel.h" +#include "llfloaterreg.h" + // viewer project includes #include "llcommandhandler.h" #include "llpanelplace.h" @@ -47,8 +49,6 @@ // Globals //----------------------------------------------------------------------------- -LLMap< const LLUUID, LLFloaterParcelInfo* > gPlaceInfoInstances; - class LLParcelHandler : public LLCommandHandler { public: @@ -68,8 +68,11 @@ public: } if (params[1].asString() == "about") { - LLFloaterParcelInfo::show(parcel_id); - return true; + if (parcel_id.notNull()) + { + LLFloaterReg::showInstance("parcel_info", LLSD(parcel_id)); + return true; + } } return false; } @@ -82,7 +85,7 @@ LLParcelHandler gParcelHandler; //---------------------------------------------------------------------------- -void* LLFloaterParcelInfo::createPanelPlace(void* data) +void* LLFloaterParcelInfo::createPanelPlace(void* data) { LLFloaterParcelInfo* self = (LLFloaterParcelInfo*)data; self->mPanelParcelp = new LLPanelPlace(); // allow edit self @@ -93,54 +96,29 @@ void* LLFloaterParcelInfo::createPanelPlace(void* data) //---------------------------------------------------------------------------- -LLFloaterParcelInfo::LLFloaterParcelInfo(const LLUUID &parcel_id) -: LLFloater(), - mParcelID( parcel_id ) +LLFloaterParcelInfo::LLFloaterParcelInfo(const LLSD& parcel_id) +: LLFloater(parcel_id), + mParcelID( parcel_id.asUUID() ), + mPanelParcelp(NULL) { mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterParcelInfo::createPanelPlace, this); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml"); - gPlaceInfoInstances.addData(parcel_id, this); +// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml"); } // virtual LLFloaterParcelInfo::~LLFloaterParcelInfo() { - // child views automatically deleted - gPlaceInfoInstances.removeData(mParcelID); - -} -void LLFloaterParcelInfo::displayParcelInfo(const LLUUID& parcel_id) -{ - mPanelParcelp->setParcelID(parcel_id); } -// static -LLFloaterParcelInfo* LLFloaterParcelInfo::show(const LLUUID &parcel_id) +BOOL LLFloaterParcelInfo::postBuild() { - if (parcel_id.isNull()) + if (mPanelParcelp) { - return NULL; + mPanelParcelp->setParcelID(mParcelID); } - - LLFloaterParcelInfo *floater; - if (gPlaceInfoInstances.checkData(parcel_id)) - { - // ...bring that window to front - floater = gPlaceInfoInstances.getData(parcel_id); - floater->openFloater(); - floater->setFrontmost(true); - } - else - { - floater = new LLFloaterParcelInfo( parcel_id ); - floater->center(); - floater->openFloater(); - floater->displayParcelInfo(parcel_id); - floater->setFrontmost(true); - } - - return floater; + center(); + return LLFloater::postBuild(); } diff --git a/indra/newview/llfloaterparcel.h b/indra/newview/llfloaterparcel.h index c2d5987d8e..386acb3fd5 100644 --- a/indra/newview/llfloaterparcel.h +++ b/indra/newview/llfloaterparcel.h @@ -43,13 +43,13 @@ class LLFloaterParcelInfo public: static void* createPanelPlace(void* data); - LLFloaterParcelInfo( const LLUUID &parcel_id ); + LLFloaterParcelInfo( const LLSD& parcel_id ); /*virtual*/ ~LLFloaterParcelInfo(); - + + /*virtual*/ BOOL postBuild(); + void displayParcelInfo(const LLUUID& parcel_id); - static LLFloaterParcelInfo* show(const LLUUID& parcel_id); - private: LLUUID mParcelID; // for which parcel is this window? LLPanelPlace* mPanelParcelp; diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index c4f1ebe8aa..17bb8221ad 100644 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -53,7 +53,8 @@ LLFloaterPerms::LLFloaterPerms(const LLSD& seed) BOOL LLFloaterPerms::postBuild() { - + mCloseSignal.connect(boost::bind(&LLFloaterPerms::cancel, this)); + refresh(); return TRUE; @@ -106,14 +107,6 @@ void LLFloaterPerms::refresh() mNextOwnerTransfer = gSavedSettings.getBOOL("NextOwnerTransfer"); } -void LLFloaterPerms::onClose(bool app_quitting) -{ - // Cancel any unsaved changes before closing. - // Note: when closed due to the OK button this amounts to a no-op. - cancel(); - destroy(); -} - //static U32 LLFloaterPerms::getGroupPerms(std::string prefix) { diff --git a/indra/newview/llfloaterperms.h b/indra/newview/llfloaterperms.h index a1897a5c00..2426f43ca7 100644 --- a/indra/newview/llfloaterperms.h +++ b/indra/newview/llfloaterperms.h @@ -41,7 +41,6 @@ class LLFloaterPerms : public LLFloater friend class LLFloaterReg; public: - /*virtual*/ void onClose(bool app_quitting = false); /*virtual*/ BOOL postBuild(); void ok(); void cancel(); diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index 696531c208..aa68a1b229 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -45,6 +45,7 @@ #include "lllineeditor.h" #include "llviewertexteditor.h" #include "llbutton.h" +#include "llfloaterreg.h" #include "llviewercontrol.h" #include "llviewernetwork.h" #include "lluictrlfactory.h" @@ -70,40 +71,30 @@ /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -//static -LLFloaterPostcard::instance_list_t LLFloaterPostcard::sInstances; - ///---------------------------------------------------------------------------- /// Class LLFloaterPostcard ///---------------------------------------------------------------------------- -LLFloaterPostcard::LLFloaterPostcard(LLImageJPEG* jpeg, LLViewerTexture *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global) -: LLFloater(), - mJPEGImage(jpeg), - mViewerImage(img), - mImageScale(img_scale), - mPosTakenGlobal(pos_taken_global), +LLFloaterPostcard::LLFloaterPostcard(const LLSD& key) +: LLFloater(key), + mJPEGImage(NULL), + mViewerImage(NULL), mHasFirstMsgFocus(false) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_postcard.xml"); - - sInstances.insert(this); - - // pick up the user's up-to-date email address - gAgent.sendAgentUserInfoRequest(); - - openFloater(); + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_postcard.xml"); } // Destroys the object LLFloaterPostcard::~LLFloaterPostcard() { - sInstances.erase(this); mJPEGImage = NULL; // deletes image } BOOL LLFloaterPostcard::postBuild() { + // pick up the user's up-to-date email address + gAgent.sendAgentUserInfoRequest(); + childSetAction("cancel_btn", onClickCancel, this); childSetAction("send_btn", onClickSend, this); @@ -127,15 +118,18 @@ BOOL LLFloaterPostcard::postBuild() return TRUE; } - - // static LLFloaterPostcard* LLFloaterPostcard::showFromSnapshot(LLImageJPEG *jpeg, LLViewerTexture *img, const LLVector2 &image_scale, const LLVector3d& pos_taken_global) { // Take the images from the caller // It's now our job to clean them up - LLFloaterPostcard *instance = new LLFloaterPostcard(jpeg, img, image_scale, pos_taken_global); - + LLFloaterPostcard* instance = LLFloaterReg::showTypedInstance<LLFloaterPostcard>("postcard", LLSD(img->getID())); + + instance->mJPEGImage = jpeg; + instance->mViewerImage = img; + instance->mImageScale = image_scale; + instance->mPosTakenGlobal = pos_taken_global; + return instance; } @@ -302,10 +296,11 @@ void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, // static void LLFloaterPostcard::updateUserInfo(const std::string& email) { - for (instance_list_t::iterator iter = sInstances.begin(); - iter != sInstances.end(); ++iter) + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); + iter != inst_list.end(); ++iter) { - LLFloaterPostcard *instance = *iter; + LLFloater* instance = *iter; const std::string& text = instance->childGetValue("from_form").asString(); if (text.empty()) { diff --git a/indra/newview/llfloaterpostcard.h b/indra/newview/llfloaterpostcard.h index 98910f85f9..49cce53106 100644 --- a/indra/newview/llfloaterpostcard.h +++ b/indra/newview/llfloaterpostcard.h @@ -48,7 +48,7 @@ class LLFloaterPostcard : public LLFloater { public: - LLFloaterPostcard(LLImageJPEG* jpeg, LLViewerTexture *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global); + LLFloaterPostcard(const LLSD& key); virtual ~LLFloaterPostcard(); virtual BOOL postBuild(); @@ -79,9 +79,6 @@ protected: LLVector2 mImageScale; LLVector3d mPosTakenGlobal; boolean mHasFirstMsgFocus; - - typedef std::set<LLFloaterPostcard*> instance_list_t; - static instance_list_t sInstances; }; diff --git a/indra/newview/llfloaterpostprocess.cpp b/indra/newview/llfloaterpostprocess.cpp index a1015918d4..2ab54d6e46 100644 --- a/indra/newview/llfloaterpostprocess.cpp +++ b/indra/newview/llfloaterpostprocess.cpp @@ -36,6 +36,7 @@ #include "llsliderctrl.h" #include "llcheckboxctrl.h" +#include "llcombobox.h" #include "lluictrlfactory.h" #include "llviewerdisplay.h" #include "llpostprocess.h" @@ -44,14 +45,10 @@ #include "llviewerwindow.h" -LLFloaterPostProcess* LLFloaterPostProcess::sPostProcess = NULL; - - -LLFloaterPostProcess::LLFloaterPostProcess() - : LLFloater() +LLFloaterPostProcess::LLFloaterPostProcess(const LLSD& key) + : LLFloater(key) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_post_process.xml"); - + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_post_process.xml"); } LLFloaterPostProcess::~LLFloaterPostProcess() @@ -87,28 +84,16 @@ BOOL LLFloaterPostProcess::postBuild() // Effect loading and saving. LLComboBox* comboBox = getChild<LLComboBox>("PPEffectsCombo"); - childSetAction("PPLoadEffect", &LLFloaterPostProcess::onLoadEffect, comboBox); + getChild<LLComboBox>("PPLoadEffect")->setCommitCallback(boost::bind(&LLFloaterPostProcess::onLoadEffect, this, comboBox)); comboBox->setCommitCallback(boost::bind(&LLFloaterPostProcess::onChangeEffectName, this, _1)); LLLineEditor* editBox = getChild<LLLineEditor>("PPEffectNameEditor"); - childSetAction("PPSaveEffect", &LLFloaterPostProcess::onSaveEffect, editBox); + getChild<LLComboBox>("PPSaveEffect")->setCommitCallback(boost::bind(&LLFloaterPostProcess::onSaveEffect, this, editBox)); syncMenu(); return TRUE; } -LLFloaterPostProcess* LLFloaterPostProcess::instance() -{ - // if we don't have our singleton instance, create it - if (!sPostProcess) - { - sPostProcess = new LLFloaterPostProcess(); - sPostProcess->openFloater(); - sPostProcess->setFocus(TRUE); - } - return sPostProcess; -} - // Bool Toggle void LLFloaterPostProcess::onBoolToggle(LLUICtrl* ctrl, void* userData) { @@ -159,33 +144,29 @@ void LLFloaterPostProcess::onColorControlIMoved(LLUICtrl* ctrl, void* userData) gPostProcess->tweaks[floatVariableName][3] = sldrCtrl->getValue(); } -void LLFloaterPostProcess::onLoadEffect(void* userData) +void LLFloaterPostProcess::onLoadEffect(LLComboBox* comboBox) { - LLComboBox* comboBox = static_cast<LLComboBox*>(userData); - LLSD::String effectName(comboBox->getSelectedValue().asString()); gPostProcess->setSelectedEffect(effectName); - sPostProcess->syncMenu(); + syncMenu(); } -void LLFloaterPostProcess::onSaveEffect(void* userData) +void LLFloaterPostProcess::onSaveEffect(LLLineEditor* editBox) { - LLLineEditor* editBox = static_cast<LLLineEditor*>(userData); - std::string effectName(editBox->getValue().asString()); if (gPostProcess->mAllEffects.has(effectName)) { LLSD payload; payload["effect_name"] = effectName; - LLNotifications::instance().add("PPSaveEffectAlert", LLSD(), payload, &LLFloaterPostProcess::saveAlertCallback); + LLNotifications::instance().add("PPSaveEffectAlert", LLSD(), payload, boost::bind(&LLFloaterPostProcess::saveAlertCallback, this, _1, _2)); } else { gPostProcess->saveEffect(effectName); - sPostProcess->syncMenu(); + syncMenu(); } } @@ -207,30 +188,11 @@ bool LLFloaterPostProcess::saveAlertCallback(const LLSD& notification, const LLS { gPostProcess->saveEffect(notification["payload"]["effect_name"].asString()); - sPostProcess->syncMenu(); + syncMenu(); } return false; } -void LLFloaterPostProcess::show() -{ - // get the instance, make sure the values are synced - // and open the menu - LLFloaterPostProcess* postProcess = instance(); - postProcess->syncMenu(); - postProcess->openFloater(); -} - -// virtual -void LLFloaterPostProcess::onClose(bool app_quitting) -{ - // just set visibility to false, don't get fancy yet - if (sPostProcess) - { - sPostProcess->setVisible(FALSE); - } -} - void LLFloaterPostProcess::syncMenu() { // add the combo boxe contents diff --git a/indra/newview/llfloaterpostprocess.h b/indra/newview/llfloaterpostprocess.h index 68e6d1e244..c789adee00 100644 --- a/indra/newview/llfloaterpostprocess.h +++ b/indra/newview/llfloaterpostprocess.h @@ -36,6 +36,8 @@ #include "llfloater.h" class LLButton; +class LLComboBox; +class LLLineEditor; class LLSliderCtrl; class LLTabContainer; class LLPanelPermissions; @@ -51,11 +53,9 @@ class LLFloaterPostProcess : public LLFloater { public: - LLFloaterPostProcess(); + LLFloaterPostProcess(const LLSD& key); virtual ~LLFloaterPostProcess(); /*virtual*/ BOOL postBuild(); - /// one and one instance only - static LLFloaterPostProcess* instance(); /// post process callbacks static void onBoolToggle(LLUICtrl* ctrl, void* userData); @@ -64,18 +64,12 @@ public: static void onColorControlGMoved(LLUICtrl* ctrl, void* userData); static void onColorControlBMoved(LLUICtrl* ctrl, void* userData); static void onColorControlIMoved(LLUICtrl* ctrl, void* userData); - static void onLoadEffect(void* userData); - static void onSaveEffect(void* userData); + void onLoadEffect(LLComboBox* comboBox); + void onSaveEffect(LLLineEditor* editBox); void onChangeEffectName(LLUICtrl* ctrl); /// prompts a user when overwriting an effect - static bool saveAlertCallback(const LLSD& notification, const LLSD& response); - - /// show off our menu - static void show(); - - /// stuff to do on exit - virtual void onClose(bool app_quitting); + bool saveAlertCallback(const LLSD& notification, const LLSD& response); /// sync up sliders void syncMenu(); @@ -84,8 +78,6 @@ public: void refresh(); */ public: - - static LLFloaterPostProcess* sPostProcess; }; #endif diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 903471ea94..8a7b2d84c0 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -124,9 +124,9 @@ class LLVoiceSetKeyDialog : public LLModalDialog }; LLVoiceSetKeyDialog::LLVoiceSetKeyDialog(LLFloaterPreference* parent) -: LLModalDialog(LLStringUtil::null, 240, 100), mParent(parent) +: LLModalDialog(LLSD(), 240, 100), mParent(parent) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_select_key.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_select_key.xml", NULL); childSetAction("Cancel", onCancel, this); childSetFocus("Cancel"); @@ -367,6 +367,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) BOOL LLFloaterPreference::postBuild() { + mCloseSignal.connect(boost::bind(&LLFloaterPreference::onClose, this)); + LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) tabcontainer->selectFirstTab(); @@ -418,7 +420,11 @@ void LLFloaterPreference::apply() panel->apply(); } // hardware menu apply - LLFloaterHardwareSettings::instance()->apply(); + LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::findTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings"); + if (hardware_settings) + { + hardware_settings->apply(); + } LLFloaterVoiceDeviceSettings* voice_device_settings = LLFloaterReg::findTypedInstance<LLFloaterVoiceDeviceSettings>("pref_voicedevicesettings"); if(voice_device_settings) @@ -506,7 +512,11 @@ void LLFloaterPreference::cancel() LLFloaterReg::hideInstance("pref_joystick"); // cancel hardware menu - LLFloaterHardwareSettings::instance()->cancel(); // TODO: angela change the build of the floater to floater reg + LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::findTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings"); + if (hardware_settings) + { + hardware_settings->cancel(); + } // reverts any changes to current skin gSavedSettings.setString("SkinCurrent", sSkin); @@ -539,16 +549,17 @@ void LLFloaterPreference::setHardwareDefaults() LLFeatureManager::getInstance()->applyRecommendedSettings(); refreshEnabledGraphics(); } -void LLFloaterPreference::onClose(bool app_quitting) + +void LLFloaterPreference::onClose() { gSavedSettings.setS32("LastPrefTab", getChild<LLTabContainer>("pref core")->getCurrentPanelIndex()); LLPanelLogin::setAlwaysRefresh(false); cancel(); // will be a no-op if OK or apply was performed just prior. - destroy(); } + void LLFloaterPreference::onOpenHardwareSettings() { - LLFloaterHardwareSettings::show(); + LLFloaterReg::showInstance("prefs_hardware_settings"); } // static void LLFloaterPreference::onBtnOK() @@ -634,9 +645,13 @@ void LLFloaterPreference::refreshEnabledGraphics() LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences"); if(instance) { - LLFloaterHardwareSettings::instance()->refreshEnabledState(); instance->refreshEnabledState(); } + LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::findTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings"); + if (hardware_settings) + { + hardware_settings->refreshEnabledState(); + } } void LLFloaterPreference::updateMeterText(LLUICtrl* ctrl) diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 23e05a1ccf..ce31abcd9e 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -72,7 +72,6 @@ public: /*virtual*/ void draw(); virtual BOOL postBuild(); virtual void onOpen(const LLSD& key); - virtual void onClose(bool app_quitting); // static data update, called from message handler static void updateUserInfo(const std::string& visibility, bool im_via_email, const std::string& email); @@ -82,6 +81,8 @@ public: protected: + void onClose(); + void onBtnOK(); void onBtnCancel(); void onBtnApply(); diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index 8e86aa3ba9..7312808bd6 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -76,7 +76,8 @@ class LLPropertiesObserver : public LLInventoryObserver { public: - LLPropertiesObserver() + LLPropertiesObserver(LLFloaterProperties* floater) + : mFloater(floater) { gInventory.addObserver(this); } @@ -85,6 +86,8 @@ public: gInventory.removeObserver(this); } virtual void changed(U32 mask); +private: + LLFloaterProperties* mFloater; }; void LLPropertiesObserver::changed(U32 mask) @@ -92,7 +95,7 @@ void LLPropertiesObserver::changed(U32 mask) // if there's a change we're interested in. if((mask & (LLInventoryObserver::LABEL | LLInventoryObserver::INTERNAL | LLInventoryObserver::REMOVE)) != 0) { - LLFloaterProperties::dirtyAll(); + mFloater->dirty(); } } @@ -102,135 +105,65 @@ void LLPropertiesObserver::changed(U32 mask) /// Class LLFloaterProperties ///---------------------------------------------------------------------------- -// static -LLFloaterProperties::instance_map LLFloaterProperties::sInstances; -LLPropertiesObserver* LLFloaterProperties::sPropertiesObserver = NULL; -S32 LLFloaterProperties::sPropertiesObserverCount = 0; - -// static -LLFloaterProperties* LLFloaterProperties::find(const LLUUID& item_id, - const LLUUID& object_id) -{ - // for simplicity's sake, we key the properties window with a - // single uuid. However, the items are keyed by item and object - // (obj == null -> agent inventory). So, we xor the two ids, and - // use that as a lookup key - instance_map::iterator it = sInstances.find(item_id ^ object_id); - if(it != sInstances.end()) - { - return (*it).second; - } - return NULL; -} - -// static -LLFloaterProperties* LLFloaterProperties::show(const LLUUID& item_id, - const LLUUID& object_id) -{ - LLFloaterProperties* instance = find(item_id, object_id); - if(instance) - { - if (LLFloater::getFloaterHost() && LLFloater::getFloaterHost() != instance->getHost()) - { - // this properties window is being opened in a new context - // needs to be rehosted - LLFloater::getFloaterHost()->addFloater(instance, TRUE); - } - - instance->refresh(); - instance->openFloater(); - } - else - { - LLFloaterProperties* floater = new LLFloaterProperties(item_id, object_id); - // keep onscreen - gFloaterView->adjustToFitScreen(floater, FALSE); - } - return instance; -} - -void LLFloaterProperties::dirtyAll() -{ - // ...this is more clear. Possibly more correct, because the - // refresh method may delete the object. - for(instance_map::iterator it = sInstances.begin(); it!=sInstances.end(); ) - { - (*it++).second->dirty(); - } -} - // Default constructor -LLFloaterProperties::LLFloaterProperties(const LLUUID& item_id, const LLUUID& object_id) - : LLFloater(), +LLFloaterProperties::LLFloaterProperties(const LLUUID& item_id) + : LLFloater(mItemID), mItemID(item_id), - mObjectID(object_id), mDirty(TRUE) { - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_inventory_item_properties.xml"); + mPropertiesObserver = new LLPropertiesObserver(this); - if (!sPropertiesObserver) - { - sPropertiesObserver = new LLPropertiesObserver; - } - sPropertiesObserverCount++; - - // add the object to the static structure - LLUUID key = mItemID ^ mObjectID; - sInstances.insert(instance_map::value_type(key, this)); - + //LLUICtrlFactory::getInstance()->buildFloater(this,"floater_inventory_item_properties.xml"); } // Destroys the object LLFloaterProperties::~LLFloaterProperties() { - // clean up the static data. - instance_map::iterator it = sInstances.find(mItemID ^ mObjectID); - if(it != sInstances.end()) - { - sInstances.erase(it); - } - sPropertiesObserverCount--; - if (!sPropertiesObserverCount) - { - delete sPropertiesObserver; - sPropertiesObserver = NULL; - } + delete mPropertiesObserver; + mPropertiesObserver = NULL; } + // virtual BOOL LLFloaterProperties::postBuild() { // build the UI // item name & description childSetPrevalidate("LabelItemName",&LLLineEditor::prevalidatePrintableNotPipe); - childSetCommitCallback("LabelItemName",onCommitName,this); + getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitName,this)); childSetPrevalidate("LabelItemDesc",&LLLineEditor::prevalidatePrintableNotPipe); - childSetCommitCallback("LabelItemDesc", onCommitDescription, this); + getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLFloaterProperties:: onCommitDescription, this)); // Creator information - childSetAction("BtnCreator",onClickCreator,this); + getChild<LLUICtrl>("BtnCreator")->setCommitCallback(boost::bind(&LLFloaterProperties::onClickCreator,this)); // owner information - childSetAction("BtnOwner",onClickOwner,this); + getChild<LLUICtrl>("BtnOwner")->setCommitCallback(boost::bind(&LLFloaterProperties::onClickOwner,this)); // acquired date // owner permissions // Permissions debug text // group permissions - childSetCommitCallback("CheckShareWithGroup",&onCommitPermissions, this); + getChild<LLUICtrl>("CheckShareWithGroup")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this)); // everyone permissions - childSetCommitCallback("CheckEveryoneCopy",&onCommitPermissions, this); + getChild<LLUICtrl>("CheckEveryoneCopy")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this)); // next owner permissions - childSetCommitCallback("CheckNextOwnerModify",&onCommitPermissions, this); - childSetCommitCallback("CheckNextOwnerCopy",&onCommitPermissions, this); - childSetCommitCallback("CheckNextOwnerTransfer",&onCommitPermissions, this); + getChild<LLUICtrl>("CheckNextOwnerModify")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this)); + getChild<LLUICtrl>("CheckNextOwnerCopy")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this)); + getChild<LLUICtrl>("CheckNextOwnerTransfer")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this)); // Mark for sale or not, and sale info - childSetCommitCallback("CheckPurchase",&onCommitSaleInfo, this); - childSetCommitCallback("RadioSaleType",&onCommitSaleType, this); + getChild<LLUICtrl>("CheckPurchase")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this)); + getChild<LLUICtrl>("RadioSaleType")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleType, this)); // "Price" label for edit - childSetCommitCallback("EditPrice",&onCommitSaleInfo, this); + getChild<LLUICtrl>("EditPrice")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this)); // The UI has been built, now fill in all the values refresh(); return TRUE; } +// virtual +void LLFloaterProperties::onOpen(const LLSD& key) +{ + refresh(); +} + void LLFloaterProperties::refresh() { LLInventoryItem* item = findItem(); @@ -604,12 +537,9 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) } } -// static -void LLFloaterProperties::onClickCreator(void* data) +void LLFloaterProperties::onClickCreator() { - LLFloaterProperties* self = (LLFloaterProperties*)data; - if(!self) return; - LLInventoryItem* item = self->findItem(); + LLInventoryItem* item = findItem(); if(!item) return; if(!item->getCreatorUUID().isNull()) { @@ -618,11 +548,9 @@ void LLFloaterProperties::onClickCreator(void* data) } // static -void LLFloaterProperties::onClickOwner(void* data) +void LLFloaterProperties::onClickOwner() { - LLFloaterProperties* self = (LLFloaterProperties*)data; - if(!self) return; - LLInventoryItem* item = self->findItem(); + LLInventoryItem* item = findItem(); if(!item) return; if(item->getPermissions().isGroupOwned()) { @@ -635,20 +563,15 @@ void LLFloaterProperties::onClickOwner(void* data) } // static -void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data) +void LLFloaterProperties::onCommitName() { //llinfos << "LLFloaterProperties::onCommitName()" << llendl; - LLFloaterProperties* self = (LLFloaterProperties*)data; - if(!self) - { - return; - } - LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem(); + LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); if(!item) { return; } - LLLineEditor* labelItemName = self->getChild<LLLineEditor>("LabelItemName"); + LLLineEditor* labelItemName = getChild<LLLineEditor>("LabelItemName"); if(labelItemName&& (item->getName() != labelItemName->getText()) && @@ -656,7 +579,7 @@ void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data) { LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); new_item->rename(labelItemName->getText()); - if(self->mObjectID.isNull()) + if(mObjectID.isNull()) { new_item->updateServer(FALSE); gInventory.updateItem(new_item); @@ -665,7 +588,7 @@ void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data) } else { - LLViewerObject* object = gObjectList.findObject(self->mObjectID); + LLViewerObject* object = gObjectList.findObject(mObjectID); if(object) { object->updateInventory( @@ -677,16 +600,13 @@ void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data) } } -// static -void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data) +void LLFloaterProperties::onCommitDescription() { //llinfos << "LLFloaterProperties::onCommitDescription()" << llendl; - LLFloaterProperties* self = (LLFloaterProperties*)data; - if(!self) return; - LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem(); + LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); if(!item) return; - LLLineEditor* labelItemDesc = self->getChild<LLLineEditor>("LabelItemDesc"); + LLLineEditor* labelItemDesc = getChild<LLLineEditor>("LabelItemDesc"); if(!labelItemDesc) { return; @@ -697,7 +617,7 @@ void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data) LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); new_item->setDescription(labelItemDesc->getText()); - if(self->mObjectID.isNull()) + if(mObjectID.isNull()) { new_item->updateServer(FALSE); gInventory.updateItem(new_item); @@ -705,7 +625,7 @@ void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data) } else { - LLViewerObject* object = gObjectList.findObject(self->mObjectID); + LLViewerObject* object = gObjectList.findObject(mObjectID); if(object) { object->updateInventory( @@ -718,17 +638,15 @@ void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data) } // static -void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data) +void LLFloaterProperties::onCommitPermissions() { //llinfos << "LLFloaterProperties::onCommitPermissions()" << llendl; - LLFloaterProperties* self = (LLFloaterProperties*)data; - if(!self) return; - LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem(); + LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); if(!item) return; LLPermissions perm(item->getPermissions()); - LLCheckBoxCtrl* CheckShareWithGroup = self->getChild<LLCheckBoxCtrl>("CheckShareWithGroup"); + LLCheckBoxCtrl* CheckShareWithGroup = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"); if(CheckShareWithGroup) { @@ -736,26 +654,26 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data) CheckShareWithGroup->get(), PERM_MODIFY | PERM_MOVE | PERM_COPY); } - LLCheckBoxCtrl* CheckEveryoneCopy = self->getChild<LLCheckBoxCtrl>("CheckEveryoneCopy"); + LLCheckBoxCtrl* CheckEveryoneCopy = getChild<LLCheckBoxCtrl>("CheckEveryoneCopy"); if(CheckEveryoneCopy) { perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(), CheckEveryoneCopy->get(), PERM_COPY); } - LLCheckBoxCtrl* CheckNextOwnerModify = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerModify"); + LLCheckBoxCtrl* CheckNextOwnerModify = getChild<LLCheckBoxCtrl>("CheckNextOwnerModify"); if(CheckNextOwnerModify) { perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(), CheckNextOwnerModify->get(), PERM_MODIFY); } - LLCheckBoxCtrl* CheckNextOwnerCopy = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerCopy"); + LLCheckBoxCtrl* CheckNextOwnerCopy = getChild<LLCheckBoxCtrl>("CheckNextOwnerCopy"); if(CheckNextOwnerCopy) { perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(), CheckNextOwnerCopy->get(), PERM_COPY); } - LLCheckBoxCtrl* CheckNextOwnerTransfer = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerTransfer"); + LLCheckBoxCtrl* CheckNextOwnerTransfer = getChild<LLCheckBoxCtrl>("CheckNextOwnerTransfer"); if(CheckNextOwnerTransfer) { perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(), @@ -791,7 +709,7 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data) flags |= LLInventoryItem::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP; } new_item->setFlags(flags); - if(self->mObjectID.isNull()) + if(mObjectID.isNull()) { new_item->updateServer(FALSE); gInventory.updateItem(new_item); @@ -799,7 +717,7 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data) } else { - LLViewerObject* object = gObjectList.findObject(self->mObjectID); + LLViewerObject* object = gObjectList.findObject(mObjectID); if(object) { object->updateInventory( @@ -812,26 +730,22 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data) else { // need to make sure we don't just follow the click - self->refresh(); + refresh(); } } // static -void LLFloaterProperties::onCommitSaleInfo(LLUICtrl* ctrl, void* data) +void LLFloaterProperties::onCommitSaleInfo() { //llinfos << "LLFloaterProperties::onCommitSaleInfo()" << llendl; - LLFloaterProperties* self = (LLFloaterProperties*)data; - if(!self) return; - self->updateSaleInfo(); + updateSaleInfo(); } // static -void LLFloaterProperties::onCommitSaleType(LLUICtrl* ctrl, void* data) +void LLFloaterProperties::onCommitSaleType() { //llinfos << "LLFloaterProperties::onCommitSaleType()" << llendl; - LLFloaterProperties* self = (LLFloaterProperties*)data; - if(!self) return; - self->updateSaleInfo(); + updateSaleInfo(); } void LLFloaterProperties::updateSaleInfo() @@ -957,13 +871,15 @@ LLInventoryItem* LLFloaterProperties::findItem() const return item; } -void LLFloaterProperties::closeByID(const LLUUID& item_id, const LLUUID &object_id) +//static +void LLFloaterProperties::dirtyAll() { - LLFloaterProperties* floaterp = find(item_id, object_id); - - if (floaterp) + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("properties"); + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); + iter != inst_list.end(); ++iter) { - floaterp->closeFloater(); + LLFloaterProperties* floater = dynamic_cast<LLFloaterProperties*>(*iter); + floater->dirty(); } } @@ -972,7 +888,7 @@ void LLFloaterProperties::closeByID(const LLUUID& item_id, const LLUUID &object_ ///---------------------------------------------------------------------------- LLMultiProperties::LLMultiProperties() - : LLMultiFloater() + : LLMultiFloater(LLSD()) { // *TODO: There should be a .xml file for this const LLRect& nextrect = LLFloaterReg::getFloaterRect("properties"); // place where the next properties should show up diff --git a/indra/newview/llfloaterproperties.h b/indra/newview/llfloaterproperties.h index d0e5abefb8..586719a4dc 100644 --- a/indra/newview/llfloaterproperties.h +++ b/indra/newview/llfloaterproperties.h @@ -53,30 +53,27 @@ class LLPropertiesObserver; class LLFloaterProperties : public LLFloater { public: - static LLFloaterProperties* find(const LLUUID& item_id, - const LLUUID& object_id = LLUUID::null); - static LLFloaterProperties* show(const LLUUID& item_id, - const LLUUID& object_id = LLUUID::null); - static void dirtyAll(); - - static void closeByID(const LLUUID& item_id, const LLUUID& object_id); - - LLFloaterProperties(const LLUUID& item_id, const LLUUID& object_id); - virtual ~LLFloaterProperties(); + LLFloaterProperties(const LLUUID& item_id); + /*virtual*/ ~LLFloaterProperties(); + /*virtual*/ BOOL postBuild(); - // do everything necessary + /*virtual*/ void onOpen(const LLSD& key); + void setObjectID(const LLUUID& object_id) { mObjectID = object_id; } + void dirty() { mDirty = TRUE; } void refresh(); - + + static void dirtyAll(); + protected: // ui callbacks - static void onClickCreator(void* data); - static void onClickOwner(void* data); - static void onCommitName(LLUICtrl* ctrl, void* data); - static void onCommitDescription(LLUICtrl* ctrl, void* data); - static void onCommitPermissions(LLUICtrl* ctrl, void* data); - static void onCommitSaleInfo(LLUICtrl* ctrl, void* data); - static void onCommitSaleType(LLUICtrl* ctrl, void* data); + void onClickCreator(); + void onClickOwner(); + void onCommitName(); + void onCommitDescription(); + void onCommitPermissions(); + void onCommitSaleInfo(); + void onCommitSaleType(); void updateSaleInfo(); LLInventoryItem* findItem() const; @@ -93,12 +90,9 @@ protected: // inventory. LLUUID mObjectID; - BOOL mDirty; + BOOL mDirty; - typedef std::map<LLUUID, LLFloaterProperties*, lluuid_less> instance_map; - static instance_map sInstances; - static LLPropertiesObserver* sPropertiesObserver; - static S32 sPropertiesObserverCount; + LLPropertiesObserver* mPropertiesObserver; }; class LLMultiProperties : public LLMultiFloater diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 009902b453..94d25aa0c8 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -724,8 +724,8 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L void LLPanelRegionGeneralInfo::onClickManageTelehub() { - LLFloaterReg::getInstance("region_info")->closeFloater(); - LLFloaterTelehub::show(); + LLFloaterReg::hideInstance("region_info"); + LLFloaterReg::showInstance("telehubs"); } // setregioninfo @@ -1455,12 +1455,12 @@ void LLPanelEstateInfo::onChangeFixedSun(LLUICtrl* ctrl, void* user_data) //--------------------------------------------------------------------------- void LLPanelEstateInfo::onClickEditSky(void* user_data) { - LLFloaterWindLight::show(); + LLFloaterReg::showInstance("env_windlight"); } void LLPanelEstateInfo::onClickEditDayCycle(void* user_data) { - LLFloaterDayCycle::show(); + LLFloaterReg::showInstance("env_day_cycle"); } // static @@ -1518,8 +1518,7 @@ bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& re LLFloater* parent_floater = gFloaterView->getParentFloater(this); - LLFloaterGroupPicker* widget; - widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); + LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance<LLFloaterGroupPicker>("group_picker", LLSD(gAgent.getID())); if (widget) { widget->setSelectGroupCallback(boost::bind(&LLPanelEstateInfo::addAllowedGroup2, this, _1)); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 8c96734057..00cbc2f0c8 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -54,6 +54,7 @@ #include "llbutton.h" #include "llcheckboxctrl.h" #include "llfloaterinventory.h" +#include "llfloaterreg.h" #include "lllineeditor.h" #include "lltexturectrl.h" #include "llscrolllistctrl.h" @@ -91,24 +92,14 @@ const U32 INCLUDE_SCREENSHOT = 0x01 << 0; // Globals //----------------------------------------------------------------------------- -// this map keeps track of current reporter instances -// there can only be one instance of each reporter type -LLMap< EReportType, LLFloaterReporter* > gReporterInstances; - -// keeps track of where email is going to - global to avoid a pile -// of static/non-static access outside my control -namespace { - static BOOL gEmailToEstateOwner = FALSE; - static BOOL gDialogVisible = FALSE; -} - //----------------------------------------------------------------------------- // Member functions //----------------------------------------------------------------------------- -LLFloaterReporter::LLFloaterReporter(EReportType report_type) -: LLFloater(), - mReportType(report_type), +LLFloaterReporter::LLFloaterReporter(const LLSD& key) +: LLFloater(key), + mReportType(COMPLAINT_REPORT), + mEmailToEstateOwner(FALSE), mObjectID(), mScreenID(), mAbuserID(), @@ -118,10 +109,34 @@ LLFloaterReporter::LLFloaterReporter(EReportType report_type) mCopyrightWarningSeen( FALSE ), mResourceDatap(new LLResourceData()) { + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml"); +} - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml"); +// static +void LLFloaterReporter::processRegionInfo(LLMessageSystem* msg) +{ + U32 region_flags; + msg->getU32("RegionInfo", "RegionFlags", region_flags); + if ( LLFloaterReg::instanceVisible("reporter") ) + { + LLFloaterReporter *f = LLFloaterReg::findTypedInstance<LLFloaterReporter>("reporter"); + BOOL email_to_estate_owner = ( region_flags & REGION_FLAGS_ABUSE_EMAIL_TO_ESTATE_OWNER ); + f->mEmailToEstateOwner = email_to_estate_owner; + if ( email_to_estate_owner ) + { + LLNotifications::instance().add("HelpReportAbuseEmailEO"); + } + else + { + LLNotifications::instance().add("HelpReportAbuseEmailLL"); + } + }; +} +// virtual +BOOL LLFloaterReporter::postBuild() +{ childSetText("abuse_location_edit", gAgent.getSLURL() ); enableControls(TRUE); @@ -135,8 +150,6 @@ LLFloaterReporter::LLFloaterReporter(EReportType report_type) } setPosBox(pos); - gReporterInstances.addData(report_type, this); - // Take a screenshot, but don't draw this floater. setVisible(FALSE); takeScreenshot(); @@ -150,9 +163,6 @@ LLFloaterReporter::LLFloaterReporter(EReportType report_type) mDefaultSummary = childGetText("details_edit"); - gDialogVisible = TRUE; - - // send a message and ask for information about this region - // result comes back in processRegionInfo(..) LLMessageSystem* msg = gMessageSystem; @@ -161,29 +171,8 @@ LLFloaterReporter::LLFloaterReporter(EReportType report_type) msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); gAgent.sendReliableMessage(); - -} - -// static -void LLFloaterReporter::processRegionInfo(LLMessageSystem* msg) -{ - U32 region_flags; - msg->getU32("RegionInfo", "RegionFlags", region_flags); - gEmailToEstateOwner = ( region_flags & REGION_FLAGS_ABUSE_EMAIL_TO_ESTATE_OWNER ); - - if ( gDialogVisible ) - { - if ( gEmailToEstateOwner ) - { - LLNotifications::instance().add("HelpReportAbuseEmailEO"); - } - else - LLNotifications::instance().add("HelpReportAbuseEmailLL"); - }; -} -// virtual -BOOL LLFloaterReporter::postBuild() -{ + + // abuser name is selected from a list LLLineEditor* le = getChild<LLLineEditor>("abuser_name_edit"); le->setEnabled( FALSE ); @@ -198,12 +187,19 @@ BOOL LLFloaterReporter::postBuild() childSetAction("send_btn", onClickSend, this); childSetAction("cancel_btn", onClickCancel, this); + + // grab the user's name + std::string fullname; + gAgent.buildFullname(fullname); + childSetText("reporter_field", fullname); + + center(); + return TRUE; } // virtual LLFloaterReporter::~LLFloaterReporter() { - gReporterInstances.removeData(mReportType); // child views automatically deleted mObjectID = LLUUID::null; @@ -218,7 +214,6 @@ LLFloaterReporter::~LLFloaterReporter() mMCDList.clear(); delete mResourceDatap; - gDialogVisible = FALSE; } // virtual @@ -227,7 +222,7 @@ void LLFloaterReporter::draw() // this is set by a static callback sometime after the dialog is created. // Only disable screenshot for abuse reports to estate owners - bug reports always // allow screenshots to be taken. - if ( gEmailToEstateOwner ) + if ( mEmailToEstateOwner ) { childSetValue("screen_check", FALSE ); childSetEnabled("screen_check", FALSE ); @@ -474,27 +469,16 @@ void LLFloaterReporter::closePickTool(void *userdata) // static void LLFloaterReporter::showFromMenu(EReportType report_type) { - if (gReporterInstances.checkData(report_type)) + if (COMPLAINT_REPORT != report_type) { - // ...bring that window to front - LLFloaterReporter *f = gReporterInstances.getData(report_type); - f->openFloater(); + llwarns << "Unknown LLViewerReporter type : " << report_type << llendl; + return; } - else + + LLFloaterReporter* f = LLFloaterReg::showTypedInstance<LLFloaterReporter>("reporter", LLSD()); + if (f) { - LLFloaterReporter *f; - - if (COMPLAINT_REPORT == report_type) - { - f = LLFloaterReporter::createNewAbuseReporter(); - } - else - { - llwarns << "Unknown LLViewerReporter type : " << report_type << llendl; - return; - } - - f->center(); + f->setReportType(report_type); if (report_type == BUG_REPORT) { @@ -504,11 +488,6 @@ void LLFloaterReporter::showFromMenu(EReportType report_type) { // popup for abuse reports is triggered elsewhere } - - // grab the user's name - std::string fullname; - gAgent.buildFullname(fullname); - f->childSetText("reporter_field", fullname); } } @@ -516,9 +495,7 @@ void LLFloaterReporter::showFromMenu(EReportType report_type) // static void LLFloaterReporter::showFromObject(const LLUUID& object_id) { - LLFloaterReporter* f = createNewAbuseReporter(); - f->center(); - f->setFocus(TRUE); + LLFloaterReporter* f = LLFloaterReg::showTypedInstance<LLFloaterReporter>("reporter"); // grab the user's name std::string fullname; @@ -535,24 +512,6 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id) } -// static -LLFloaterReporter* LLFloaterReporter::getReporter(EReportType report_type) -{ - LLFloaterReporter *self = NULL; - if (gReporterInstances.checkData(report_type)) - { - // ...bring that window to front - self = gReporterInstances.getData(report_type); - } - return self; -} - -LLFloaterReporter* LLFloaterReporter::createNewAbuseReporter() -{ - return new LLFloaterReporter(COMPLAINT_REPORT); -} - - void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id) { childSetText("object_name", object_name); @@ -710,7 +669,7 @@ LLSD LLFloaterReporter::gatherReport() if (childGetValue("screen_check")) { - if ( gEmailToEstateOwner == FALSE ) + if ( mEmailToEstateOwner == FALSE ) { screenshot_id = childGetValue("screenshot"); } @@ -914,7 +873,7 @@ void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data, llwarns << "Unknown report type : " << data->mPreferredLocation << llendl; } - LLFloaterReporter *self = getReporter(report_type); + LLFloaterReporter *self = LLFloaterReg::findTypedInstance<LLFloaterReporter>("reporter"); if (self) { self->mScreenID = uuid; @@ -935,35 +894,35 @@ void LLFloaterReporter::setPosBox(const LLVector3d &pos) childSetText("pos_field", pos_string); } -void LLFloaterReporter::setDescription(const std::string& description, LLMeanCollisionData *mcd) -{ - LLFloaterReporter *self = gReporterInstances[COMPLAINT_REPORT]; - if (self) - { - self->childSetText("details_edit", description); - - for_each(self->mMCDList.begin(), self->mMCDList.end(), DeletePointer()); - self->mMCDList.clear(); - if (mcd) - { - self->mMCDList.push_back(new LLMeanCollisionData(mcd)); - } - } -} - -void LLFloaterReporter::addDescription(const std::string& description, LLMeanCollisionData *mcd) -{ - LLFloaterReporter *self = gReporterInstances[COMPLAINT_REPORT]; - if (self) - { - LLTextEditor* text = self->getChild<LLTextEditor>("details_edit"); - if (text) - { - text->insertText(description); - } - if (mcd) - { - self->mMCDList.push_back(new LLMeanCollisionData(mcd)); - } - } -} +// void LLFloaterReporter::setDescription(const std::string& description, LLMeanCollisionData *mcd) +// { +// LLFloaterReporter *self = LLFloaterReg::findTypedInstance<LLFloaterReporter>("reporter"); +// if (self) +// { +// self->childSetText("details_edit", description); + +// for_each(self->mMCDList.begin(), self->mMCDList.end(), DeletePointer()); +// self->mMCDList.clear(); +// if (mcd) +// { +// self->mMCDList.push_back(new LLMeanCollisionData(mcd)); +// } +// } +// } + +// void LLFloaterReporter::addDescription(const std::string& description, LLMeanCollisionData *mcd) +// { +// LLFloaterReporter *self = LLFloaterReg::findTypedInstance<LLFloaterReporter>("reporter"); +// if (self) +// { +// LLTextEditor* text = self->getChild<LLTextEditor>("details_edit"); +// if (text) +// { +// text->insertText(description); +// } +// if (mcd) +// { +// self->mMCDList.push_back(new LLMeanCollisionData(mcd)); +// } +// } +// } diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index 52bea736bf..f363b9531e 100644 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -82,11 +82,13 @@ class LLFloaterReporter : public LLFloater { public: - LLFloaterReporter(EReportType = UNKNOWN_REPORT); + LLFloaterReporter(const LLSD& key); /*virtual*/ ~LLFloaterReporter(); /*virtual*/ BOOL postBuild(); virtual void draw(); - + + void setReportType(EReportType type) { mReportType = type; } + // Enables all buttons static void showFromMenu(EReportType report_type); @@ -101,10 +103,6 @@ public: static void addDescription(const std::string& description, LLMeanCollisionData *mcd = NULL); static void setDescription(const std::string& description, LLMeanCollisionData *mcd = NULL); - // returns a pointer to reporter of report_type - static LLFloaterReporter* getReporter(EReportType report_type); - static LLFloaterReporter* createNewAbuseReporter(); - // static static void processRegionInfo(LLMessageSystem* msg); @@ -126,6 +124,7 @@ private: private: EReportType mReportType; + BOOL mEmailToEstateOwner; LLUUID mObjectID; LLUUID mScreenID; LLUUID mAbuserID; 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<LLMultiFloater>("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<LLFloaterScriptDebugOutput>("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<LLFloaterScriptDebugOutput>("script_debug_output", source_id); + if (floaterp) + { + floaterp->addLine(utf8mesg, floater_label, color); + } } // // LLFloaterScriptDebugOutput // -std::map<LLUUID, LLFloaterScriptDebugOutput*> 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; -} diff --git a/indra/newview/llfloaterscriptdebug.h b/indra/newview/llfloaterscriptdebug.h index 5f2cf48125..ffc60e5554 100644 --- a/indra/newview/llfloaterscriptdebug.h +++ b/indra/newview/llfloaterscriptdebug.h @@ -41,15 +41,13 @@ class LLUUID; class LLFloaterScriptDebug : public LLMultiFloater { public: + LLFloaterScriptDebug(const LLSD& key); virtual ~LLFloaterScriptDebug(); - virtual void onClose(bool app_quitting) { setVisible(FALSE); } virtual BOOL postBuild(); static void show(const LLUUID& object_id); static void addScriptLine(const std::string &utf8mesg, const std::string &user_name, const LLColor4& color, const LLUUID& source_id); protected: - LLFloaterScriptDebug(const std::string& filename); - static LLFloater* addOutputWindow(const LLUUID& object_id); protected: @@ -59,24 +57,17 @@ protected: class LLFloaterScriptDebugOutput : public LLFloater { public: - LLFloaterScriptDebugOutput(); - LLFloaterScriptDebugOutput(const LLUUID& object_id); + LLFloaterScriptDebugOutput(const LLSD& object_id); ~LLFloaterScriptDebugOutput(); void addLine(const std::string &utf8mesg, const std::string &user_name, const LLColor4& color); virtual BOOL postBuild(); - static LLFloaterScriptDebugOutput* show(const LLUUID& object_id); - static LLFloaterScriptDebugOutput* getFloaterByID(const LLUUID& id); - protected: - LLTextEditor* mHistoryEditor; - - typedef std::map<LLUUID, LLFloaterScriptDebugOutput*> instance_map_t; - static instance_map_t sInstanceMap; + LLTextEditor* mHistoryEditor; - LLUUID mObjectID; + LLUUID mObjectID; }; #endif // LL_LLFLOATERSCRIPTDEBUG_H diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index 6775e218cb..a6aa01e83b 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -34,7 +34,7 @@ #include "llfloatersellland.h" #include "llfloateravatarpicker.h" -#include "llfloater.h" +#include "llfloaterreg.h" #include "llfloaterland.h" #include "lllineeditor.h" #include "llnotify.h" @@ -55,10 +55,21 @@ enum Badge { BADGE_OK, BADGE_NOTE, BADGE_WARN, BADGE_ERROR }; class LLFloaterSellLandUI : public LLFloater { -private: - LLFloaterSellLandUI(); +public: + LLFloaterSellLandUI(const LLSD& key); virtual ~LLFloaterSellLandUI(); - + +private: + class SelectionObserver : public LLParcelObserver + { + public: + SelectionObserver(LLFloaterSellLandUI* floater) : mFloater(floater) {} + virtual void changed(); + private: + LLFloaterSellLandUI* mFloater; + }; + +private: LLViewerRegion* mRegion; LLParcelSelectionHandle mParcelSelection; bool mParcelIsForSale; @@ -69,13 +80,12 @@ private: LLUUID mParcelSnapshot; LLUUID mAuthorizedBuyer; bool mParcelSoldWithObjects; + SelectionObserver mParcelSelectionObserver; void updateParcelInfo(); void refreshUI(); void setBadge(const char* id, Badge badge); - static LLFloaterSellLandUI* sInstance; - static void onChangeValue(LLUICtrl *ctrl, void *userdata); static void doSelectAgent(void *userdata); static void doCancel(void *userdata); @@ -89,82 +99,55 @@ private: public: virtual BOOL postBuild(); - static LLFloaterSellLandUI* soleInstance(bool createIfNeeded); - bool setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel); - -private: - class SelectionObserver : public LLParcelObserver - { - public: - virtual void changed(); - }; }; // static void LLFloaterSellLand::sellLand( LLViewerRegion* region, LLParcelSelectionHandle parcel) { - LLFloaterSellLandUI* ui = LLFloaterSellLandUI::soleInstance(true); - if (ui->setParcel(region, parcel)) - { - ui->openFloater(); - } + LLFloaterSellLandUI* ui = LLFloaterReg::showTypedInstance<LLFloaterSellLandUI>("sell_land"); + ui->setParcel(region, parcel); } // static -LLFloaterSellLandUI* LLFloaterSellLandUI::sInstance = NULL; - -// static -LLFloaterSellLandUI* LLFloaterSellLandUI::soleInstance(bool createIfNeeded) +LLFloater* LLFloaterSellLand::buildFloater(const LLSD& key) { - if (!sInstance && createIfNeeded) - { - sInstance = new LLFloaterSellLandUI(); - - LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_sell_land.xml"); - sInstance->center(); - } - - - static SelectionObserver* parcelSelectionObserver = NULL; - if (!parcelSelectionObserver) - { - parcelSelectionObserver = new SelectionObserver; - LLViewerParcelMgr::getInstance()->addObserver(parcelSelectionObserver); - } - - return sInstance; + LLFloaterSellLandUI* floater = new LLFloaterSellLandUI(key); + return floater; } -LLFloaterSellLandUI::LLFloaterSellLandUI() -: LLFloater(), +#if LL_WINDOWS +// passing 'this' during construction generates a warning. The callee +// only uses the pointer to hold a reference to 'this' which is +// already valid, so this call does the correct thing. Disable the +// warning so that we can compile without generating a warning. +#pragma warning(disable : 4355) +#endif +LLFloaterSellLandUI::LLFloaterSellLandUI(const LLSD& key) +: LLFloater(key), + mParcelSelectionObserver(this), mRegion(0) { + LLViewerParcelMgr::getInstance()->addObserver(&mParcelSelectionObserver); +// LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_sell_land.xml"); } LLFloaterSellLandUI::~LLFloaterSellLandUI() { - if (sInstance == this) - { - sInstance = NULL; - } + LLViewerParcelMgr::getInstance()->removeObserver(&mParcelSelectionObserver); } void LLFloaterSellLandUI::SelectionObserver::changed() { - LLFloaterSellLandUI* ui = LLFloaterSellLandUI::soleInstance(false); - if (ui) + if (LLViewerParcelMgr::getInstance()->selectionEmpty()) { - if (LLViewerParcelMgr::getInstance()->selectionEmpty()) - { - ui->closeFloater(); - } - else { - ui->setParcel( - LLViewerParcelMgr::getInstance()->getSelectionRegion(), - LLViewerParcelMgr::getInstance()->getParcelSelection()); - } + mFloater->closeFloater(); + } + else + { + mFloater->setParcel(LLViewerParcelMgr::getInstance()->getSelectionRegion(), + LLViewerParcelMgr::getInstance()->getParcelSelection()); } } @@ -178,6 +161,7 @@ BOOL LLFloaterSellLandUI::postBuild() childSetAction("cancel_btn", doCancel, this); childSetAction("sell_btn", doSellLand, this); childSetAction("show_objects", doShowObjects, this); + center(); return TRUE; } diff --git a/indra/newview/llfloatersellland.h b/indra/newview/llfloatersellland.h index 12b0ecbcef..1adf08052b 100644 --- a/indra/newview/llfloatersellland.h +++ b/indra/newview/llfloatersellland.h @@ -34,6 +34,7 @@ #include "llsafehandle.h" +class LLFloater; class LLParcel; class LLViewerRegion; class LLParcelSelection; @@ -43,6 +44,8 @@ class LLFloaterSellLand public: static void sellLand(LLViewerRegion* region, LLSafeHandle<LLParcelSelection> parcel); + + static LLFloater* buildFloater(const LLSD& key); }; #endif // LL_LLFLOATERSELLLAND_H diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 38d8420c96..371dfa50cd 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -2094,14 +2094,6 @@ void LLFloaterSnapshot::onOpen(const LLSD& key) gSnapshotFloaterView->adjustToFitScreen(this, FALSE); } -void LLFloaterSnapshot::onClose(bool app_quitting) -{ - gSnapshotFloaterView->setEnabled(FALSE); - // Set invisible so it doesn't eat tooltips. JC - gSnapshotFloaterView->setVisible(FALSE); - destroy(); -} - //static void LLFloaterSnapshot::update() { diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index 1333497bd2..bd01f6c573 100644 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -52,7 +52,6 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void draw(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); static void update(); diff --git a/indra/newview/llfloatertelehub.cpp b/indra/newview/llfloatertelehub.cpp index 174350ddf4..9841cd2796 100644 --- a/indra/newview/llfloatertelehub.cpp +++ b/indra/newview/llfloatertelehub.cpp @@ -39,6 +39,7 @@ #include "llfontgl.h" #include "llagent.h" +#include "llfloaterreg.h" #include "llfloatertools.h" #include "llscrolllistctrl.h" #include "llselectmgr.h" @@ -48,59 +49,25 @@ #include "llviewerobjectlist.h" #include "lluictrlfactory.h" -LLFloaterTelehub* LLFloaterTelehub::sInstance = NULL; - - -// static -void LLFloaterTelehub::show() -{ - if (sInstance) - { - sInstance->setVisibleAndFrontmost(); - return; - } - - sInstance = new LLFloaterTelehub(); - - // Show tools floater by selecting translate (select) tool - LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); - LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompTranslate::getInstance() ); - - // Find tools floater, glue to bottom - if (gFloaterTools) - { - LLRect tools_rect = gFloaterTools->getRect(); - S32 our_width = sInstance->getRect().getWidth(); - S32 our_height = sInstance->getRect().getHeight(); - LLRect our_rect; - our_rect.setLeftTopAndSize(tools_rect.mLeft, tools_rect.mBottom, our_width, our_height); - sInstance->setRect(our_rect); - } - - sInstance->sendTelehubInfoRequest(); -} - -LLFloaterTelehub::LLFloaterTelehub() -: LLFloater(), +LLFloaterTelehub::LLFloaterTelehub(const LLSD& key) +: LLFloater(key), mTelehubObjectID(), mTelehubObjectName(), mTelehubPos(), mTelehubRot(), mNumSpawn(0) { - sInstance = this; - - gMessageSystem->setHandlerFunc("TelehubInfo", processTelehubInfo); - - LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_telehub.xml"); + //LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_telehub.xml"); } + BOOL LLFloaterTelehub::postBuild() { + gMessageSystem->setHandlerFunc("TelehubInfo", processTelehubInfo); - childSetAction("connect_btn", onClickConnect, this); - childSetAction("disconnect_btn", onClickDisconnect, this); - childSetAction("add_spawn_point_btn", onClickAddSpawnPoint, this); - childSetAction("remove_spawn_point_btn", onClickRemoveSpawnPoint, this); + getChild<LLUICtrl>("connect_btn")->setCommitCallback(boost::bind(&LLFloaterTelehub::onClickConnect, this)); + getChild<LLUICtrl>("disconnect_btn")->setCommitCallback(boost::bind(&LLFloaterTelehub::onClickDisconnect, this)); + getChild<LLUICtrl>("add_spawn_point_btn")->setCommitCallback(boost::bind(&LLFloaterTelehub::onClickAddSpawnPoint, this)); + getChild<LLUICtrl>("remove_spawn_point_btn")->setCommitCallback(boost::bind(&LLFloaterTelehub::onClickRemoveSpawnPoint, this)); LLScrollListCtrl* list = getChild<LLScrollListCtrl>("spawn_points_list"); if (list) @@ -113,12 +80,28 @@ BOOL LLFloaterTelehub::postBuild() } void LLFloaterTelehub::onOpen(const LLSD& key) { + // Show tools floater by selecting translate (select) tool + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompTranslate::getInstance() ); + + // Find tools floater, glue to bottom + if (gFloaterTools) + { + LLRect tools_rect = gFloaterTools->getRect(); + S32 our_width = getRect().getWidth(); + S32 our_height = getRect().getHeight(); + LLRect our_rect; + our_rect.setLeftTopAndSize(tools_rect.mLeft, tools_rect.mBottom, our_width, our_height); + setRect(our_rect); + } + + sendTelehubInfoRequest(); + mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); } + LLFloaterTelehub::~LLFloaterTelehub() { - sInstance = NULL; - // no longer interested in this message gMessageSystem->setHandlerFunc("TelehubInfo", NULL); } @@ -160,19 +143,22 @@ void LLFloaterTelehub::refresh() BOOL LLFloaterTelehub::renderBeacons() { // only render if we've got a telehub - return sInstance && sInstance->mTelehubObjectID.notNull(); + LLFloaterTelehub* floater = LLFloaterReg::findTypedInstance<LLFloaterTelehub>("telehubs"); + return floater && floater->mTelehubObjectID.notNull(); } // static void LLFloaterTelehub::addBeacons() { - if (!sInstance) return; - + LLFloaterTelehub* floater = LLFloaterReg::findTypedInstance<LLFloaterTelehub>("telehubs"); + if (!floater) + return; + // Find the telehub position, either our cached old position, or // an updated one based on the actual object position. - LLVector3 hub_pos_region = sInstance->mTelehubPos; - LLQuaternion hub_rot = sInstance->mTelehubRot; - LLViewerObject* obj = gObjectList.findObject(sInstance->mTelehubObjectID); + LLVector3 hub_pos_region = floater->mTelehubPos; + LLQuaternion hub_rot = floater->mTelehubRot; + LLViewerObject* obj = gObjectList.findObject(floater->mTelehubObjectID); if (obj) { hub_pos_region = obj->getPositionRegion(); @@ -181,13 +167,13 @@ void LLFloaterTelehub::addBeacons() // Draw nice thick 3-pixel lines. gObjectList.addDebugBeacon(hub_pos_region, "", LLColor4::yellow, LLColor4::white, 4); - LLScrollListCtrl* list = sInstance->getChild<LLScrollListCtrl>("spawn_points_list"); + LLScrollListCtrl* list = floater->getChild<LLScrollListCtrl>("spawn_points_list"); if (list) { S32 spawn_index = list->getFirstSelectedIndex(); if (spawn_index >= 0) { - LLVector3 spawn_pos = hub_pos_region + (sInstance->mSpawnPointPos[spawn_index] * hub_rot); + LLVector3 spawn_pos = hub_pos_region + (floater->mSpawnPointPos[spawn_index] * hub_rot); gObjectList.addDebugBeacon(spawn_pos, "", LLColor4::orange, LLColor4::white, 4); } } @@ -198,32 +184,27 @@ void LLFloaterTelehub::sendTelehubInfoRequest() LLSelectMgr::getInstance()->sendGodlikeRequest("telehub", "info ui"); } -// static -void LLFloaterTelehub::onClickConnect(void* data) +void LLFloaterTelehub::onClickConnect() { LLSelectMgr::getInstance()->sendGodlikeRequest("telehub", "connect"); } -// static -void LLFloaterTelehub::onClickDisconnect(void* data) +void LLFloaterTelehub::onClickDisconnect() { LLSelectMgr::getInstance()->sendGodlikeRequest("telehub", "delete"); } -// static -void LLFloaterTelehub::onClickAddSpawnPoint(void* data) +void LLFloaterTelehub::onClickAddSpawnPoint() { LLSelectMgr::getInstance()->sendGodlikeRequest("telehub", "spawnpoint add"); LLSelectMgr::getInstance()->deselectAll(); } -// static -void LLFloaterTelehub::onClickRemoveSpawnPoint(void* data) +void LLFloaterTelehub::onClickRemoveSpawnPoint() { - if (!sInstance) return; - - LLScrollListCtrl* list = sInstance->getChild<LLScrollListCtrl>("spawn_points_list"); - if (!list) return; + LLScrollListCtrl* list = getChild<LLScrollListCtrl>("spawn_points_list"); + if (!list) + return; S32 spawn_index = list->getFirstSelectedIndex(); if (spawn_index < 0) return; // nothing selected @@ -261,9 +242,10 @@ void LLFloaterTelehub::onClickRemoveSpawnPoint(void* data) // static void LLFloaterTelehub::processTelehubInfo(LLMessageSystem* msg, void**) { - if (sInstance) + LLFloaterTelehub* floater = LLFloaterReg::findTypedInstance<LLFloaterTelehub>("telehubs"); + if (floater) { - sInstance->unpackTelehubInfo(msg); + floater->unpackTelehubInfo(msg); } } diff --git a/indra/newview/llfloatertelehub.h b/indra/newview/llfloatertelehub.h index 86749dcc0b..5b654585f1 100644 --- a/indra/newview/llfloatertelehub.h +++ b/indra/newview/llfloatertelehub.h @@ -44,26 +44,24 @@ const S32 MAX_SPAWNPOINTS_PER_TELEHUB = 16; class LLFloaterTelehub : public LLFloater { public: - // Opens the floater on screen. - static void show(); + LLFloaterTelehub(const LLSD& key); + ~LLFloaterTelehub(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); - virtual void draw(); - /*virtual*/ BOOL postBuild(); - void onOpen(const LLSD& key); + /*virtual*/ void draw(); + static BOOL renderBeacons(); static void addBeacons(); -private: - LLFloaterTelehub(); - ~LLFloaterTelehub(); - void refresh(); void sendTelehubInfoRequest(); - static void onClickConnect(void* data); - static void onClickDisconnect(void* data); - static void onClickAddSpawnPoint(void* data); - static void onClickRemoveSpawnPoint(void* data); + void onClickConnect(); + void onClickDisconnect(); + void onClickAddSpawnPoint(); + void onClickRemoveSpawnPoint(); static void processTelehubInfo(LLMessageSystem* msg, void**); void unpackTelehubInfo(LLMessageSystem* msg); diff --git a/indra/newview/llfloatertestlistview.cpp b/indra/newview/llfloatertestlistview.cpp index f7a327c088..5c942d0ed9 100644 --- a/indra/newview/llfloatertestlistview.cpp +++ b/indra/newview/llfloatertestlistview.cpp @@ -63,15 +63,15 @@ BOOL LLFloaterTestListView::postBuild() void LLFloaterTestListView::onListViewChanged() { - llinfos << "JAMESDEBUG list view changed" << llendl; + llinfos << "list view changed" << llendl; } void LLFloaterTestListView::onClickTest1() { - llinfos << "JAMESDEBUG test 1" << llendl; + llinfos << "test 1" << llendl; } void LLFloaterTestListView::onClickTest2() { - llinfos << "JAMESDEBUG test 2" << llendl; + llinfos << "test 2" << llendl; } diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 4704630147..bbcab00ab2 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -198,6 +198,7 @@ LLPCode toolData[]={ BOOL LLFloaterTools::postBuild() { + mCloseSignal.connect(boost::bind(&LLFloaterTools::onClose, this)); // Hide until tool selected setVisible(FALSE); @@ -727,11 +728,8 @@ void LLFloaterTools::onOpen(const LLSD& key) gMenuBarView->setItemVisible("BuildTools", TRUE); } -// virtual -void LLFloaterTools::onClose(bool app_quitting) +void LLFloaterTools::onClose() { - setMinimized(FALSE); - setVisible(FALSE); mTab->setVisible(FALSE); LLViewerJoystick::getInstance()->moveAvatar(false); diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h index 7bb072232a..1b9f1d31ec 100644 --- a/indra/newview/llfloatertools.h +++ b/indra/newview/llfloatertools.h @@ -73,7 +73,6 @@ public: virtual ~LLFloaterTools(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); /*virtual*/ BOOL canClose(); /*virtual*/ void draw(); /*virtual*/ void onFocusReceived(); @@ -103,10 +102,10 @@ public: static void setEditTool(void* data); void saveLastTool(); private: - static void setObjectType( LLPCode pcode ); - + void onClose(); void refresh(); + static void setObjectType( LLPCode pcode ); static void onClickGridOptions(void* data); public: diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 764a6a3498..1e84902594 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -54,34 +54,9 @@ #include "message.h" -// static -LLFloaterTOS* LLFloaterTOS::sInstance = NULL; - -// static -LLFloaterTOS* LLFloaterTOS::show(ETOSType type, const std::string & message) -{ - if( !LLFloaterTOS::sInstance ) - { - LLFloaterTOS::sInstance = new LLFloaterTOS(type, message); - } - - if (type == TOS_TOS) - { - LLUICtrlFactory::getInstance()->buildFloater(LLFloaterTOS::sInstance, "floater_tos.xml"); - } - else - { - LLUICtrlFactory::getInstance()->buildFloater(LLFloaterTOS::sInstance, "floater_critical.xml"); - } - - return LLFloaterTOS::sInstance; -} - - -LLFloaterTOS::LLFloaterTOS(ETOSType type, const std::string & message) -: LLModalDialog( std::string(" "), 100, 100 ), - mType(type), - mMessage(message), +LLFloaterTOS::LLFloaterTOS(const LLSD& message) +: LLModalDialog( message, 100, 100 ), + mMessage(message.asString()), mWebBrowserWindowId( 0 ), mLoadCompleteCount( 0 ) { @@ -139,8 +114,8 @@ BOOL LLFloaterTOS::postBuild() childSetAction("Continue", onContinue, this); childSetAction("Cancel", onCancel, this); childSetCommitCallback("agree_chk", updateAgree, this); - - if ( mType != TOS_TOS ) + + if (hasChild("tos_text")) { // this displays the critical message LLTextEditor *editor = getChild<LLTextEditor>("tos_text"); @@ -177,17 +152,14 @@ BOOL LLFloaterTOS::postBuild() void LLFloaterTOS::setSiteIsAlive( bool alive ) { // only do this for TOS pages - if ( mType == TOS_TOS ) + if (hasChild("tos_html")) { LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); // if the contents of the site was retrieved if ( alive ) { - if ( web_browser ) - { - // navigate to the "real" page - web_browser->navigateTo( getString( "real_url" ) ); - }; + // navigate to the "real" page + web_browser->navigateTo( getString( "real_url" ) ); } else { @@ -195,8 +167,8 @@ void LLFloaterTOS::setSiteIsAlive( bool alive ) // but if the page is unavailable, we need to do this now LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); tos_agreement->setEnabled( true ); - }; - }; + } + } } LLFloaterTOS::~LLFloaterTOS() @@ -211,8 +183,6 @@ LLFloaterTOS::~LLFloaterTOS() // tell the responder we're not here anymore if ( gResponsePtr ) gResponsePtr->setParent( 0 ); - - LLFloaterTOS::sInstance = NULL; } // virtual @@ -235,7 +205,7 @@ void LLFloaterTOS::onContinue( void* userdata ) { LLFloaterTOS* self = (LLFloaterTOS*) userdata; llinfos << "User agrees with TOS." << llendl; - if (self->mType == TOS_TOS) + if (self->getInstanceName() == "message_tos") { gAcceptTOS = TRUE; } diff --git a/indra/newview/llfloatertos.h b/indra/newview/llfloatertos.h index dbec3ff8b6..a9436cbd63 100644 --- a/indra/newview/llfloatertos.h +++ b/indra/newview/llfloatertos.h @@ -48,18 +48,9 @@ class LLFloaterTOS : public LLWebBrowserCtrlObserver { public: + LLFloaterTOS(const LLSD& message); virtual ~LLFloaterTOS(); - // Types of dialog. - enum ETOSType - { - TOS_TOS = 0, - TOS_CRITICAL_MESSAGE = 1 - }; - - // Asset_id is overwritten with LLUUID::null when agree is clicked. - static LLFloaterTOS* show(ETOSType type, const std::string & message); - BOOL postBuild(); virtual void draw(); @@ -73,16 +64,9 @@ public: virtual void onNavigateComplete( const EventType& eventIn ); private: - // Asset_id is overwritten with LLUUID::null when agree is clicked. - LLFloaterTOS(ETOSType type, const std::string & message); - -private: - ETOSType mType; std::string mMessage; int mWebBrowserWindowId; int mLoadCompleteCount; - - static LLFloaterTOS* sInstance; }; #endif // LL_LLFLOATERTOS_H diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 4870494b20..e5b4657742 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -71,10 +71,6 @@ #endif // Static initialization -LLFloaterUIPreview* LLFloaterUIPreview::sInstance = NULL; // initialization of static instance pointer to NULL -std::string LLFloaterUIPreview::mSavedEditorPath = std::string(""); -std::string LLFloaterUIPreview::mSavedEditorArgs = std::string(""); -std::string LLFloaterUIPreview::mSavedDiffPath = std::string(""); static const S32 PRIMARY_FLOATER = 1; static const S32 SECONDARY_FLOATER = 2; @@ -86,12 +82,74 @@ static std::string get_xui_dir() return gDirUtilp->getSkinBaseDir() + delim + "default" + delim + "xui" + delim; } +//---------------------------------------------------------------------------- +// Local class declarations +// Reset object to ensure that when we change the current language setting for preview purposes, +// it automatically is reset. Constructed on the stack at the start of the method; the reset +// occurs as it falls out of scope at the end of the method. See llfloateruipreview.cpp for usage. +class LLLocalizationResetForcer +{ +public: + LLLocalizationResetForcer(LLFloaterUIPreview* floater, S32 ID); + virtual ~LLLocalizationResetForcer(); + +private: + std::string mSavedLocalization; // the localization before we change it +}; + +// Implementation of live file +// When a floater is being previewed, any saved changes to its corresponding +// file cause the previewed floater to be reloaded +class LLGUIPreviewLiveFile : public LLLiveFile +{ +public: + LLGUIPreviewLiveFile(std::string path, std::string name, LLFloaterUIPreview* parent); + virtual ~LLGUIPreviewLiveFile(); + LLFloaterUIPreview* mParent; + LLFadeEventTimer* mFadeTimer; // timer for fade-to-yellow-and-back effect to warn that file has been reloaded + BOOL mFirstFade; // setting this avoids showing the fade reload warning on first load + std::string mFileName; +protected: + bool loadFile(); +}; + +// Implementation of graphical fade in/out (on timer) for when XUI files are updated +class LLFadeEventTimer : public LLEventTimer +{ +public: + LLFadeEventTimer(F32 refresh, LLGUIPreviewLiveFile* parent); + BOOL tick(); + LLGUIPreviewLiveFile* mParent; +private: + BOOL mFadingOut; // fades in then out; this is toggled in between + LLColor4 mOriginalColor; // original color; color is reset to this after fade is coimplete +}; + +// Implementation of previewed floater +// Used to override draw and mouse handler +class LLPreviewedFloater : public LLFloater +{ +public: + LLPreviewedFloater(LLFloaterUIPreview* floater) + : LLFloater(LLSD()), + mFloaterUIPreview(floater) + { + } + virtual void draw(); + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + BOOL selectElement(LLView* parent, int x, int y, int depth); // select element to display its overlappers + + LLFloaterUIPreview* mFloaterUIPreview; +}; + +//---------------------------------------------------------------------------- + // Localization reset forcer -- ensures that when localization is temporarily changed for previewed floater, it is reset // Changes are made here -LLLocalizationResetForcer::LLLocalizationResetForcer(S32 ID) +LLLocalizationResetForcer::LLLocalizationResetForcer(LLFloaterUIPreview* floater, S32 ID) { mSavedLocalization = LLUI::sSettingGroups["config"]->getString("Language"); // save current localization setting - LLUI::sSettingGroups["config"]->setString("Language", LLFloaterUIPreview::getLocStr(ID));// hack language to be the one we want to preview floaters in + LLUI::sSettingGroups["config"]->setString("Language", floater->getLocStr(ID));// hack language to be the one we want to preview floaters in LLUI::setupPaths(); // forcibly reset XUI paths with this new language } @@ -201,7 +259,6 @@ LLFloaterUIPreview::LLFloaterUIPreview(const LLSD& key) mLastDisplayedY(0) { - sInstance = this; // called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_ui_preview.xml"); } @@ -211,27 +268,27 @@ LLFloaterUIPreview::~LLFloaterUIPreview() // spawned floaters are deleted automatically, so we don't need to delete them here // save contents of textfields so it can be restored later if the floater is created again this session - LLFloaterUIPreview::mSavedEditorPath = mEditorPathTextBox->getText(); - LLFloaterUIPreview::mSavedEditorArgs = mEditorArgsTextBox->getText(); - LLFloaterUIPreview::mSavedDiffPath = mDiffPathTextBox->getText(); + mSavedEditorPath = mEditorPathTextBox->getText(); + mSavedEditorArgs = mEditorArgsTextBox->getText(); + mSavedDiffPath = mDiffPathTextBox->getText(); // delete live file if it exists - if(sInstance->mLiveFile) + if(mLiveFile) { - delete sInstance->mLiveFile; - sInstance->mLiveFile = NULL; + delete mLiveFile; + mLiveFile = NULL; } - - sInstance = NULL; // clear static pointer } // Perform post-build setup (defined in superclass) BOOL LLFloaterUIPreview::postBuild() { + mCloseSignal.connect(boost::bind(&LLFloaterUIPreview::onClose, this, _2)); + LLPanel* main_panel_tmp = getChild<LLPanel>("main_panel"); // get a pointer to the main panel in order to... mFileList = main_panel_tmp->getChild<LLScrollListCtrl>("name_list"); // save pointer to file list // Double-click opens the floater, for convenience - mFileList->setDoubleClickCallback(onClickDisplayFloater, (void*)&PRIMARY_FLOATER); + mFileList->setDoubleClickCallback(boost::bind(&LLFloaterUIPreview::onClickDisplayFloater, this, PRIMARY_FLOATER)); // get pointers to buttons and link to callbacks mLanguageSelection = main_panel_tmp->getChild<LLComboBox>("language_select_combo"); @@ -240,26 +297,26 @@ BOOL LLFloaterUIPreview::postBuild() mLanguageSelection_2->setSelectionCallback(boost::bind(&LLFloaterUIPreview::onLanguageComboSelect, this, mLanguageSelection)); LLPanel* editor_panel_tmp = main_panel_tmp->getChild<LLPanel>("editor_panel"); mDisplayFloaterBtn = main_panel_tmp->getChild<LLButton>("display_floater"); - mDisplayFloaterBtn->setClickedCallback(onClickDisplayFloater, (void*)&PRIMARY_FLOATER); + mDisplayFloaterBtn->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickDisplayFloater, this, PRIMARY_FLOATER)); mDisplayFloaterBtn_2 = main_panel_tmp->getChild<LLButton>("display_floater_2"); - mDisplayFloaterBtn_2->setClickedCallback(onClickDisplayFloater, (void*)&SECONDARY_FLOATER); + mDisplayFloaterBtn_2->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickDisplayFloater, this, SECONDARY_FLOATER)); mToggleOverlapButton = main_panel_tmp->getChild<LLButton>("toggle_overlap_panel"); - mToggleOverlapButton->setClickedCallback(onClickToggleOverlapping, this); + mToggleOverlapButton->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickToggleOverlapping, this)); mCloseOtherButton = main_panel_tmp->getChild<LLButton>("close_displayed_floater"); - mCloseOtherButton->setClickedCallback(onClickCloseDisplayedFloater, (void*)&PRIMARY_FLOATER); + mCloseOtherButton->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickCloseDisplayedFloater, this, PRIMARY_FLOATER)); mCloseOtherButton_2 = main_panel_tmp->getChild<LLButton>("close_displayed_floater_2"); - mCloseOtherButton_2->setClickedCallback(onClickCloseDisplayedFloater, (void*)&SECONDARY_FLOATER); + mCloseOtherButton_2->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickCloseDisplayedFloater, this, SECONDARY_FLOATER)); mEditFloaterBtn = main_panel_tmp->getChild<LLButton>("edit_floater"); - mEditFloaterBtn->setClickedCallback(onClickEditFloater, this); + mEditFloaterBtn->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickEditFloater, this)); mExecutableBrowseButton = editor_panel_tmp->getChild<LLButton>("browse_for_executable"); LLPanel* vlt_panel_tmp = main_panel_tmp->getChild<LLPanel>("vlt_panel"); - mExecutableBrowseButton->setClickedCallback(onClickBrowseForEditor, this); + mExecutableBrowseButton->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickBrowseForEditor, this)); mDiffBrowseButton = vlt_panel_tmp->getChild<LLButton>("browse_for_vlt_diffs"); - mDiffBrowseButton->setClickedCallback(onClickBrowseForDiffs, NULL); + mDiffBrowseButton->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickBrowseForDiffs, this)); mToggleHighlightButton = vlt_panel_tmp->getChild<LLButton>("toggle_vlt_diff_highlight"); - mToggleHighlightButton->setClickedCallback(onClickToggleDiffHighlighting, NULL); - main_panel_tmp->getChild<LLButton>("save_floater")->setClickedCallback(onClickSaveFloater, (void*)&PRIMARY_FLOATER); - main_panel_tmp->getChild<LLButton>("save_all_floaters")->setClickedCallback(onClickSaveAll, (void*)&PRIMARY_FLOATER); + mToggleHighlightButton->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickToggleDiffHighlighting, this)); + main_panel_tmp->getChild<LLButton>("save_floater")->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickSaveFloater, this, PRIMARY_FLOATER)); + main_panel_tmp->getChild<LLButton>("save_all_floaters")->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickSaveAll, this, PRIMARY_FLOATER)); getChild<LLButton>("export_schema")->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickExportSchema, this)); @@ -269,14 +326,14 @@ BOOL LLFloaterUIPreview::postBuild() mDiffPathTextBox = vlt_panel_tmp->getChild<LLLineEditor>("vlt_diff_path_field"); // *HACK: restored saved editor path and args to textfields - mEditorPathTextBox->setText(LLFloaterUIPreview::mSavedEditorPath); - mEditorArgsTextBox->setText(LLFloaterUIPreview::mSavedEditorArgs); - mDiffPathTextBox->setText(LLFloaterUIPreview::mSavedDiffPath); + mEditorPathTextBox->setText(mSavedEditorPath); + mEditorArgsTextBox->setText(mSavedEditorArgs); + mDiffPathTextBox->setText(mSavedDiffPath); // Set up overlap panel mOverlapPanel = getChild<LLOverlapPanel>("overlap_panel"); - sInstance->childSetVisible("overlap_scroll", mHighlightingOverlaps); + childSetVisible("overlap_scroll", mHighlightingOverlaps); mDelim = gDirUtilp->getDirDelimiter(); // initialize delimiter to dir sep slash @@ -338,7 +395,7 @@ void LLFloaterUIPreview::onLanguageComboSelect(LLUICtrl* ctrl) { if(mDisplayedFloater) { - onClickCloseDisplayedFloater((void*)&PRIMARY_FLOATER); + onClickCloseDisplayedFloater(PRIMARY_FLOATER); displayFloater(TRUE,1); } } @@ -346,7 +403,7 @@ void LLFloaterUIPreview::onLanguageComboSelect(LLUICtrl* ctrl) { if(mDisplayedFloater_2) { - onClickCloseDisplayedFloater((void*)&PRIMARY_FLOATER); + onClickCloseDisplayedFloater(PRIMARY_FLOATER); displayFloater(TRUE,2); // *TODO: make take an arg } } @@ -385,16 +442,17 @@ void LLFloaterUIPreview::onClickExportSchema() // Close click handler -- delete my displayed floater if it exists -void LLFloaterUIPreview::onClose(bool app_quitting) +void LLFloaterUIPreview::onClose(const LLSD& app_quitting) { - if(!app_quitting && sInstance && sInstance->mDisplayedFloater) + if(!app_quitting.asBoolean() && mDisplayedFloater) { - onClickCloseDisplayedFloater((void*)&PRIMARY_FLOATER); - onClickCloseDisplayedFloater((void*)&SECONDARY_FLOATER); - delete sInstance->mDisplayedFloater; - sInstance->mDisplayedFloater = NULL; + onClickCloseDisplayedFloater(PRIMARY_FLOATER); + onClickCloseDisplayedFloater(SECONDARY_FLOATER); + delete mDisplayedFloater; + mDisplayedFloater = NULL; + delete mDisplayedFloater_2; + mDisplayedFloater_2 = NULL; } - destroy(); } // Error handling (to avoid code repetition) @@ -412,18 +470,18 @@ std::string LLFloaterUIPreview::getLocStr(S32 ID) { if(ID == 1) { - return sInstance->mLanguageSelection->getSelectedItemLabel(0); + return mLanguageSelection->getSelectedItemLabel(0); } else { - return sInstance->mLanguageSelection_2->getSelectedItemLabel(0); + return mLanguageSelection_2->getSelectedItemLabel(0); } } // Get localized directory (build path from data directory to XUI files, substituting localization string in for language) std::string LLFloaterUIPreview::getLocalizedDirectory() { - return get_xui_dir() + (sInstance ? getLocStr(1) : "en") + mDelim; // e.g. "C:/Code/guipreview/indra/newview/skins/xui/en/"; + return get_xui_dir() + (getLocStr(1)) + mDelim; // e.g. "C:/Code/guipreview/indra/newview/skins/xui/en/"; } // Refresh the list of floaters by doing a directory traverse for XML XUI floater files @@ -535,36 +593,33 @@ void LLFloaterUIPreview::addFloaterEntry(const std::string& path) } // Respond to button click to display/refresh currently-selected floater -void LLFloaterUIPreview::onClickDisplayFloater(void* data) +void LLFloaterUIPreview::onClickDisplayFloater(S32 caller_id) { - S32 caller_id = *((S32*)data); displayFloater(TRUE, caller_id); - if(caller_id == 1) + if(caller_id == PRIMARY_FLOATER) { - sInstance->mDisplayedFloater->center(); // move displayed floater to the center of the screen + mDisplayedFloater->center(); // move displayed floater to the center of the screen } } // Saves the current floater/panel -void LLFloaterUIPreview::onClickSaveFloater(void* data) +void LLFloaterUIPreview::onClickSaveFloater(S32 caller_id) { - S32 caller_id = *((S32*)data); displayFloater(TRUE, caller_id, true); - if(caller_id == 1) + if(caller_id == PRIMARY_FLOATER) { - sInstance->mDisplayedFloater->center(); // move displayed floater to the center of the screen + mDisplayedFloater->center(); // move displayed floater to the center of the screen } } // Saves all floater/panels -void LLFloaterUIPreview::onClickSaveAll(void* data) +void LLFloaterUIPreview::onClickSaveAll(S32 caller_id) { - S32 caller_id = *((S32*)data); - int listSize = sInstance->mFileList->getItemCount(); + int listSize = mFileList->getItemCount(); for (int index = 0; index < listSize; index++) { - sInstance->mFileList->selectNthItem(index); + mFileList->selectNthItem(index); displayFloater(TRUE, caller_id, true); } } @@ -586,43 +641,43 @@ static std::string append_new_to_xml_filename(const std::string& path) void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) { // Convince UI that we're in a different language (the one selected on the drop-down menu) - LLLocalizationResetForcer reset_forcer(ID); // save old language in reset forcer object (to be reset upon destruction when it falls out of scope) + LLLocalizationResetForcer reset_forcer(this, ID); // save old language in reset forcer object (to be reset upon destruction when it falls out of scope) - LLPreviewedFloater** floaterp = (ID == 1 ? &(sInstance->mDisplayedFloater) : &(sInstance->mDisplayedFloater_2)); + LLPreviewedFloater** floaterp = (ID == 1 ? &(mDisplayedFloater) : &(mDisplayedFloater_2)); if(ID == 1) { - BOOL floater_already_open = sInstance->mDisplayedFloater != NULL; + BOOL floater_already_open = mDisplayedFloater != NULL; if(floater_already_open) // if we are already displaying a floater { - sInstance->mLastDisplayedX = sInstance->mDisplayedFloater->calcScreenRect().mLeft; // save floater's last known position to put the new one there - sInstance->mLastDisplayedY = sInstance->mDisplayedFloater->calcScreenRect().mBottom; - delete sInstance->mDisplayedFloater; // delete it (this closes it too) - sInstance->mDisplayedFloater = NULL; // and reset the pointer + mLastDisplayedX = mDisplayedFloater->calcScreenRect().mLeft; // save floater's last known position to put the new one there + mLastDisplayedY = mDisplayedFloater->calcScreenRect().mBottom; + delete mDisplayedFloater; // delete it (this closes it too) + mDisplayedFloater = NULL; // and reset the pointer } } else { - if(sInstance->mDisplayedFloater_2 != NULL) + if(mDisplayedFloater_2 != NULL) { - delete sInstance->mDisplayedFloater_2; - sInstance->mDisplayedFloater_2 = NULL; + delete mDisplayedFloater_2; + mDisplayedFloater_2 = NULL; } } - std::string path = sInstance->mFileList->getSelectedItemLabel(1); // get the path of the currently-selected floater + std::string path = mFileList->getSelectedItemLabel(1); // get the path of the currently-selected floater if(std::string("") == path) // if no item is selected { return; // ignore click (this can only happen with empty list; otherwise an item is always selected) } - *floaterp = new LLPreviewedFloater(); + *floaterp = new LLPreviewedFloater(this); if(!strncmp(path.c_str(),"floater_",8)) // if it's a floater { if (save) { LLXMLNodePtr floater_write = new LLXMLNode(); - LLUICtrlFactory::getInstance()->buildFloater(*floaterp, path, FALSE, floater_write); // just build it + LLUICtrlFactory::getInstance()->buildFloater(*floaterp, path, floater_write); // just build it if (!floater_write->isNull()) { @@ -636,7 +691,8 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) } else { - LLUICtrlFactory::getInstance()->buildFloater(*floaterp, path, TRUE); // just build it + LLUICtrlFactory::getInstance()->buildFloater(*floaterp, path, NULL); // just build it + (*floaterp)->openFloater((*floaterp)->getKey()); } } @@ -702,7 +758,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) if(ID == 1) { - (*floaterp)->setOrigin(sInstance->mLastDisplayedX, sInstance->mLastDisplayedY); + (*floaterp)->setOrigin(mLastDisplayedX, mLastDisplayedY); } // *HACK: Remove ability to close it; if you close it, its destructor gets called, but we don't know it's null and try to delete it again, @@ -711,22 +767,22 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) if(ID == 1) { - sInstance->mCloseOtherButton->setEnabled(TRUE); // enable my floater's close button + mCloseOtherButton->setEnabled(TRUE); // enable my floater's close button } else { - sInstance->mCloseOtherButton_2->setEnabled(TRUE); + mCloseOtherButton_2->setEnabled(TRUE); } // *TODO: Make the secondary floater pop up next to the primary one. Doesn't seem to always work if secondary was up first... - if((sInstance->mDisplayedFloater && ID == 2) || (sInstance->mDisplayedFloater_2 && ID == 1)) + if((mDisplayedFloater && ID == 2) || (mDisplayedFloater_2 && ID == 1)) { - sInstance->mDisplayedFloater_2->setSnapTarget(sInstance->mDisplayedFloater->getHandle()); - sInstance->mDisplayedFloater->addDependentFloater(sInstance->mDisplayedFloater_2); + mDisplayedFloater_2->setSnapTarget(mDisplayedFloater->getHandle()); + mDisplayedFloater->addDependentFloater(mDisplayedFloater_2); } // Add localization to title so user knows whether it's localized or defaulted to en - std::string full_path = sInstance->getLocalizedDirectory() + path; + std::string full_path = getLocalizedDirectory() + path; std::string floater_lang = "EN"; llstat dummy; if(!LLFile::stat(full_path.c_str(), &dummy)) // if the file does not exist @@ -740,37 +796,37 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) if(click && ID == 1 && !save) { // set up live file to track it - if(sInstance->mLiveFile) + if(mLiveFile) { - delete sInstance->mLiveFile; - sInstance->mLiveFile = NULL; + delete mLiveFile; + mLiveFile = NULL; } - sInstance->mLiveFile = new LLGUIPreviewLiveFile(std::string(full_path.c_str()),std::string(path.c_str()),sInstance); - sInstance->mLiveFile->checkAndReload(); - sInstance->mLiveFile->addToEventTimer(); + mLiveFile = new LLGUIPreviewLiveFile(std::string(full_path.c_str()),std::string(path.c_str()),this); + mLiveFile->checkAndReload(); + mLiveFile->addToEventTimer(); } if(ID == 1) { - sInstance->mToggleOverlapButton->setEnabled(TRUE); + mToggleOverlapButton->setEnabled(TRUE); } if(LLView::sHighlightingDiffs && click && ID == 1) { - sInstance->highlightChangedElements(); + highlightChangedElements(); } if(ID == 1) { - sInstance->mOverlapMap.clear(); + mOverlapPanel->mOverlapMap.clear(); LLView::sPreviewClickedElement = NULL; // stop overlapping elements from drawing - sInstance->mOverlapPanel->mLastClickedElement = NULL; - sInstance->findOverlapsInChildren((LLView*)sInstance->mDisplayedFloater); + mOverlapPanel->mLastClickedElement = NULL; + findOverlapsInChildren((LLView*)mDisplayedFloater); // highlight and enable them - if(sInstance->mHighlightingOverlaps) + if(mHighlightingOverlaps) { - for(OverlapMap::iterator iter = sInstance->mOverlapMap.begin(); iter != sInstance->mOverlapMap.end(); ++iter) + for(LLOverlapPanel::OverlapMap::iterator iter = mOverlapPanel->mOverlapMap.begin(); iter != mOverlapPanel->mOverlapMap.end(); ++iter) { LLView* viewp = iter->first; LLView::sPreviewHighlightedElements.insert(viewp); @@ -778,7 +834,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) } else if(LLView::sHighlightingDiffs) { - sInstance->highlightChangedElements(); + highlightChangedElements(); } } @@ -786,14 +842,14 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) } // Respond to button click to edit currently-selected floater -void LLFloaterUIPreview::onClickEditFloater(void*) +void LLFloaterUIPreview::onClickEditFloater() { - std::string file_name = sInstance->mFileList->getSelectedItemLabel(1); // get the file name of the currently-selected floater + std::string file_name = mFileList->getSelectedItemLabel(1); // get the file name of the currently-selected floater if(std::string("") == file_name) // if no item is selected { return; // ignore click } - std::string path = sInstance->getLocalizedDirectory() + file_name; + std::string path = getLocalizedDirectory() + file_name; // stat file to see if it exists (some localized versions may not have it there are no diffs, and then we try to open an nonexistent file) llstat dummy; @@ -802,12 +858,12 @@ void LLFloaterUIPreview::onClickEditFloater(void*) std::string warning = "No file for this floater exists in the selected localization. Opening the EN version instead."; popupAndPrintWarning(warning); - path = get_xui_dir() + sInstance->mDelim + "en" + sInstance->mDelim + file_name; // open the en version instead, by default + path = get_xui_dir() + mDelim + "en" + mDelim + file_name; // open the en version instead, by default } // get executable path const char* exe_path_char; - std::string path_in_textfield = sInstance->mEditorPathTextBox->getText(); + std::string path_in_textfield = mEditorPathTextBox->getText(); if(std::string("") != path_in_textfield) // if the text field is not emtpy, use its path { exe_path_char = path_in_textfield.c_str(); @@ -842,7 +898,7 @@ void LLFloaterUIPreview::onClickEditFloater(void*) { // build paths and arguments std::string args; - std::string custom_args = sInstance->mEditorArgsTextBox->getText(); + std::string custom_args = mEditorArgsTextBox->getText(); int position_of_file = custom_args.find(std::string("%FILE%"), 0); // prepare to replace %FILE% with actual file path std::string first_part_of_args = ""; std::string second_part_of_args = ""; @@ -859,7 +915,7 @@ void LLFloaterUIPreview::onClickEditFloater(void*) } // find directory in which executable resides by taking everything after last slash - int last_slash_position = exe_path.find_last_of(sInstance->mDelim); + int last_slash_position = exe_path.find_last_of(mDelim); if(-1 == last_slash_position) { std::string warning = std::string("Unable to find a valid path to the specified executable for XUI XML editing: ") + exe_path; @@ -973,7 +1029,7 @@ void LLFloaterUIPreview::onClickEditFloater(void*) } // Respond to button click to browse for an executable with which to edit XML files -void LLFloaterUIPreview::onClickBrowseForEditor(void*) +void LLFloaterUIPreview::onClickBrowseForEditor() { // create load dialog box LLFilePicker::ELoadFilter type = (LLFilePicker::ELoadFilter)((intptr_t)((void*)LLFilePicker::FFLOAD_ALL)); // nothing for *.exe so just use all @@ -1025,11 +1081,11 @@ void LLFloaterUIPreview::onClickBrowseForEditor(void*) } #endif - sInstance->mEditorPathTextBox->setText(std::string(executable_path)); // copy the path to the executable to the textfield for display and later fetching + mEditorPathTextBox->setText(std::string(executable_path)); // copy the path to the executable to the textfield for display and later fetching } // Respond to button click to browse for a VLT-generated diffs file -void LLFloaterUIPreview::onClickBrowseForDiffs(void*) +void LLFloaterUIPreview::onClickBrowseForDiffs() { // create load dialog box LLFilePicker::ELoadFilter type = (LLFilePicker::ELoadFilter)((intptr_t)((void*)LLFilePicker::FFLOAD_XML)); // nothing for *.exe so just use all @@ -1041,35 +1097,35 @@ void LLFloaterUIPreview::onClickBrowseForDiffs(void*) // put the selected path into text field const std::string chosen_path = picker.getFirstFile(); - sInstance->mDiffPathTextBox->setText(std::string(chosen_path)); // copy the path to the executable to the textfield for display and later fetching + mDiffPathTextBox->setText(std::string(chosen_path)); // copy the path to the executable to the textfield for display and later fetching if(LLView::sHighlightingDiffs) // if we're already highlighting, toggle off and then on so we get the data from the new file { - onClickToggleDiffHighlighting(NULL); - onClickToggleDiffHighlighting(NULL); + onClickToggleDiffHighlighting(); + onClickToggleDiffHighlighting(); } } -void LLFloaterUIPreview::onClickToggleDiffHighlighting(void*) +void LLFloaterUIPreview::onClickToggleDiffHighlighting() { - if(sInstance->mHighlightingOverlaps) + if(mHighlightingOverlaps) { - onClickToggleOverlapping(NULL); - sInstance->mToggleOverlapButton->toggleState(); + onClickToggleOverlapping(); + mToggleOverlapButton->toggleState(); } LLView::sPreviewHighlightedElements.clear(); // clear lists first - sInstance->mDiffsMap.clear(); - sInstance->mFileList->clearHighlightedItems(); + mDiffsMap.clear(); + mFileList->clearHighlightedItems(); if(LLView::sHighlightingDiffs) // Turning highlighting off { - LLView::sHighlightingDiffs = !sInstance->sHighlightingDiffs; + LLView::sHighlightingDiffs = !sHighlightingDiffs; return; } else // Turning highlighting on { // Get the file and make sure it exists - std::string path_in_textfield = sInstance->mDiffPathTextBox->getText(); // get file path + std::string path_in_textfield = mDiffPathTextBox->getText(); // get file path BOOL error = FALSE; if(std::string("") == path_in_textfield) // check for blank file @@ -1103,18 +1159,18 @@ void LLFloaterUIPreview::onClickToggleDiffHighlighting(void*) { if(!strncmp("file",child->getName().c_str(),5)) { - sInstance->scanDiffFile(child); + scanDiffFile(child); } else if(!strncmp("error",child->getName().c_str(),6)) { std::string error_file, error_message; child->getAttributeString("filename",error_file); child->getAttributeString("message",error_message); - if(sInstance->mDiffsMap.find(error_file) != sInstance->mDiffsMap.end()) + if(mDiffsMap.find(error_file) != mDiffsMap.end()) { - sInstance->mDiffsMap.insert(std::make_pair(error_file,std::make_pair(StringListPtr(new StringList), StringListPtr(new StringList)))); + mDiffsMap.insert(std::make_pair(error_file,std::make_pair(StringListPtr(new StringList), StringListPtr(new StringList)))); } - sInstance->mDiffsMap[error_file].second->push_back(error_message); + mDiffsMap[error_file].second->push_back(error_message); } else { @@ -1141,13 +1197,13 @@ void LLFloaterUIPreview::onClickToggleDiffHighlighting(void*) if(error) // if we encountered an error, reset the button to off { - sInstance->mToggleHighlightButton->setToggleState(FALSE); + mToggleHighlightButton->setToggleState(FALSE); } else // only toggle if we didn't encounter an error { - LLView::sHighlightingDiffs = !sInstance->sHighlightingDiffs; - sInstance->highlightChangedElements(); // *TODO: this is extraneous, right? - sInstance->highlightChangedFiles(); // *TODO: this is extraneous, right? + LLView::sHighlightingDiffs = !sHighlightingDiffs; + highlightChangedElements(); // *TODO: this is extraneous, right? + highlightChangedFiles(); // *TODO: this is extraneous, right? } } } @@ -1204,7 +1260,7 @@ void LLFloaterUIPreview::highlightChangedElements() for(std::list<std::string>::iterator iter = changed_element_paths->begin(); iter != changed_element_paths->end(); ++iter) // for every changed element path { - LLView* element = sInstance->mDisplayedFloater; + LLView* element = mDisplayedFloater; if(!strncmp(iter->c_str(),".",1)) // if it's the root floater itself { continue; @@ -1267,42 +1323,41 @@ void LLFloaterUIPreview::highlightChangedFiles() } // Respond to button click to browse for an executable with which to edit XML files -void LLFloaterUIPreview::onClickCloseDisplayedFloater(void* data) +void LLFloaterUIPreview::onClickCloseDisplayedFloater(S32 caller_id) { - S32 caller_id = *((S32*)data); - if(caller_id == 1) + if(caller_id == PRIMARY_FLOATER) { - sInstance->mCloseOtherButton->setEnabled(FALSE); - sInstance->mToggleOverlapButton->setEnabled(FALSE); + mCloseOtherButton->setEnabled(FALSE); + mToggleOverlapButton->setEnabled(FALSE); - if(sInstance->mDisplayedFloater) + if(mDisplayedFloater) { - sInstance->mLastDisplayedX = sInstance->mDisplayedFloater->calcScreenRect().mLeft; - sInstance->mLastDisplayedY = sInstance->mDisplayedFloater->calcScreenRect().mBottom; - delete sInstance->mDisplayedFloater; - sInstance->mDisplayedFloater = NULL; + mLastDisplayedX = mDisplayedFloater->calcScreenRect().mLeft; + mLastDisplayedY = mDisplayedFloater->calcScreenRect().mBottom; + delete mDisplayedFloater; + mDisplayedFloater = NULL; } - if(sInstance->mLiveFile) + if(mLiveFile) { - delete sInstance->mLiveFile; - sInstance->mLiveFile = NULL; + delete mLiveFile; + mLiveFile = NULL; } - if(sInstance->mToggleOverlapButton->getToggleState()) + if(mToggleOverlapButton->getToggleState()) { - sInstance->mToggleOverlapButton->toggleState(); - onClickToggleOverlapping(NULL); + mToggleOverlapButton->toggleState(); + onClickToggleOverlapping(); } LLView::sPreviewClickedElement = NULL; // stop overlapping elements panel from drawing - sInstance->mOverlapPanel->mLastClickedElement = NULL; + mOverlapPanel->mLastClickedElement = NULL; } else { - sInstance->mCloseOtherButton_2->setEnabled(FALSE); - delete sInstance->mDisplayedFloater_2; - sInstance->mDisplayedFloater_2 = NULL; + mCloseOtherButton_2->setEnabled(FALSE); + delete mDisplayedFloater_2; + mDisplayedFloater_2 = NULL; } } @@ -1358,47 +1413,47 @@ BOOL LLPreviewedFloater::selectElement(LLView* parent, int x, int y, int depth) void LLPreviewedFloater::draw() { - if(NULL != LLFloaterUIPreview::sInstance) + if(NULL != mFloaterUIPreview) { // Set and unset sDrawPreviewHighlights flag so as to avoid using two flags - if(LLFloaterUIPreview::sInstance->mHighlightingOverlaps) + if(mFloaterUIPreview->mHighlightingOverlaps) { LLView::sDrawPreviewHighlights = TRUE; } LLFloater::draw(); - if(LLFloaterUIPreview::sInstance->mHighlightingOverlaps) + if(mFloaterUIPreview->mHighlightingOverlaps) { LLView::sDrawPreviewHighlights = FALSE; } } } -void LLFloaterUIPreview::onClickToggleOverlapping(void*) +void LLFloaterUIPreview::onClickToggleOverlapping() { if(LLView::sHighlightingDiffs) { - onClickToggleDiffHighlighting(NULL); - sInstance->mToggleHighlightButton->toggleState(); + onClickToggleDiffHighlighting(); + mToggleHighlightButton->toggleState(); } LLView::sPreviewHighlightedElements.clear(); // clear lists first S32 width, height; - sInstance->getResizeLimits(&width, &height); // illegal call of non-static member function - if(sInstance->mHighlightingOverlaps) + getResizeLimits(&width, &height); // illegal call of non-static member function + if(mHighlightingOverlaps) { - sInstance->mHighlightingOverlaps = !sInstance->mHighlightingOverlaps; + mHighlightingOverlaps = !mHighlightingOverlaps; // reset list of preview highlighted elements - sInstance->setRect(LLRect(sInstance->getRect().mLeft,sInstance->getRect().mTop,sInstance->getRect().mRight - sInstance->mOverlapPanel->getRect().getWidth(),sInstance->getRect().mBottom)); - sInstance->setResizeLimits(width - sInstance->mOverlapPanel->getRect().getWidth(), height); + setRect(LLRect(getRect().mLeft,getRect().mTop,getRect().mRight - mOverlapPanel->getRect().getWidth(),getRect().mBottom)); + setResizeLimits(width - mOverlapPanel->getRect().getWidth(), height); } else { - sInstance->mHighlightingOverlaps = !sInstance->mHighlightingOverlaps; + mHighlightingOverlaps = !mHighlightingOverlaps; displayFloater(FALSE,1); - sInstance->setRect(LLRect(sInstance->getRect().mLeft,sInstance->getRect().mTop,sInstance->getRect().mRight + sInstance->mOverlapPanel->getRect().getWidth(),sInstance->getRect().mBottom)); - sInstance->setResizeLimits(width + sInstance->mOverlapPanel->getRect().getWidth(), height); + setRect(LLRect(getRect().mLeft,getRect().mTop,getRect().mRight + mOverlapPanel->getRect().getWidth(),getRect().mBottom)); + setResizeLimits(width + mOverlapPanel->getRect().getWidth(), height); } - sInstance->childSetVisible("overlap_scroll", sInstance->mHighlightingOverlaps); + childSetVisible("overlap_scroll", mHighlightingOverlaps); } void LLFloaterUIPreview::findOverlapsInChildren(LLView* parent) @@ -1429,7 +1484,7 @@ void LLFloaterUIPreview::findOverlapsInChildren(LLView* parent) // if they overlap... (we don't care if they're visible or enabled -- we want to check those anyway, i.e. hidden tabs that can be later shown) if(sibling != child && elementOverlap(child, sibling)) { - mOverlapMap[child].push_back(sibling); // add to the map + mOverlapPanel->mOverlapMap[child].push_back(sibling); // add to the map } } findOverlapsInChildren(child); // recur @@ -1481,13 +1536,13 @@ void LLOverlapPanel::draw() } else { - LLFloaterUIPreview::OverlapMap::iterator iterExists = LLFloaterUIPreview::sInstance->mOverlapMap.find(LLView::sPreviewClickedElement); - if(iterExists == LLFloaterUIPreview::sInstance->mOverlapMap.end()) + OverlapMap::iterator iterExists = mOverlapMap.find(LLView::sPreviewClickedElement); + if(iterExists == mOverlapMap.end()) { return; } - std::list<LLView*> overlappers = LLFloaterUIPreview::sInstance->mOverlapMap[LLView::sPreviewClickedElement]; + std::list<LLView*> overlappers = mOverlapMap[LLView::sPreviewClickedElement]; if(overlappers.size() == 0) { LLUI::translate(5,getRect().getHeight()-20); // translate to top-5,left-5 @@ -1518,15 +1573,15 @@ void LLOverlapPanel::draw() if(need_to_recalculate_bounds || LLView::sPreviewClickedElement->getName() != mLastClickedElement->getName()) { // reset panel's rectangle to its default width and height (300x600) - LLRect panel_rect = LLFloaterUIPreview::sInstance->mOverlapPanel->getRect(); - LLFloaterUIPreview::sInstance->mOverlapPanel->setRect(LLRect(panel_rect.mLeft,panel_rect.mTop,panel_rect.mLeft+LLFloaterUIPreview::sInstance->mOverlapPanel->getRect().getWidth(),panel_rect.mTop-LLFloaterUIPreview::sInstance->mOverlapPanel->getRect().getHeight())); + LLRect panel_rect = getRect(); + setRect(LLRect(panel_rect.mLeft,panel_rect.mTop,panel_rect.mLeft+getRect().getWidth(),panel_rect.mTop-getRect().getHeight())); LLRect rect; // change bounds for selected element int height_sum = mLastClickedElement->getRect().getHeight() + mSpacing + 80; - rect = LLFloaterUIPreview::sInstance->mOverlapPanel->getRect(); - LLFloaterUIPreview::sInstance->mOverlapPanel->setRect(LLRect(rect.mLeft,rect.mTop,rect.getWidth() > mLastClickedElement->getRect().getWidth() + 5 ? rect.mRight : rect.mLeft + mLastClickedElement->getRect().getWidth() + 5, rect.mBottom)); + rect = getRect(); + setRect(LLRect(rect.mLeft,rect.mTop,rect.getWidth() > mLastClickedElement->getRect().getWidth() + 5 ? rect.mRight : rect.mLeft + mLastClickedElement->getRect().getWidth() + 5, rect.mBottom)); // and widen to accomodate text if that's wider std::string display_text = current_selection_text + LLView::sPreviewClickedElement->getName(); @@ -1534,15 +1589,15 @@ void LLOverlapPanel::draw() rect = getRect(); setRect(LLRect(rect.mLeft,rect.mTop,rect.getWidth() < text_width ? rect.mLeft + text_width : rect.mRight,rect.mTop)); - std::list<LLView*> overlappers = LLFloaterUIPreview::sInstance->mOverlapMap[LLView::sPreviewClickedElement]; + std::list<LLView*> overlappers = mOverlapMap[LLView::sPreviewClickedElement]; for(std::list<LLView*>::iterator overlap_it = overlappers.begin(); overlap_it != overlappers.end(); ++overlap_it) { LLView* viewp = *overlap_it; height_sum += viewp->getRect().getHeight() + mSpacing*3; // widen panel's rectangle to accommodate widest overlapping element of this floater - rect = LLFloaterUIPreview::sInstance->mOverlapPanel->getRect(); - LLFloaterUIPreview::sInstance->mOverlapPanel->setRect(LLRect(rect.mLeft,rect.mTop,rect.getWidth() > viewp->getRect().getWidth() + 5 ? rect.mRight : rect.mLeft + viewp->getRect().getWidth() + 5, rect.mBottom)); + rect = getRect(); + setRect(LLRect(rect.mLeft,rect.mTop,rect.getWidth() > viewp->getRect().getWidth() + 5 ? rect.mRight : rect.mLeft + viewp->getRect().getWidth() + 5, rect.mBottom)); // and widen to accomodate text if that's wider std::string display_text = overlapper_text + viewp->getName(); @@ -1551,8 +1606,8 @@ void LLOverlapPanel::draw() setRect(LLRect(rect.mLeft,rect.mTop,rect.getWidth() < text_width ? rect.mLeft + text_width : rect.mRight,rect.mTop)); } // change panel's height to accommodate all element heights plus spacing between them - rect = LLFloaterUIPreview::sInstance->mOverlapPanel->getRect(); - LLFloaterUIPreview::sInstance->mOverlapPanel->setRect(LLRect(rect.mLeft,rect.mTop,rect.mRight,rect.mTop-height_sum)); + rect = getRect(); + setRect(LLRect(rect.mLeft,rect.mTop,rect.mRight,rect.mTop-height_sum)); } LLUI::translate(5,getRect().getHeight()-10); // translate to top left diff --git a/indra/newview/llfloateruipreview.h b/indra/newview/llfloateruipreview.h index eca8c0a141..b8c378e2e9 100644 --- a/indra/newview/llfloateruipreview.h +++ b/indra/newview/llfloateruipreview.h @@ -54,57 +54,10 @@ class LLXmlTreeNode; class LLFloaterUIPreview; class LLFadeEventTimer; -// Reset object to ensure that when we change the current language setting for preview purposes, -// it automatically is reset. Constructed on the stack at the start of the method; the reset -// occurs as it falls out of scope at the end of the method. See llfloateruipreview.cpp for usage. -class LLLocalizationResetForcer -{ -public: - LLLocalizationResetForcer(S32 ID); - virtual ~LLLocalizationResetForcer(); - -private: - std::string mSavedLocalization; // the localization before we change it -}; - -// Implementation of live file -// When a floater is being previewed, any saved changes to its corresponding -// file cause the previewed floater to be reloaded -class LLGUIPreviewLiveFile : public LLLiveFile -{ -public: - LLGUIPreviewLiveFile(std::string path, std::string name, LLFloaterUIPreview* parent); - virtual ~LLGUIPreviewLiveFile(); - LLFloaterUIPreview* mParent; - LLFadeEventTimer* mFadeTimer; // timer for fade-to-yellow-and-back effect to warn that file has been reloaded - BOOL mFirstFade; // setting this avoids showing the fade reload warning on first load - std::string mFileName; -protected: - bool loadFile(); -}; - -// Implementation of graphical fade in/out (on timer) for when XUI files are updated -class LLFadeEventTimer : public LLEventTimer -{ -public: - LLFadeEventTimer(F32 refresh, LLGUIPreviewLiveFile* parent); - BOOL tick(); - LLGUIPreviewLiveFile* mParent; -private: - BOOL mFadingOut; // fades in then out; this is toggled in between - LLColor4 mOriginalColor; // original color; color is reset to this after fade is coimplete -}; - -// Implementation of previewed floater -// Used to override draw and mouse handler -class LLPreviewedFloater : public LLFloater -{ -public: - LLPreviewedFloater() : LLFloater() {} - virtual void draw(); - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - BOOL selectElement(LLView* parent, int x, int y, int depth); // select element to display its overlappers -}; +class LLLocalizationResetForcer; +class LLGUIPreviewLiveFile; +class LLFadeEventTimer; +class LLPreviewedFloater; // Implementation of custom overlapping element display panel class LLOverlapPanel : public LLPanel @@ -123,11 +76,16 @@ public: mOriginalHeight = getRect().getHeight(); } virtual void draw(); + + typedef std::map<LLView*, std::list<LLView*> > OverlapMap; + OverlapMap mOverlapMap; // map, of XUI element to a list of XUI elements it overlaps + // LLView *mClickedElement; LLView *mLastClickedElement; int mOriginalWidth, mOriginalHeight, mSpacing; }; + class LLFloaterUIPreview : public LLFloater { public: @@ -135,15 +93,16 @@ public: LLFloaterUIPreview(const LLSD& key); virtual ~LLFloaterUIPreview(); - static std::string getLocStr(S32 ID); // fetches the localization string based on what is selected in the drop-down menu - static void displayFloater(BOOL click, S32 ID, bool save = false); // needs to be public so live file can call it when it finds an update - static BOOL containerType(LLView* viewp); // check if the element is a container type and tree traverses need to look at its children - static LLFloaterUIPreview* sInstance; // static instance of this (for references in handlers) + std::string getLocStr(S32 ID); // fetches the localization string based on what is selected in the drop-down menu + void displayFloater(BOOL click, S32 ID, bool save = false); // needs to be public so live file can call it when it finds an update BOOL postBuild(); // post-build setup (called by superclass' constructor) void refreshList(); // refresh list (empty it out and fill it up from scratch) void addFloaterEntry(const std::string& path); // add a single file's entry to the list of floaters - + + static BOOL containerType(LLView* viewp); // check if the element is a container type and tree traverses need to look at its children + +public: LLPreviewedFloater* mDisplayedFloater; // the floater which is currently being displayed LLPreviewedFloater* mDisplayedFloater_2; // the floater which is currently being displayed LLGUIPreviewLiveFile* mLiveFile; // live file for checking for updates to the currently-displayed XML file @@ -151,9 +110,6 @@ public: // BOOL mHighlightingDiffs; // bool for whether localization diffs are being highlighted or not BOOL mHighlightingOverlaps; // bool for whether overlapping elements are being highlighted - typedef std::map<LLView*, std::list<LLView*> > OverlapMap; - OverlapMap mOverlapMap; // map, of XUI element to a list of XUI elements it overlaps - // typedef std::map<std::string,std::pair<std::list<std::string>,std::list<std::string> > > DiffMap; // this version copies the lists etc., and thus is bad memory-wise typedef std::list<std::string> StringList; typedef boost::shared_ptr<StringList> StringListPtr; @@ -161,7 +117,7 @@ public: DiffMap mDiffsMap; // map, of filename to pair of list of changed element paths and list of errors protected: - virtual void onClose(bool app_quitting); + void onClose(const LLSD& app_quitting); private: // XUI elements for this floater @@ -174,19 +130,19 @@ private: LLButton* mEditFloaterBtn; // button to edit floater LLButton* mExecutableBrowseButton; // button to browse for executable LLButton* mCloseOtherButton; // button to close primary displayed floater - LLButton* mCloseOtherButton_2; // button to close secondary displayed floater + LLButton* mCloseOtherButton_2; // button to close secondary displayed floater LLButton* mDiffBrowseButton; // button to browse for diff file LLButton* mToggleHighlightButton; // button to toggle highlight of files/elements with diffs LLButton* mToggleOverlapButton; // button to togle overlap panel/highlighting LLComboBox* mLanguageSelection; // combo box for primary language selection LLComboBox* mLanguageSelection_2; // combo box for secondary language selection - LLScrollContainer* mOverlapScrollView; // overlapping elements scroll container + LLScrollContainer* mOverlapScrollView; // overlapping elements scroll container S32 mLastDisplayedX, mLastDisplayedY; // stored position of last floater so the new one opens up in the same place - std::string mDelim; // the OS-specific delimiter character (/ or \) (*TODO: this shouldn't be needed, right?) + std::string mDelim; // the OS-specific delimiter character (/ or \) (*TODO: this shouldn't be needed, right?) - static std::string mSavedEditorPath; // stored editor path so closing this floater doesn't reset it - static std::string mSavedEditorArgs; // stored editor args so closing this floater doesn't reset it - static std::string mSavedDiffPath; // stored diff file path so closing this floater doesn't reset it + std::string mSavedEditorPath; // stored editor path so closing this floater doesn't reset it + std::string mSavedEditorArgs; // stored editor args so closing this floater doesn't reset it + std::string mSavedDiffPath; // stored diff file path so closing this floater doesn't reset it // Internal functionality static void popupAndPrintWarning(std::string& warning); // pop up a warning @@ -202,15 +158,15 @@ private: BOOL elementOverlap(LLView* view1, LLView* view2); // Button/drop-down action listeners (self explanatory) - static void onClickDisplayFloater(void*); - static void onClickSaveFloater(void*); - static void onClickSaveAll(void*); - static void onClickEditFloater(void*); - static void onClickBrowseForEditor(void*); - static void onClickBrowseForDiffs(void*); - static void onClickToggleDiffHighlighting(void*); - static void onClickToggleOverlapping(void*); - static void onClickCloseDisplayedFloater(void*); + void onClickDisplayFloater(S32 id); + void onClickSaveFloater(S32 id); + void onClickSaveAll(S32 id); + void onClickEditFloater(); + void onClickBrowseForEditor(); + void onClickBrowseForDiffs(); + void onClickToggleDiffHighlighting(); + void onClickToggleOverlapping(); + void onClickCloseDisplayedFloater(S32 id); void onLanguageComboSelect(LLUICtrl* ctrl); void onClickExportSchema(); }; diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 1f59812029..2ad41291f3 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -86,10 +86,10 @@ public: // LLFloaterURLEntry() //----------------------------------------------------------------------------- LLFloaterURLEntry::LLFloaterURLEntry(LLHandle<LLPanel> parent) - : LLFloater(), + : LLFloater(LLSD()), mPanelLandMediaHandle(parent) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_url_entry.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_url_entry.xml", NULL); } //----------------------------------------------------------------------------- diff --git a/indra/newview/llfloatervoicedevicesettings.cpp b/indra/newview/llfloatervoicedevicesettings.cpp index 0cbeaa591d..fa76bb728d 100644 --- a/indra/newview/llfloatervoicedevicesettings.cpp +++ b/indra/newview/llfloatervoicedevicesettings.cpp @@ -294,6 +294,8 @@ LLFloaterVoiceDeviceSettings::LLFloaterVoiceDeviceSettings(const LLSD& seed) } BOOL LLFloaterVoiceDeviceSettings::postBuild() { + mCloseSignal.connect(boost::bind(&LLFloaterVoiceDeviceSettings::onClose, this)); + center(); return TRUE; } @@ -305,14 +307,12 @@ void LLFloaterVoiceDeviceSettings::onOpen(const LLSD& key) } } -void LLFloaterVoiceDeviceSettings::onClose(bool app_quitting) +void LLFloaterVoiceDeviceSettings::onClose() { if(mDevicePanel) { mDevicePanel->cleanup(); } - - setVisible(FALSE); } void LLFloaterVoiceDeviceSettings::apply() diff --git a/indra/newview/llfloatervoicedevicesettings.h b/indra/newview/llfloatervoicedevicesettings.h index ed8840a9f9..2565bfad2b 100644 --- a/indra/newview/llfloatervoicedevicesettings.h +++ b/indra/newview/llfloatervoicedevicesettings.h @@ -70,7 +70,6 @@ public: virtual BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void draw(); void apply(); void cancel(); @@ -79,7 +78,10 @@ private: protected: static void* createPanelVoiceDeviceSettings(void* user_data); - + + void onClose(); + +protected: LLPanelVoiceDeviceSettings* mDevicePanel; }; diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp index 5b551af836..72c82c178b 100644 --- a/indra/newview/llfloaterwater.cpp +++ b/indra/newview/llfloaterwater.cpp @@ -37,6 +37,7 @@ #include "pipeline.h" #include "llsky.h" +#include "llfloaterreg.h" #include "llsliderctrl.h" #include "llspinctrl.h" #include "llcolorswatch.h" @@ -62,15 +63,19 @@ #undef max -LLFloaterWater* LLFloaterWater::sWaterMenu = NULL; - std::set<std::string> LLFloaterWater::sDefaultPresets; -LLFloaterWater::LLFloaterWater() - : LLFloater() +LLFloaterWater::LLFloaterWater(const LLSD& key) + : LLFloater(key) +{ + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml"); +} + +LLFloaterWater::~LLFloaterWater() +{ +} +BOOL LLFloaterWater::postBuild() { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml"); - std::string def_water = getString("WLDefaultWaterNames"); @@ -82,15 +87,7 @@ LLFloaterWater::LLFloaterWater() std::string tok(*token_iter); sDefaultPresets.insert(tok); } - - -} - -LLFloaterWater::~LLFloaterWater() -{ -} -BOOL LLFloaterWater::postBuild() -{ + // add the combo boxes LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); @@ -108,6 +105,7 @@ BOOL LLFloaterWater::postBuild() } // load it up initCallbacks(); + syncMenu(); return TRUE; } void LLFloaterWater::initCallbacks(void) { @@ -131,63 +129,58 @@ void LLFloaterWater::initCallbacks(void) { LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); - childSetCommitCallback("WaterFogColor", onWaterFogColorMoved, ¶m_mgr->mFogColor); + getChild<LLUICtrl>("WaterFogColor")->setCommitCallback(boost::bind(&LLFloaterWater::onWaterFogColorMoved, this, _1, ¶m_mgr->mFogColor)); // - childSetCommitCallback("WaterGlow", onColorControlAMoved, ¶m_mgr->mFogColor); + getChild<LLUICtrl>("WaterGlow")->setCommitCallback(boost::bind(&LLFloaterWater::onColorControlAMoved, this, _1, ¶m_mgr->mFogColor)); // fog density - childSetCommitCallback("WaterFogDensity", onExpFloatControlMoved, ¶m_mgr->mFogDensity); - childSetCommitCallback("WaterUnderWaterFogMod", onFloatControlMoved, ¶m_mgr->mUnderWaterFogMod); + getChild<LLUICtrl>("WaterFogDensity")->setCommitCallback(boost::bind(&LLFloaterWater::onExpFloatControlMoved, this, _1, ¶m_mgr->mFogDensity)); + getChild<LLUICtrl>("WaterUnderWaterFogMod")->setCommitCallback(boost::bind(&LLFloaterWater::onFloatControlMoved, this, _1, ¶m_mgr->mUnderWaterFogMod)); // blue density - childSetCommitCallback("WaterNormalScaleX", onVector3ControlXMoved, ¶m_mgr->mNormalScale); - childSetCommitCallback("WaterNormalScaleY", onVector3ControlYMoved, ¶m_mgr->mNormalScale); - childSetCommitCallback("WaterNormalScaleZ", onVector3ControlZMoved, ¶m_mgr->mNormalScale); + getChild<LLUICtrl>("WaterNormalScaleX")->setCommitCallback(boost::bind(&LLFloaterWater::onVector3ControlXMoved, this, _1, ¶m_mgr->mNormalScale)); + getChild<LLUICtrl>("WaterNormalScaleY")->setCommitCallback(boost::bind(&LLFloaterWater::onVector3ControlYMoved, this, _1, ¶m_mgr->mNormalScale)); + getChild<LLUICtrl>("WaterNormalScaleZ")->setCommitCallback(boost::bind(&LLFloaterWater::onVector3ControlZMoved, this, _1, ¶m_mgr->mNormalScale)); // fresnel - childSetCommitCallback("WaterFresnelScale", onFloatControlMoved, ¶m_mgr->mFresnelScale); - childSetCommitCallback("WaterFresnelOffset", onFloatControlMoved, ¶m_mgr->mFresnelOffset); + getChild<LLUICtrl>("WaterFresnelScale")->setCommitCallback(boost::bind(&LLFloaterWater::onFloatControlMoved, this, _1, ¶m_mgr->mFresnelScale)); + getChild<LLUICtrl>("WaterFresnelOffset")->setCommitCallback(boost::bind(&LLFloaterWater::onFloatControlMoved, this, _1, ¶m_mgr->mFresnelOffset)); // scale above/below - childSetCommitCallback("WaterScaleAbove", onFloatControlMoved, ¶m_mgr->mScaleAbove); - childSetCommitCallback("WaterScaleBelow", onFloatControlMoved, ¶m_mgr->mScaleBelow); + getChild<LLUICtrl>("WaterScaleAbove")->setCommitCallback(boost::bind(&LLFloaterWater::onFloatControlMoved, this, _1, ¶m_mgr->mScaleAbove)); + getChild<LLUICtrl>("WaterScaleBelow")->setCommitCallback(boost::bind(&LLFloaterWater::onFloatControlMoved, this, _1, ¶m_mgr->mScaleBelow)); // blur mult - childSetCommitCallback("WaterBlurMult", onFloatControlMoved, ¶m_mgr->mBlurMultiplier); + getChild<LLUICtrl>("WaterBlurMult")->setCommitCallback(boost::bind(&LLFloaterWater::onFloatControlMoved, this, _1, ¶m_mgr->mBlurMultiplier)); // Load/save - LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); - - //childSetAction("WaterLoadPreset", onLoadPreset, comboBox); - childSetAction("WaterNewPreset", onNewPreset, comboBox); - childSetAction("WaterSavePreset", onSavePreset, comboBox); - childSetAction("WaterDeletePreset", onDeletePreset, comboBox); +// getChild<LLUICtrl>("WaterLoadPreset")->setCommitCallback(boost::bind(&LLFloaterWater::onLoadPreset, this)); + getChild<LLUICtrl>("WaterNewPreset")->setCommitCallback(boost::bind(&LLFloaterWater::onNewPreset, this)); + getChild<LLUICtrl>("WaterSavePreset")->setCommitCallback(boost::bind(&LLFloaterWater::onSavePreset, this)); + getChild<LLUICtrl>("WaterDeletePreset")->setCommitCallback(boost::bind(&LLFloaterWater::onDeletePreset, this)); // wave direction - childSetCommitCallback("WaterWave1DirX", onVector2ControlXMoved, ¶m_mgr->mWave1Dir); - childSetCommitCallback("WaterWave1DirY", onVector2ControlYMoved, ¶m_mgr->mWave1Dir); - childSetCommitCallback("WaterWave2DirX", onVector2ControlXMoved, ¶m_mgr->mWave2Dir); - childSetCommitCallback("WaterWave2DirY", onVector2ControlYMoved, ¶m_mgr->mWave2Dir); + getChild<LLUICtrl>("WaterWave1DirX")->setCommitCallback(boost::bind(&LLFloaterWater::onVector2ControlXMoved, this, _1, ¶m_mgr->mWave1Dir)); + getChild<LLUICtrl>("WaterWave1DirY")->setCommitCallback(boost::bind(&LLFloaterWater::onVector2ControlYMoved, this, _1, ¶m_mgr->mWave1Dir)); + getChild<LLUICtrl>("WaterWave2DirX")->setCommitCallback(boost::bind(&LLFloaterWater::onVector2ControlXMoved, this, _1, ¶m_mgr->mWave2Dir)); + getChild<LLUICtrl>("WaterWave2DirY")->setCommitCallback(boost::bind(&LLFloaterWater::onVector2ControlYMoved, this, _1, ¶m_mgr->mWave2Dir)); - comboBox->setCommitCallback(boost::bind(&LLFloaterWater::onChangePresetName, this, _1)); + getChild<LLUICtrl>("WaterPresetsCombo")->setCommitCallback(boost::bind(&LLFloaterWater::onChangePresetName, this, _1)); LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap"); textCtrl->setDefaultImageAssetID(DEFAULT_WATER_NORMAL); - childSetCommitCallback("WaterNormalMap", onNormalMapPicked, NULL); + getChild<LLUICtrl>("WaterNormalMap")->setCommitCallback(boost::bind(&LLFloaterWater::onNormalMapPicked, this, _1)); } -void LLFloaterWater::onClickHelp(void* data) +void LLFloaterWater::onClickHelp(std::string xml_alert) { - LLFloaterWater* self = LLFloaterWater::instance(); - - const std::string* xml_alert = (std::string*)data; - LLNotifications::instance().add(self->contextualNotification(*xml_alert)); + LLNotifications::instance().add(contextualNotification(xml_alert)); } void LLFloaterWater::initHelpBtn(const std::string& name, const std::string& xml_alert) { - childSetAction(name, onClickHelp, new std::string(xml_alert)); + getChild<LLButton>(name)->setClickedCallback(boost::bind(&LLFloaterWater::onClickHelp, this, xml_alert)); } bool LLFloaterWater::newPromptCallback(const LLSD& notification, const LLSD& response) @@ -201,7 +194,7 @@ bool LLFloaterWater::newPromptCallback(const LLSD& notification, const LLSD& res } if(option == 0) { - LLComboBox* comboBox = sWaterMenu->getChild<LLComboBox>( "WaterPresetsCombo"); + LLComboBox* comboBox = getChild<LLComboBox>( "WaterPresetsCombo"); LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); @@ -245,7 +238,7 @@ void LLFloaterWater::syncMenu() LLColor4 col = param_mgr->getFogColor(); childSetValue("WaterGlow", col.mV[3]); col.mV[3] = 1.0f; - LLColorSwatchCtrl* colCtrl = sWaterMenu->getChild<LLColorSwatchCtrl>("WaterFogColor"); + LLColorSwatchCtrl* colCtrl = getChild<LLColorSwatchCtrl>("WaterFogColor"); colCtrl->set(col); @@ -290,56 +283,15 @@ void LLFloaterWater::syncMenu() childSetValue("WaterWave2DirX", param_mgr->mWave2Dir.mX); childSetValue("WaterWave2DirY", param_mgr->mWave2Dir.mY); - LLTextureCtrl* textCtrl = sWaterMenu->getChild<LLTextureCtrl>("WaterNormalMap"); + LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap"); textCtrl->setImageAssetID(param_mgr->getNormalMapID()); } -// static -LLFloaterWater* LLFloaterWater::instance() -{ - if (!sWaterMenu) - { - sWaterMenu = new LLFloaterWater(); - sWaterMenu->openFloater(); - sWaterMenu->setFocus(TRUE); - } - return sWaterMenu; -} -void LLFloaterWater::show() -{ - LLFloaterWater* water = instance(); - water->syncMenu(); - - // comment in if you want the menu to rebuild each time - //LLUICtrlFactory::getInstance()->buildFloater(water, "floater_water.xml"); - //water->initCallbacks(); - - water->openFloater(); -} - -bool LLFloaterWater::isOpen() -{ - if (sWaterMenu != NULL) { - return true; - } - return false; -} - -// virtual -void LLFloaterWater::onClose(bool app_quitting) -{ - if (sWaterMenu) - { - sWaterMenu->setVisible(FALSE); - } -} - // vector control callbacks -void LLFloaterWater::onVector3ControlXMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onVector3ControlXMoved(LLUICtrl* ctrl, WaterVector3Control* vectorControl) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WaterVector3Control * vectorControl = static_cast<WaterVector3Control *>(userData); vectorControl->mX = sldrCtrl->getValueF32(); @@ -349,10 +301,9 @@ void LLFloaterWater::onVector3ControlXMoved(LLUICtrl* ctrl, void* userData) } // vector control callbacks -void LLFloaterWater::onVector3ControlYMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onVector3ControlYMoved(LLUICtrl* ctrl, WaterVector3Control* vectorControl) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WaterVector3Control * vectorControl = static_cast<WaterVector3Control *>(userData); vectorControl->mY = sldrCtrl->getValueF32(); @@ -362,10 +313,9 @@ void LLFloaterWater::onVector3ControlYMoved(LLUICtrl* ctrl, void* userData) } // vector control callbacks -void LLFloaterWater::onVector3ControlZMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onVector3ControlZMoved(LLUICtrl* ctrl, WaterVector3Control* vectorControl) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WaterVector3Control * vectorControl = static_cast<WaterVector3Control *>(userData); vectorControl->mZ = sldrCtrl->getValueF32(); @@ -376,10 +326,9 @@ void LLFloaterWater::onVector3ControlZMoved(LLUICtrl* ctrl, void* userData) // vector control callbacks -void LLFloaterWater::onVector2ControlXMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onVector2ControlXMoved(LLUICtrl* ctrl, WaterVector2Control* vectorControl) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WaterVector2Control * vectorControl = static_cast<WaterVector2Control *>(userData); vectorControl->mX = sldrCtrl->getValueF32(); @@ -389,10 +338,9 @@ void LLFloaterWater::onVector2ControlXMoved(LLUICtrl* ctrl, void* userData) } // vector control callbacks -void LLFloaterWater::onVector2ControlYMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onVector2ControlYMoved(LLUICtrl* ctrl, WaterVector2Control* vectorControl) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WaterVector2Control * vectorControl = static_cast<WaterVector2Control *>(userData); vectorControl->mY = sldrCtrl->getValueF32(); @@ -402,10 +350,9 @@ void LLFloaterWater::onVector2ControlYMoved(LLUICtrl* ctrl, void* userData) } // color control callbacks -void LLFloaterWater::onColorControlRMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onColorControlRMoved(LLUICtrl* ctrl, WaterColorControl* colorControl) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); colorControl->mR = sldrCtrl->getValueF32(); @@ -418,7 +365,7 @@ void LLFloaterWater::onColorControlRMoved(LLUICtrl* ctrl, void* userData) std::string name = colorControl->mSliderName; name.append("I"); - sWaterMenu->childSetValue(name, colorControl->mR); + childSetValue(name, colorControl->mR); } colorControl->update(LLWaterParamManager::instance()->mCurParams); @@ -426,10 +373,9 @@ void LLFloaterWater::onColorControlRMoved(LLUICtrl* ctrl, void* userData) LLWaterParamManager::instance()->propagateParameters(); } -void LLFloaterWater::onColorControlGMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onColorControlGMoved(LLUICtrl* ctrl, WaterColorControl* colorControl) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); colorControl->mG = sldrCtrl->getValueF32(); @@ -442,7 +388,7 @@ void LLFloaterWater::onColorControlGMoved(LLUICtrl* ctrl, void* userData) std::string name = colorControl->mSliderName; name.append("I"); - sWaterMenu->childSetValue(name, colorControl->mG); + childSetValue(name, colorControl->mG); } @@ -451,10 +397,9 @@ void LLFloaterWater::onColorControlGMoved(LLUICtrl* ctrl, void* userData) LLWaterParamManager::instance()->propagateParameters(); } -void LLFloaterWater::onColorControlBMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onColorControlBMoved(LLUICtrl* ctrl, WaterColorControl* colorControl) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); colorControl->mB = sldrCtrl->getValueF32(); @@ -467,7 +412,7 @@ void LLFloaterWater::onColorControlBMoved(LLUICtrl* ctrl, void* userData) std::string name = colorControl->mSliderName; name.append("I"); - sWaterMenu->childSetValue(name, colorControl->mB); + childSetValue(name, colorControl->mB); } colorControl->update(LLWaterParamManager::instance()->mCurParams); @@ -475,10 +420,9 @@ void LLFloaterWater::onColorControlBMoved(LLUICtrl* ctrl, void* userData) LLWaterParamManager::instance()->propagateParameters(); } -void LLFloaterWater::onColorControlAMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onColorControlAMoved(LLUICtrl* ctrl, WaterColorControl* colorControl) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); colorControl->mA = sldrCtrl->getValueF32(); @@ -488,10 +432,9 @@ void LLFloaterWater::onColorControlAMoved(LLUICtrl* ctrl, void* userData) } -void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, WaterColorControl* colorControl) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); colorControl->mI = sldrCtrl->getValueF32(); @@ -538,9 +481,9 @@ void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, void* userData) } // set the sliders to the new vals - sWaterMenu->childSetValue(rName, colorControl->mR); - sWaterMenu->childSetValue(gName, colorControl->mG); - sWaterMenu->childSetValue(bName, colorControl->mB); + childSetValue(rName, colorControl->mR); + childSetValue(gName, colorControl->mG); + childSetValue(bName, colorControl->mB); } // now update the current parameters and send them to shaders @@ -548,10 +491,9 @@ void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, void* userData) LLWaterParamManager::instance()->propagateParameters(); } -void LLFloaterWater::onExpFloatControlMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onExpFloatControlMoved(LLUICtrl* ctrl, WaterExpFloatControl* expFloatControl) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WaterExpFloatControl * expFloatControl = static_cast<WaterExpFloatControl *>(userData); F32 val = sldrCtrl->getValueF32(); expFloatControl->mExp = val; @@ -561,50 +503,40 @@ void LLFloaterWater::onExpFloatControlMoved(LLUICtrl* ctrl, void* userData) LLWaterParamManager::instance()->propagateParameters(); } -void LLFloaterWater::onFloatControlMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onFloatControlMoved(LLUICtrl* ctrl, WaterFloatControl* floatControl) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WaterFloatControl * floatControl = static_cast<WaterFloatControl *>(userData); floatControl->mX = sldrCtrl->getValueF32() / floatControl->mMult; floatControl->update(LLWaterParamManager::instance()->mCurParams); LLWaterParamManager::instance()->propagateParameters(); } -void LLFloaterWater::onWaterFogColorMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onWaterFogColorMoved(LLUICtrl* ctrl, WaterColorControl* colorControl) { LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl); - WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); *colorControl = swatch->get(); colorControl->update(LLWaterParamManager::instance()->mCurParams); LLWaterParamManager::instance()->propagateParameters(); } -void LLFloaterWater::onBoolToggle(LLUICtrl* ctrl, void* userData) -{ - LLCheckBoxCtrl* cbCtrl = static_cast<LLCheckBoxCtrl*>(ctrl); - - bool value = cbCtrl->get(); - (*(static_cast<BOOL *>(userData))) = value; -} - -void LLFloaterWater::onNormalMapPicked(LLUICtrl* ctrl, void* userData) +void LLFloaterWater::onNormalMapPicked(LLUICtrl* ctrl) { LLTextureCtrl* textCtrl = static_cast<LLTextureCtrl*>(ctrl); LLUUID textID = textCtrl->getImageAssetID(); LLWaterParamManager::instance()->setNormalMapID(textID); } -void LLFloaterWater::onNewPreset(void* userData) +void LLFloaterWater::onNewPreset() { - LLNotifications::instance().add("NewWaterPreset", LLSD(), LLSD(), newPromptCallback); + LLNotifications::instance().add("NewWaterPreset", LLSD(), LLSD(), boost::bind(&LLFloaterWater::newPromptCallback, this, _1, _2)); } -void LLFloaterWater::onSavePreset(void* userData) +void LLFloaterWater::onSavePreset() { // get the name - LLComboBox* comboBox = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo"); + LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); // don't save the empty name if(comboBox->getSelectedItemLabel() == "") @@ -624,7 +556,7 @@ void LLFloaterWater::onSavePreset(void* userData) return; } - LLNotifications::instance().add("WLSavePresetAlert", LLSD(), LLSD(), saveAlertCallback); + LLNotifications::instance().add("WLSavePresetAlert", LLSD(), LLSD(), boost::bind(&LLFloaterWater::saveAlertCallback, this, _1, _2)); } bool LLFloaterWater::saveAlertCallback(const LLSD& notification, const LLSD& response) @@ -645,9 +577,9 @@ bool LLFloaterWater::saveAlertCallback(const LLSD& notification, const LLSD& res return false; } -void LLFloaterWater::onDeletePreset(void* userData) +void LLFloaterWater::onDeletePreset() { - LLComboBox* combo_box = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo"); + LLComboBox* combo_box = getChild<LLComboBox>("WaterPresetsCombo"); if(combo_box->getSelectedValue().asString() == "") { @@ -656,7 +588,7 @@ void LLFloaterWater::onDeletePreset(void* userData) LLSD args; args["SKY"] = combo_box->getSelectedValue().asString(); - LLNotifications::instance().add("WLDeletePresetAlert", args, LLSD(), deleteAlertCallback); + LLNotifications::instance().add("WLDeletePresetAlert", args, LLSD(), boost::bind(&LLFloaterWater::deleteAlertCallback, this, _1, _2)); } bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& response) @@ -665,14 +597,13 @@ bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& r // if they choose delete, do it. Otherwise, don't do anything if(option == 0) { - LLComboBox* combo_box = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo"); - LLFloaterDayCycle* day_cycle = NULL; + LLComboBox* combo_box = getChild<LLComboBox>("WaterPresetsCombo"); + LLFloaterDayCycle* day_cycle = LLFloaterReg::findTypedInstance<LLFloaterDayCycle>("env_day_cycle"); LLComboBox* key_combo = NULL; LLMultiSliderCtrl* mult_sldr = NULL; - if(LLFloaterDayCycle::isOpen()) + if (day_cycle) { - day_cycle = LLFloaterDayCycle::instance(); key_combo = day_cycle->getChild<LLComboBox>("WaterKeyPresets"); mult_sldr = day_cycle->getChild<LLMultiSliderCtrl>("WaterDayCycleKeys"); } @@ -723,7 +654,7 @@ void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl) if(!data.empty()) { LLWaterParamManager::instance()->loadPreset(data); - sWaterMenu->syncMenu(); + syncMenu(); } } diff --git a/indra/newview/llfloaterwater.h b/indra/newview/llfloaterwater.h index 50fd7dd450..08c630c69e 100644 --- a/indra/newview/llfloaterwater.h +++ b/indra/newview/llfloaterwater.h @@ -42,91 +42,74 @@ #include <vector> #include "llwlparamset.h" +struct WaterVector2Control; +struct WaterVector3Control; struct WaterColorControl; -struct WaterloatControl; - +struct WaterFloatControl; +struct WaterExpFloatControl; /// Menuing system for all of windlight's functionality class LLFloaterWater : public LLFloater { public: - LLFloaterWater(); + LLFloaterWater(const LLSD& key); virtual ~LLFloaterWater(); /*virtual*/ BOOL postBuild(); /// initialize all void initCallbacks(void); - /// one and one instance only - static LLFloaterWater* instance(); - // help button stuff - static void onClickHelp(void* data); + void onClickHelp(std::string xml_alert); void initHelpBtn(const std::string& name, const std::string& xml_alert); - static bool newPromptCallback(const LLSD& notification, const LLSD& response); + bool newPromptCallback(const LLSD& notification, const LLSD& response); /// general purpose callbacks for dealing with color controllers - static void onColorControlRMoved(LLUICtrl* ctrl, void* userData); - static void onColorControlGMoved(LLUICtrl* ctrl, void* userData); - static void onColorControlBMoved(LLUICtrl* ctrl, void* userData); - static void onColorControlAMoved(LLUICtrl* ctrl, void* userData); - static void onColorControlIMoved(LLUICtrl* ctrl, void* userData); - - static void onVector3ControlXMoved(LLUICtrl* ctrl, void* userData); - static void onVector3ControlYMoved(LLUICtrl* ctrl, void* userData); - static void onVector3ControlZMoved(LLUICtrl* ctrl, void* userData); + void onColorControlRMoved(LLUICtrl* ctrl, WaterColorControl* colorControl); + void onColorControlGMoved(LLUICtrl* ctrl, WaterColorControl* colorControl); + void onColorControlBMoved(LLUICtrl* ctrl, WaterColorControl* colorControl); + void onColorControlAMoved(LLUICtrl* ctrl, WaterColorControl* colorControl); + void onColorControlIMoved(LLUICtrl* ctrl, WaterColorControl* colorControl); - static void onVector2ControlXMoved(LLUICtrl* ctrl, void* userData); - static void onVector2ControlYMoved(LLUICtrl* ctrl, void* userData); + void onVector3ControlXMoved(LLUICtrl* ctrl, WaterVector3Control* vectorControl); + void onVector3ControlYMoved(LLUICtrl* ctrl, WaterVector3Control* vectorControl); + void onVector3ControlZMoved(LLUICtrl* ctrl, WaterVector3Control* vectorControl); - static void onFloatControlMoved(LLUICtrl* ctrl, void* userData); + void onVector2ControlXMoved(LLUICtrl* ctrl, WaterVector2Control* vectorControl); + void onVector2ControlYMoved(LLUICtrl* ctrl, WaterVector2Control* vectorControl); + + void onFloatControlMoved(LLUICtrl* ctrl, WaterFloatControl* floatControl); - static void onExpFloatControlMoved(LLUICtrl* ctrl, void* userData); + void onExpFloatControlMoved(LLUICtrl* ctrl, WaterExpFloatControl* expFloatControl); - static void onWaterFogColorMoved(LLUICtrl* ctrl, void* userData); - - static void onBoolToggle(LLUICtrl* ctrl, void* userData); + void onWaterFogColorMoved(LLUICtrl* ctrl, WaterColorControl* colorControl); /// handle if they choose a new normal map - static void onNormalMapPicked(LLUICtrl* ctrl, void* userData); + void onNormalMapPicked(LLUICtrl* ctrl); /// when user hits the load preset button - static void onNewPreset(void* userData); + void onNewPreset(); /// when user hits the save preset button - static void onSavePreset(void* userData); + void onSavePreset(); /// prompts a user when overwriting a preset - static bool saveAlertCallback(const LLSD& notification, const LLSD& response); + bool saveAlertCallback(const LLSD& notification, const LLSD& response); /// when user hits the save preset button - static void onDeletePreset(void* userData); + void onDeletePreset(); /// prompts a user when overwriting a preset - static bool deleteAlertCallback(const LLSD& notification, const LLSD& response); + bool deleteAlertCallback(const LLSD& notification, const LLSD& response); /// what to do when you change the preset name void onChangePresetName(LLUICtrl* ctrl); - //// menu management - - /// show off our menu - static void show(); - - /// return if the menu exists or not - static bool isOpen(); - - /// stuff to do on exit - virtual void onClose(bool app_quitting); - /// sync up sliders with parameters void syncMenu(); private: - // one instance on the inside - static LLFloaterWater* sWaterMenu; - static std::set<std::string> sDefaultPresets; }; diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp index 2ba4002d94..18745284cb 100644 --- a/indra/newview/llfloaterwindlight.cpp +++ b/indra/newview/llfloaterwindlight.cpp @@ -37,6 +37,7 @@ #include "pipeline.h" #include "llsky.h" +#include "llfloaterreg.h" #include "llsliderctrl.h" #include "llmultislider.h" #include "llmultisliderctrl.h" @@ -61,19 +62,22 @@ #undef max -LLFloaterWindLight* LLFloaterWindLight::sWindLight = NULL; - std::set<std::string> LLFloaterWindLight::sDefaultPresets; static const F32 WL_SUN_AMBIENT_SLIDER_SCALE = 3.0f; -LLFloaterWindLight::LLFloaterWindLight() - : LLFloater() +LLFloaterWindLight::LLFloaterWindLight(const LLSD& key) + : LLFloater(key) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_windlight_options.xml"); - + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_windlight_options.xml"); +} +LLFloaterWindLight::~LLFloaterWindLight() +{ +} +BOOL LLFloaterWindLight::postBuild() +{ // add the list of presets std::string def_days = getString("WLDefaultSkyNames"); @@ -85,13 +89,7 @@ LLFloaterWindLight::LLFloaterWindLight() std::string tok(*token_iter); sDefaultPresets.insert(tok); } -} -LLFloaterWindLight::~LLFloaterWindLight() -{ -} -BOOL LLFloaterWindLight::postBuild() -{ // add the combo boxes LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo"); @@ -112,6 +110,9 @@ BOOL LLFloaterWindLight::postBuild() } // load it up initCallbacks(); + + syncMenu(); + return TRUE; } void LLFloaterWindLight::initCallbacks(void) { @@ -149,102 +150,99 @@ void LLFloaterWindLight::initCallbacks(void) { LLWLParamManager * param_mgr = LLWLParamManager::instance(); // blue horizon - childSetCommitCallback("WLBlueHorizonR", onColorControlRMoved, ¶m_mgr->mBlueHorizon); - childSetCommitCallback("WLBlueHorizonG", onColorControlGMoved, ¶m_mgr->mBlueHorizon); - childSetCommitCallback("WLBlueHorizonB", onColorControlBMoved, ¶m_mgr->mBlueHorizon); - childSetCommitCallback("WLBlueHorizonI", onColorControlIMoved, ¶m_mgr->mBlueHorizon); + getChild<LLUICtrl>("WLBlueHorizonR")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mBlueHorizon)); + getChild<LLUICtrl>("WLBlueHorizonG")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mBlueHorizon)); + getChild<LLUICtrl>("WLBlueHorizonB")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mBlueHorizon)); + getChild<LLUICtrl>("WLBlueHorizonI")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlIMoved, this, _1, ¶m_mgr->mBlueHorizon)); // haze density, horizon, mult, and altitude - childSetCommitCallback("WLHazeDensity", onColorControlRMoved, ¶m_mgr->mHazeDensity); - childSetCommitCallback("WLHazeHorizon", onColorControlRMoved, ¶m_mgr->mHazeHorizon); - childSetCommitCallback("WLDensityMult", onFloatControlMoved, ¶m_mgr->mDensityMult); - childSetCommitCallback("WLMaxAltitude", onFloatControlMoved, ¶m_mgr->mMaxAlt); + getChild<LLUICtrl>("WLHazeDensity")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mHazeDensity)); + getChild<LLUICtrl>("WLHazeHorizon")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mHazeHorizon)); + getChild<LLUICtrl>("WLDensityMult")->setCommitCallback(boost::bind(&LLFloaterWindLight::onFloatControlMoved, this, _1, ¶m_mgr->mDensityMult)); + getChild<LLUICtrl>("WLMaxAltitude")->setCommitCallback(boost::bind(&LLFloaterWindLight::onFloatControlMoved, this, _1, ¶m_mgr->mMaxAlt)); // blue density - childSetCommitCallback("WLBlueDensityR", onColorControlRMoved, ¶m_mgr->mBlueDensity); - childSetCommitCallback("WLBlueDensityG", onColorControlGMoved, ¶m_mgr->mBlueDensity); - childSetCommitCallback("WLBlueDensityB", onColorControlBMoved, ¶m_mgr->mBlueDensity); - childSetCommitCallback("WLBlueDensityI", onColorControlIMoved, ¶m_mgr->mBlueDensity); + getChild<LLUICtrl>("WLBlueDensityR")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mBlueDensity)); + getChild<LLUICtrl>("WLBlueDensityG")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mBlueDensity)); + getChild<LLUICtrl>("WLBlueDensityB")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mBlueDensity)); + getChild<LLUICtrl>("WLBlueDensityI")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlIMoved, this, _1, ¶m_mgr->mBlueDensity)); // Lighting // sunlight - childSetCommitCallback("WLSunlightR", onColorControlRMoved, ¶m_mgr->mSunlight); - childSetCommitCallback("WLSunlightG", onColorControlGMoved, ¶m_mgr->mSunlight); - childSetCommitCallback("WLSunlightB", onColorControlBMoved, ¶m_mgr->mSunlight); - childSetCommitCallback("WLSunlightI", onColorControlIMoved, ¶m_mgr->mSunlight); + getChild<LLUICtrl>("WLSunlightR")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mSunlight)); + getChild<LLUICtrl>("WLSunlightG")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mSunlight)); + getChild<LLUICtrl>("WLSunlightB")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mSunlight)); + getChild<LLUICtrl>("WLSunlightI")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlIMoved, this, _1, ¶m_mgr->mSunlight)); // glow - childSetCommitCallback("WLGlowR", onGlowRMoved, ¶m_mgr->mGlow); - childSetCommitCallback("WLGlowB", onGlowBMoved, ¶m_mgr->mGlow); + getChild<LLUICtrl>("WLGlowR")->setCommitCallback(boost::bind(&LLFloaterWindLight::onGlowRMoved, this, _1, ¶m_mgr->mGlow)); + getChild<LLUICtrl>("WLGlowB")->setCommitCallback(boost::bind(&LLFloaterWindLight::onGlowBMoved, this, _1, ¶m_mgr->mGlow)); // ambient - childSetCommitCallback("WLAmbientR", onColorControlRMoved, ¶m_mgr->mAmbient); - childSetCommitCallback("WLAmbientG", onColorControlGMoved, ¶m_mgr->mAmbient); - childSetCommitCallback("WLAmbientB", onColorControlBMoved, ¶m_mgr->mAmbient); - childSetCommitCallback("WLAmbientI", onColorControlIMoved, ¶m_mgr->mAmbient); + getChild<LLUICtrl>("WLAmbientR")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mAmbient)); + getChild<LLUICtrl>("WLAmbientG")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mAmbient)); + getChild<LLUICtrl>("WLAmbientB")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mAmbient)); + getChild<LLUICtrl>("WLAmbientI")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlIMoved, this, _1, ¶m_mgr->mAmbient)); // time of day - childSetCommitCallback("WLSunAngle", onSunMoved, ¶m_mgr->mLightnorm); - childSetCommitCallback("WLEastAngle", onSunMoved, ¶m_mgr->mLightnorm); + getChild<LLUICtrl>("WLSunAngle")->setCommitCallback(boost::bind(&LLFloaterWindLight::onSunMoved, this, _1, ¶m_mgr->mLightnorm)); + getChild<LLUICtrl>("WLEastAngle")->setCommitCallback(boost::bind(&LLFloaterWindLight::onSunMoved, this, _1, ¶m_mgr->mLightnorm)); // Clouds // Cloud Color - childSetCommitCallback("WLCloudColorR", onColorControlRMoved, ¶m_mgr->mCloudColor); - childSetCommitCallback("WLCloudColorG", onColorControlGMoved, ¶m_mgr->mCloudColor); - childSetCommitCallback("WLCloudColorB", onColorControlBMoved, ¶m_mgr->mCloudColor); - childSetCommitCallback("WLCloudColorI", onColorControlIMoved, ¶m_mgr->mCloudColor); + getChild<LLUICtrl>("WLCloudColorR")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mCloudColor)); + getChild<LLUICtrl>("WLCloudColorG")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mCloudColor)); + getChild<LLUICtrl>("WLCloudColorB")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mCloudColor)); + getChild<LLUICtrl>("WLCloudColorI")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlIMoved, this, _1, ¶m_mgr->mCloudColor)); // Cloud - childSetCommitCallback("WLCloudX", onColorControlRMoved, ¶m_mgr->mCloudMain); - childSetCommitCallback("WLCloudY", onColorControlGMoved, ¶m_mgr->mCloudMain); - childSetCommitCallback("WLCloudDensity", onColorControlBMoved, ¶m_mgr->mCloudMain); + getChild<LLUICtrl>("WLCloudX")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mCloudMain)); + getChild<LLUICtrl>("WLCloudY")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mCloudMain)); + getChild<LLUICtrl>("WLCloudDensity")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mCloudMain)); // Cloud Detail - childSetCommitCallback("WLCloudDetailX", onColorControlRMoved, ¶m_mgr->mCloudDetail); - childSetCommitCallback("WLCloudDetailY", onColorControlGMoved, ¶m_mgr->mCloudDetail); - childSetCommitCallback("WLCloudDetailDensity", onColorControlBMoved, ¶m_mgr->mCloudDetail); + getChild<LLUICtrl>("WLCloudDetailX")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mCloudDetail)); + getChild<LLUICtrl>("WLCloudDetailY")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mCloudDetail)); + getChild<LLUICtrl>("WLCloudDetailDensity")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mCloudDetail)); // Cloud extras - childSetCommitCallback("WLCloudCoverage", onFloatControlMoved, ¶m_mgr->mCloudCoverage); - childSetCommitCallback("WLCloudScale", onFloatControlMoved, ¶m_mgr->mCloudScale); - childSetCommitCallback("WLCloudLockX", onCloudScrollXToggled, NULL); - childSetCommitCallback("WLCloudLockY", onCloudScrollYToggled, NULL); - childSetCommitCallback("WLCloudScrollX", onCloudScrollXMoved, NULL); - childSetCommitCallback("WLCloudScrollY", onCloudScrollYMoved, NULL); - childSetCommitCallback("WLDistanceMult", onFloatControlMoved, ¶m_mgr->mDistanceMult); + getChild<LLUICtrl>("WLCloudCoverage")->setCommitCallback(boost::bind(&LLFloaterWindLight::onFloatControlMoved, this, _1, ¶m_mgr->mCloudCoverage)); + getChild<LLUICtrl>("WLCloudScale")->setCommitCallback(boost::bind(&LLFloaterWindLight::onFloatControlMoved, this, _1, ¶m_mgr->mCloudScale)); + getChild<LLUICtrl>("WLCloudLockX")->setCommitCallback(boost::bind(&LLFloaterWindLight::onCloudScrollXToggled, this, _1)); + getChild<LLUICtrl>("WLCloudLockY")->setCommitCallback(boost::bind(&LLFloaterWindLight::onCloudScrollYToggled, this, _1)); + getChild<LLUICtrl>("WLCloudScrollX")->setCommitCallback(boost::bind(&LLFloaterWindLight::onCloudScrollXMoved, this, _1)); + getChild<LLUICtrl>("WLCloudScrollY")->setCommitCallback(boost::bind(&LLFloaterWindLight::onCloudScrollYMoved, this, _1)); + getChild<LLUICtrl>("WLDistanceMult")->setCommitCallback(boost::bind(&LLFloaterWindLight::onFloatControlMoved, this, _1, ¶m_mgr->mDistanceMult)); getChild<LLUICtrl>("DrawClassicClouds")->setCommitCallback(boost::bind(LLSavedSettingsGlue::setBOOL, _1, "SkyUseClassicClouds")); // WL Top - childSetAction("WLDayCycleMenuButton", onOpenDayCycle, NULL); + getChild<LLUICtrl>("WLDayCycleMenuButton")->setCommitCallback(boost::bind(&LLFloaterWindLight::onOpenDayCycle, this)); // Load/save LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo"); //childSetAction("WLLoadPreset", onLoadPreset, comboBox); - childSetAction("WLNewPreset", onNewPreset, comboBox); - childSetAction("WLSavePreset", onSavePreset, comboBox); - childSetAction("WLDeletePreset", onDeletePreset, comboBox); + getChild<LLUICtrl>("WLNewPreset")->setCommitCallback(boost::bind(&LLFloaterWindLight::onNewPreset, this)); + getChild<LLUICtrl>("WLSavePreset")->setCommitCallback(boost::bind(&LLFloaterWindLight::onSavePreset, this)); + getChild<LLUICtrl>("WLDeletePreset")->setCommitCallback(boost::bind(&LLFloaterWindLight::onDeletePreset, this)); comboBox->setCommitCallback(boost::bind(&LLFloaterWindLight::onChangePresetName, this, _1)); // Dome - childSetCommitCallback("WLGamma", onFloatControlMoved, ¶m_mgr->mWLGamma); - childSetCommitCallback("WLStarAlpha", onStarAlphaMoved, NULL); + getChild<LLUICtrl>("WLGamma")->setCommitCallback(boost::bind(&LLFloaterWindLight::onFloatControlMoved, this, _1, ¶m_mgr->mWLGamma)); + getChild<LLUICtrl>("WLStarAlpha")->setCommitCallback(boost::bind(&LLFloaterWindLight::onStarAlphaMoved, this, _1)); } -void LLFloaterWindLight::onClickHelp(void* data) +void LLFloaterWindLight::onClickHelp(std::string xml_alert) { - LLFloaterWindLight* self = LLFloaterWindLight::instance(); - - const std::string xml_alert = *(std::string*)data; - LLNotifications::instance().add(self->contextualNotification(xml_alert)); + LLNotifications::instance().add(contextualNotification(xml_alert)); } void LLFloaterWindLight::initHelpBtn(const std::string& name, const std::string& xml_alert) { - childSetAction(name, onClickHelp, new std::string(xml_alert)); + getChild<LLButton>(name)->setClickedCallback(boost::bind(&LLFloaterWindLight::onClickHelp, this, xml_alert)); } bool LLFloaterWindLight::newPromptCallback(const LLSD& notification, const LLSD& response) @@ -258,16 +256,13 @@ bool LLFloaterWindLight::newPromptCallback(const LLSD& notification, const LLSD& } if(option == 0) { - LLComboBox* comboBox = sWindLight->getChild<LLComboBox>( - "WLPresetsCombo"); + LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo"); - LLFloaterDayCycle* sDayCycle = NULL; + LLFloaterDayCycle* day_cycle = LLFloaterReg::findTypedInstance<LLFloaterDayCycle>("env_day_cycle"); LLComboBox* keyCombo = NULL; - if(LLFloaterDayCycle::isOpen()) + if(day_cycle) { - sDayCycle = LLFloaterDayCycle::instance(); - keyCombo = sDayCycle->getChild<LLComboBox>( - "WLKeyPresets"); + keyCombo = day_cycle->getChild<LLComboBox>("WLKeyPresets"); } // add the current parameters to the list @@ -292,7 +287,7 @@ bool LLFloaterWindLight::newPromptCallback(const LLSD& notification, const LLSD& comboBox->add(LLStringUtil::null); comboBox->setSelectedByValue(text, true); - if(LLFloaterDayCycle::isOpen()) + if(keyCombo) { keyCombo->add(text); keyCombo->sortByName(); @@ -442,53 +437,12 @@ void LLFloaterWindLight::syncMenu() } -// static -LLFloaterWindLight* LLFloaterWindLight::instance() -{ - if (!sWindLight) - { - sWindLight = new LLFloaterWindLight(); - sWindLight->openFloater(); - sWindLight->setFocus(TRUE); - } - return sWindLight; -} -void LLFloaterWindLight::show() -{ - LLFloaterWindLight* windLight = instance(); - windLight->syncMenu(); - - // comment in if you want the menu to rebuild each time - //LLUICtrlFactory::getInstance()->buildFloater(windLight, "floater_windlight_options.xml"); - //windLight->initCallbacks(); - - windLight->openFloater(); -} - -bool LLFloaterWindLight::isOpen() -{ - if (sWindLight != NULL) { - return true; - } - return false; -} - -// virtual -void LLFloaterWindLight::onClose(bool app_quitting) -{ - if (sWindLight) - { - sWindLight->setVisible(FALSE); - } -} - // color control callbacks -void LLFloaterWindLight::onColorControlRMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onColorControlRMoved(LLUICtrl* ctrl, WLColorControl* colorControl) { deactivateAnimator(); LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WLColorControl * colorControl = static_cast<WLColorControl *>(userData); colorControl->r = sldrCtrl->getValueF32(); if(colorControl->isSunOrAmbientColor) { @@ -506,11 +460,11 @@ void LLFloaterWindLight::onColorControlRMoved(LLUICtrl* ctrl, void* userData) name.append("I"); if(colorControl->isSunOrAmbientColor) { - sWindLight->childSetValue(name, colorControl->r / 3); + childSetValue(name, colorControl->r / 3); } else if(colorControl->isBlueHorizonOrDensity) { - sWindLight->childSetValue(name, colorControl->r / 2); + childSetValue(name, colorControl->r / 2); } else { - sWindLight->childSetValue(name, colorControl->r); + childSetValue(name, colorControl->r); } } @@ -519,12 +473,11 @@ void LLFloaterWindLight::onColorControlRMoved(LLUICtrl* ctrl, void* userData) LLWLParamManager::instance()->propagateParameters(); } -void LLFloaterWindLight::onColorControlGMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onColorControlGMoved(LLUICtrl* ctrl, WLColorControl* colorControl) { deactivateAnimator(); LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WLColorControl * colorControl = static_cast<WLColorControl *>(userData); colorControl->g = sldrCtrl->getValueF32(); if(colorControl->isSunOrAmbientColor) { @@ -542,11 +495,11 @@ void LLFloaterWindLight::onColorControlGMoved(LLUICtrl* ctrl, void* userData) name.append("I"); if(colorControl->isSunOrAmbientColor) { - sWindLight->childSetValue(name, colorControl->g / 3); + childSetValue(name, colorControl->g / 3); } else if(colorControl->isBlueHorizonOrDensity) { - sWindLight->childSetValue(name, colorControl->g / 2); + childSetValue(name, colorControl->g / 2); } else { - sWindLight->childSetValue(name, colorControl->g); + childSetValue(name, colorControl->g); } } @@ -555,12 +508,11 @@ void LLFloaterWindLight::onColorControlGMoved(LLUICtrl* ctrl, void* userData) LLWLParamManager::instance()->propagateParameters(); } -void LLFloaterWindLight::onColorControlBMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onColorControlBMoved(LLUICtrl* ctrl, WLColorControl* colorControl) { deactivateAnimator(); LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WLColorControl * colorControl = static_cast<WLColorControl *>(userData); colorControl->b = sldrCtrl->getValueF32(); if(colorControl->isSunOrAmbientColor) { @@ -578,11 +530,11 @@ void LLFloaterWindLight::onColorControlBMoved(LLUICtrl* ctrl, void* userData) name.append("I"); if(colorControl->isSunOrAmbientColor) { - sWindLight->childSetValue(name, colorControl->b / 3); + childSetValue(name, colorControl->b / 3); } else if(colorControl->isBlueHorizonOrDensity) { - sWindLight->childSetValue(name, colorControl->b / 2); + childSetValue(name, colorControl->b / 2); } else { - sWindLight->childSetValue(name, colorControl->b); + childSetValue(name, colorControl->b); } } @@ -591,12 +543,11 @@ void LLFloaterWindLight::onColorControlBMoved(LLUICtrl* ctrl, void* userData) LLWLParamManager::instance()->propagateParameters(); } -void LLFloaterWindLight::onColorControlIMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onColorControlIMoved(LLUICtrl* ctrl, WLColorControl* colorControl) { deactivateAnimator(); LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WLColorControl * colorControl = static_cast<WLColorControl *>(userData); colorControl->i = sldrCtrl->getValueF32(); @@ -653,24 +604,24 @@ void LLFloaterWindLight::onColorControlIMoved(LLUICtrl* ctrl, void* userData) // divide sun color vals by three if(colorControl->isSunOrAmbientColor) { - sWindLight->childSetValue(rName, colorControl->r/3); - sWindLight->childSetValue(gName, colorControl->g/3); - sWindLight->childSetValue(bName, colorControl->b/3); + childSetValue(rName, colorControl->r/3); + childSetValue(gName, colorControl->g/3); + childSetValue(bName, colorControl->b/3); } else if(colorControl->isBlueHorizonOrDensity) { - sWindLight->childSetValue(rName, colorControl->r/2); - sWindLight->childSetValue(gName, colorControl->g/2); - sWindLight->childSetValue(bName, colorControl->b/2); + childSetValue(rName, colorControl->r/2); + childSetValue(gName, colorControl->g/2); + childSetValue(bName, colorControl->b/2); } else { // set the sliders to the new vals - sWindLight->childSetValue(rName, colorControl->r); - sWindLight->childSetValue(gName, colorControl->g); - sWindLight->childSetValue(bName, colorControl->b); + childSetValue(rName, colorControl->r); + childSetValue(gName, colorControl->g); + childSetValue(bName, colorControl->b); } } @@ -680,12 +631,11 @@ void LLFloaterWindLight::onColorControlIMoved(LLUICtrl* ctrl, void* userData) } /// GLOW SPECIFIC CODE -void LLFloaterWindLight::onGlowRMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onGlowRMoved(LLUICtrl* ctrl, WLColorControl* colorControl) { deactivateAnimator(); LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WLColorControl * colorControl = static_cast<WLColorControl *>(userData); // scaled by 20 colorControl->r = (2 - sldrCtrl->getValueF32()) * 20; @@ -695,12 +645,11 @@ void LLFloaterWindLight::onGlowRMoved(LLUICtrl* ctrl, void* userData) } /// \NOTE that we want NEGATIVE (-) B -void LLFloaterWindLight::onGlowBMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onGlowBMoved(LLUICtrl* ctrl, WLColorControl* colorControl) { deactivateAnimator(); LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WLColorControl * colorControl = static_cast<WLColorControl *>(userData); /// \NOTE that we want NEGATIVE (-) B and NOT by 20 as 20 is too big colorControl->b = -sldrCtrl->getValueF32() * 5; @@ -709,12 +658,11 @@ void LLFloaterWindLight::onGlowBMoved(LLUICtrl* ctrl, void* userData) LLWLParamManager::instance()->propagateParameters(); } -void LLFloaterWindLight::onFloatControlMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onFloatControlMoved(LLUICtrl* ctrl, WLFloatControl* floatControl) { deactivateAnimator(); LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - WLFloatControl * floatControl = static_cast<WLFloatControl *>(userData); floatControl->x = sldrCtrl->getValueF32() / floatControl->mult; @@ -722,29 +670,16 @@ void LLFloaterWindLight::onFloatControlMoved(LLUICtrl* ctrl, void* userData) LLWLParamManager::instance()->propagateParameters(); } -void LLFloaterWindLight::onBoolToggle(LLUICtrl* ctrl, void* userData) -{ - deactivateAnimator(); - - LLCheckBoxCtrl* cbCtrl = static_cast<LLCheckBoxCtrl*>(ctrl); - - bool value = cbCtrl->get(); - (*(static_cast<BOOL *>(userData))) = value; -} - - // Lighting callbacks // time of day -void LLFloaterWindLight::onSunMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onSunMoved(LLUICtrl* ctrl, WLColorControl* colorControl) { deactivateAnimator(); - LLSliderCtrl* sunSldr = sWindLight->getChild<LLSliderCtrl>("WLSunAngle"); - LLSliderCtrl* eastSldr = sWindLight->getChild<LLSliderCtrl>("WLEastAngle"); + LLSliderCtrl* sunSldr = getChild<LLSliderCtrl>("WLSunAngle"); + LLSliderCtrl* eastSldr = getChild<LLSliderCtrl>("WLEastAngle"); - WLColorControl * colorControl = static_cast<WLColorControl *>(userData); - // get the two angles LLWLParamManager * param_mgr = LLWLParamManager::instance(); @@ -763,18 +698,7 @@ void LLFloaterWindLight::onSunMoved(LLUICtrl* ctrl, void* userData) param_mgr->propagateParameters(); } -void LLFloaterWindLight::onFloatTweakMoved(LLUICtrl* ctrl, void* userData) -{ - deactivateAnimator(); - - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - F32 * tweak = static_cast<F32 *>(userData); - - (*tweak) = sldrCtrl->getValueF32(); - LLWLParamManager::instance()->propagateParameters(); -} - -void LLFloaterWindLight::onStarAlphaMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onStarAlphaMoved(LLUICtrl* ctrl) { deactivateAnimator(); @@ -783,15 +707,15 @@ void LLFloaterWindLight::onStarAlphaMoved(LLUICtrl* ctrl, void* userData) LLWLParamManager::instance()->mCurParams.setStarBrightness(sldrCtrl->getValueF32()); } -void LLFloaterWindLight::onNewPreset(void* userData) +void LLFloaterWindLight::onNewPreset() { - LLNotifications::instance().add("NewSkyPreset", LLSD(), LLSD(), newPromptCallback); + LLNotifications::instance().add("NewSkyPreset", LLSD(), LLSD(), boost::bind(&LLFloaterWindLight::newPromptCallback, this, _1, _2)); } -void LLFloaterWindLight::onSavePreset(void* userData) +void LLFloaterWindLight::onSavePreset() { // get the name - LLComboBox* comboBox = sWindLight->getChild<LLComboBox>( + LLComboBox* comboBox = getChild<LLComboBox>( "WLPresetsCombo"); // don't save the empty name @@ -812,7 +736,7 @@ void LLFloaterWindLight::onSavePreset(void* userData) LLWLParamManager::instance()->mCurParams.mName = comboBox->getSelectedItemLabel(); - LLNotifications::instance().add("WLSavePresetAlert", LLSD(), LLSD(), saveAlertCallback); + LLNotifications::instance().add("WLSavePresetAlert", LLSD(), LLSD(), boost::bind(&LLFloaterWindLight::saveAlertCallback, this, _1, _2)); } bool LLFloaterWindLight::saveAlertCallback(const LLSD& notification, const LLSD& response) @@ -831,9 +755,9 @@ bool LLFloaterWindLight::saveAlertCallback(const LLSD& notification, const LLSD& return false; } -void LLFloaterWindLight::onDeletePreset(void* userData) +void LLFloaterWindLight::onDeletePreset() { - LLComboBox* combo_box = sWindLight->getChild<LLComboBox>( + LLComboBox* combo_box = getChild<LLComboBox>( "WLPresetsCombo"); if(combo_box->getSelectedValue().asString() == "") @@ -844,7 +768,7 @@ void LLFloaterWindLight::onDeletePreset(void* userData) LLSD args; args["SKY"] = combo_box->getSelectedValue().asString(); LLNotifications::instance().add("WLDeletePresetAlert", args, LLSD(), - boost::bind(&LLFloaterWindLight::deleteAlertCallback, sWindLight, _1, _2)); + boost::bind(&LLFloaterWindLight::deleteAlertCallback, this, _1, _2)); } bool LLFloaterWindLight::deleteAlertCallback(const LLSD& notification, const LLSD& response) @@ -854,17 +778,14 @@ bool LLFloaterWindLight::deleteAlertCallback(const LLSD& notification, const LLS // if they choose delete, do it. Otherwise, don't do anything if(option == 0) { - LLComboBox* combo_box = getChild<LLComboBox>( - "WLPresetsCombo"); - LLFloaterDayCycle* day_cycle = NULL; + LLComboBox* combo_box = getChild<LLComboBox>("WLPresetsCombo"); + LLFloaterDayCycle* day_cycle = LLFloaterReg::findTypedInstance<LLFloaterDayCycle>("env_day_cycle"); LLComboBox* key_combo = NULL; LLMultiSliderCtrl* mult_sldr = NULL; - if(LLFloaterDayCycle::isOpen()) + if (day_cycle) { - day_cycle = LLFloaterDayCycle::instance(); - key_combo = day_cycle->getChild<LLComboBox>( - "WLKeyPresets"); + key_combo = day_cycle->getChild<LLComboBox>("WLKeyPresets"); mult_sldr = day_cycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); } @@ -915,17 +836,17 @@ void LLFloaterWindLight::onChangePresetName(LLUICtrl* ctrl) if(!data.empty()) { LLWLParamManager::instance()->loadPreset( data); - sWindLight->syncMenu(); + syncMenu(); } } -void LLFloaterWindLight::onOpenDayCycle(void* userData) +void LLFloaterWindLight::onOpenDayCycle() { - LLFloaterDayCycle::show(); + LLFloaterReg::showInstance("env_day_cycle"); } // Clouds -void LLFloaterWindLight::onCloudScrollXMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onCloudScrollXMoved(LLUICtrl* ctrl) { deactivateAnimator(); @@ -934,7 +855,7 @@ void LLFloaterWindLight::onCloudScrollXMoved(LLUICtrl* ctrl, void* userData) LLWLParamManager::instance()->mCurParams.setCloudScrollX(sldrCtrl->getValueF32() + 10.0f); } -void LLFloaterWindLight::onCloudScrollYMoved(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onCloudScrollYMoved(LLUICtrl* ctrl) { deactivateAnimator(); @@ -944,7 +865,7 @@ void LLFloaterWindLight::onCloudScrollYMoved(LLUICtrl* ctrl, void* userData) LLWLParamManager::instance()->mCurParams.setCloudScrollY(sldrCtrl->getValueF32() + 10.0f); } -void LLFloaterWindLight::onCloudScrollXToggled(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onCloudScrollXToggled(LLUICtrl* ctrl) { deactivateAnimator(); @@ -953,7 +874,7 @@ void LLFloaterWindLight::onCloudScrollXToggled(LLUICtrl* ctrl, void* userData) bool lock = cbCtrl->get(); LLWLParamManager::instance()->mCurParams.setEnableCloudScrollX(!lock); - LLSliderCtrl* sldr = sWindLight->getChild<LLSliderCtrl>( + LLSliderCtrl* sldr = getChild<LLSliderCtrl>( "WLCloudScrollX"); if(cbCtrl->get()) @@ -967,7 +888,7 @@ void LLFloaterWindLight::onCloudScrollXToggled(LLUICtrl* ctrl, void* userData) } -void LLFloaterWindLight::onCloudScrollYToggled(LLUICtrl* ctrl, void* userData) +void LLFloaterWindLight::onCloudScrollYToggled(LLUICtrl* ctrl) { deactivateAnimator(); @@ -975,7 +896,7 @@ void LLFloaterWindLight::onCloudScrollYToggled(LLUICtrl* ctrl, void* userData) bool lock = cbCtrl->get(); LLWLParamManager::instance()->mCurParams.setEnableCloudScrollY(!lock); - LLSliderCtrl* sldr = sWindLight->getChild<LLSliderCtrl>( + LLSliderCtrl* sldr = getChild<LLSliderCtrl>( "WLCloudScrollY"); if(cbCtrl->get()) diff --git a/indra/newview/llfloaterwindlight.h b/indra/newview/llfloaterwindlight.h index e527a5637c..56c2c6623b 100644 --- a/indra/newview/llfloaterwindlight.h +++ b/indra/newview/llfloaterwindlight.h @@ -51,54 +51,47 @@ class LLFloaterWindLight : public LLFloater { public: - LLFloaterWindLight(); + LLFloaterWindLight(const LLSD& key); virtual ~LLFloaterWindLight(); /*virtual*/ BOOL postBuild(); /// initialize all void initCallbacks(void); - /// one and one instance only - static LLFloaterWindLight* instance(); - // help button stuff - static void onClickHelp(void* data); + void onClickHelp(std::string alert); void initHelpBtn(const std::string& name, const std::string& xml_alert); - static bool newPromptCallback(const LLSD& notification, const LLSD& response); + bool newPromptCallback(const LLSD& notification, const LLSD& response); /// general purpose callbacks for dealing with color controllers - static void onColorControlRMoved(LLUICtrl* ctrl, void* userData); - static void onColorControlGMoved(LLUICtrl* ctrl, void* userData); - static void onColorControlBMoved(LLUICtrl* ctrl, void* userData); - static void onColorControlIMoved(LLUICtrl* ctrl, void* userData); - static void onFloatControlMoved(LLUICtrl* ctrl, void* userData); - static void onBoolToggle(LLUICtrl* ctrl, void* userData); + void onColorControlRMoved(LLUICtrl* ctrl, WLColorControl* userData); + void onColorControlGMoved(LLUICtrl* ctrl, WLColorControl* userData); + void onColorControlBMoved(LLUICtrl* ctrl, WLColorControl* userData); + void onColorControlIMoved(LLUICtrl* ctrl, WLColorControl* userData); + void onFloatControlMoved(LLUICtrl* ctrl, WLFloatControl* userData); /// lighting callbacks for glow - static void onGlowRMoved(LLUICtrl* ctrl, void* userData); + void onGlowRMoved(LLUICtrl* ctrl, WLColorControl* userData); //static void onGlowGMoved(LLUICtrl* ctrl, void* userData); - static void onGlowBMoved(LLUICtrl* ctrl, void* userData); + void onGlowBMoved(LLUICtrl* ctrl, WLColorControl* userData); /// lighting callbacks for sun - static void onSunMoved(LLUICtrl* ctrl, void* userData); - - /// handle if float is changed - static void onFloatTweakMoved(LLUICtrl* ctrl, void* userData); + void onSunMoved(LLUICtrl* ctrl, WLColorControl* userData); /// for handling when the star slider is moved to adjust the alpha - static void onStarAlphaMoved(LLUICtrl* ctrl, void* userData); + void onStarAlphaMoved(LLUICtrl* ctrl); /// when user hits the load preset button - static void onNewPreset(void* userData); + void onNewPreset(); /// when user hits the save preset button - static void onSavePreset(void* userData); + void onSavePreset(); /// prompts a user when overwriting a preset - static bool saveAlertCallback(const LLSD& notification, const LLSD& response); + bool saveAlertCallback(const LLSD& notification, const LLSD& response); /// when user hits the save preset button - static void onDeletePreset(void* userData); + void onDeletePreset(); /// prompts a user when overwriting a preset bool deleteAlertCallback(const LLSD& notification, const LLSD& response); @@ -107,24 +100,13 @@ public: void onChangePresetName(LLUICtrl* ctrl); /// when user hits the save preset button - static void onOpenDayCycle(void* userData); + void onOpenDayCycle(); /// handle cloud scrolling - static void onCloudScrollXMoved(LLUICtrl* ctrl, void* userData); - static void onCloudScrollYMoved(LLUICtrl* ctrl, void* userData); - static void onCloudScrollXToggled(LLUICtrl* ctrl, void* userData); - static void onCloudScrollYToggled(LLUICtrl* ctrl, void* userData); - - //// menu management - - /// show off our menu - static void show(); - - /// return if the menu exists or not - static bool isOpen(); - - /// stuff to do on exit - virtual void onClose(bool app_quitting); + void onCloudScrollXMoved(LLUICtrl* ctrl); + void onCloudScrollYMoved(LLUICtrl* ctrl); + void onCloudScrollXToggled(LLUICtrl* ctrl); + void onCloudScrollYToggled(LLUICtrl* ctrl); /// sync up sliders with parameters void syncMenu(); @@ -133,9 +115,6 @@ public: static void deactivateAnimator(); private: - // one instance on the inside - static LLFloaterWindLight* sWindLight; - static std::set<std::string> sDefaultPresets; }; diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index cdc4cbc411..57acbb147d 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -182,6 +182,8 @@ void* LLFloaterWorldMap::createWorldMapView(void* data) BOOL LLFloaterWorldMap::postBuild() { + mCloseSignal.connect(boost::bind(&LLFloaterWorldMap::onClose, this)); + mTabs = getChild<LLTabContainer>("maptab"); if (!mTabs) return FALSE; @@ -252,13 +254,10 @@ LLFloaterWorldMap* LLFloaterWorldMap::getInstance() return LLFloaterReg::getTypedInstance<LLFloaterWorldMap>("world_map"); } -// virtual -void LLFloaterWorldMap::onClose(bool app_quitting) +void LLFloaterWorldMap::onClose() { // While we're not visible, discard the overlay images we're using LLWorldMap::getInstance()->clearImageRefs(); - - setVisible(FALSE); } // virtual diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index d52079fc06..f117ea05af 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -65,7 +65,6 @@ public: BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); static void reloadIcons(void*); @@ -113,6 +112,8 @@ public: void teleport(); protected: + void onClose(); + void onGoHome(); void onLandmarkComboPrearrange(); diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index eb2c6768f3..69498d3099 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -58,8 +58,6 @@ #include "llviewerstats.h" #include "llnearbychatbar.h" -LLGestureManager gGestureManager; - // Longest time, in seconds, to wait for all animations to stop playing const F32 MAX_WAIT_ANIM_SECS = 30.f; @@ -71,7 +69,9 @@ LLGestureManager::LLGestureManager() mPlaying(), mActive(), mLoadingCount(0) -{ } +{ + gInventory.addObserver(this); +} // We own the data for gestures, so clean them up. @@ -85,6 +85,7 @@ LLGestureManager::~LLGestureManager() delete gesture; gesture = NULL; } + gInventory.removeObserver(this); } @@ -442,7 +443,7 @@ void LLGestureManager::replaceGesture(const LLUUID& item_id, LLMultiGesture* new void LLGestureManager::replaceGesture(const LLUUID& item_id, const LLUUID& new_asset_id) { - item_map_t::iterator it = gGestureManager.mActive.find(item_id); + item_map_t::iterator it = LLGestureManager::instance().mActive.find(item_id); if (it == mActive.end()) { llwarns << "replaceGesture for inactive gesture " << item_id << llendl; @@ -451,7 +452,7 @@ void LLGestureManager::replaceGesture(const LLUUID& item_id, const LLUUID& new_a // mActive owns this gesture pointer, so clean up memory. LLMultiGesture* gesture = (*it).second; - gGestureManager.replaceGesture(item_id, gesture, new_asset_id); + LLGestureManager::instance().replaceGesture(item_id, gesture, new_asset_id); } void LLGestureManager::playGesture(LLMultiGesture* gesture) @@ -921,7 +922,7 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs, delete info; info = NULL; - gGestureManager.mLoadingCount--; + LLGestureManager::instance().mLoadingCount--; if (0 == status) { @@ -943,22 +944,34 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs, { if (deactivate_similar) { - gGestureManager.deactivateSimilarGestures(gesture, item_id); + LLGestureManager::instance().deactivateSimilarGestures(gesture, item_id); // Display deactivation message if this was the last of the bunch. - if (gGestureManager.mLoadingCount == 0 - && gGestureManager.mDeactivateSimilarNames.length() > 0) + if (LLGestureManager::instance().mLoadingCount == 0 + && LLGestureManager::instance().mDeactivateSimilarNames.length() > 0) { // we're done with this set of deactivations LLSD args; - args["NAMES"] = gGestureManager.mDeactivateSimilarNames; + args["NAMES"] = LLGestureManager::instance().mDeactivateSimilarNames; LLNotifications::instance().add("DeactivatedGesturesTrigger", args); } } + LLViewerInventoryItem* item = gInventory.getItem(item_id); + if(item) + { + gesture->mName = item->getName(); + } + else + { + // Watch this item and set gesture name when item exists in inventory + LLGestureManager::instance().watchItem(item_id); + } + LLGestureManager::instance().mActive[item_id] = gesture; + // Everything has been successful. Add to the active list. - gGestureManager.mActive[item_id] = gesture; gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); + if (inform_server) { // Inform the database of this change @@ -977,13 +990,13 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs, gAgent.sendReliableMessage(); } - gGestureManager.notifyObservers(); + LLGestureManager::instance().notifyObservers(); } else { llwarns << "Unable to load gesture" << llendl; - gGestureManager.mActive.erase(item_id); + LLGestureManager::instance().mActive.erase(item_id); delete gesture; gesture = NULL; @@ -1005,7 +1018,7 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs, llwarns << "Problem loading gesture: " << status << llendl; - gGestureManager.mActive.erase(item_id); + LLGestureManager::instance().mActive.erase(item_id); } } @@ -1133,3 +1146,19 @@ void LLGestureManager::getItemIDs(std::vector<LLUUID>* ids) ids->push_back(it->first); } } + +void LLGestureManager::done() +{ + for(item_map_t::iterator it = mActive.begin(); it != mActive.end(); ++it) + { + if(it->second->mName.empty()) + { + LLViewerInventoryItem* item = gInventory.getItem(it->first); + if(item) + { + it->second->mName = item->getName(); + } + } + } + notifyObservers(); +} diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index f564c17486..947773d66d 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -38,6 +38,8 @@ #include <vector> #include "llassetstorage.h" // LLAssetType +#include "llinventorymodel.h" +#include "llsingleton.h" #include "llviewerinventory.h" class LLMultiGesture; @@ -52,7 +54,7 @@ public: virtual void changed() = 0; }; -class LLGestureManager +class LLGestureManager : public LLSingleton<LLGestureManager>, public LLInventoryCompletionObserver { public: LLGestureManager(); @@ -133,6 +135,9 @@ protected: // Do a single step in a gesture void runStep(LLMultiGesture* gesture, LLGestureStep* step); + // LLInventoryCompletionObserver trigger + void done(); + // Used by loadGesture static void onLoadComplete(LLVFS *vfs, const LLUUID& asset_uuid, @@ -158,6 +163,4 @@ public: std::vector<LLGestureManagerObserver*> mObservers; }; -extern LLGestureManager gGestureManager; - #endif diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index 4c8c1b5f7f..886fe3da07 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -42,6 +42,7 @@ #include "llfontgl.h" #include "llglheaders.h" #include "llviewerwindow.h" +#include "llui.h" void hud_render_utf8text(const std::string &str, const LLVector3 &pos_agent, const LLFontGL &font, diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 248a8dbc4c..4ae188977e 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -35,6 +35,7 @@ #include "llimpanel.h" #include "indra_constants.h" +#include "llfloaterreg.h" #include "llfocusmgr.h" #include "llfontgl.h" #include "llrect.h" @@ -448,13 +449,17 @@ void LLVoiceChannel::setState(EState state) void LLVoiceChannel::toggleCallWindowIfNeeded(EState state) { if (state == STATE_CONNECTED) - LLFloaterCall::openInstance(mSessionID); + { + LLFloaterReg::showInstance("voice_call", mSessionID); + } // By checking that current state is CONNECTED we make sure that the call window // has been shown, hence there's something to hide. This helps when user presses // the "End call" button right after initiating the call. // *TODO: move this check to LLFloaterCall? else if (state == STATE_HUNG_UP && mState == STATE_CONNECTED) - LLFloaterCall::closeInstance(mSessionID); + { + LLFloaterReg::hideInstance("voice_call", mSessionID); + } } //static @@ -1005,7 +1010,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(const std::string& session_label, // All participants will be added to the list of people we've recently interacted with. mSpeakers->addListener(&LLRecentPeople::instance(), "add"); - LLUICtrlFactory::getInstance()->buildFloater(this, xml_filename, FALSE); + LLUICtrlFactory::getInstance()->buildFloater(this, xml_filename, NULL); setTitle(mSessionLabel); mInputEditor->setMaxTextLength(1023); @@ -1088,6 +1093,10 @@ LLFloaterIMPanel::~LLFloaterIMPanel() BOOL LLFloaterIMPanel::postBuild() { + mCloseSignal.connect(boost::bind(&LLFloaterIMPanel::onClose, this)); + + mVisibleSignal.connect(boost::bind(&LLFloaterIMPanel::onVisibilityChange, this, _2)); + requires<LLLineEditor>("chat_editor"); requires<LLTextEditor>("im_history"); @@ -1414,24 +1423,6 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4 } -void LLFloaterIMPanel::setVisible(BOOL b) -{ - LLPanel::setVisible(b); - - LLMultiFloater* hostp = getHost(); - if( b && hostp ) - { - hostp->setFloaterFlashing(this, FALSE); - - /* Don't change containing floater title - leave it "Instant Message" JC - LLUIString title = sTitleString; - title.setArg("[NAME]", mSessionLabel); - hostp->setTitle( title ); - */ - } -} - - void LLFloaterIMPanel::setInputFocus( BOOL b ) { mInputEditor->setFocus( b ); @@ -1671,7 +1662,7 @@ void LLFloaterIMPanel::onInputEditorKeystroke(LLLineEditor* caller, void* userda } } -void LLFloaterIMPanel::onClose(bool app_quitting) +void LLFloaterIMPanel::onClose() { setTyping(FALSE); @@ -1680,21 +1671,20 @@ void LLFloaterIMPanel::onClose(bool app_quitting) gIMMgr->removeSession(mSessionUUID); // *HACK hide the voice floater - LLFloaterCall::toggleInstanceVisibility(FALSE, mSessionUUID); - - destroy(); + LLFloaterReg::hideInstance("voice_call", mSessionUUID); } -void LLFloaterIMPanel::onVisibilityChange(BOOL new_visibility) +void LLFloaterIMPanel::onVisibilityChange(const LLSD& new_visibility) { - if (new_visibility) + if (new_visibility.asBoolean()) { mNumUnreadMessages = 0; } - - LLFloaterCall::toggleInstanceVisibility( - new_visibility && mVoiceChannel->getState() == LLVoiceChannel::STATE_CONNECTED, - mSessionUUID); + + if (new_visibility.asBoolean() && mVoiceChannel->getState() == LLVoiceChannel::STATE_CONNECTED) + LLFloaterReg::showInstance("voice_call", mSessionUUID); + else + LLFloaterReg::hideInstance("voice_call", mSessionUUID); } void LLFloaterIMPanel::sendMsg() @@ -2047,53 +2037,16 @@ bool LLFloaterIMPanel::onConfirmForceCloseError(const LLSD& notification, const } -std::map<LLUUID, LLIMFloater*> LLIMFloater::sIMFloaterMap; - -LLIMFloater::LLIMFloater(const LLUUID& session_id, - const std::string title, - EInstantMessage dialog) -: mSessionID(session_id), +LLIMFloater::LLIMFloater(const LLUUID& session_id) + : LLFloater(session_id), + mSessionID(session_id), mLastMessageIndex(-1), - mDialog(dialog) + mDialog(IM_NOTHING_SPECIAL), + mHistoryEditor(NULL), + mInputEditor(NULL), + mPositioned(false) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_im_session.xml"); - sIMFloaterMap[mSessionID] = this; - - LLPanelIMControlPanel* im_control_panel = getChild<LLPanelIMControlPanel>("panel_im_control_panel"); - - LLIMModel::LLIMSession* session = get_if_there(LLIMModel::instance().sSessionsMap, session_id, (LLIMModel::LLIMSession*)NULL); - if(session) - { - mOtherParticipantUUID = session->mOtherParticipantID; - im_control_panel->setAvatarId(session->mOtherParticipantID); - } - - LLButton* slide_left = getChild<LLButton>("slide_left_btn"); - slide_left->setVisible(im_control_panel->getVisible()); - slide_left->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this)); - - LLButton* slide_right = getChild<LLButton>("slide_right_btn"); - slide_right->setVisible(!im_control_panel->getVisible()); - slide_right->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this)); - - setTitle(title); - setDocked(true); - - mInputEditor = getChild<LLLineEditor>("chat_editor"); - - - mInputEditor->setMaxTextLength(1023); - // enable line history support for instant message bar - mInputEditor->setEnableLineHistory(TRUE); - - mInputEditor->setFocusReceivedCallback( onInputEditorFocusReceived, this ); - mInputEditor->setFocusLostCallback( onInputEditorFocusLost, this ); - mInputEditor->setKeystrokeCallback( onInputEditorKeystroke, this ); - mInputEditor->setCommitOnFocusLost( FALSE ); - mInputEditor->setRevertOnEsc( FALSE ); - mInputEditor->setReplaceNewlinesWithSpaces( FALSE ); - - childSetCommitCallback("chat_editor", onSendMsg, this); +// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_im_session.xml"); } /* static */ @@ -2103,8 +2056,7 @@ void LLIMFloater::newIMCallback(const LLSD& data){ { LLUUID session_id = data["session_id"].asUUID(); - LLIMFloater* floater = get_if_there(sIMFloaterMap, session_id, (LLIMFloater*)NULL); - + LLIMFloater* floater = LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", session_id); if (floater == NULL) { llwarns << "new_im_callback for non-existent session_id " << session_id << llendl; @@ -2160,20 +2112,50 @@ void LLIMFloater::sendMsg() LLIMFloater::~LLIMFloater() { - sIMFloaterMap.erase(mSessionID); } //virtual BOOL LLIMFloater::postBuild() { - mHistoryEditor = getChild<LLViewerTextEditor>("im_text", true, false); - mChiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(mSessionID); + LLPanelIMControlPanel* im_control_panel = getChild<LLPanelIMControlPanel>("panel_im_control_panel"); - if (!mChiclet) + LLIMModel::LLIMSession* session = get_if_there(LLIMModel::instance().sSessionsMap, mSessionID, (LLIMModel::LLIMSession*)NULL); + if(session) { - llwarns << "No chiclet found for the IMFloter" << llendl; + mOtherParticipantUUID = session->mOtherParticipantID; + im_control_panel->setAvatarId(session->mOtherParticipantID); + mDialog = session->mType; } - setDocked(false); + + LLButton* slide_left = getChild<LLButton>("slide_left_btn"); + slide_left->setVisible(im_control_panel->getVisible()); + slide_left->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this)); + + LLButton* slide_right = getChild<LLButton>("slide_right_btn"); + slide_right->setVisible(!im_control_panel->getVisible()); + slide_right->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this)); + + mInputEditor = getChild<LLLineEditor>("chat_editor"); + mInputEditor->setMaxTextLength(1023); + // enable line history support for instant message bar + mInputEditor->setEnableLineHistory(TRUE); + + mInputEditor->setFocusReceivedCallback( onInputEditorFocusReceived, this ); + mInputEditor->setFocusLostCallback( onInputEditorFocusLost, this ); + mInputEditor->setKeystrokeCallback( onInputEditorKeystroke, this ); + mInputEditor->setCommitOnFocusLost( FALSE ); + mInputEditor->setRevertOnEsc( FALSE ); + mInputEditor->setReplaceNewlinesWithSpaces( FALSE ); + + childSetCommitCallback("chat_editor", onSendMsg, this); + + mHistoryEditor = getChild<LLViewerTextEditor>("im_text", true, false); + + setTitle(LLIMModel::instance().getName(mSessionID)); + setDocked(true); + + mDockTongue = LLUI::getUIImage("windows/Flyout_Pointer.png"); + return TRUE; } @@ -2197,27 +2179,14 @@ void LLIMFloater::onFocusLost() void LLIMFloater::setDocked(bool docked, bool pop_on_undock) { LLFloater::setDocked(docked); - mChiclet->setDockTongueVisible(docked); - if (docked) - { - S32 x, y; - mChiclet->localPointToScreen((mChiclet->getRect().getWidth())/2, 0, &x, &y); - translate(x - getRect().getCenterX(), DOCK_ICON_HEIGHT - getRect().mBottom); - } - else if (pop_on_undock) + + if (!docked && pop_on_undock) { // visually pop up a little bit to emphasize the undocking translate(0, UNDOCK_LEAP_HEIGHT); } } - -void LLIMFloater::onClose(bool app_quitting) -{ - mChiclet->setDockTongueVisible(false); - LLFloater::onClose(app_quitting); -} - void LLIMFloater::onSlide() { LLPanel* im_control_panel = getChild<LLPanel>("panel_im_control_panel"); @@ -2230,31 +2199,22 @@ void LLIMFloater::onSlide() //static LLIMFloater* LLIMFloater::show(const LLUUID& session_id) { - LLIMFloater* floater = get_if_there(sIMFloaterMap, session_id, (LLIMFloater*)NULL); - - if (floater == NULL) - { - floater = new LLIMFloater(session_id, LLIMModel::instance().getName(session_id), IM_NOTHING_SPECIAL); - } - //hide all - for (std::map<LLUUID, LLIMFloater*>::iterator iter = sIMFloaterMap.begin(); - iter != sIMFloaterMap.end(); ++iter) + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); + iter != inst_list.end(); ++iter) { - LLIMFloater* floater = (*iter).second; - floater->setVisible(false); - floater->mChiclet->setDockTongueVisible(false); - + LLIMFloater* floater = dynamic_cast<LLIMFloater*>(*iter); + if (floater) + { + floater->setVisible(false); + } } - floater->setVisibleAndFrontmost(true); - - if (floater->isDocked()) - { - floater->mChiclet->setDockTongueVisible(true); - } + LLIMFloater* floater = LLFloaterReg::showTypedInstance<LLIMFloater>("impanel", session_id); floater->updateMessages(); + floater->mInputEditor->setFocus(TRUE); return floater; } @@ -2312,7 +2272,24 @@ void LLIMFloater::onInputEditorKeystroke(LLLineEditor* caller, void* userdata) } } + //just a stub for now void LLIMFloater::setTyping(BOOL typing) { } + + +void LLIMFloater::draw() +{ + //if we are docked, make sure we've been positioned by the chiclet + if (!isDocked() || mPositioned) + { + LLFloater::draw(); + + if (isDocked()) + { + mDockTongue->draw( (getRect().getWidth()/2) - mDockTongue->getWidth()/2, -mDockTongue->getHeight()); + } + } +} + diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index e6bde5c93a..dcb0f2416f 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -47,7 +47,6 @@ class LLInventoryItem; class LLInventoryCategory; class LLIMSpeakerMgr; class LLPanelActiveSpeakers; -class LLIMChiclet; class LLVoiceChannel : public LLVoiceClientStatusObserver { @@ -196,8 +195,9 @@ public: // Check typing timeout timer. /*virtual*/ void draw(); - /*virtual*/ void onClose(bool app_quitting = FALSE); - /*virtual*/ void onVisibilityChange(BOOL new_visibility); + + void onClose(); + void onVisibilityChange(const LLSD& new_visibility); // add target ids to the session. // Return TRUE if successful, otherwise FALSE. @@ -213,7 +213,6 @@ public: void selectAll(); void selectNone(); - void setVisible(BOOL b); S32 getNumUnreadMessages() { return mNumUnreadMessages; } @@ -251,6 +250,7 @@ public: void setSpeakers(const LLSD& speaker_list); LLVoiceChannel* getVoiceChannel() { return mVoiceChannel; } EInstantMessage getDialogType() const { return mDialog; } + void setDialogType(EInstantMessage dialog) { mDialog = dialog; } void requestAutoConnect(); @@ -365,14 +365,16 @@ private: class LLIMFloater : public LLFloater { public: - LLIMFloater(const LLUUID& session_id, - const std::string title, - EInstantMessage dialog); + LLIMFloater(const LLUUID& session_id); virtual ~LLIMFloater(); // LLView overrides /*virtual*/ BOOL postBuild(); + + // LLView overrides for drawing dock tongue + /*virtual*/ + void draw(); // Floater should close when user clicks away to other UI area, // hence causing focus loss. @@ -382,7 +384,6 @@ public: /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); static LLIMFloater* show(const LLUUID& session_id); - void onClose(bool app_quitting); // get new messages from LLIMModel void updateMessages(); @@ -392,8 +393,10 @@ public: // callback for LLIMModel on new messages // route to specific floater if it is visible static void newIMCallback(const LLSD& data); - - static std::map<LLUUID, LLIMFloater*> sIMFloaterMap; + + // called when docked floater's position has been set by chiclet + void setPositioned(bool b) { mPositioned = b; }; + private: @@ -408,11 +411,11 @@ private: LLUUID mSessionID; S32 mLastMessageIndex; EInstantMessage mDialog; - LLIMChiclet* mChiclet; LLUUID mOtherParticipantUUID; LLViewerTextEditor* mHistoryEditor; LLLineEditor* mInputEditor; - + bool mPositioned; + LLUIImagePtr mDockTongue; }; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 0505baac41..6d0868b526 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -719,14 +719,14 @@ LLUUID LLIMMgr::computeSessionID( //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LLFloaterIM::LLFloaterIM() - : LLMultiFloater() + : LLMultiFloater(LLSD()) { // autoresize=false is necessary to avoid resizing of the IM window whenever // a session is opened or closed (it would otherwise resize the window to match // the size of the im-sesssion when they were created. This happens in // LLMultiFloater::resizeToContents() when called through LLMultiFloater::addFloater()) - this->mAutoResize = FALSE; - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_im.xml"); + mAutoResize = FALSE; + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_im.xml", NULL); } BOOL LLFloaterIM::postBuild() @@ -813,10 +813,10 @@ BOOL LLFloaterIM::postBuild() // Class LLIncomingCallDialog //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LLIncomingCallDialog::LLIncomingCallDialog(const LLSD& payload) : - LLModalDialog(LLStringUtil::null, 240, 200), + LLModalDialog(payload, 240, 200), mPayload(payload) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_incoming_call.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_incoming_call.xml", NULL); } BOOL LLIncomingCallDialog::postBuild() @@ -1186,10 +1186,6 @@ void LLIMMgr::addMessage( dialog, FALSE); - - LLIMModel::instance().newSession(new_session_id, name, dialog, other_participant_id); - - // When we get a new IM, and if you are a god, display a bit // of information about the source. This is to help liaisons // when answering questions. @@ -1351,7 +1347,10 @@ LLUUID LLIMMgr::addSession( TRUE); noteOfflineUsers(floater, ids); - LLFloaterReg::showInstance("communicate", session_id); + //LLFloaterReg::showInstance("communicate", session_id); + // *NOTE: Is this right? Or should we only do it for + // dialog == IM_NOTHING_SPECIAL and some group types? + LLIMFloater::show(session_id); // Only warn for regular IMs - not group IMs if( dialog == IM_NOTHING_SPECIAL ) @@ -1361,6 +1360,8 @@ LLUUID LLIMMgr::addSession( } else { + // *TODO: Remove this? Otherwise old communicate window opens on + // second initiation of IM session from People panel? floater->openFloater(); } //mTabContainer->selectTabPanel(panel); @@ -1402,7 +1403,8 @@ LLUUID LLIMMgr::addSession( if ( !floater ) return LLUUID::null; noteOfflineUsers(floater, ids); - LLFloaterReg::showInstance("communicate", session_id); + // *BUG: Is this correct? What do we want to spawn for group IMs? + // LLFloaterReg::showInstance("communicate", session_id); // Only warn for regular IMs - not group IMs if( dialog == IM_NOTHING_SPECIAL ) @@ -1762,6 +1764,7 @@ LLFloaterIMPanel* LLIMMgr::createFloater( LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; LLFloaterChatterBox::getInstance()->addFloater(floater, FALSE, i_pt); mFloaters.insert(floater->getHandle()); + LLIMModel::instance().newSession(session_id, session_label, dialog, other_participant_id); return floater; } @@ -1788,6 +1791,7 @@ LLFloaterIMPanel* LLIMMgr::createFloater( LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; LLFloaterChatterBox::getInstance()->addFloater(floater, FALSE, i_pt); mFloaters.insert(floater->getHandle()); + LLIMModel::instance().newSession(session_id, session_label, dialog, other_participant_id); return floater; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index a0cd0debf4..5877a0b19c 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -252,7 +252,7 @@ BOOL LLInvFVBridge::isItemMovable() // *TODO: make sure this does the right thing void LLInvFVBridge::showProperties() { - LLFloaterProperties::show(mUUID); + LLFloaterReg::showInstance("properties", mUUID); } void LLInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batch) @@ -275,7 +275,7 @@ void LLInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batc { if(LLAssetType::AT_GESTURE == item->getType()) { - gGestureManager.deactivateGesture(item->getUUID()); + LLGestureManager::instance().deactivateGesture(item->getUUID()); } } } @@ -291,7 +291,7 @@ void LLInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batc { if(LLAssetType::AT_GESTURE == descendent_items[j]->getType()) { - gGestureManager.deactivateGesture(descendent_items[j]->getUUID()); + LLGestureManager::instance().deactivateGesture(descendent_items[j]->getUUID()); } } } @@ -1501,9 +1501,9 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, { LLInventoryItem* item = descendent_items[i]; if (item->getType() == LLAssetType::AT_GESTURE - && gGestureManager.isGestureActive(item->getUUID())) + && LLGestureManager::instance().isGestureActive(item->getUUID())) { - gGestureManager.deactivateGesture(item->getUUID()); + LLGestureManager::instance().deactivateGesture(item->getUUID()); } } } @@ -2068,9 +2068,9 @@ BOOL LLFolderBridge::removeItem() { LLInventoryItem* item = descendent_items[i]; if (item->getType() == LLAssetType::AT_GESTURE - && gGestureManager.isGestureActive(item->getUUID())) + && LLGestureManager::instance().isGestureActive(item->getUUID())) { - gGestureManager.deactivateGesture(item->getUUID()); + LLGestureManager::instance().deactivateGesture(item->getUUID()); } } @@ -2594,9 +2594,9 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if(accept && drop) { if (inv_item->getType() == LLAssetType::AT_GESTURE - && gGestureManager.isGestureActive(inv_item->getUUID()) && move_is_into_trash) + && LLGestureManager::instance().isGestureActive(inv_item->getUUID()) && move_is_into_trash) { - gGestureManager.deactivateGesture(inv_item->getUUID()); + LLGestureManager::instance().deactivateGesture(inv_item->getUUID()); } // If an item is being dragged between windows, unselect // everything in the active window so that we don't follow @@ -3208,7 +3208,7 @@ LLUIImagePtr LLGestureBridge::getIcon() const LLFontGL::StyleFlags LLGestureBridge::getLabelStyle() const { - if( gGestureManager.isGestureActive(mUUID) ) + if( LLGestureManager::instance().isGestureActive(mUUID) ) { return LLFontGL::BOLD; } @@ -3220,7 +3220,7 @@ LLFontGL::StyleFlags LLGestureBridge::getLabelStyle() const std::string LLGestureBridge::getLabelSuffix() const { - if( gGestureManager.isGestureActive(mUUID) ) + if( LLGestureManager::instance().isGestureActive(mUUID) ) { return LLItemBridge::getLabelSuffix() + " (active)"; } @@ -3235,7 +3235,7 @@ void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* mode { if ("activate" == action) { - gGestureManager.activateGesture(mUUID); + LLGestureManager::instance().activateGesture(mUUID); LLViewerInventoryItem* item = gInventory.getItem(mUUID); if (!item) return; @@ -3247,7 +3247,7 @@ void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* mode } else if ("deactivate" == action) { - gGestureManager.deactivateGesture(mUUID); + LLGestureManager::instance().deactivateGesture(mUUID); LLViewerInventoryItem* item = gInventory.getItem(mUUID); if (!item) return; @@ -3281,7 +3281,7 @@ void LLGestureBridge::openItem() BOOL LLGestureBridge::removeItem() { // Force close the preview window, if it exists - gGestureManager.deactivateGesture(mUUID); + LLGestureManager::instance().deactivateGesture(mUUID); return LLItemBridge::removeItem(); } @@ -3490,7 +3490,7 @@ void LLObjectBridge::openItem() } /* - LLFloaterProperties::show(mUUID); + LLFloaterReg::showInstance("properties", mUUID); */ } @@ -4156,7 +4156,7 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, LLUUID category, BOO { llinfos << "Activating " << gest_count << " gestures" << llendl; - gGestureManager.activateGestures(gest_item_array); + LLGestureManager::instance().activateGestures(gest_item_array); // Update the inventory item labels to reflect the fact // they are active. @@ -4433,9 +4433,9 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ { for(i = 0; i < gest_count; ++i) { - if ( gGestureManager.isGestureActive( gest_item_array.get(i)->getUUID()) ) + if ( LLGestureManager::instance().isGestureActive( gest_item_array.get(i)->getUUID()) ) { - gGestureManager.deactivateGesture( gest_item_array.get(i)->getUUID() ); + LLGestureManager::instance().deactivateGesture( gest_item_array.get(i)->getUUID() ); gInventory.updateItem( gest_item_array.get(i) ); gInventory.notifyObservers(); } @@ -5028,7 +5028,7 @@ void LLAnimationBridgeAction::doIt() //virtual void LLObjectBridgeAction::doIt() { - LLFloaterProperties::show(mUUID); + LLFloaterReg::showInstance("properties", mUUID); LLInvFVBridgeAction::doIt(); } diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index ffc3b2f37a..087fdda14a 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -138,20 +138,20 @@ void LLNameListCtrl::addGroupNameItem(const LLUUID& group_id, EAddPosition pos, item.enabled = enabled; item.target = GROUP; - addRow(item, pos); + addNameItemRow(item, pos); } // public void LLNameListCtrl::addGroupNameItem(LLNameListCtrl::NameItem& item, EAddPosition pos) { item.target = GROUP; - addRow(item, pos); + addNameItemRow(item, pos); } void LLNameListCtrl::addNameItem(LLNameListCtrl::NameItem& item, EAddPosition pos) { item.target = INDIVIDUAL; - addRow(item, pos); + addNameItemRow(item, pos); } LLScrollListItem* LLNameListCtrl::addElement(const LLSD& element, EAddPosition pos, void* userdata) @@ -159,11 +159,11 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& element, EAddPosition p LLNameListCtrl::NameItem item_params; LLParamSDParser::instance().readSD(element, item_params); item_params.userdata = userdata; - return addRow(item_params, pos); + return addNameItemRow(item_params, pos); } -LLScrollListItem* LLNameListCtrl::addRow(const LLNameListCtrl::NameItem& name_item, EAddPosition pos) +LLScrollListItem* LLNameListCtrl::addNameItemRow(const LLNameListCtrl::NameItem& name_item, EAddPosition pos) { LLScrollListItem* item = LLScrollListCtrl::addRow(name_item, pos); if (!item) return NULL; diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 80feaea881..070b6c4f4f 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -94,15 +94,7 @@ public: void addNameItem(NameItem& item, EAddPosition pos = ADD_BOTTOM); /*virtual*/ LLScrollListItem* addElement(const LLSD& element, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); - LLScrollListItem* addRow(const LLScrollListItem::Params& value, EAddPosition pos = ADD_BOTTOM) - { - // *NOTE:Mani - This implementation overrides the LLScrollListItem::addRow() - // method to call this class's special version of addRow(). - // The dynamic_cast of a reference type should throw - // a std::bad_cast exception on failure. - return addRow(dynamic_cast<const NameItem&>(value), pos); - } - LLScrollListItem* addRow(const NameItem& value, EAddPosition pos = ADD_BOTTOM); + LLScrollListItem* addNameItemRow(const NameItem& value, EAddPosition pos = ADD_BOTTOM); // Add a user to the list by name. It will be added, the name // requested from the cache, and updated as necessary. diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index 74e3710f40..670a394c95 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -54,12 +54,6 @@ public: LLNearbyChat(const LLSD& key); ~LLNearbyChat(); - LLNearbyChat():mEChatTearofState(CHAT_PINNED){}; - LLNearbyChat(const Params& params):mEChatTearofState(CHAT_PINNED){}; - - //static LLNearbyChat* createInstance(); - //static LLNearbyChat* getInstance (); - BOOL postBuild (); void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index a3100f65ca..83f8d14b5f 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -60,7 +60,7 @@ static LLChatTypeTrigger sChatTypeTriggers[] = { { "/shout" , CHAT_TYPE_SHOUT} }; -LLGestureComboBox::LLGestureComboBox(const LLComboBox::Params& p) +LLGestureComboBox::LLGestureComboBox(const LLGestureComboBox::Params& p) : LLComboBox(p) , mGestureLabelTimer() , mLabel(p.label) @@ -68,7 +68,7 @@ LLGestureComboBox::LLGestureComboBox(const LLComboBox::Params& p) setCommitCallback(boost::bind(&LLGestureComboBox::onCommitGesture, this, _1)); // now register us as observer since we have a place to put the results - gGestureManager.addObserver(this); + LLGestureManager::instance().addObserver(this); // refresh list from current active gestures refreshGestures(); @@ -76,7 +76,7 @@ LLGestureComboBox::LLGestureComboBox(const LLComboBox::Params& p) LLGestureComboBox::~LLGestureComboBox() { - gGestureManager.removeObserver(this); + LLGestureManager::instance().removeObserver(this); } void LLGestureComboBox::refreshGestures() @@ -90,7 +90,7 @@ void LLGestureComboBox::refreshGestures() // collect list of unique gestures std::map <std::string, BOOL> unique; LLGestureManager::item_map_t::iterator it; - for (it = gGestureManager.mActive.begin(); it != gGestureManager.mActive.end(); ++it) + for (it = LLGestureManager::instance().mActive.begin(); it != LLGestureManager::instance().mActive.end(); ++it) { LLMultiGesture* gesture = (*it).second; if (gesture) @@ -140,7 +140,7 @@ void LLGestureComboBox::onCommitGesture(LLUICtrl* ctrl) // substitution and logging. std::string text(trigger); std::string revised_text; - gGestureManager.triggerAndReviseString(text, &revised_text); + LLGestureManager::instance().triggerAndReviseString(text, &revised_text); revised_text = utf8str_trim(revised_text); if (!revised_text.empty()) @@ -304,7 +304,7 @@ void LLNearbyChatBar::onChatBoxKeystroke(LLLineEditor* caller, void* userdata) std::string utf8_trigger = wstring_to_utf8str(raw_text); std::string utf8_out_str(utf8_trigger); - if (gGestureManager.matchPrefix(utf8_trigger, &utf8_out_str)) + if (LLGestureManager::instance().matchPrefix(utf8_trigger, &utf8_out_str)) { std::string rest_of_match = utf8_out_str.substr(utf8_trigger.size()); self->mChatBox->setText(utf8_trigger + rest_of_match); // keep original capitalization for user-entered part @@ -386,7 +386,7 @@ void LLNearbyChatBar::sendChat( EChatType type ) if (0 == channel) { // discard returned "found" boolean - gGestureManager.triggerAndReviseString(utf8text, &utf8_revised_text); + LLGestureManager::instance().triggerAndReviseString(utf8text, &utf8_revised_text); } else { diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index 9c2a72aaf3..b640aedf7a 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -43,8 +43,10 @@ class LLGestureComboBox : public LLComboBox , public LLGestureManagerObserver { +public: + struct Params : public LLInitParam::Block<Params, LLComboBox::Params> { }; protected: - LLGestureComboBox(const LLComboBox::Params&); + LLGestureComboBox(const Params&); friend class LLUICtrlFactory; public: ~LLGestureComboBox(); diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 955f50caf5..d088c45710 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -70,6 +70,7 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) : LLView(p), mPower(0), mIsMuted(true), + mIsTalking(false), mImageMute(p.image_mute), mImageOff(p.image_off), mImageOn(p.image_on), @@ -116,31 +117,32 @@ void LLOutputMonitorCtrl::draw() // call directly into gVoiceClient to ask if that agent-id is muted, is // speaking, and what power. This avoids duplicating data, which can get // out of sync. + const F32 LEVEL_0 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL / 3.f; + const F32 LEVEL_1 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL * 2.f / 3.f; + const F32 LEVEL_2 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL; + LLPointer<LLUIImage> icon; if (mIsMuted) { icon = mImageMute; } - else if (mPower == 0.f) + else if (mPower == 0.f && !mIsTalking) { + // only show off if PTT is not engaged icon = mImageOff; } - else if (mPower < LLVoiceClient::OVERDRIVEN_POWER_LEVEL) + else if (mPower < LEVEL_0) + { + // PTT is on, possibly with quiet background noise + icon = mImageOn; + } + else if (mPower < LEVEL_1) + { + icon = mImageLevel1; + } + else if (mPower < LEVEL_2) { - S32 icon_image_idx = llmin(2, llfloor((mPower / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 3.f)); - switch(icon_image_idx) - { - default: - case 0: - icon = mImageOn; - break; - case 1: - icon = mImageLevel1; - break; - case 2: - icon = mImageLevel2; - break; - } + icon = mImageLevel2; } else { diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h index e391c14e40..98b2fe9dc6 100644 --- a/indra/newview/lloutputmonitorctrl.h +++ b/indra/newview/lloutputmonitorctrl.h @@ -76,6 +76,10 @@ public: bool getIsMuted() const { return mIsMuted; } void setIsMuted(bool val) { mIsMuted = val; } + // For the current user, need to know the PTT state to show + // correct button image. + void setIsTalking(bool val) { mIsTalking = val; } + private: //static LLColor4 sColorMuted; //static LLColor4 sColorNormal; @@ -87,6 +91,7 @@ private: F32 mPower; bool mIsMuted; + bool mIsTalking; LLPointer<LLUIImage> mImageMute; LLPointer<LLUIImage> mImageOff; LLPointer<LLUIImage> mImageOn; diff --git a/indra/newview/llpanelavatartag.cpp b/indra/newview/llpanelavatartag.cpp new file mode 100644 index 0000000000..e66c36287b --- /dev/null +++ b/indra/newview/llpanelavatartag.cpp @@ -0,0 +1,129 @@ +/** + * @file llpanelavatartag.cpp + * @brief Avatar tag panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelavatartag.h" + +#include "lluictrlfactory.h" +#include "llavatariconctrl.h" +#include "lltextbox.h" + +LLPanelAvatarTag::LLPanelAvatarTag(const LLUUID& key, const std::string im_time) + : LLPanel() + , mAvatarId(LLUUID::null) +// , mFadeTimer() +{ + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_tag.xml"); + setLeftButtonClickCallback(boost::bind(&LLPanelAvatarTag::onClick, this)); + setAvatarId(key); + setTime(im_time); +} + +LLPanelAvatarTag::~LLPanelAvatarTag() +{ + // Name callbacks will be automatically disconnected since LLPanel is trackable +} + +BOOL LLPanelAvatarTag::postBuild() +{ + mIcon = getChild<LLAvatarIconCtrl>("avatar_tag_icon"); + mName = getChild<LLTextBox>("sender_tag_name"); + mTime = getChild<LLTextBox>("tag_time"); + return TRUE; +} + +void LLPanelAvatarTag::draw() +{ + + ///TODO: ANGELA do something similar to fade the panel out +/* // HACK: assuming tooltip background is in ToolTipBGColor, perform fade out + LLColor4 bg_color = LLUIColorTable::instance().getColor( "ToolTipBgColor" ); + if (tooltip_vis) + { + mToolTipFadeTimer.stop(); + mToolTip->setBackgroundColor(bg_color); + } + else + { + if (!mToolTipFadeTimer.getStarted()) + { + mToolTipFadeTimer.start(); + } + F32 tool_tip_fade_time = gSavedSettings.getF32("ToolTipFadeTime"); + bg_color.mV[VALPHA] = clamp_rescale(mToolTipFadeTimer.getElapsedTimeF32(), 0.f, tool_tip_fade_time, bg_color.mV[VALPHA], 0.f); + mToolTip->setBackgroundColor(bg_color); + } + + // above interpolation of bg_color alpha is guaranteed to reach 0.f exactly + mToolTip->setVisible( bg_color.mV[VALPHA] != 0.f ); + */ +} +void LLPanelAvatarTag::setName(const std::string& name) +{ + if (mName) + mName->setText(name); +} + +void LLPanelAvatarTag::setTime(const std::string& time) +{ + if (mTime) + mTime->setText(time); +} + + +void LLPanelAvatarTag::setAvatarId(const LLUUID& avatar_id) +{ + mAvatarId = avatar_id; + if (mIcon) + { + mIcon->setValue(avatar_id); + } + setName(std::string(mIcon->getFirstName()+ " "+ mIcon->getLastName())); +} + +boost::signals2::connection LLPanelAvatarTag::setLeftButtonClickCallback( + const commit_callback_t& cb) +{ + return mCommitSignal.connect(cb); +} + +BOOL LLPanelAvatarTag::handleMouseDown(S32 x, S32 y, MASK mask) +{ + onCommit(); + return TRUE; +} + +void LLPanelAvatarTag::onClick() +{ + // Do the on click stuff. +} diff --git a/indra/newview/llpanelavatartag.h b/indra/newview/llpanelavatartag.h new file mode 100644 index 0000000000..d68b0d7299 --- /dev/null +++ b/indra/newview/llpanelavatartag.h @@ -0,0 +1,93 @@ +/** + * @file llpanelavatartag.h + * @brief Avatar row panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELAVATARTAG_H +#define LL_LLPANELAVATARTAG_H + +#include "llpanel.h" +#include "llavatarpropertiesprocessor.h" + +class LLAvatarIconCtrl; +class LLTextBox; + +/** + * Avatar Tag panel. + * + * Test. + * + * Contains avatar name + * Provide methods for setting avatar id, state, muted status and speech power. + */ +class LLPanelAvatarTag : public LLPanel +{ +public: + LLPanelAvatarTag(const LLUUID& key, const std::string im_time); + virtual ~LLPanelAvatarTag(); + + /** + * Set avatar ID. + * + * After the ID is set, it is possible to track the avatar status and get its name. + */ + void setAvatarId(const LLUUID& avatar_id); + void setTime (const std::string& time); + + const LLUUID& getAvatarId() const { return mAvatarId; } + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void draw(); + + virtual boost::signals2::connection setLeftButtonClickCallback( + const commit_callback_t& cb); + virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + + void onClick(); +private: + void setName(const std::string& name); + + /** + * Called by LLCacheName when the avatar name gets updated. + */ + void nameUpdatedCallback( + const LLUUID& id, + const std::string& first, + const std::string& last, + BOOL is_group); + + LLAvatarIconCtrl* mIcon; /// status tracking avatar icon + LLTextBox* mName; /// displays avatar name + LLTextBox* mTime; /// displays time + LLUUID mAvatarId; +// LLFrameTimer mFadeTimer; +}; + +#endif diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index df687ffb30..42522942f3 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -55,7 +55,6 @@ #include "llcommandhandler.h" // for classified HTML detail page click tracking #include "llviewercontrol.h" #include "lllineeditor.h" -#include "llfloaterclassified.h" #include "lltextbox.h" #include "llcombobox.h" #include "llviewertexteditor.h" @@ -1063,7 +1062,7 @@ void LLPanelClassified::sendClassifiedClickMessage(const std::string& type) //////////////////////////////////////////////////////////////////////////////////////////// LLFloaterPriceForListing::LLFloaterPriceForListing() -: LLFloater(), +: LLFloater(LLSD()), mCallback(NULL), mUserData(NULL) { } @@ -1099,7 +1098,7 @@ void LLFloaterPriceForListing::show( void (*callback)(S32, std::string, void*), LLFloaterPriceForListing *self = new LLFloaterPriceForListing(); // Builds and adds to gFloaterView - LLUICtrlFactory::getInstance()->buildFloater(self, "floater_price_for_listing.xml"); + LLUICtrlFactory::getInstance()->buildFloater(self, "floater_price_for_listing.xml", NULL); self->center(); self->mCallback = callback; diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 1c52c3cea4..50e1f84cad 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -144,17 +144,22 @@ BOOL LLPanelGroupRoles::postBuild() if (!mSubTabContainer) return FALSE; // Hook up each sub-tabs callback and widgets. - S32 i; - for (i = 0; i < mSubTabContainer->getTabCount(); ++i) + for (S32 i = 0; i < mSubTabContainer->getTabCount(); ++i) { - LLPanelGroupSubTab* subtabp = (LLPanelGroupSubTab*) mSubTabContainer->getPanelByIndex(i); - + LLPanel* panel = mSubTabContainer->getPanelByIndex(i); + LLPanelGroupSubTab* subtabp = dynamic_cast<LLPanelGroupSubTab*>(panel); + if (!subtabp) + { + llwarns << "Invalid subtab panel: " << panel->getName() << llendl; + return FALSE; + } // Add click callbacks to all the tabs. mSubTabContainer->setCommitCallback(boost::bind(&LLPanelGroupRoles::handleClickSubTab, this)); // Hand the subtab a pointer to this LLPanelGroupRoles, so that it can // look around for the widgets it is interested in. - if (!subtabp->postBuildSubTab(this)) return FALSE; + if (!subtabp->postBuildSubTab(this)) + return FALSE; subtabp->addObserver(this); } @@ -1711,7 +1716,18 @@ void* LLPanelGroupRolesSubTab::createTab(void* data) } LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab(const LLUUID& group_id) -: LLPanelGroupSubTab(group_id), mHasRoleChange(FALSE) + : LLPanelGroupSubTab(group_id), + mRolesList(NULL), + mAssignedMembersList(NULL), + mAllowedActionsList(NULL), + mRoleName(NULL), + mRoleTitle(NULL), + mRoleDescription(NULL), + mMemberVisibleCheck(NULL), + mDeleteRoleButton(NULL), + mCreateRoleButton(NULL), + + mHasRoleChange(FALSE) { } diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 9beecf75eb..7007bfc9d5 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -431,9 +431,14 @@ BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask) # if !LL_RELEASE_FOR_DOWNLOAD if ( KEY_F2 == key ) { - llinfos << "Spawning floater TOS window" << llendl; - LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_TOS,""); - tos_dialog->startModal(); + llinfos << "Spawning floater TOS window (TOS)" << llendl; + LLFloaterReg::showInstance("message_tos",LLSD("")); + return TRUE; + } + if ( KEY_F3 == key ) + { + llinfos << "Spawning floater TOS window (critical message)" << llendl; + LLFloaterReg::showInstance("message_critical",LLSD("")); return TRUE; } #endif @@ -636,7 +641,12 @@ void LLPanelLogin::refreshLocation( bool force_visible ) BOOL show_start = TRUE; if ( ! force_visible ) - show_start = gSavedSettings.getBOOL("ShowStartLocation"); + { + // Don't show on first run after install + // Otherwise ShowStartLocation defaults to true. + show_start = gSavedSettings.getBOOL("ShowStartLocation") + && !gSavedSettings.getBOOL("FirstRunThisInstall"); + } sInstance->childSetVisible("start_location_combo", show_start); sInstance->childSetVisible("start_location_text", show_start); @@ -793,7 +803,8 @@ void LLPanelLogin::loadLoginPage() { oStr << "&auto_login=TRUE"; } - if (gSavedSettings.getBOOL("ShowStartLocation")) + if (gSavedSettings.getBOOL("ShowStartLocation") + && !gSavedSettings.getBOOL("FirstRunThisInstall")) { oStr << "&show_start_location=TRUE"; } diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 2f63033437..9be2fb12d2 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -330,6 +330,8 @@ LLPanelPeople::~LLPanelPeople() BOOL LLPanelPeople::postBuild() { + mVisibleSignal.connect(boost::bind(&LLPanelPeople::onVisibilityChange, this, _2)); + mFilterEditor = getChild<LLFilterEditor>("filter_input"); mFilterEditor->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); @@ -589,9 +591,9 @@ void LLPanelPeople::showGroupMenu(LLMenuGL* menu) LLMenuGL::showPopup(parent_panel, menu, menu_x, menu_y); } -void LLPanelPeople::onVisibilityChange(BOOL new_visibility) +void LLPanelPeople::onVisibilityChange(const LLSD& new_visibility) { - if (new_visibility == FALSE) + if (new_visibility.asBoolean() == FALSE) { // Don't update anything while we're invisible. mNearbyListUpdater->setActive(FALSE); @@ -618,9 +620,9 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) mFilterSubString = search_string; + // Searches are case-insensitive LLStringUtil::toUpper(mFilterSubString); LLStringUtil::trimHead(mFilterSubString); - mFilterEditor->setText(mFilterSubString); // Apply new filter to all tabs. filterNearbyList(); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 6c3b5e0664..58ed77f0f2 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -72,7 +72,7 @@ private: void buttonSetAction(const std::string& btn_name, const commit_signal_t::slot_type& cb); void showGroupMenu(LLMenuGL* menu); - /*virtual*/ void onVisibilityChange(BOOL new_visibility); + void onVisibilityChange( const LLSD& new_visibility); void reSelectedCurrentTab(); diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 371c0f2df3..19aef93d7e 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -58,6 +58,7 @@ #include "lldbstrings.h" #include "llfloatergroupinfo.h" #include "llfloatergroups.h" +#include "llfloaterreg.h" #include "llavataractions.h" #include "llnamebox.h" #include "llviewercontrol.h" @@ -836,15 +837,17 @@ void LLPanelPermissions::onClickGroup() if(owners_identical && (owner_id == gAgent.getID())) { - LLFloaterGroupPicker* fg; - fg = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); - fg->setSelectGroupCallback( boost::bind(&LLPanelPermissions::cbGroupID, this, _1) ); - - if (parent_floater) + LLFloaterGroupPicker* fg = LLFloaterReg::showTypedInstance<LLFloaterGroupPicker>("group_picker", LLSD(gAgent.getID())); + if (fg) { - LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, fg); - fg->setOrigin(new_rect.mLeft, new_rect.mBottom); - parent_floater->addDependentFloater(fg); + fg->setSelectGroupCallback( boost::bind(&LLPanelPermissions::cbGroupID, this, _1) ); + + if (parent_floater) + { + LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, fg); + fg->setOrigin(new_rect.mLeft, new_rect.mBottom); + parent_floater->addDependentFloater(fg); + } } } } diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 1fb3eb8b71..31b2d01dcf 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -239,11 +239,10 @@ void LLPanelPlaces::onFilterEdit(const std::string& search_string) { mFilterSubString = search_string; + // Searches are case-insensitive LLStringUtil::toUpper(mFilterSubString); LLStringUtil::trimHead(mFilterSubString); - mFilterEditor->setText(mFilterSubString); - mActivePanel->onSearchEdit(mFilterSubString); } } @@ -480,7 +479,7 @@ void LLPanelPlaces::showLandmarkFoldersMenu() { if (mLandmarkFoldersMenuHandle.isDead()) { - LLMenuGL::Params menu_p; + LLToggleableMenu::Params menu_p; menu_p.name("landmarks_folders_menu"); menu_p.can_tear_off(false); menu_p.visible(false); diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 9a987c8d7c..7faabbb28b 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -442,7 +442,7 @@ void LLPreview::handleReshape(const LLRect& new_rect, bool by_user) // LLMultiPreview::LLMultiPreview() - : LLMultiFloater() + : LLMultiFloater(LLSD()) { // *TODO: There should be a .xml file for this const LLRect& nextrect = LLFloaterReg::getFloaterRect("preview"); // place where the next preview should show up diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index c4037c94fe..6fe23e8aeb 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -69,6 +69,8 @@ void LLPreviewAnim::endAnimCallback( void *userdata ) // virtual BOOL LLPreviewAnim::postBuild() { + mCloseSignal.connect(boost::bind(&LLPreviewAnim::onClose, this)); + const LLInventoryItem* item = getItem(); if(item) { @@ -180,7 +182,7 @@ void LLPreviewAnim::auditionAnim( void *userdata ) } } -void LLPreviewAnim::onClose(bool app_quitting) +void LLPreviewAnim::onClose() { const LLInventoryItem *item = getItem(); @@ -198,5 +200,4 @@ void LLPreviewAnim::onClose(bool app_quitting) motion->setDeactivateCallback(NULL, (void *)NULL); } } - destroy(); } diff --git a/indra/newview/llpreviewanim.h b/indra/newview/llpreviewanim.h index ca42b7e731..d24e624c32 100644 --- a/indra/newview/llpreviewanim.h +++ b/indra/newview/llpreviewanim.h @@ -49,7 +49,7 @@ public: void activate(e_activation_type type); protected: - virtual void onClose(bool app_quitting); + void onClose(); LLAnimPauseRequest mPauseRequest; LLUUID mItemID; diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index ac08fd23a4..04827e3a78 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -260,11 +260,9 @@ BOOL LLPreviewGesture::canClose() } } -// virtual -void LLPreviewGesture::onClose(bool app_quitting) +void LLPreviewGesture::onClose() { - gGestureManager.stopGesture(mPreviewGesture); - LLPreview::onClose(app_quitting); + LLGestureManager::instance().stopGesture(mPreviewGesture); } // virtual @@ -273,18 +271,11 @@ void LLPreviewGesture::onUpdateSucceeded() refresh(); } -// virtual -void LLPreviewGesture::setMinimized(BOOL minimize) +void LLPreviewGesture::onVisibilityChange ( const LLSD& new_visibility ) { - if (minimize != isMinimized()) + if (new_visibility.asBoolean()) { - LLFloater::setMinimized(minimize); - - // We're being restored - if (!minimize) - { - refresh(); - } + refresh(); } } @@ -295,13 +286,13 @@ bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const L switch(option) { case 0: // "Yes" - gGestureManager.stopGesture(mPreviewGesture); + LLGestureManager::instance().stopGesture(mPreviewGesture); mCloseAfterSave = TRUE; onClickSave(this); break; case 1: // "No" - gGestureManager.stopGesture(mPreviewGesture); + LLGestureManager::instance().stopGesture(mPreviewGesture); mDirty = FALSE; // Force the dirty flag because user has clicked NO on confirm save dialog... closeFloater(); break; @@ -363,6 +354,9 @@ LLPreviewGesture::~LLPreviewGesture() BOOL LLPreviewGesture::postBuild() { + mCloseSignal.connect(boost::bind(&LLPreviewGesture::onClose, this)); + mVisibleSignal.connect(boost::bind(&LLPreviewGesture::onVisibilityChange, this, _2)); + LLLineEditor* edit; LLComboBox* combo; LLButton* btn; @@ -778,7 +772,7 @@ void LLPreviewGesture::refresh() mOptionsText->setText(optionstext); - BOOL active = gGestureManager.isGestureActive(mItemUUID); + BOOL active = LLGestureManager::instance().isGestureActive(mItemUUID); mActiveCheck->set(active); // Can only preview if there are steps @@ -1130,10 +1124,10 @@ void LLPreviewGesture::saveIfNeeded() // If this gesture is active, then we need to update the in-memory // active map with the new pointer. - if (!delayedUpload && gGestureManager.isGestureActive(mItemUUID)) + if (!delayedUpload && LLGestureManager::instance().isGestureActive(mItemUUID)) { // gesture manager now owns the pointer - gGestureManager.replaceGesture(mItemUUID, gesture, asset_id); + LLGestureManager::instance().replaceGesture(mItemUUID, gesture, asset_id); // replaceGesture may deactivate other gestures so let the // inventory know. @@ -1694,13 +1688,13 @@ void LLPreviewGesture::onClickDelete(void* data) void LLPreviewGesture::onCommitActive(LLUICtrl* ctrl, void* data) { LLPreviewGesture* self = (LLPreviewGesture*)data; - if (!gGestureManager.isGestureActive(self->mItemUUID)) + if (!LLGestureManager::instance().isGestureActive(self->mItemUUID)) { - gGestureManager.activateGesture(self->mItemUUID); + LLGestureManager::instance().activateGesture(self->mItemUUID); } else { - gGestureManager.deactivateGesture(self->mItemUUID); + LLGestureManager::instance().deactivateGesture(self->mItemUUID); } // Make sure the (active) label in the inventory gets updated. @@ -1739,14 +1733,14 @@ void LLPreviewGesture::onClickPreview(void* data) self->mPreviewBtn->setLabel(self->getString("stop_txt")); // play it, and delete when done - gGestureManager.playGesture(self->mPreviewGesture); + LLGestureManager::instance().playGesture(self->mPreviewGesture); self->refresh(); } else { // Will call onDonePreview() below - gGestureManager.stopGesture(self->mPreviewGesture); + LLGestureManager::instance().stopGesture(self->mPreviewGesture); self->refresh(); } diff --git a/indra/newview/llpreviewgesture.h b/indra/newview/llpreviewgesture.h index d3e9c77789..16ac935775 100644 --- a/indra/newview/llpreviewgesture.h +++ b/indra/newview/llpreviewgesture.h @@ -70,8 +70,6 @@ public: // LLFloater /*virtual*/ BOOL canClose(); - /*virtual*/ void setMinimized(BOOL minimize); - /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void onUpdateSucceeded(); /*virtual*/ void refresh(); @@ -109,7 +107,10 @@ protected: // Add a step. Pass the name of the step, like "Animation", // "Sound", "Chat", or "Wait" LLScrollListItem* addStep(const enum EStepType step_type); - + + void onClose(); + void onVisibilityChange ( const LLSD& new_visibility ); + static std::string getLabel(std::vector<std::string> labels); static void updateLabel(LLScrollListItem* item); diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 7883b1ab06..ad978cc5b3 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -156,10 +156,10 @@ private: LLFloaterScriptSearch* LLFloaterScriptSearch::sInstance = NULL; LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core) -: LLFloater(), +: LLFloater(LLSD()), mEditorCore(editor_core) { - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_search.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_search.xml", NULL); sInstance = this; @@ -640,8 +640,8 @@ void LLScriptEdCore::onBtnDynamicHelp() return; } - live_help_floater = new LLFloater(); - LLUICtrlFactory::getInstance()->buildFloater(live_help_floater, "floater_lsl_guide.xml"); + live_help_floater = new LLFloater(LLSD()); + LLUICtrlFactory::getInstance()->buildFloater(live_help_floater, "floater_lsl_guide.xml", NULL); LLFloater* parent = dynamic_cast<LLFloater*>(getParent()); parent->addDependentFloater(live_help_floater, TRUE); live_help_floater->childSetCommitCallback("lock_check", onCheckLock, this); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index c24b3f0d04..5984af5df4 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -4452,8 +4452,7 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use // the reporter widget askes the server for info about picked objects if (request_flags & COMPLAINT_REPORT_REQUEST ) { - EReportType report_type = COMPLAINT_REPORT ; - LLFloaterReporter *reporterp = LLFloaterReporter::getReporter(report_type); + LLFloaterReporter *reporterp = LLFloaterReg::findTypedInstance<LLFloaterReporter>("reporter"); if (reporterp) { std::string fullname; @@ -5405,6 +5404,7 @@ void dialog_refresh_all() } LLFloaterProperties::dirtyAll(); + LLFloaterInspect* inspect_instance = LLFloaterReg::getTypedInstance<LLFloaterInspect>("inspect"); if(inspect_instance) { diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3410a1eb68..993a092eba 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -293,8 +293,11 @@ public: virtual void done() { // we've downloaded all the items, so repaint the dialog - LLFloaterGesture::refreshAll(); - + LLFloaterGesture* floater = LLFloaterReg::findTypedInstance<LLFloaterGesture>("gestures"); + if (floater) + { + floater->refreshAll(); + } gInventory.removeObserver(this); delete this; } @@ -1229,9 +1232,7 @@ bool idle_startup() { LL_DEBUGS("AppInit") << "Need tos agreement" << LL_ENDL; LLStartUp::setStartupState( STATE_UPDATE_CHECK ); - LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_TOS, - message_response); - tos_dialog->startModal(); + LLFloaterReg::showInstance("message_tos", LLSD(message_response)); // LLFloaterTOS deletes itself. return false; } @@ -1246,9 +1247,7 @@ bool idle_startup() { LL_DEBUGS("AppInit") << "Need critical message" << LL_ENDL; LLStartUp::setStartupState( STATE_UPDATE_CHECK ); - LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_CRITICAL_MESSAGE, - message_response); - tos_dialog->startModal(); + LLFloaterReg::showInstance("message_critical", LLSD(message_response)); // LLFloaterTOS deletes itself. return false; } @@ -1718,13 +1717,6 @@ bool idle_startup() } gLoginMenuBarView->setVisible( FALSE ); gLoginMenuBarView->setEnabled( FALSE ); - - LLFloaterReg::showInitialVisibleInstances(); - - if (gSavedSettings.getBOOL("BeaconAlwaysOn")) - { - LLFloaterReg::showInstance("beacons"); - } if (!gNoRender) { @@ -2171,6 +2163,7 @@ bool idle_startup() // We're successfully logged in. gSavedSettings.setBOOL("FirstLoginThisInstall", FALSE); + LLFloaterReg::showInitialVisibleInstances(); // based on the comments, we've successfully logged in so we can delete the 'forced' // URL that the updater set in settings.ini (in a mostly paranoid fashion) @@ -2227,7 +2220,7 @@ bool idle_startup() // Could schedule and delay these for later. const BOOL no_inform_server = FALSE; const BOOL no_deactivate_similar = FALSE; - gGestureManager.activateGestureWithAsset(item_id, asset_id, + LLGestureManager::instance().activateGestureWithAsset(item_id, asset_id, no_inform_server, no_deactivate_similar); // We need to fetch the inventory items for these gestures diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index d792b972bb..3c7a8d757b 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -110,7 +110,6 @@ public: virtual BOOL handleKeyHere(KEY key, MASK mask); // LLFloater overrides - virtual void onClose(bool app_quitting); virtual BOOL postBuild(); // New functions @@ -131,6 +130,7 @@ public: void commitIfImmediateSet(); void onFilterEdit(const std::string& search_string ); + void onClose(); static void onBtnSetToDefault( void* userdata ); static void onBtnSelect( void* userdata ); @@ -181,7 +181,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( PermissionMask non_immediate_filter_perm_mask, BOOL can_apply_immediately, const std::string& fallback_image_name) -: LLFloater(), +: LLFloater(LLSD()), mOwner( owner ), mImageAssetID( owner->getImageAssetID() ), mFallbackImageName( fallback_image_name ), @@ -197,7 +197,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mContextConeOpacity(0.f) { mCanApplyImmediately = can_apply_immediately; - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_texture_ctrl.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_texture_ctrl.xml",NULL); setCanMinimize(FALSE); } @@ -369,20 +369,20 @@ BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask) return LLFloater::handleKeyHere(key, mask); } -// virtual -void LLFloaterTexturePicker::onClose(bool app_quitting) +void LLFloaterTexturePicker::onClose() { if (mOwner) { mOwner->onFloaterClose(); } stopUsingPipette(); - destroy(); } // virtual BOOL LLFloaterTexturePicker::postBuild() { + mCloseSignal.connect(boost::bind(&LLFloaterTexturePicker::onClose, this)); + LLFloater::postBuild(); if (!mLabel.empty()) @@ -523,9 +523,6 @@ void LLFloaterTexturePicker::draw() childSetEnabled("Pipette", mActive); childSetValue("Pipette", LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); - //RN: reset search bar to reflect actual search query (all caps, for example) - mFilterEdit->setText(mInventoryPanel->getFilterSubString()); - //BOOL allow_copy = FALSE; if( mOwner ) { diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 0d4c75b507..8a7c7708b9 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -42,7 +42,7 @@ using namespace LLNotificationsUI; //-------------------------------------------------------------------------- LLToast::LLToast(LLPanel* panel) : - LLFloater(), + LLFloater(LLSD()), mTimerValue(5), mIsViewed(false), mPanel(panel), diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index afaa01a77a..5d67015526 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -66,7 +66,8 @@ static const S32 HPAD = 25; static const S32 BTN_HPAD = 8; LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal) - : LLToastPanel(notification), + : LLFloater(LLSD()), + LLToastPanel(notification), mDefaultOption( 0 ), mCheck(NULL), mCaution(notification->getPriority() >= NOTIFICATION_PRIORITY_HIGH), @@ -359,11 +360,6 @@ void LLToastAlertPanel::setVisible( BOOL visible ) } } -void LLToastAlertPanel::onClose(bool app_quitting) -{ - LLFloater::onClose(app_quitting); -} - LLToastAlertPanel::~LLToastAlertPanel() { } diff --git a/indra/newview/lltoastalertpanel.h b/indra/newview/lltoastalertpanel.h index f714630c77..543c14d404 100644 --- a/indra/newview/lltoastalertpanel.h +++ b/indra/newview/lltoastalertpanel.h @@ -78,7 +78,6 @@ public: virtual void draw(); virtual void setVisible( BOOL visible ); - virtual void onClose(bool app_quitting); bool setCheckBox( const std::string&, const std::string& ); void setCaution(BOOL val = TRUE) { mCaution = val; } diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 72812d0bb9..70fa2f715b 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -2463,7 +2463,7 @@ EAcceptance LLToolDragAndDrop::dad3dActivateGesture( } else { - gGestureManager.activateGesture(item->getUUID()); + LLGestureManager::instance().activateGesture(item->getUUID()); gInventory.updateItem(item); gInventory.notifyObservers(); } diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 034bb9b88d..9c29131def 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -40,45 +40,74 @@ #include "llcompilequeue.h" #include "llfloaterabout.h" #include "llfloateractivespeakers.h" -#include "llfloaterauction.h" #include "llfloateraddlandmark.h" +#include "llfloateranimpreview.h" +#include "llfloaterauction.h" +#include "llfloateravatarpicker.h" +#include "llfloateravatartextures.h" #include "llfloaterbeacons.h" -#include "llfloaterbulkpermission.h" #include "llfloaterbuildoptions.h" +#include "llfloaterbuy.h" +#include "llfloaterbuycontents.h" +#include "llfloaterbuycurrency.h" +#include "llfloaterbuyland.h" +#include "llfloaterbulkpermission.h" #include "llfloaterbump.h" +#include "llfloatercall.h" #include "llfloatercamera.h" #include "llfloaterchat.h" #include "llfloaterchatterbox.h" +#include "llfloaterdaycycle.h" #include "llfloaterdirectory.h" #include "llfloaterfirsttimetip.h" +#include "llfloaterenvsettings.h" #include "llfloaterfonttest.h" +#include "llfloatergesture.h" #include "llfloatergodtools.h" +#include "llfloatergroupinfo.h" +#include "llfloatergroups.h" +#include "llfloaterhardwaresettings.h" #include "llfloaterhtmlcurrency.h" #include "llfloaterhtmlhelp.h" #include "llfloaterhud.h" +#include "llfloaterimagepreview.h" +#include "llimpanel.h" #include "llfloaterinspect.h" +#include "llfloaterinventory.h" #include "llfloaterjoystick.h" -#include "llfloaternotificationsconsole.h" #include "llfloaterlagmeter.h" #include "llfloaterland.h" +#include "llfloaterlandholdings.h" #include "llfloatermap.h" #include "llfloatermemleak.h" #include "llfloatermute.h" -#include "llfloaterobjectiminfo.h" +#include "llfloaternamedesc.h" +#include "llfloaternotificationsconsole.h" #include "llfloateropenobject.h" +#include "llgivemoney.h" +#include "llfloaterparcel.h" #include "llfloaterperms.h" +#include "llfloaterpostcard.h" +#include "llfloaterpostprocess.h" #include "llfloaterpreference.h" +#include "llfloaterproperties.h" #include "llfloaterregioninfo.h" -#include "llfloatersnapshot.h" +#include "llfloaterreporter.h" +#include "llfloaterscriptdebug.h" +#include "llfloatersellland.h" #include "llfloatersettingsdebug.h" +#include "llfloatersnapshot.h" +#include "llfloatertelehub.h" #include "llfloatertestlistview.h" -#include "llfloatertopobjects.h" #include "llfloatertools.h" +#include "llfloatertos.h" +#include "llfloatertopobjects.h" #include "llfloateruipreview.h" #include "llfloaterurldisplay.h" #include "llfloatervoicedevicesettings.h" +#include "llfloaterwater.h" +#include "llfloaterwindlight.h" #include "llfloaterworldmap.h" -#include "llfloaterinventory.h" #include "llmediaremotectrl.h" #include "llmoveview.h" #include "llnearbychat.h" @@ -96,13 +125,21 @@ void LLViewerFloaterReg::registerFloaters() { + // *NOTE: Please keep these alphabetized for easier merges + LLFloaterReg::add("about_land", "floater_about_land.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLand>); LLFloaterReg::add("active_speakers", "floater_active_speakers.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterActiveSpeakers>); LLFloaterReg::add("add_landmark", "floater_add_landmark.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAddLandmark>); LLFloaterReg::add("auction", "floater_auction.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAuction>); + LLFloaterReg::add("avatar_picker", "floater_avatar_picker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAvatarPicker>); + LLFloaterReg::add("avatar_textures", "floater_avatar_textures.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAvatarTextures>); LLFloaterReg::add("beacons", "floater_beacons.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBeacons>); LLFloaterReg::add("bulk_perms", "floater_bulk_perms.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBulkPermission>); + LLFloaterReg::add("buy_currency", "floater_buy_currency.xml", &LLFloaterBuyCurrency::buildFloater); + LLFloaterReg::add("buy_land", "floater_buy_land.xml", &LLFloaterBuyLand::buildFloater); + LLFloaterReg::add("buy_object", "floater_buy_object.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuy>); + LLFloaterReg::add("buy_object_contents", "floater_buy_contents.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuyContents>); LLFloaterReg::add("build", "floater_tools.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTools>); LLFloaterReg::add("build_options", "floater_build_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuildOptions>); LLFloaterReg::add("bumps", "floater_bumps.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBump>); @@ -115,22 +152,36 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("contacts", "floater_my_friends.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMyFriends>); LLFloaterReg::add("first_time_tip", "floater_first_time_tip.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFirstTimeTip>); + LLFloaterReg::add("env_day_cycle", "floater_day_cycle_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDayCycle>); + LLFloaterReg::add("env_post_process", "floater_post_process.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPostProcess>); + LLFloaterReg::add("env_settings", "floater_env_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEnvSettings>); + LLFloaterReg::add("env_water", "floater_water.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWater>); + LLFloaterReg::add("env_windlight", "floater_windlight_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWindLight>); + LLFloaterReg::add("font_test", "floater_font_test.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFontTest>); + LLFloaterReg::add("gestures", "floater_gesture.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGesture>); LLFloaterReg::add("god_tools", "floater_god_tools.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGodTools>); + LLFloaterReg::add("group_info", "floater_groupinfo.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGroupInfo>); + LLFloaterReg::add("group_picker", "floater_choose_group.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGroupPicker>); - LLFloaterReg::add("html_currency", "floater_html_simple.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHtmlCurrency>); LLFloaterReg::add("hud", "floater_hud.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHUD>); - + LLFloaterReg::add("html_simple", "floater_html_simple.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHtmlSimple>); + + LLFloaterReg::add("impanel", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMFloater>); LLFloaterReg::add("inventory", "floater_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInventory>); LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInspect>); LLFloaterReg::add("lagmeter", "floater_lagmeter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLagMeter>); + LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLandHoldings>); LLFloaterReg::add("mem_leaking", "floater_mem_leaking.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMemLeak>); LLFloaterReg::add("media_browser", "floater_media_browser.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMediaBrowser>); + LLFloaterReg::add("message_critical", "floater_critical.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTOS>); + LLFloaterReg::add("message_tos", "floater_tos.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTOS>); LLFloaterReg::add("moveview", "floater_moveview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMove>); LLFloaterReg::add("mute", "floater_mute.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMute>); + LLFloaterReg::add("mute_object", "floater_mute_object.xml", &LLFloaterMute::buildFloaterMuteObjectUI); LLFloaterReg::add("mini_map", "floater_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMap>); LLFloaterReg::add("mini_inspector", "panel_mini_inspector.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMiniInspector>); @@ -138,8 +189,14 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("nearby_chat", "floater_nearby_chat.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNearbyChat>); LLFloaterReg::add("openobject", "floater_openobject.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterOpenObject>); + + LLFloaterReg::add("parcel_info", "floater_preview_url.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterParcelInfo>); + LLFloaterReg::add("pay_resident", "floater_pay.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPay>); + LLFloaterReg::add("pay_object", "floater_pay_object.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPay>); + LLFloaterReg::add("postcard", "floater_postcard.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPostcard>); LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>); + LLFloaterReg::add("prefs_hardware_settings", "floater_hardware_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHardwareSettings>); LLFloaterReg::add("perm_prefs", "floater_perm_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPerms>); LLFloaterReg::add("preview_url", "floater_preview_url.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterURLDisplay>); LLFloaterReg::add("pref_joystick", "floater_joystick.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterJoystick>); @@ -152,15 +209,21 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("preview_scriptedit", "floater_live_lsleditor.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLLiveLSLEditor>, "preview"); LLFloaterReg::add("preview_sound", "floater_preview_sound.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewSound>, "preview"); LLFloaterReg::add("preview_texture", "floater_preview_texture.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewTexture>, "preview"); - + LLFloaterReg::add("properties", "floater_inventory_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterProperties>); + + LLFloaterReg::add("telehubs", "floater_telehub.xml",&LLFloaterReg::build<LLFloaterTelehub>); LLFloaterReg::add("test_list_view", "floater_test_list_view.xml",&LLFloaterReg::build<LLFloaterTestListView>); LLFloaterReg::add("test_widgets", "floater_test_widgets.xml", &LLFloaterReg::build<LLFloater>); LLFloaterReg::add("top_objects", "floater_top_objects.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTopObjects>); + LLFloaterReg::add("reporter", "floater_report_abuse.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterReporter>); LLFloaterReg::add("reset_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterResetQueue>); LLFloaterReg::add("region_info", "floater_region_info.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterRegionInfo>); - LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsDebug>); + LLFloaterReg::add("script_debug", "floater_script_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptDebug>); + LLFloaterReg::add("script_debug_output", "floater_script_debug_panel.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptDebugOutput>); + LLFloaterReg::add("sell_land", "floater_sell_land.xml", &LLFloaterSellLand::buildFloater); + LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsDebug>); LLFloaterReg::add("stats", "floater_stats.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>); LLFloaterReg::add("start_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterRunQueue>); LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>); @@ -169,14 +232,23 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("search", "floater_directory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDirectory>); LLFloaterReg::add("ui_preview", "floater_ui_preview.xml", &LLFloaterReg::build<LLFloaterUIPreview>); + LLFloaterReg::add("upload_anim", "floater_animation_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAnimPreview>, "upload"); + LLFloaterReg::add("upload_image", "floater_image_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterImagePreview>, "upload"); + LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundPreview>, "upload"); + + LLFloaterReg::add("voice_call", "floater_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCall>); LLFloaterReg::add("world_map", "floater_world_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWorldMap>); + + // *NOTE: Please keep these alphabetized for easier merges - LLObjectIMInfo::register_floater(); // debug use only LLFloaterReg::add("media_remote_ctrl", "floater_media_remote.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMediaRemoteCtrl>); - - // *NOTE: Please keep these alphabetized for easier merges + + // Untested / dangerous - not for release +#if !LL_RELEASE_FOR_DOWNLOAD + LLFloaterReg::add("buy_currency_html", "floater_html_simple.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHtmlCurrency>); +#endif LLFloaterReg::registerControlVariables(); // Make sure visibility and rect controls get preserved when saving } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 75d9321313..bb14a619c5 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -674,13 +674,12 @@ void RezAttachmentCallback::fire(const LLUUID& inv_item) } } -extern LLGestureManager gGestureManager; void ActivateGestureCallback::fire(const LLUUID& inv_item) { if (inv_item.isNull()) return; - gGestureManager.activateGesture(inv_item); + LLGestureManager::instance().activateGesture(inv_item); } void CreateGestureCallback::fire(const LLUUID& inv_item) @@ -688,7 +687,7 @@ void CreateGestureCallback::fire(const LLUUID& inv_item) if (inv_item.isNull()) return; - gGestureManager.activateGesture(inv_item); + LLGestureManager::instance().activateGesture(inv_item); LLViewerInventoryItem* item = gInventory.getItem(inv_item); if (!item) return; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d4cbe580a9..c7df1d9d70 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3049,7 +3049,7 @@ class LLAvatarDebug : public view_listener_t strings.push_back(avatar->getID().asString()); LLUUID invoice; send_generic_message("dumptempassetdata", strings, invoice); - LLFloaterAvatarTextures::show( avatar->getID() ); + LLFloaterReg::showInstance( "avatar_tetures", LLSD(avatar->getID()) ); } return true; } @@ -5337,8 +5337,7 @@ void invite_to_group(const LLUUID& dest_id) LLViewerObject* dest = gObjectList.findObject(dest_id); if(dest && dest->isAvatar()) { - LLFloaterGroupPicker* widget; - widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); + LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance<LLFloaterGroupPicker>("group_picker", LLSD(gAgent.getID())); if (widget) { widget->center(); @@ -5540,11 +5539,7 @@ class LLShowFloater : public view_listener_t bool handleEvent(const LLSD& userdata) { std::string floater_name = userdata.asString(); - if (floater_name == "gestures") - { - LLFloaterGesture::toggleVisibility(); - } - else if (floater_name == "appearance") + if (floater_name == "appearance") { if (gAgentWearables.areWearablesLoaded()) { @@ -5555,10 +5550,6 @@ class LLShowFloater : public view_listener_t { LLToolBar::toggle(NULL); } - else if (floater_name == "my land") - { - LLFloaterLandHoldings::show(NULL); - } else if (floater_name == "buy land") { if (LLViewerParcelMgr::getInstance()->selectionEmpty()) @@ -6815,7 +6806,7 @@ void handle_debug_avatar_textures(void*) LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (objectp) { - LLFloaterAvatarTextures::show(objectp->getID()); + LLFloaterReg::showInstance( "avatar_tetures", LLSD(objectp->getID()) ); } } @@ -7070,8 +7061,8 @@ void handle_load_from_xml(void*) if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) { std::string filename = picker.getFirstFile(); - LLFloater* floater = new LLFloater(); - LLUICtrlFactory::getInstance()->buildFloater(floater, filename); + LLFloater* floater = new LLFloater(LLSD()); + LLUICtrlFactory::getInstance()->buildFloater(floater, filename, NULL); } } @@ -7117,14 +7108,7 @@ void handle_buy_currency_test(void*) llinfos << "buy currency url " << url << llendl; - LLFloaterHtmlCurrency* floater =LLFloaterReg::getTypedInstance<LLFloaterHtmlCurrency>("html_currency", LLSD(url)); - if(floater) - { - LLFloaterReg::showInstance("html_currency", LLSD(url)); - // Needed so we can use secondlife:///app/floater/self/close SLURLs - floater->setTrusted(true); - floater->center(); - } + LLFloaterReg::showInstance("buy_currency_html", LLSD(url)); } void handle_rebake_textures(void*) @@ -7524,16 +7508,7 @@ class LLWorldEnvSettings : public view_listener_t if (tod == "editor") { // if not there or is hidden, show it - if( !LLFloaterEnvSettings::isOpen() || - !LLFloaterEnvSettings::instance()->getVisible()) { - LLFloaterEnvSettings::show(); - - // otherwise, close it button acts like a toggle - } - else - { - LLFloaterEnvSettings::instance()->closeFloater(); - } + LLFloaterReg::toggleInstance("env_settings"); return true; } @@ -7595,17 +7570,7 @@ class LLWorldWaterSettings : public view_listener_t { bool handleEvent(const LLSD& userdata) { - // if not there or is hidden, show it - if( !LLFloaterWater::isOpen() || - !LLFloaterWater::instance()->getVisible()) { - LLFloaterWater::show(); - - // otherwise, close it button acts like a toggle - } - else - { - LLFloaterWater::instance()->closeFloater(); - } + LLFloaterReg::toggleInstance("env_water"); return true; } }; @@ -7615,7 +7580,7 @@ class LLWorldPostProcess : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloaterPostProcess::show(); + LLFloaterReg::showInstance("env_post_process"); return true; } }; @@ -7625,7 +7590,7 @@ class LLWorldDayCycle : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloaterDayCycle::show(); + LLFloaterReg::showInstance("env_day_cycle"); return true; } }; diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index e34c47368c..02e9528f7d 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -37,10 +37,8 @@ // project includes #include "llagent.h" #include "llfilepicker.h" -#include "llfloateranimpreview.h" +#include "llfloaterreg.h" #include "llfloaterbuycurrency.h" -#include "llfloaterimagepreview.h" -#include "llfloaternamedesc.h" #include "llfloatersnapshot.h" #include "llinventorymodel.h" // gInventory #include "llresourcedata.h" @@ -254,8 +252,7 @@ class LLFileUploadImage : public view_listener_t std::string filename = upload_pick((void *)LLFilePicker::FFLOAD_IMAGE); if (!filename.empty()) { - LLFloaterImagePreview* floaterp = new LLFloaterImagePreview(filename); - LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_image_preview.xml"); + LLFloaterReg::showInstance("upload_image", LLSD(filename)); } return TRUE; } @@ -268,9 +265,7 @@ class LLFileUploadSound : public view_listener_t std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_WAV); if (!filename.empty()) { - LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename); - LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_sound_preview.xml"); - floaterp->childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() )); + LLFloaterReg::showInstance("upload_sound", LLSD(filename)); } return true; } @@ -283,8 +278,7 @@ class LLFileUploadAnim : public view_listener_t const std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_ANIM); if (!filename.empty()) { - LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename); - LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_animation_preview.xml"); + LLFloaterReg::showInstance("upload_anim", LLSD(filename)); } return true; } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 129cd5aab9..f8b6e0f687 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1469,6 +1469,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat); BOOL is_linden = LLMuteList::getInstance()->isLinden(name); BOOL is_owned_by_me = FALSE; + BOOL is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL) ? false : true; + BOOL accept_im_from_only_friend = gSavedSettings.getBOOL("VoiceCallsFriendsOnly"); chat.mMuted = is_muted && !is_linden; chat.mFromID = from_id; @@ -1596,7 +1598,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; - if (!is_muted || is_linden) + bool mute_im = is_muted; + if(accept_im_from_only_friend&&!is_friend) + { + mute_im = true; + } + if (!mute_im || is_linden) { gIMMgr->addMessage( session_id, @@ -1787,7 +1794,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Someone has offered us some inventory. { LLOfferInfo* info = new LLOfferInfo; - + bool mute_im = false; if (IM_INVENTORY_OFFERED == dialog) { struct offer_agent_bucket_t @@ -1804,6 +1811,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) bucketp = (struct offer_agent_bucket_t*) &binary_bucket[0]; info->mType = (LLAssetType::EType) bucketp->asset_type; info->mObjectID = bucketp->object_id; + + if(accept_im_from_only_friend&&!is_friend) + { + mute_im = true; + } } else { @@ -1834,7 +1846,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) info->mDesc = message; info->mHost = msg->getSender(); //if (((is_busy && !is_owned_by_me) || is_muted)) - if ( is_muted ) + if ( is_muted || mute_im) { // Same as closing window info->forceResponse(IOR_DECLINE); @@ -2435,12 +2447,17 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // show on screen and add to history LLNotificationsUI::LLNotificationManager::instance().onChat( chat, LLNotificationsUI::NT_NEARBYCHAT); + + // adding temporarily so that communications window chat bar + // works until the new chat window is ready + LLFloaterChat::addChat(chat, FALSE, FALSE); } else { LLNotificationsUI::LLNotificationManager::instance().onChat( chat, LLNotificationsUI::NT_NEARBYCHAT); - // just add to chat history + // adding temporarily + LLFloaterChat::addChatHistory(chat); } } } @@ -4526,9 +4543,6 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/) LL_INFOS_ONCE("Messaging") << "EconomyData message arrived; upload cost is L$" << upload_cost << LL_ENDL; - LLFloaterImagePreview::setUploadAmount(upload_cost); - LLFloaterAnimPreview::setUploadAmount(upload_cost); - gMenuHolder->childSetLabelArg("Upload Image", "[COST]", llformat("%d", upload_cost)); gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", llformat("%d", upload_cost)); gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", llformat("%d", upload_cost)); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index cf3491ef03..ec11e0aee2 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -42,6 +42,7 @@ #include "llviewercontrol.h" #include "lldatapacker.h" #include "llfasttimer.h" +#include "llfloaterreg.h" #include "llfontgl.h" #include "llframetimer.h" #include "llinventory.h" @@ -2595,7 +2596,7 @@ void LLViewerObject::doInventoryCallback() void LLViewerObject::removeInventory(const LLUUID& item_id) { // close any associated floater properties - LLFloaterProperties::closeByID(item_id, mID); + LLFloaterReg::hideInstance("properties", item_id); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_RemoveTaskInventory); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 2f3ed0e68a..ca9e89723c 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -142,20 +142,12 @@ void LLViewerTextureList::doPreloadImages() image->setAddressMode(LLTexUnit::TAM_WRAP); mImagePreloads.insert(image); } - else - { - llinfos << "JAMESDEBUG" << llendl; - } image = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryPassLines.png", MIPMAP_YES, IMMEDIATE_YES); if (image) { image->setAddressMode(LLTexUnit::TAM_WRAP); mImagePreloads.insert(image); } - else - { - llinfos << "JAMESDEBUG" << llendl; - } image = LLViewerTextureManager::getFetchedTexture(DEFAULT_WATER_NORMAL, MIPMAP_YES, IMMEDIATE_YES); if (image) { diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index e44112fb8f..4d51fe2ab8 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -537,7 +537,7 @@ public: ypos += y_inc; } // only display these messages if we are actually rendering beacons at this moment - if (LLPipeline::getRenderBeacons(NULL) && gSavedSettings.getBOOL("BeaconAlwaysOn")) + if (LLPipeline::getRenderBeacons(NULL) && LLFloaterReg::instanceVisible("beacons")) { if (LLPipeline::getRenderParticleBeacons(NULL)) { @@ -2221,7 +2221,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) } // Try for a new-format gesture - if (gGestureManager.triggerGesture(key, mask)) + if (LLGestureManager::instance().triggerGesture(key, mask)) { return TRUE; } diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 62769fe343..a823e5bd99 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -50,6 +50,7 @@ #include "llnotifications.h" #include "llmousehandler.h" #include "llcursortypes.h" +#include "llhandle.h" class LLView; class LLViewerObject; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6658227aaf..2b5c3361c4 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2215,7 +2215,7 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled) else { llinfos << "oops - CurrentGesticulationLevel can be only 0, 1, or 2" << llendl; } // this is the call that Karl S. created for triggering gestures from within the code. - gGestureManager.triggerAndReviseString( gestureString ); + LLGestureManager::instance().triggerAndReviseString( gestureString ); } } diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index 50e407739b..92c223e43d 100644 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -39,6 +39,7 @@ #include "pipeline.h" #include "llsky.h" +#include "llfloaterreg.h" #include "llsliderctrl.h" #include "llspinctrl.h" #include "llcheckboxctrl.h" @@ -270,9 +271,10 @@ void LLWaterParamManager::update(LLViewerCamera * cam) propagateParameters(); // sync menus if they exist - if(LLFloaterWater::isOpen()) + LLFloaterWater* waterfloater = LLFloaterReg::findTypedInstance<LLFloaterWater>("env_water"); + if(waterfloater) { - LLFloaterWater::instance()->syncMenu(); + waterfloater->syncMenu(); } stop_glerror(); diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index b8a2bf0bd2..c237c0bded 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -37,6 +37,7 @@ #include "pipeline.h" #include "llsky.h" +#include "llfloaterreg.h" #include "llsliderctrl.h" #include "llspinctrl.h" #include "llcheckboxctrl.h" @@ -377,17 +378,20 @@ void LLWLParamManager::update(LLViewerCamera * cam) propagateParameters(); // sync menus if they exist - if(LLFloaterWindLight::isOpen()) + LLFloaterWindLight* wlfloater = LLFloaterReg::findTypedInstance<LLFloaterWindLight>("env_windlight"); + if (wlfloater) { - LLFloaterWindLight::instance()->syncMenu(); + wlfloater->syncMenu(); } - if(LLFloaterDayCycle::isOpen()) + LLFloaterDayCycle* dlfloater = LLFloaterReg::findTypedInstance<LLFloaterDayCycle>("env_day_cycle"); + if (dlfloater) { - LLFloaterDayCycle::instance()->syncMenu(); + dlfloater->syncMenu(); } - if(LLFloaterEnvSettings::isOpen()) + LLFloaterEnvSettings* envfloater = LLFloaterReg::findTypedInstance<LLFloaterEnvSettings>("env_settings"); + if (envfloater) { - LLFloaterEnvSettings::instance()->syncMenu(); + envfloater->syncMenu(); } F32 camYaw = cam->getYaw(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 38c81bf027..f422791868 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -66,6 +66,7 @@ #include "llface.h" #include "llfeaturemanager.h" #include "llfloatertelehub.h" +#include "llfloaterreg.h" #include "llgldbg.h" #include "llhudmanager.h" #include "lllightconstants.h" @@ -2299,7 +2300,7 @@ void LLPipeline::postSort(LLCamera& camera) } // only render if the flag is set. The flag is only set if we are in edit mode or the toggle is set in the menus - if (gSavedSettings.getBOOL("BeaconAlwaysOn") && !sShadowRender) + if (LLFloaterReg::instanceVisible("beacons") && !sShadowRender) { if (sRenderScriptedTouchBeacons) { diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index d55f9fa42f..73f0d32d12 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -262,7 +262,7 @@ reference="White" /> <color name="FilterBackgroundColor" - reference="FloaterDefaultBackgroundColor" /> + reference="DkGray" /> <color name="FilterTextColor" value="1 0.78 0.27 1" /> diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index dc5936a435..96d93e7081 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -1,33 +1,24 @@ <textures version="101"> <!-- Please add new files alphabetically to prevent merge conflicts. JC --> + <texture name="Accordion_ArrowClosed_Off" file_name="containers/Accordion_ArrowClosed_Off.png" preload="false" /> + <texture name="Accordion_ArrowClosed_Press" file_name="containers/Accordion_ArrowClosed_Press.png" preload="false" /> + <texture name="Accordion_ArrowOpened_Off" file_name="containers/Accordion_ArrowOpened_Off.png" preload="false" /> + <texture name="Accordion_ArrowOpened_Press" file_name="containers/Accordion_ArrowOpened_Press.png" preload="false" /> + <texture name="Accordion_Off" file_name="containers/Accordion_Off.png" preload="false" /> + <texture name="Accordion_Press" file_name="containers/Accordion_Press.png" preload="false" /> - <texture name="ScrollThumb_Horiz" file_name="widgets/ScrollThumb_Horiz.png" preload="true" scale.left="4" scale.top="10" scale.bottom="53" scale.right="4" /> - <texture name="ScrollThumb_Vert" file_name="widgets/ScrollThumb_Vert.png" preload="true" scale.left="4" scale.top="53" scale.bottom="10" scale.right="4" /> - <texture name="ScrollTrack_Vert" file_name="widgets/ScrollTrack_Vert.png" preload="true" scale.left="2" scale.top="40" scale.bottom="13" scale.right="0" /> - <texture name="ScrollTrack_Horiz" file_name="widgets/ScrollTrack_Horiz.png" preload="true" scale.left="0" scale.top="13" scale.bottom="40" scale.right="2" /> - <texture name="sm_rounded_corners_simple.tga" scale.left="4" scale.top="4" scale.bottom="4" scale.right="4"/> + <texture name="AddItem_Off" file_name="icons/AddItem_Off.png" preload="false" /> + <texture name="AddItem_Press" file_name="icons/AddItem_Press.png" preload="false" /> - <!--There are still references to this old textfield art in the code somewhere -erica--> - <texture name="icn_textfield_enabled.tga" scale.left="5" scale.top="5" scale.bottom="5" scale.right="5"/> - <texture name="icn_rounded-text-field.tga" scale.left="14" scale.bottom="16" scale.top="16" scale.right="114"/> - - <texture name="TextField_Search_Disabled" file_name="widgets/TextField_Search_Disabled.png" preload="true" scale.left="4" scale.top="18" scale.right="252" scale.bottom="4" /> - <texture name="TextField_Off" file_name="widgets/TextField_Off.png" preload="true" scale.left="4" scale.top="18" scale.right="252" scale.bottom="4" /> - <texture name="TextField_Search_Active" file_name="widgets/TextField_Search_Active.png" preload="true" scale.left="4" scale.top="18" scale.right="252" scale.bottom="4" /> - <texture name="TextField_Search_Off" file_name="widgets/TextField_Search_Off.png" preload="true" scale.left="4" scale.top="18" scale.right="252" scale.bottom="4" /> - <texture name="TextField_Disabled" file_name="widgets/TextField_Disabled.png" preload="true" scale.left="4" scale.top="18" scale.right="252" scale.bottom="4" /> - <texture name="TextField_Active" file_name="widgets/TextField_Active.png" preload="true" scale.left="4" scale.top="18" scale.right="252" scale.bottom="4" /> + <texture name="Arrow_Left_Off" file_name="navbar/Arrow_Left_Off.png" preload="true"/> + <texture name="Arrow_Left_Press" file_name="navbar/Arrow_Left_Press.png" preload="true"/> + <texture name="Arrow_Right_Off" file_name="navbar/Arrow_Right_Off.png" preload="true"/> + <texture name="Arrow_Right_Press" file_name="navbar/Arrow_Right_Press.png" preload="true"/> - <texture name="PushButton_Off" file_name="widgets/PushButton_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> - <texture name="PushButton_Press" file_name="widgets/PushButton_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> - <texture name="PushButton_Disabled" file_name="widgets/PushButton_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> - <texture name="PushButton_Selected" file_name="widgets/PushButton_Selected.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> - <texture name="PushButton_Selected_Press" file_name="widgets/PushButton_Selected_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> - <texture name="PushButton_Selected_Disabled" file_name="widgets/PushButton_Selected_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> + <texture name="BackArrow_Off" file_name="icons/BackArrow_Off.png" preload="false" /> + <texture name="BackArrow_Press" file_name="icons/BackArrow_Press.png" preload="false" /> - <texture name="toolbar_btn_enabled.tga" scale.left="7" scale.top="32" scale.right="121" scale.bottom="0" /> - <texture name="toolbar_btn_disabled.tga" scale.left="7" scale.top="32" scale.right="121" scale.bottom="0" /> - <texture name="toolbar_btn_selected.tga" scale.left="7" scale.top="32" scale.right="121" scale.bottom="0" /> + <texture name="BottomTray_BG" file_name="bottomtray/BottomTray_BG.png" preload="false" /> <texture name="Checkbox_Off_Disabled" file_name="widgets/Checkbox_Disabled.png" preload="true" /> <texture name="Checkbox_On_Disabled" file_name="widgets/Checkbox_On_Disabled.png" preload="true" /> @@ -35,124 +26,314 @@ <texture name="Checkbox_On" file_name="widgets/Checkbox_On.png" preload="true" /> <texture name="Checkbox_On_Press" file_name="widgets/Checkbox_On_Press.png" preload="true" /> <texture name="Checkbox_Press" file_name="widgets/Checkbox_Press.png" preload="true" /> - <texture name="RadioButton_On_Press" file_name="widgets/RadioButton_On_Press.png" preload="true" /> - <texture name="minimize_inactive.tga" preload="true"/> - <texture name="minimize.tga" preload="true" /> - <texture name="minimize_pressed.tga" preload="true"/> + <texture name="ComboButton_Disabled" file_name="widgets/ComboButton_Disabled.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + <texture name="ComboButton_Over" file_name="widgets/ComboButton_Over.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + <texture name="ComboButton_Press" file_name="widgets/ComboButton_Press.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + <texture name="ComboButton_Selected" file_name="widgets/ComboButton_Selected.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + <texture name="ComboButton_Off" file_name="widgets/ComboButton_Off.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + + <texture name="Container" file_name="containers/Container.png" preload="false" /> + + <texture name="DisclosureArrow_Closed_Off" file_name="widgets/DisclosureArrow_Closed_Off.png" preload="true" /> + <texture name="DisclosureArrow_Closed_Press" file_name="widgets/DisclosureArrow_Closed_Press.png" preload="true" /> + <texture name="DisclosureArrow_Opened_Off" file_name="widgets/DisclosureArrow_Opened_Off.png" preload="true" /> + <texture name="DisclosureArrow_Opened_Press" file_name="widgets/DisclosureArrow_Opened_Press.png" preload="true" /> + + <texture name="DownArrow" file_name="bottomtray/DownArrow.png" preload="false" /> + + <texture name="DropDown_Disabled" file_name="widgets/DropDown_Disabled.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + <texture name="DropDown_Over" file_name="widgets/DropDown_Over.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + <texture name="DropDown_Press" file_name="widgets/DropDown_Press.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + <texture name="DropDown_Selected" file_name="widgets/DropDown_Selected.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + <texture name="DropDown_Off" file_name="widgets/DropDown_Off.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + + <texture name="Favorite_Star_Active" file_name="navbar/Favorite_Star_Active.png" preload="false" /> + <texture name="Favorite_Star_Off" file_name="navbar/Favorite_Star_Off.png" preload="false" /> + <texture name="Favorite_Star_Press" file_name="navbar/Favorite_Star_Press.png" preload="false" /> + <texture name="Favorite_Star_Over" file_name="navbar/Favorite_Star_Over.png" preload="false"/> + + <texture name="FileMenu_BarSelect" file_name="navbar/FileMenu_BarSelect.png" preload="false" /> + <texture name="FileMenu_BG" file_name="navbar/FileMenu_BG.png" preload="false" /> + + <texture name="Help_Off" file_name="navbar/Help_Off.png" preload="false"/> + <texture name="Help_Press" file_name="navbar/Help_Press.png" preload="false"/> + + <texture name="History_Arrow" file_name="navbar/History_Arrow.png" preload="true"/> + + <texture name="Home_Off" file_name="navbar/Home_Off.png" preload="false"/> + <texture name="Home_Press" file_name="navbar/Home_Press.png" preload="false"/> <texture name="Icon_Close_Background" file_name="windows/Icon_Close_Background.png" preload="true" /> <texture name="Icon_Close_Foreground" file_name="windows/Icon_Close_Foreground.png" preload="true" /> <texture name="Icon_Close_Press" file_name="windows/Icon_Close_Press.png" preload="true" /> <texture name="Icon_Close_Toast" file_name="windows/Icon_Close_Toast.png" preload="true" /> + <texture name="Icon_Dock_Background" file_name="windows/Icon_Dock_Background.png" preload="true" /> <texture name="Icon_Dock_Foreground" file_name="windows/Icon_Dock_Foreground.png" preload="true" /> <texture name="Icon_Dock_Press" file_name="windows/Icon_Dock_Press.png" preload="true" /> + + <texture name="Icon_Gear_Background" file_name="windows/Icon_Gear_Background.png" preload="false"/> + <texture name="Icon_Gear_Foreground" file_name="windows/Icon_Gear_Foreground.png" preload="false"/> + <texture name="Icon_Gear_Press" file_name="windows/Icon_Gear_Press.png" preload="false"/> + <texture name="Icon_Undock_Background" file_name="windows/Icon_Undock_Background.png" preload="true" /> <texture name="Icon_Undock_Foreground" file_name="windows/Icon_Undock_Foreground.png" preload="true" /> <texture name="Icon_Undock_Press" file_name="windows/Icon_Undock_Press.png" preload="true" /> - <texture name="Toast_CloseBtn" file_name="windows/Toast_CloseBtn.png" preload="true" /> - <texture name="Toast" file_name="windows/Toast.png" preload="true" /> - - <texture name="Window_Background" file_name="windows/Window_Background.png" preload="true" /> - <texture name="Window_Foreground" file_name="windows/Window_Foreground.png" preload="true" /> - - <texture name="Favorite_Star_Active" file_name="navbar/Favorite_Star_Active.png" preload="true" /> - <texture name="Favorite_Star_Off" file_name="navbar/Favorite_Star_Off.png" preload="true" /> - <texture name="Favorite_Star_Press" file_name="navbar/Favorite_Star_Press.png" preload="true" /> - <texture name="FileMenu_BarSelect" file_name="navbar/FileMenu_BarSelect.png" preload="true" /> - <texture name="FileMenu_BG" file_name="navbar/FileMenu_BG.png" preload="true" /> - <texture name="NavBar_BG_NoFav" file_name="navbar/NavBar_BG_NoFav.png" preload="true" /> - <texture name="NavBar_BG" file_name="navbar/NavBar_BG.png" preload="true" /> - <texture name="Row_Selection" file_name="navbar/Row_Selection.png" preload="true" /> - - <texture name="BottomTray_BG" file_name="bottomtray/BottomTray_BG.png" preload="true" /> - <texture name="DownArrow" file_name="bottomtray/DownArrow.png" preload="true" /> - <texture name="NearbyVoice_Lvl1" file_name="bottomtray/NearbyVoice_Lvl1.png" preload="true" /> - <texture name="NearbyVoice_Lvl2" file_name="bottomtray/NearbyVoice_Lvl2.png" preload="true" /> - <texture name="NearbyVoice_Lvl3" file_name="bottomtray/NearbyVoice_Lvl3.png" preload="true" /> - <texture name="NearbyVoice_On" file_name="bottomtray/NearbyVoice_On.png" preload="true" /> - <texture name="Unread_IM" file_name="bottomtray/Unread_IM.png" preload="true" /> - <texture name="Unread_Msg" file_name="bottomtray/Unread_Msg.png" preload="true" /> - <texture name="VoicePPT_Lvl1" file_name="bottomtray/VoicePPT_Lvl1.png" preload="true" /> - <texture name="VoicePPT_Lvl2" file_name="bottomtray/VoicePPT_Lvl2.png" preload="true" /> - <texture name="VoicePPT_Lvl3" file_name="bottomtray/VoicePPT_Lvl3.png" preload="true" /> - <texture name="VoicePPT_Off" file_name="bottomtray/VoicePPT_Off.png" preload="true" /> - <texture name="VoicePPT_On" file_name="bottomtray/VoicePPT_On.png" preload="true" /> - - <texture name="Accordion_ArrowClosed_Off" file_name="containers/Accordion_ArrowClosed_Off.png" preload="true" /> - <texture name="Accordion_ArrowClosed_Press" file_name="containers/Accordion_ArrowClosed_Press.png" preload="true" /> - <texture name="Accordion_ArrowOpened_Off" file_name="containers/Accordion_ArrowOpened_Off.png" preload="true" /> - <texture name="Accordion_ArrowOpened_Press" file_name="containers/Accordion_ArrowOpened_Press.png" preload="true" /> - <texture name="Accordion_Off" file_name="containers/Accordion_Off.png" preload="true" /> - <texture name="Accordion_Press" file_name="containers/Accordion_Press.png" preload="true" /> - <texture name="Container" file_name="containers/Container.png" preload="true" /> - <texture name="TabTop_Divider" file_name="containers/TabTop_Divider.png" preload="true" /> - <texture name="TabTop_Left_Press" file_name="containers/TabTop_Left_Press.png" preload="true" /> - <texture name="TabTop_Middle_Press" file_name="containers/TabTop_Middle_Press.png" preload="true" /> - <texture name="TabTop_Right_Off" file_name="containers/TabTop_Right_Off.png" preload="true" /> - <texture name="TabTop_Right_Press" file_name="containers/TabTop_Right_Press.png" preload="true" /> - <texture name="TabTop_Right_Selected" file_name="containers/TabTop_Right_Selected.png" preload="true" /> - <texture name="Toolbar_Divider" file_name="containers/Toolbar_Divider.png" preload="true" /> - <texture name="Toolbar_Left_Off" file_name="containers/Toolbar_Left_Off.png" preload="true" /> - <texture name="Toolbar_Left_Press" file_name="containers/Toolbar_Left_Press.png" preload="true" /> - <texture name="Toolbar_Left_Selected" file_name="containers/Toolbar_Left_Selected.png" preload="true" /> - <texture name="Toolbar_Middle_Off" file_name="containers/Toolbar_Middle_Off.png" preload="true" /> - <texture name="Toolbar_Middle_Press" file_name="containers/Toolbar_Middle_Press.png" preload="true" /> - <texture name="Toolbar_Middle_Selected" file_name="containers/Toolbar_Middle_Selected.png" preload="true" /> - <texture name="Toolbar_Right_Off" file_name="containers/Toolbar_Right_Off.png" preload="true" /> - <texture name="Toolbar_Right_Press" file_name="containers/Toolbar_Right_Press.png" preload="true" /> - <texture name="Toolbar_Right_Selected" file_name="containers/Toolbar_Right_Selected.png" preload="true" /> - - <texture name="AddItem_Off" file_name="icons/AddItem_Off.png" preload="true" /> - <texture name="AddItem_Press" file_name="icons/AddItem_Press.png" preload="true" /> - <texture name="BackArrow_Off" file_name="icons/BackArrow_Off.png" preload="true" /> - <texture name="BackArrow_Press" file_name="icons/BackArrow_Press.png" preload="true" /> - <texture name="Info" file_name="icons/Info.png" preload="true" /> - <texture name="OptionsMenu_Off" file_name="icons/OptionsMenu_Off.png" preload="true" /> - <texture name="OptionsMenu_Press" file_name="icons/OptionsMenu_Press.png" preload="true" /> - <texture name="TrashItem_Off" file_name="icons/TrashItem_Off.png" preload="true" /> - <texture name="TrashItem_Press" file_name="icons/TrashItem_Press.png" preload="true" /> - <texture name="Widget_DownArrow" file_name="icons/Widget_DownArrow.png" preload="true" /> - - <texture name="TabIcon_Close_Off" file_name="taskpanel/TabIcon_Close_Off.png" preload="true" /> - <texture name="TabIcon_Home_Off" file_name="taskpanel/TabIcon_Home_Off.png" preload="true" /> - <texture name="TabIcon_Home_Selected" file_name="taskpanel/TabIcon_Home_Selected.png" preload="true" /> - <texture name="TabIcon_Me_Off" file_name="taskpanel/TabIcon_Me_Off.png" preload="true" /> - <texture name="TabIcon_Me_Selected" file_name="taskpanel/TabIcon_Me_Selected.png" preload="true" /> - <texture name="TabIcon_Open_Off" file_name="taskpanel/TabIcon_Open_Off.png" preload="true" /> - <texture name="TabIcon_People_Off" file_name="taskpanel/TabIcon_People_Off.png" preload="true" /> - <texture name="TabIcon_People_Selected" file_name="taskpanel/TabIcon_People_Selected.png" preload="true" /> - <texture name="TabIcon_Places_Off" file_name="taskpanel/TabIcon_Places_Off.png" preload="true" /> - <texture name="TabIcon_Places_Selected" file_name="taskpanel/TabIcon_Places_Selected.png" preload="true" /> - <texture name="TabIcon_Things_Off" file_name="taskpanel/TabIcon_Things_Off.png" preload="true" /> - <texture name="TabIcon_Things_Selected" file_name="taskpanel/TabIcon_Things_Selected.png" preload="true" /> - - <texture name="DisclosureArrow_Closed_Off" file_name="widgets/DisclosureArrow_Closed_Off.png" preload="true" /> - <texture name="DisclosureArrow_Closed_Process" file_name="widgets/DisclosureArrow_Closed_Process.png" preload="true" /> - <texture name="DisclosureArrow_Opened_Off" file_name="widgets/DisclosureArrow_Opened_Off.png" preload="true" /> - <texture name="DisclosureArrow_Opened_Press" file_name="widgets/DisclosureArrow_Opened_Press.png" preload="true" /> + + <texture name="Info" file_name="icons/Info.png" preload="false" /> + + <texture name="Info_Off" file_name="navbar/Info_Off.png" preload="false"/> + <texture name="Info_Press" file_name="navbar/Info_Press.png" preload="false"/> + <texture name="ListItem_Select" file_name="widgets/ListItem_Select.png" preload="true" /> + <texture name="menu_separator" file_name="navbar/FileMenu_Divider.png" scale.left="4" scale.top="166" scale.right="0" scale.bottom="0" /> + + <texture name="NavBar_BG_NoFav" file_name="navbar/NavBar_BG_NoFav.png" preload="false" /> + <texture name="NavBar_BG" file_name="navbar/NavBar_BG.png" preload="false" /> + + <texture name="NearbyVoice_Lvl1" file_name="bottomtray/NearbyVoice_Lvl1.png" preload="false" /> + <texture name="NearbyVoice_Lvl2" file_name="bottomtray/NearbyVoice_Lvl2.png" preload="false" /> + <texture name="NearbyVoice_Lvl3" file_name="bottomtray/NearbyVoice_Lvl3.png" preload="false" /> + <texture name="NearbyVoice_On" file_name="bottomtray/NearbyVoice_On.png" preload="false" /> + + <texture name="OptionsMenu_Off" file_name="icons/OptionsMenu_Off.png" preload="false" /> + <texture name="OptionsMenu_Press" file_name="icons/OptionsMenu_Press.png" preload="false" /> + + <texture name="ProgressBar" file_name="widgets/ProgressBar.png" preload="true" scale.left="4" scale.top="10" scale.right="48" scale.bottom="2" /> + <texture name="ProgressTrack" file_name="widgets/ProgressTrack.png" preload="true" scale.left="4" scale.top="13" scale.right="148" scale.bottom="2" /> + + <texture name="PushButton_Off" file_name="widgets/PushButton_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> + <texture name="PushButton_Press" file_name="widgets/PushButton_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> + <texture name="PushButton_Disabled" file_name="widgets/PushButton_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> + <texture name="PushButton_Selected" file_name="widgets/PushButton_Selected.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> + <texture name="PushButton_Selected_Press" file_name="widgets/PushButton_Selected_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> + <texture name="PushButton_Selected_Disabled" file_name="widgets/PushButton_Selected_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" /> + + <texture name="RadioButton_On_Press" file_name="widgets/RadioButton_On_Press.png" preload="true" /> <texture name="RadioButton_Off" file_name="widgets/RadioButton_Off.png" preload="true" /> <texture name="RadioButton_On" file_name="widgets/RadioButton_On.png" preload="true" /> <texture name="RadioButton_Disabled" file_name="widgets/RadioButton_Disabled.png" preload="true" /> <texture name="RadioButton_On_Disabled" file_name="widgets/RadioButton_On_Disabled.png" preload="true" /> - <texture name="ComboButton_Disabled" file_name="widgets/ComboButton_Disabled.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="ComboButton_Over" file_name="widgets/ComboButton_Over.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="ComboButton_Press" file_name="widgets/ComboButton_Press.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="ComboButton_Selected" file_name="widgets/ComboButton_Selected.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="ComboButton_Off" file_name="widgets/ComboButton_Off.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + <texture name="Resize_Corner" file_name="windows/Resize_Corner.png" preload="true"/> - <texture name="DropDown_Disabled" file_name="widgets/DropDown_Disabled.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="DropDown_Over" file_name="widgets/DropDown_Over.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="DropDown_Press" file_name="widgets/DropDown_Press.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="DropDown_Selected" file_name="widgets/DropDown_Selected.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="DropDown_Off" file_name="widgets/DropDown_Off.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> + <texture name="Row_Selection" file_name="navbar/Row_Selection.png" preload="false" /> - <texture name="Resize_Corner" file_name="windows/Resize_Corner.png" preload="true"/> + <texture name="ScrollArrow_Down" file_name="widgets/ScrollArrow_Down.png" preload="true" scale.left="2" scale.top="13" scale.right="13" scale.bottom="2" /> + <texture name="ScrollArrow_Left" file_name="widgets/ScrollArrow_Left.png" preload="true" scale.left="2" scale.top="13" scale.right="13" scale.bottom="2" /> + <texture name="ScrollArrow_Right" file_name="widgets/ScrollArrow_Right.png" preload="true" scale.left="2" scale.top="13" scale.right="13" scale.bottom="2" /> + <texture name="ScrollArrow_Up" file_name="widgets/ScrollArrow_Up.png" preload="true" scale.left="2" scale.top="13" scale.right="13" scale.bottom="2" /> + + <texture name="ScrollThumb_Horiz" file_name="widgets/ScrollThumb_Horiz.png" preload="true" scale.left="0" scale.top="0" scale.bottom="0" scale.right="0" /> + <texture name="ScrollThumb_Vert" file_name="widgets/ScrollThumb_Vert.png" preload="true" scale.left="4" scale.top="53" scale.bottom="10" scale.right="4" /> + <texture name="ScrollTrack_Vert" file_name="widgets/ScrollTrack_Vert.png" preload="true" scale.left="2" scale.top="40" scale.bottom="13" scale.right="0" /> + <texture name="ScrollTrack_Horiz" file_name="widgets/ScrollTrack_Horiz.png" preload="true" scale.left="0" scale.top="0" scale.bottom="0" scale.right="2" /> + + <texture name="Search" file_name="navbar/Search.png" preload="false"/> + + <texture name="SegmentedBtn_Left_Off" file_name="widgets/SegmentedBtn_Left_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Left_Press" file_name="widgets/SegmentedBtn_Left_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Left_Disabled" file_name="widgets/SegmentedBtn_Left_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Left_Selected" file_name="widgets/SegmentedBtn_Left_Selected.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Left_Selected_Press" file_name="widgets/SegmentedBtn_Left_Selected_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Left_Selected_Disabled" file_name="widgets/SegmentedBtn_Left_Selected_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + + <texture name="SegmentedBtn_Middle_Off" file_name="widgets/SegmentedBtn_Middle_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Middle_Press" file_name="widgets/SegmentedBtn_Middle_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Middle_Disabled" file_name="widgets/SegmentedBtn_Middle_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Middle_Selected" file_name="widgets/SegmentedBtn_Middle_Selected.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Middle_Selected_Press" file_name="widgets/SegmentedBtn_Middle_Selected_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Middle_Selected_Disabled" file_name="widgets/SegmentedBtn_Middle_Selected_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + + <texture name="SegmentedBtn_Right_Off" file_name="widgets/SegmentedBtn_Right_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Right_Press" file_name="widgets/SegmentedBtn_Right_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Right_Disabled" file_name="widgets/SegmentedBtn_Right_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Right_Selected" file_name="widgets/SegmentedBtn_Right_Selected.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Right_Selected_Press" file_name="widgets/SegmentedBtn_Right_Selected_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SegmentedBtn_Right_Selected_Disabled" file_name="widgets/SegmentedBtn_Right_Selected_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + + <texture name="SliderTrack_Horiz" file_name="widgets/SliderTrack_Horiz.png" scale.left="4" scale.top="4" scale.right="100" scale.bottom="2" /> + <texture name="SliderTrack_Vert" file_name="widgets/SliderTrack_Vert.png" scale.left="2" scale.top="100" scale.right="4" scale.bottom="4" /> + <texture name="SliderThumb_Off" file_name="widgets/SliderThumb_Off.png" /> + <texture name="SliderThumb_Disabled" file_name="widgets/SliderThumb_Disabled.png" /> + <texture name="SliderThumb_Press" file_name="widgets/SliderThumb_Press.png" /> + + <texture name="Stepper_Down_Disabled" file_name="widgets/Stepper_Down_Disabled.png" preload="true"/> + <texture name="Stepper_Down_Off" file_name="widgets/Stepper_Down_Off.png" preload="true"/> + <texture name="Stepper_Down_Press" file_name="widgets/Stepper_Down_Press.png" preload="true"/> + <texture name="Stepper_Up_Disabled" file_name="widgets/Stepper_Up_Disabled.png" preload="true"/> + <texture name="Stepper_Up_Off" file_name="widgets/Stepper_Up_Off.png" preload="true"/> + <texture name="Stepper_Up_Press" file_name="widgets/Stepper_Up_Press.png" preload="true"/> + + <texture name="TabIcon_Close_Off" file_name="taskpanel/TabIcon_Close_Off.png" preload="false" /> + <texture name="TabIcon_Close_Over" file_name="taskpanel/TabIcon_Close_Over.png" preload="false"/> + <texture name="TabIcon_Home_Off" file_name="taskpanel/TabIcon_Home_Off.png" preload="false" /> + <texture name="TabIcon_Home_Over" file_name="taskpanel/TabIcon_Home_Over.png" preload="false"/> + <texture name="TabIcon_Home_Selected" file_name="taskpanel/TabIcon_Home_Selected.png" preload="false" /> + <texture name="TabIcon_Me_Off" file_name="taskpanel/TabIcon_Me_Off.png" preload="false" /> + <texture name="TabIcon_Me_Over" file_name="taskpanel/TabIcon_Me_Over.png" preload="false"/> + <texture name="TabIcon_Me_Selected" file_name="taskpanel/TabIcon_Me_Selected.png" preload="false" /> + <texture name="TabIcon_Open_Off" file_name="taskpanel/TabIcon_Open_Off.png" preload="false" /> + <texture name="TabIcon_Open_Over" file_name="taskpanel/TabIcon_Open_Over.png" preload="false"/> + <texture name="TabIcon_People_Off" file_name="taskpanel/TabIcon_People_Off.png" preload="false" /> + <texture name="TabIcon_People_Over" file_name="taskpanel/TabIcon_People_Over.png" preload="false"/> + <texture name="TabIcon_People_Selected" file_name="taskpanel/TabIcon_People_Selected.png" preload="false" /> + <texture name="TabIcon_Places_Over" file_name="taskpanel/TabIcon_Places_Over.png" preload="false"/> + <texture name="TabIcon_Places_Off" file_name="taskpanel/TabIcon_Places_Off.png" preload="false" /> + <texture name="TabIcon_Places_Selected" file_name="taskpanel/TabIcon_Places_Selected.png" preload="false" /> + <texture name="TabIcon_Things_Off" file_name="taskpanel/TabIcon_Things_Off.png" preload="false" /> + <texture name="TabIcon_Things_Selected" file_name="taskpanel/TabIcon_Things_Selected.png" preload="false" /> + <texture name="TabIcon_Things_Over" file_name="taskpanel/TabIcon_Things_Over.png" preload="false"/> + + <texture name="TabTop_Divider" file_name="containers/TabTop_Divider.png" preload="false" /> + <texture name="TabTop_Left_Press" file_name="containers/TabTop_Left_Press.png" preload="false" /> + <texture name="TabTop_Middle_Press" file_name="containers/TabTop_Middle_Press.png" preload="false" /> + <texture name="TabTop_Right_Off" file_name="containers/TabTop_Right_Off.png" preload="false" /> + <texture name="TabTop_Right_Press" file_name="containers/TabTop_Right_Press.png" preload="false" /> + <texture name="TabTop_Right_Selected" file_name="containers/TabTop_Right_Selected.png" preload="false" /> + <texture name="TabTop_Middle_Off" file_name="containers/TabTop_Middle_Off.png" preload="false" scale.left="8" scale.top="8" scale.right="120" scale.bottom="9" /> + <texture name="TabTop_Middle_Selected" file_name="containers/TabTop_Middle_Selected.png" preload="false" scale.left="8" scale.top="8" scale.right="96" scale.bottom="9" /> + <texture name="TabTop_Left_Off" file_name="containers/TabTop_Left_Off.png" preload="false" scale.left="8" scale.top="8" scale.right="120" scale.bottom="9"/> + <texture name="TabTop_Left_Selected" file_name="containers/TabTop_Left_Selected.png" preload="false" scale.left="8" scale.top="8" scale.right="96" scale.bottom="9"/> + + <texture name="TaskPanel_Tab_Off" file_name="taskpanel/TaskPanel_Tab_Off.png" preload="false" scale.left="4" scale.top="29" scale.right="36" scale.bottom="4" /> + <texture name="TaskPanel_Tab_Selected" file_name="taskpanel/TaskPanel_Tab_Selected.png" preload="false" scale.left="5" scale.top="30" scale.right="36" scale.bottom="5" /> + <texture name="TaskPanel_BG" file_name="taskpanel/TaskPanel_BG.png" preload="false" scale.left="4" scale.top="146" scale.right="146" scale.bottom="4" /> + <texture name="TaskPanel_Tab_Unselected" file_name="taskpanel/TaskPanel_Tab_Over.png" preload="false" scale.left="5" scale.top="30" scale.right="36" scale.bottom="5" /> + + <texture name="TextField_Search_Disabled" file_name="widgets/TextField_Search_Disabled.png" preload="true" scale.left="4" scale.top="18" scale.right="252" scale.bottom="4" /> + <texture name="TextField_Off" file_name="widgets/TextField_Off.png" preload="true" scale.left="4" scale.top="18" scale.right="252" scale.bottom="4" /> + <texture name="TextField_Search_Active" file_name="widgets/TextField_Search_Active.png" preload="true" scale.left="4" scale.top="18" scale.right="252" scale.bottom="4" /> + <texture name="TextField_Search_Off" file_name="widgets/TextField_Search_Off.png" preload="true" scale.left="4" scale.top="18" scale.right="252" scale.bottom="4" /> + <texture name="TextField_Disabled" file_name="widgets/TextField_Disabled.png" preload="true" scale.left="4" scale.top="18" scale.right="252" scale.bottom="4" /> + <texture name="TextField_Active" file_name="widgets/TextField_Active.png" preload="true" scale.left="4" scale.top="18" scale.right="252" scale.bottom="4" /> + + <texture name="Toast_CloseBtn" file_name="windows/Toast_CloseBtn.png" preload="true" /> + <texture name="Toast" file_name="windows/Toast.png" preload="true" /> + + <texture name="Toolbar_Divider" file_name="containers/Toolbar_Divider.png" preload="false" /> + <texture name="Toolbar_Left_Off" file_name="containers/Toolbar_Left_Off.png" preload="false" /> + <texture name="Toolbar_Left_Press" file_name="containers/Toolbar_Left_Press.png" preload="false" /> + <texture name="Toolbar_Left_Selected" file_name="containers/Toolbar_Left_Selected.png" preload="false" /> + <texture name="Toolbar_Middle_Off" file_name="containers/Toolbar_Middle_Off.png" preload="false" /> + <texture name="Toolbar_Middle_Press" file_name="containers/Toolbar_Middle_Press.png" preload="false" /> + <texture name="Toolbar_Middle_Selected" file_name="containers/Toolbar_Middle_Selected.png" preload="false" /> + <texture name="Toolbar_Right_Off" file_name="containers/Toolbar_Right_Off.png" preload="false" /> + <texture name="Toolbar_Right_Press" file_name="containers/Toolbar_Right_Press.png" preload="false" /> + <texture name="Toolbar_Right_Selected" file_name="containers/Toolbar_Right_Selected.png" preload="false" /> + + <texture name="TrashItem_Off" file_name="icons/TrashItem_Off.png" preload="false" /> + <texture name="TrashItem_Press" file_name="icons/TrashItem_Press.png" preload="false" /> + + <texture name="Unread_IM" file_name="bottomtray/Unread_IM.png" preload="false" /> + <texture name="Unread_Msg" file_name="bottomtray/Unread_Msg.png" preload="false" /> + + <texture name="VoicePTT_Lvl1" file_name="bottomtray/VoicePTT_Lvl1.png" preload="false" /> + <texture name="VoicePTT_Lvl2" file_name="bottomtray/VoicePTT_Lvl2.png" preload="false" /> + <texture name="VoicePTT_Lvl3" file_name="bottomtray/VoicePTT_Lvl3.png" preload="false" /> + <texture name="VoicePTT_Off" file_name="bottomtray/VoicePTT_Off.png" preload="false" /> + <texture name="VoicePTT_On" file_name="bottomtray/VoicePTT_On.png" preload="false" /> + + <texture name="Widget_DownArrow" file_name="icons/Widget_DownArrow.png" preload="true" /> + + <texture name="Window_Background" file_name="windows/Window_Background.png" preload="true" /> + <texture name="Window_Foreground" file_name="windows/Window_Foreground.png" preload="true" /> + + + + + + <!--There are still references to this old textfield art in the code somewhere -erica--> + + <texture name="btn_chatbar.tga" scale.left="20" scale.top="24" scale.right="44" scale.bottom="0"/> + <texture name="btn_chatbar_selected.tga" scale.left="20" scale.top="24" scale.right="44" scale.bottom="0"/> + + <texture name="cam_rotate_out.tga" preload="false"/> + <texture name="cam_rotate_in.tga" preload="false"/> + <texture name="cam_zoom_out.tga" preload="false"/> + <texture name="cam_zoom_plus_in.tga" preload="false"/> + <texture name="cam_zoom_minus_in.tga" preload="false"/> + + <texture name="close_inactive_blue.tga"/> + <texture name="closebox.tga"/> + <texture name="icn_clear_lineeditor.tga" /> + + <texture name="icn_chatbar.tga"/> + <texture name="icn_media-pause.tga"/> + <texture name="icn_media-play.tga"/> + <texture name="icn_music-play.tga"/> + <texture name="icn_music-pause.tga"/> + <texture name="icn_media_web.tga" preload="true"/> + <texture name="icn_media_movie.tga" preload="true"/> + + <texture name="icn_speaker-muted_dark.tga"/> + <texture name="icn_speaker_dark.tga"/> + + <texture name="icn_voice-localchat.tga"/> + <texture name="icn_voice-groupfocus.tga"/> + <texture name="icn_voice-pvtfocus.tga"/> + + <texture name="jump_left_out.tga"/> + <texture name="jump_left_in.tga"/> + <texture name="jump_right_out.tga"/> + <texture name="jump_right_in.tga"/> + + <texture name="move_forward_out.tga" preload="false"/> + <texture name="move_forward_in.tga" preload="false"/> + <texture name="move_left_out.tga" preload="false"/> + <texture name="move_left_in.tga" preload="false"/> + <texture name="move_turn_left_out.tga" preload="false"/> + <texture name="move_turn_left_in.tga" preload="false"/> + <texture name="move_turn_right_out.tga" preload="false"/> + <texture name="move_turn_right_in.tga" preload="false"/> + <texture name="move_right_out.tga" preload="false"/> + <texture name="move_right_in.tga" preload="false"/> + <texture name="move_up_in.tga" preload="false"/> + <texture name="move_up_out.tga" preload="false"/> + <texture name="move_down_in.tga" preload="false"/> + <texture name="move_down_out.tga" preload="false"/> + + <texture name="tool_grab.tga"/> + <texture name="tool_grab_active.tga"/> + + <texture name="tool_face.tga"/> + <texture name="tool_face_active.tga"/> + + <texture name="tool_create.tga"/> + <texture name="tool_create_active.tga"/> + + <texture name="up_arrow.tga" file_name="up_arrow.png"/> + <texture name="down_arrow.tga" file_name="down_arrow.png"/> + + <texture name="restore_inactive.tga"/> + <texture name="restore.tga"/> + <texture name="restore_pressed.tga"/> + + <texture name="tearoffbox.tga"/> + <texture name="tearoff_pressed.tga"/> + + <texture name="icn_label_music.tga"/> + <texture name="icn_label_media.tga"/> + <texture name="arrow_down.tga"/> + <texture name="cloud-particle.j2c" use_mips="true"/> + + <texture name="skin_thumbnail_default.png" preload="false" /> + + <texture name="icn_textfield_enabled.tga" scale.left="5" scale.top="5" scale.bottom="5" scale.right="5"/> + <texture name="icn_rounded-text-field.tga" scale.left="14" scale.bottom="16" scale.top="16" scale.right="114"/> + + <texture name="toolbar_btn_enabled.tga" scale.left="7" scale.top="32" scale.right="121" scale.bottom="0" /> + <texture name="toolbar_btn_disabled.tga" scale.left="7" scale.top="32" scale.right="121" scale.bottom="0" /> + <texture name="toolbar_btn_selected.tga" scale.left="7" scale.top="32" scale.right="121" scale.bottom="0" /> + + <texture name="minimize_inactive.tga" preload="true"/> + <texture name="minimize.tga" preload="true" /> + <texture name="minimize_pressed.tga" preload="true"/> + <texture name="sm_rounded_corners_simple.tga" scale.left="4" scale.top="4" scale.bottom="4" scale.right="4"/> + <texture name="rounded_square.tga" file_name="rounded_square.j2c" preload="true" scale.left="16" scale.top="16" scale.right="112" scale.bottom="16" /> <texture name="rounded_square_soft.tga" file_name="rounded_square_soft.j2c" preload="true" scale.left="16" scale.top="16" scale.right="112" scale.bottom="16"/> @@ -160,20 +341,8 @@ <texture name="toolbar_tab.tga" preload="true" scale.left="6" scale.top="42" scale.right="104" scale.bottom="8"/> <texture name="toolbar_bg.tga" preload="true" scale.left="6" scale.top="42" scale.right="96" scale.bottom="16"/> - <texture name="ProgressBar" file_name="widgets/ProgressBar.png" preload="true" scale.left="4" scale.top="10" scale.right="48" scale.bottom="2" /> - <texture name="ProgressTrack" file_name="widgets/ProgressTrack.png" preload="true" scale.left="4" scale.top="13" scale.right="148" scale.bottom="2" /> - - <texture name="ScrollArrow_Down" file_name="widgets/ScrollArrow_Down.png" preload="true" scale.left="2" scale.top="13" scale.right="13" scale.bottom="2" /> - <texture name="ScrollArrow_Left" file_name="widgets/ScrollArrow_Left.png" preload="true" scale.left="2" scale.top="13" scale.right="13" scale.bottom="2" /> - <texture name="ScrollArrow_Right" file_name="widgets/ScrollArrow_Right.png" preload="true" scale.left="2" scale.top="13" scale.right="13" scale.bottom="2" /> - <texture name="ScrollArrow_Up" file_name="widgets/ScrollArrow_Up.png" preload="true" scale.left="2" scale.top="13" scale.right="13" scale.bottom="2" /> - - <texture name="TabTop_Middle_Off" file_name="containers/TabTop_Middle_Off.png" preload="true" scale.left="8" scale.top="8" scale.right="120" scale.bottom="9" /> - <texture name="TabTop_Middle_Selected" file_name="containers/TabTop_Middle_Selected.png" preload="true" scale.left="8" scale.top="8" scale.right="96" scale.bottom="9" /> - <texture name="TabTop_Left_Off" file_name="containers/TabTop_Left_Off.png" preload="true" scale.left="8" scale.top="8" scale.right="120" scale.bottom="9"/> - <texture name="TabTop_Left_Selected" file_name="containers/TabTop_Left_Selected.png" preload="true" scale.left="8" scale.top="8" scale.right="96" scale.bottom="9"/> - <texture name="tab_top_blue.tga" preload="true" scale.left="8" scale.top="8" scale.right="120" scale.bottom="9"/> - <texture name="tab_top_selected_blue.tga" preload="true" scale.left="8" scale.top="8" scale.right="96" scale.bottom="9"/> + <texture name="tab_top_blue.tga" preload="false" scale.left="8" scale.top="8" scale.right="120" scale.bottom="9"/> + <texture name="tab_top_selected_blue.tga" preload="false" scale.left="8" scale.top="8" scale.right="96" scale.bottom="9"/> <texture name="startup_logo.j2c" preload="true"/> <texture name="color_swatch_alpha.tga" preload="true"/> @@ -266,8 +435,8 @@ <texture name="media_icon.tga" file_name="icn_label_media.tga" /> <texture name="music_icon.tga" file_name="icn_label_music.tga" /> - <texture name="NoEntryLines" file_name="world/NoEntryLines.png" use_mips="true" preload="true" /> - <texture name="NoEntryPassLines" file_name="world/NoEntryPassLines.png" use_mips="true" preload="true" /> + <texture name="NoEntryLines" file_name="world/NoEntryLines.png" use_mips="true" preload="false" /> + <texture name="NoEntryPassLines" file_name="world/NoEntryPassLines.png" use_mips="true" preload="false" /> <texture name="notify_tip_icon.tga"/> <texture name="notify_caution_icon.tga"/> @@ -342,140 +511,8 @@ <texture name="mute_icon.tga"/> - <texture name="SliderTrack_Horiz" file_name="widgets/SliderTrack_Horiz.png" scale.left="4" scale.top="4" scale.right="100" scale.bottom="2" /> - <texture name="SliderTrack_Vert" file_name="widgets/SliderTrack_Vert.png" scale.left="2" scale.top="100" scale.right="4" scale.bottom="4" /> - <texture name="SliderThumb_Off" file_name="widgets/SliderThumb_Off.png" /> - <texture name="SliderThumb_Disabled" file_name="widgets/SliderThumb_Disabled.png" /> - <texture name="SliderThumb_Press" file_name="widgets/SliderThumb_Press.png" /> - - <texture name="icn_speaker-muted_dark.tga"/> - <texture name="icn_speaker_dark.tga"/> - - <texture name="icn_voice-localchat.tga"/> - <texture name="icn_voice-groupfocus.tga"/> - <texture name="icn_voice-pvtfocus.tga"/> - - <texture name="icn_media-pause.tga"/> - <texture name="icn_media-play.tga"/> - <texture name="icn_music-play.tga"/> - <texture name="icn_music-pause.tga"/> - <texture name="icn_media_web.tga" preload="true"/> - <texture name="icn_media_movie.tga" preload="true"/> - - <texture name="icn_chatbar.tga"/> - <texture name="btn_chatbar.tga" scale.left="20" scale.top="24" scale.right="44" scale.bottom="0"/> - <texture name="btn_chatbar_selected.tga" scale.left="20" scale.top="24" scale.right="44" scale.bottom="0"/> - - <texture name="SegmentedBtn_Left_Off" file_name="widgets/SegmentedBtn_Left_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Left_Press" file_name="widgets/SegmentedBtn_Left_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Left_Disabled" file_name="widgets/SegmentedBtn_Left_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Left_Selected" file_name="widgets/SegmentedBtn_Left_Selected.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Left_Selected_Press" file_name="widgets/SegmentedBtn_Left_Selected_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Left_Selected_Disabled" file_name="widgets/SegmentedBtn_Left_Selected_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - - <texture name="SegmentedBtn_Middle_Off" file_name="widgets/SegmentedBtn_Middle_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Middle_Press" file_name="widgets/SegmentedBtn_Middle_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Middle_Disabled" file_name="widgets/SegmentedBtn_Middle_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Middle_Selected" file_name="widgets/SegmentedBtn_Middle_Selected.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Middle_Selected_Press" file_name="widgets/SegmentedBtn_Middle_Selected_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Middle_Selected_Disabled" file_name="widgets/SegmentedBtn_Middle_Selected_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - - <texture name="SegmentedBtn_Right_Off" file_name="widgets/SegmentedBtn_Right_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Right_Press" file_name="widgets/SegmentedBtn_Right_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Right_Disabled" file_name="widgets/SegmentedBtn_Right_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Right_Selected" file_name="widgets/SegmentedBtn_Right_Selected.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Right_Selected_Press" file_name="widgets/SegmentedBtn_Right_Selected_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - <texture name="SegmentedBtn_Right_Selected_Disabled" file_name="widgets/SegmentedBtn_Right_Selected_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> - - <texture name="move_forward_out.tga" preload="true"/> - <texture name="move_forward_in.tga" preload="true"/> - <texture name="move_left_out.tga" preload="true"/> - <texture name="move_left_in.tga" preload="true"/> - <texture name="move_turn_left_out.tga" preload="true"/> - <texture name="move_turn_left_in.tga" preload="true"/> - <texture name="move_turn_right_out.tga" preload="true"/> - <texture name="move_turn_right_in.tga" preload="true"/> - <texture name="move_right_out.tga" preload="true"/> - <texture name="move_right_in.tga" preload="true"/> - <texture name="move_up_in.tga" preload="true"/> - <texture name="move_up_out.tga" preload="true"/> - <texture name="move_down_in.tga" preload="true"/> - <texture name="move_down_out.tga" preload="true"/> - - <texture name="cam_rotate_out.tga" preload="true"/> - <texture name="cam_rotate_in.tga" preload="true"/> - <texture name="cam_zoom_out.tga" preload="true"/> - <texture name="cam_zoom_plus_in.tga" preload="true"/> - <texture name="cam_zoom_minus_in.tga" preload="true"/> - - <texture name="jump_left_out.tga"/> - <texture name="jump_left_in.tga"/> - <texture name="jump_right_out.tga"/> - <texture name="jump_right_in.tga"/> - - <texture name="tool_grab.tga"/> - <texture name="tool_grab_active.tga"/> - - <texture name="tool_face.tga"/> - <texture name="tool_face_active.tga"/> - - <texture name="tool_create.tga"/> - <texture name="tool_create_active.tga"/> - - <texture name="close_inactive_blue.tga"/> - <texture name="closebox.tga"/> - <texture name="icn_clear_lineeditor.tga" /> - - <texture name="up_arrow.tga" file_name="up_arrow.png"/> - <texture name="down_arrow.tga" file_name="down_arrow.png"/> - - <texture name="restore_inactive.tga"/> - <texture name="restore.tga"/> - <texture name="restore_pressed.tga"/> - - <texture name="tearoffbox.tga"/> - <texture name="tearoff_pressed.tga"/> - - <texture name="icn_label_music.tga"/> - <texture name="icn_label_media.tga"/> - <texture name="arrow_down.tga"/> - <texture name="cloud-particle.j2c" use_mips="true"/> - - <texture name="skin_thumbnail_default.png" preload="true" /> - <texture name="default_land_picture.j2c"/> <texture name="default_profile_picture.j2c"/> <texture name="locked_image.j2c"/> - <texture name="menu_separator" file_name="navbar/FileMenu_Divider.png" scale.left="4" scale.top="166" scale.right="0" scale.bottom="0" /> - <texture name="TaskPanel_Tab_Off" file_name="taskpanel/TaskPanel_Tab_Off.png" preload="true" scale.left="4" scale.top="29" scale.right="36" scale.bottom="4" /> - <texture name="TaskPanel_Tab_Selected" file_name="taskpanel/TaskPanel_Tab_Selected.png" preload="true" scale.left="5" scale.top="30" scale.right="36" scale.bottom="5" /> - <texture name="TaskPanel_BG" file_name="taskpanel/TaskPanel_BG.png" preload="true" scale.left="4" scale.top="146" scale.right="146" scale.bottom="4" /> - <texture name="TaskPanel_Tab_Unselected" file_name="taskpanel/TaskPanel_Tab_Over.png" preload="true" scale.left="5" scale.top="30" scale.right="36" scale.bottom="5" /> - - <texture name="Arrow_Left_Off" file_name="navbar/Arrow_Left_Off.png" preload="true"/> - <texture name="Arrow_Left_Press" file_name="navbar/Arrow_Left_Press.png" preload="true"/> - <texture name="Arrow_Right_Off" file_name="navbar/Arrow_Right_Off.png" preload="true"/> - <texture name="Arrow_Right_Press" file_name="navbar/Arrow_Right_Press.png" preload="true"/> - <texture name="Home_Off" file_name="navbar/Home_Off.png" preload="true"/> - <texture name="Home_Press" file_name="navbar/Home_Press.png" preload="true"/> - <texture name="Info_Off" file_name="navbar/Info_Off.png" preload="true"/> - <texture name="Info_Press" file_name="navbar/Info_Press.png" preload="true"/> - <texture name="Favorite_Star_Over" file_name="navbar/Favorite_Star_Over.png" preload="true"/> - <texture name="History_Arrow" file_name="navbar/History_Arrow.png" preload="true"/> - <texture name="Search" file_name="navbar/Search.png" preload="true"/> - <texture name="Help_Off" file_name="navbar/Help_Off.png" preload="true"/> - <texture name="Help_Press" file_name="navbar/Help_Press.png" preload="true"/> - - <texture name="Icon_Gear_Background" file_name="windows/Icon_Gear_Background.png" preload="true"/> - <texture name="Icon_Gear_Foreground" file_name="windows/Icon_Gear_Foreground.png" preload="true"/> - <texture name="Icon_Gear_Press" file_name="windows/Icon_Gear_Press.png" preload="true"/> - <texture name="Stepper_Down_Disabled" file_name="widgets/Stepper_Down_Disabled.png" preload="true"/> - <texture name="Stepper_Down_Off" file_name="widgets/Stepper_Down_Off.png" preload="true"/> - <texture name="Stepper_Down_Press" file_name="widgets/Stepper_Down_Press.png" preload="true"/> - <texture name="Stepper_Up_Disabled" file_name="widgets/Stepper_Up_Disabled.png" preload="true"/> - <texture name="Stepper_Up_Off" file_name="widgets/Stepper_Up_Off.png" preload="true"/> - <texture name="Stepper_Up_Press" file_name="widgets/Stepper_Up_Press.png" preload="true"/> - - <!-- Please add new files alphabetically to prevent merge conflicts. JC --> </textures> diff --git a/indra/newview/skins/default/textures/world/NoEntryLines.png b/indra/newview/skins/default/textures/world/NoEntryLines.png Binary files differindex 5a1f0ea95e..18e270bde5 100644 --- a/indra/newview/skins/default/textures/world/NoEntryLines.png +++ b/indra/newview/skins/default/textures/world/NoEntryLines.png diff --git a/indra/newview/skins/default/xui/da/language_settings.xml b/indra/newview/skins/default/xui/da/language_settings.xml new file mode 100644 index 0000000000..71418d446a --- /dev/null +++ b/indra/newview/skins/default/xui/da/language_settings.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- This file contains strings that used to be hardcoded in the source.--> +<strings> + + <!-- Locale Information --> + <string name="MicrosoftLocale">english</string> + <string name="DarwinLocale">C</string> + <string name="LinuxLocale">C</string> + + <!-- + datetimeToCodes["wkday"] = "%a"; // Thu + datetimeToCodes["weekday"] = "%A"; // Thursday + datetimeToCodes["year4"] = "%Y"; // 2009 + datetimeToCodes["year"] = "%Y"; // 2009 + datetimeToCodes["year2"] = "%y"; // 09 + datetimeToCodes["mth"] = "%b"; // Aug + datetimeToCodes["month"] = "%B"; // August + datetimeToCodes["mthnum"] = "%m"; // 08 + datetimeToCodes["day"] = "%d"; // 31 + datetimeToCodes["hour24"] = "%H"; // 14 + datetimeToCodes["hour"] = "%H"; // 14 + datetimeToCodes["hour12"] = "%I"; // 02 + datetimeToCodes["min"] = "%M"; // 59 + datetimeToCodes["ampm"] = "%p"; // AM + datetimeToCodes["second"] = "%S"; // 59 + datetimeToCodes["timezone"] = "%Z"; // PST + --> + + <string name="TimeHour">hour,datetime,slt</string> + <string name="TimeMin">min,datetime,slt</string> + <string name="TimeYear">year,datetime,slt</string> + <string name="TimeDay">day,datetime,slt</string> + <string name="TimeMonth">mthnum,datetime,slt</string> + <string name="TimeWeek">wkday,datetime,slt</string> + <string name="TimeAMPM">ampm,datetime,slt</string> + <string name="TimeHour12">hour12,datetime,slt</string> + + <string name="LTimeMthNum">mthnum,datetime,local</string> + <string name="LTimeWeek">wkday,datetime,local</string> + <string name="LTimeMonth">mth,datetime,local</string> + <string name="LTimeDay">day,datetime,local</string> + <string name="LTimeSec">second,datetime,local</string> + <string name="LTimeHour">hour,datetime,local</string> + <string name="LTimeMin">min,datetime,local</string> + <string name="LTimeYear">year,datetime,local</string> + + <string name="UTCTimeWeek">weekday,datetime,utc</string> + <string name="UTCTimeDay">day,datetime,utc</string> + <string name="UTCTimeMth">mth,datetime,utc</string> + <string name="UTCTimeYr">year,datetime,utc</string> + <string name="UTCTimeHr">hour,datetime,utc</string> + <string name="UTCTimeMin">min,datetime,utc</string> + <string name="UTCTimeSec">second,datetime,utc</string> + <string name="UTCTimeTimezone">timezone,datetime,utc</string> +</strings> diff --git a/indra/newview/skins/default/xui/de/language_settings.xml b/indra/newview/skins/default/xui/de/language_settings.xml new file mode 100644 index 0000000000..71418d446a --- /dev/null +++ b/indra/newview/skins/default/xui/de/language_settings.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- This file contains strings that used to be hardcoded in the source.--> +<strings> + + <!-- Locale Information --> + <string name="MicrosoftLocale">english</string> + <string name="DarwinLocale">C</string> + <string name="LinuxLocale">C</string> + + <!-- + datetimeToCodes["wkday"] = "%a"; // Thu + datetimeToCodes["weekday"] = "%A"; // Thursday + datetimeToCodes["year4"] = "%Y"; // 2009 + datetimeToCodes["year"] = "%Y"; // 2009 + datetimeToCodes["year2"] = "%y"; // 09 + datetimeToCodes["mth"] = "%b"; // Aug + datetimeToCodes["month"] = "%B"; // August + datetimeToCodes["mthnum"] = "%m"; // 08 + datetimeToCodes["day"] = "%d"; // 31 + datetimeToCodes["hour24"] = "%H"; // 14 + datetimeToCodes["hour"] = "%H"; // 14 + datetimeToCodes["hour12"] = "%I"; // 02 + datetimeToCodes["min"] = "%M"; // 59 + datetimeToCodes["ampm"] = "%p"; // AM + datetimeToCodes["second"] = "%S"; // 59 + datetimeToCodes["timezone"] = "%Z"; // PST + --> + + <string name="TimeHour">hour,datetime,slt</string> + <string name="TimeMin">min,datetime,slt</string> + <string name="TimeYear">year,datetime,slt</string> + <string name="TimeDay">day,datetime,slt</string> + <string name="TimeMonth">mthnum,datetime,slt</string> + <string name="TimeWeek">wkday,datetime,slt</string> + <string name="TimeAMPM">ampm,datetime,slt</string> + <string name="TimeHour12">hour12,datetime,slt</string> + + <string name="LTimeMthNum">mthnum,datetime,local</string> + <string name="LTimeWeek">wkday,datetime,local</string> + <string name="LTimeMonth">mth,datetime,local</string> + <string name="LTimeDay">day,datetime,local</string> + <string name="LTimeSec">second,datetime,local</string> + <string name="LTimeHour">hour,datetime,local</string> + <string name="LTimeMin">min,datetime,local</string> + <string name="LTimeYear">year,datetime,local</string> + + <string name="UTCTimeWeek">weekday,datetime,utc</string> + <string name="UTCTimeDay">day,datetime,utc</string> + <string name="UTCTimeMth">mth,datetime,utc</string> + <string name="UTCTimeYr">year,datetime,utc</string> + <string name="UTCTimeHr">hour,datetime,utc</string> + <string name="UTCTimeMin">min,datetime,utc</string> + <string name="UTCTimeSec">second,datetime,utc</string> + <string name="UTCTimeTimezone">timezone,datetime,utc</string> +</strings> diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml new file mode 100644 index 0000000000..d2a0193763 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="440" + layout="topleft" + name="floater_aaa" + save_rect="true" + title="About [SECOND_LIFE_VIEWER]" + width="470"> + <text_editor + follows="left|top|right|bottom" + height="400" + layout="topleft" + left="6" + max_length="65536" + name="credits_editor" + top="25" + width="458" + word_wrap="true"> + This is line 1a + + + This is line 4 + </text_editor> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_beacons.xml b/indra/newview/skins/default/xui/en/floater_beacons.xml index 049ea9ab14..ea41289769 100644 --- a/indra/newview/skins/default/xui/en/floater_beacons.xml +++ b/indra/newview/skins/default/xui/en/floater_beacons.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater - control_name="BeaconAlwaysOn" height="225" layout="topleft" name="beacons" save_rect="true" + save_visibility="true" + single_instance="true" title="Beacons" width="250"> <panel diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml index 245d84fff4..e2bdc756a9 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml @@ -4,6 +4,7 @@ height="270" layout="topleft" name="buy currency" + single_instance="true" title="Buy Currency" width="350"> <floater.string diff --git a/indra/newview/skins/default/xui/en/floater_buy_land.xml b/indra/newview/skins/default/xui/en/floater_buy_land.xml index ca025346fd..ec52c565ae 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_land.xml @@ -4,6 +4,7 @@ height="484" layout="topleft" name="buy land" + single_instance="true" title="Buy Land" width="740"> <floater.string diff --git a/indra/newview/skins/default/xui/en/floater_buy_object.xml b/indra/newview/skins/default/xui/en/floater_buy_object.xml index 24010dda93..505411b964 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_object.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_object.xml @@ -7,6 +7,7 @@ min_width="154" name="contents" save_rect="true" + single_instance="true" title="Buy Copy of Object" width="280"> <floater.string diff --git a/indra/newview/skins/default/xui/en/floater_hud.xml b/indra/newview/skins/default/xui/en/floater_hud.xml index f62b7eece0..73804f90a5 100644 --- a/indra/newview/skins/default/xui/en/floater_hud.xml +++ b/indra/newview/skins/default/xui/en/floater_hud.xml @@ -4,6 +4,8 @@ height="292" layout="topleft" name="floater_hud" + save_rect="true" + save_visibility="true" title="Tutorial" width="362"> <web_browser diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index 44c56e4207..4d7fa45a47 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -9,7 +9,7 @@ top="0"
can_dock="true"
can_minimize="false"
- visible="false"
+ visible="true"
width="315">
<layout_stack follows="left|top|right|bottom"
height="235"
diff --git a/indra/newview/skins/default/xui/en/floater_inventory.xml b/indra/newview/skins/default/xui/en/floater_inventory.xml index 6a54c187cb..37c6cbf391 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory.xml @@ -9,6 +9,7 @@ name="Inventory" save_rect="true" save_visibility="true" + single_instance="true" title="Inventory" width="467"> <floater.string diff --git a/indra/newview/skins/default/xui/en/floater_notifications_console.xml b/indra/newview/skins/default/xui/en/floater_notifications_console.xml index 14aa12aed7..34bda53ef1 100644 --- a/indra/newview/skins/default/xui/en/floater_notifications_console.xml +++ b/indra/newview/skins/default/xui/en/floater_notifications_console.xml @@ -5,6 +5,7 @@ layout="topleft" min_height="50" name="notifications_console" + single_instance="true" title="Notifications Console" width="500"> <combo_box diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml index 8a76c2167f..d9602c75ee 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences.xml @@ -103,66 +103,10 @@ name="advanced2" /> <panel class="panel_preference" - filename="panel_preferences_advanced3.xml" - label="Not in specs" - layout="topleft" - name="advanced3" /> - <panel - class="panel_preference" filename="panel_preferences_advanced4.xml" label="Storage/Kill" layout="topleft" name="advanced4" /> - <!--panel - class="panel_preference" - filename="panel_preferences_network.xml" - label="Network" - layout="topleft" - name="network" /> - <panel - class="panel_preference" - filename="panel_preferences_web.xml" - label="Web" - layout="topleft" - name="web" /> - <panel - class="panel_preference" - filename="panel_preferences_voice.xml" - label="Voice Chat" - layout="topleft" - name="voice" /> - <panel - class="panel_preference" - filename="panel_preferences_skins.xml" - label="Skins" - layout="topleft" - name="skins" /--> </tab_container> - - <!--button - follows="left|bottom" - height="20" - label="About" - label_selected="About" - layout="topleft" - left_delta="-512" - name="About..." - top_delta="0" - width="90"> - <button.commit_callback - function="Floater.Show" - parameter="sl_about" /> - </button--> - <!--bottom" - height="20" - help_url="https://support.secondlife.com/ics/support/default.asp?deptID=4417" - label="Help" - label_selected="Help" - layout="topleft" - left_pad="3" - name="Help" - top_delta="0" - width="90" /--> - - + </floater> diff --git a/indra/newview/skins/default/xui/en/floater_sell_land.xml b/indra/newview/skins/default/xui/en/floater_sell_land.xml index 85e35926ab..cf26b7ab47 100644 --- a/indra/newview/skins/default/xui/en/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/en/floater_sell_land.xml @@ -4,6 +4,7 @@ height="600" layout="topleft" name="sell land" + single_instance="true" title="Sell Land" width="280"> <texture_picker @@ -322,4 +323,4 @@ on parcel will change ownership. name="cancel_btn" top_delta="0" width="90" /> -</floater>
\ No newline at end of file +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_widgets.xml b/indra/newview/skins/default/xui/en/floater_test_widgets.xml index c6c561b497..d773e1f2b8 100644 --- a/indra/newview/skins/default/xui/en/floater_test_widgets.xml +++ b/indra/newview/skins/default/xui/en/floater_test_widgets.xml @@ -15,6 +15,7 @@ Otherwise specify location with left and top attributes. --> <floater + can_dock="true" can_resize="true" title="Test Floater" height="500" diff --git a/indra/newview/skins/default/xui/en/language_settings.xml b/indra/newview/skins/default/xui/en/language_settings.xml new file mode 100644 index 0000000000..71418d446a --- /dev/null +++ b/indra/newview/skins/default/xui/en/language_settings.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- This file contains strings that used to be hardcoded in the source.--> +<strings> + + <!-- Locale Information --> + <string name="MicrosoftLocale">english</string> + <string name="DarwinLocale">C</string> + <string name="LinuxLocale">C</string> + + <!-- + datetimeToCodes["wkday"] = "%a"; // Thu + datetimeToCodes["weekday"] = "%A"; // Thursday + datetimeToCodes["year4"] = "%Y"; // 2009 + datetimeToCodes["year"] = "%Y"; // 2009 + datetimeToCodes["year2"] = "%y"; // 09 + datetimeToCodes["mth"] = "%b"; // Aug + datetimeToCodes["month"] = "%B"; // August + datetimeToCodes["mthnum"] = "%m"; // 08 + datetimeToCodes["day"] = "%d"; // 31 + datetimeToCodes["hour24"] = "%H"; // 14 + datetimeToCodes["hour"] = "%H"; // 14 + datetimeToCodes["hour12"] = "%I"; // 02 + datetimeToCodes["min"] = "%M"; // 59 + datetimeToCodes["ampm"] = "%p"; // AM + datetimeToCodes["second"] = "%S"; // 59 + datetimeToCodes["timezone"] = "%Z"; // PST + --> + + <string name="TimeHour">hour,datetime,slt</string> + <string name="TimeMin">min,datetime,slt</string> + <string name="TimeYear">year,datetime,slt</string> + <string name="TimeDay">day,datetime,slt</string> + <string name="TimeMonth">mthnum,datetime,slt</string> + <string name="TimeWeek">wkday,datetime,slt</string> + <string name="TimeAMPM">ampm,datetime,slt</string> + <string name="TimeHour12">hour12,datetime,slt</string> + + <string name="LTimeMthNum">mthnum,datetime,local</string> + <string name="LTimeWeek">wkday,datetime,local</string> + <string name="LTimeMonth">mth,datetime,local</string> + <string name="LTimeDay">day,datetime,local</string> + <string name="LTimeSec">second,datetime,local</string> + <string name="LTimeHour">hour,datetime,local</string> + <string name="LTimeMin">min,datetime,local</string> + <string name="LTimeYear">year,datetime,local</string> + + <string name="UTCTimeWeek">weekday,datetime,utc</string> + <string name="UTCTimeDay">day,datetime,utc</string> + <string name="UTCTimeMth">mth,datetime,utc</string> + <string name="UTCTimeYr">year,datetime,utc</string> + <string name="UTCTimeHr">hour,datetime,utc</string> + <string name="UTCTimeMin">min,datetime,utc</string> + <string name="UTCTimeSec">second,datetime,utc</string> + <string name="UTCTimeTimezone">timezone,datetime,utc</string> +</strings> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 4d1572e4a5..44565333e5 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -51,7 +51,7 @@ name="My Land"> <menu_item_call.on_click function="ShowFloater" - parameter="my land" /> + parameter="land_holdings" /> </menu_item_call> <menu_item_call label="Buy Land" @@ -2679,6 +2679,14 @@ function="Advanced.WebBrowserTest" /> </menu_item_call> <menu_item_call + label="Simple Web Browser Test" + layout="topleft" + name="Simple Web Browser Test"> + <menu_item_call.on_click + function="Floater.Show" + parameter="html_simple.http://www.secondlife.com" /> + </menu_item_call> + <menu_item_call label="Buy Currency Test" layout="topleft" name="Buy Currency Test"> diff --git a/indra/newview/skins/default/xui/en/panel_avatar_tag.xml b/indra/newview/skins/default/xui/en/panel_avatar_tag.xml new file mode 100644 index 0000000000..34b4736979 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_avatar_tag.xml @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + name="avatar_tag_notification" + top="10" + width="250" + height="100" + background_opaque="false" + background_visible="true" + follows="left|top|bottom|right" + bg_alpha_color="0.3 0.3 0.3 1.0"> + <panel + width="250" + height="30" + background_visible="true" + background_opaque="false" + follows="left|top|right" + bg_alpha_color="0.0 0.0 0.0 1.0" + name="msg_caption"> + <avatar_icon + top="-7" + left="10" + width="20" + height="20" + follows="left|top" + color="1 1 1 1" + enabled="true" + name="avatar_tag_icon"/> + <text + width="160" + top="-10" + left="40" + height="20" + follows="left|right|top" + font="SansSerifBigBold" + text_color="white" + word_wrap="true" + mouse_opaque="true" + name="sender_tag_name" > + Angela Tester + </text> + <text + width="30" + top="-12" + left="210" + height="20" + follows="right|top" + text_color="white" + word_wrap="true" + mouse_opaque="true" + name="tag_time" > + 07:52 + </text> + </panel> + <text_editor + top="65" + left="10" + right="-10" + can_resize="true" + height="100" + follows="left|top|bottom|right" + font="SansSerifSmall" + read_only="true" + bg_readonly_color="0 0 0 0" + hide_scrollbar="true" + word_wrap="true" + mouse_opaque="true" + name="msg_text" > + The quick brown fox jumps over the lazy dog. + </text_editor> +</panel> + diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index 26354ce611..b0f8052a9c 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -155,8 +155,8 @@ type="string" length="1" follows="left|top|right" - font="SansSerif" - height="45" + font="SansSerifSmall" + height="120" layout="topleft" left="9" name="sl_description_edit" @@ -182,8 +182,8 @@ type="string" length="1" follows="left|top|right" - font="SansSerif" - height="45" + font="SansSerifSmall" + height="120" layout="topleft" left="9" name="fl_description_edit" @@ -209,7 +209,7 @@ follows="left|top|right" font="SansSerif" font.style="UNDERLINE" - height="15" + height="20" layout="topleft" left="9" name="homepage_edit" diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index c9a0b6bc38..4904a0d40a 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -11,7 +11,7 @@ <button follows="left|top" font="SansSerifSmall" - height="20" + height="23" image_disabled="PushButton_Disabled" image_disabled_selected="PushButton_Disabled" image_overlay="Arrow_Left_Off" @@ -19,17 +19,17 @@ image_unselected="PushButton_Off" hover_glow_amount="0.15" layout="topleft" - left="5" + left="10" name="back_btn" picture_style="true" tool_tip="Go back to previous location" top="8" - width="20" /> + width="31" /> <button follows="left|top" font="SansSerifSmall" - height="20" + height="23" image_disabled="PushButton_Disabled" image_disabled_selected="PushButton_Disabled" image_overlay="Arrow_Right_Off" @@ -37,16 +37,16 @@ image_unselected="PushButton_Off" hover_glow_amount="0.15" layout="topleft" - left_pad="2" + left_pad="0" name="forward_btn" picture_style="true" tool_tip="Go forward one location" top_delta="0" - width="20" /> + width="31" /> <button follows="left|top" font="SansSerifSmall" - height="20" + height="23" image_disabled="PushButton_Disabled" image_disabled_selected="PushButton_Disabled" image_overlay="Home_Off" @@ -54,24 +54,24 @@ image_unselected="PushButton_Off" hover_glow_amount="0.15" layout="topleft" - left_pad="5" + left_pad="7" name="home_btn" picture_style="true" tool_tip="Teleport to your home location" top_delta="0" - width="20" /> + width="32" /> <location_input follows="left|right|top" halign="right" - height="20" + height="22" label="Location" layout="topleft" - left_pad="5" + left_pad="7" max_chars="254" mouse_opaque="false" name="location_combo" top_delta="0" - width="320"> + width="266"> <!-- *TODO: Delete. Let the location_input use the correct art sizes. <location_input.add_landmark_button height="18" @@ -108,33 +108,17 @@ commit_on_focus_lost="false" follows="right|top" halign="right" - height="20" + height="22" label="Search All" layout="topleft" - left_pad="5" + left_pad="7" mouse_opaque="false" name="search_input" tool_tip="Search All" top_delta="0" - width="135" /> + width="200" /> + - <button - follows="right|top" - font="SansSerifSmall" - height="20" - image_disabled="PushButton_Disabled" - image_disabled_selected="PushButton_Disabled" - image_overlay="Help_Off" - image_selected="PushButton_Selected" - image_unselected="PushButton_Off" - hover_glow_amount="0.15" - layout="topleft" - left_pad="15" - name="help_btn" - picture_style="true" - tool_tip="Help" - top_delta="0" - width="20" /> <favorites_bar follows="left|right|top" diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 55ac14ed46..6b3f5eaee1 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -7,7 +7,6 @@ height="465" follows="left|top|right|bottom" background_visible="true" - bg_alpha_color="0.3 0.3 0.3 1" label="People" name="people_panel"> <filter_editor diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 624345367f..13efa7bcff 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -10,18 +10,6 @@ name="advanced" top="1" width="517"> - <text - type="string" - text_color="LabelSelectedDisabledColor" - length="1" - follows="left|top" - layout="topleft" - left="8" - name="text status" - top_pad="3" - width="280"> -Beware the Trout! - </text> <!-- ADVANCED --> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 70d15c237b..2d42757150 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -30,7 +30,7 @@ max_chars="135" name="language_combobox" top_pad="10" - width="155"> + width="170"> <combo_box.item enabled="true" label="System Default" @@ -154,7 +154,7 @@ left_delta="50" name="maturity_desired_combobox" top_pad="10" - width="155"> + width="170"> <combo_box.item label="PG, Mature and Adult" name="Desired_Adult" @@ -188,7 +188,7 @@ left_delta="50" name="start_location_combo" top_pad="10" - width="155"> + width="170"> <combo_box.item label="My Last Location" name="MyLastLocation" @@ -221,7 +221,6 @@ width="400"> Name tags: </text> - <!-- THIS IS A NEW RADIO GROUP ADDED BY LIS --> <radio_group control_name="AvatarNameTagMode" height="30" @@ -273,7 +272,7 @@ left_delta="0" name="show_all_title_checkbox" top_pad="5" - width="256" /> + width="300" /> <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 563056890a..0c01aec95d 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -26,7 +26,7 @@ left="30" name="WindowSizeLabel" top="10" - width="128"> + width="300"> Window size: </text> <check_box @@ -37,44 +37,65 @@ left_delta="30" name="windowed mode" top_pad="4" - width="100"> + width="175"> </check_box> - <combo_box + <combo_box visiblity_control="WindowFullScreen" - allow_text_entry="true" - height="16" - layout="topleft" - left_delta="175" - max_chars="100" - name="aspect_ratio" - tool_tip="width / height" - top_delta="0" - width="150"> - <combo_box.item - enabled="true" - label="4:3 (Standard CRT)" - name="item1" - value="1.333333" /> - <combo_box.item - enabled="true" - label="5:4 (1280x1024 LCD)" - name="item2" - value="1.25" /> - <combo_box.item - enabled="true" - label="8:5 (Widescreen)" - name="item3" - value="1.6" /> - <combo_box.item - enabled="true" - label="16:9 (Widescreen)" - name="item4" - value="1.7777777" /> - <combo_box.commit_callback - function="setControlFalse" - parameter="FullScreenAutoDetectAspectRatio" /> - </combo_box> - <text + allow_text_entry="false" + enabled="true" + layout="topleft" + height="18" + left_delta="220" + max_chars="20" + mouse_opaque="true" + name="windowsize combo" + top_delta="-1" + width="150"> + <combo_box.item + type="string" + length="1" + enabled="true" + name="640x480" + value="640 x 480"> + 640x480 + </combo_box.item> + <combo_box.item + type="string" + length="1" + enabled="true" + name="800x600" + value="800 x 600"> + 800x600 + </combo_box.item> + <combo_box.item + type="string" + length="1" + enabled="true" + name="720x480" + value="720 x 480"> + 720x480 (NTSC) + </combo_box.item> + <combo_box.item + type="string" + length="1" + enabled="true" + name="768x576" + value="768 x 576"> + 768x576 (PAL) + </combo_box.item> + <combo_box.item + type="string" + length="1" + enabled="true" + name="1024x768" + value="1024 x 768"> + 1024x768 + </combo_box.item> + <combo_box.commit_callback + function="setControlFalse" + parameter="FullScreenAutoDetectAspectRatio" /> + </combo_box> + <text type="string" length="1" follows="left|top" @@ -83,7 +104,7 @@ left="30" name="UI Size:" top_pad="4" - width="100"> + width="300"> UI Size: </text> <slider @@ -148,7 +169,7 @@ left_delta="360" name="BetterText" top_delta="0" - width="80"> + width="100"> Better </text> <icon @@ -428,30 +449,7 @@ name="AvatarCloth" top_pad="1" width="256" /> - <text - type="string" - length="1" - follows="left|top" - height="12" - layout="topleft" - left="457" - name="DrawDistanceMeterText1" - top="3" - width="128"> - m - </text> - <text - type="string" - length="1" - follows="left|top" - height="12" - layout="topleft" - left_delta="6" - name="DrawDistanceMeterText2" - top_delta="0" - width="128"> - m - </text> + <slider control_name="RenderFarClip" decimal_digits="0" @@ -462,15 +460,27 @@ label="Draw Distance:" label_width="140" layout="topleft" - left_delta="-248" + left="216" max_val="512" min_val="64" name="DrawDistance" - top_delta="0" + top="3" width="255"> <slider.commit_callback function="Pref.UpdateMeterText" /> </slider> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="250" + name="DrawDistanceMeterText2" + top_delta="1" + width="128"> + m + </text> <slider control_name="RenderMaxPartCount" decimal_digits="0" @@ -481,10 +491,10 @@ label="Max. Particle Count:" label_width="140" layout="topleft" - left_delta="0" + left="216" max_val="8192" name="MaxParticleCount" - top_pad="4" + top_pad="6" width="262" /> <slider control_name="RenderGlowResolutionPow" @@ -830,10 +840,7 @@ left_pad="35" name="Advanced" top_delta="0" - width="115"> - <button.commit_callback - function="Pref.ChangeCustom" /> - </button> + width="115" /> <button follows="right|bottom" height="20" diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml index 73b06a3e41..8953633276 100644 --- a/indra/newview/skins/default/xui/en/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml @@ -29,7 +29,7 @@ name="sidebar_people" tab_title="People" description="Find your friends, contacts and people nearby." - image="icn_voice-groupfocus.tga" + image="TabIcon_People_Off" mouse_opaque="false" background_opaque="false" background_visible="true" @@ -58,7 +58,7 @@ tab_title="Places" label="Places" description="Find places to go and places you've been." - image="inv_item_landmark.tga" + image="TabIcon_Places_Off" mouse_opaque="false" background_visible="true" bg_opaque_color="0.5 0.5 0.5 1.0" @@ -76,7 +76,7 @@ name="sidebar_me" tab_title="Me" description="Change your profile, your look and quick links to your outfits." - image="icn_voice-pvtfocus.tga" + image="TabIcon_Me_Off" mouse_opaque="false" background_visible="true" bg_opaque_color="0.5 0.5 0.5 1.0" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index c64316e305..bc364687e9 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -736,56 +736,4 @@ If you continue to receive this message, contact customer support. <!-- Group Information --> - <!-- Locale Information --> - <string name="MicrosoftLocale">english</string> - <string name="DarwinLocale">C</string> - <string name="LinuxLocale">C</string> - - <!-- - datetimeToCodes["wkday"] = "%a"; // Thu - datetimeToCodes["weekday"] = "%A"; // Thursday - datetimeToCodes["year4"] = "%Y"; // 2009 - datetimeToCodes["year"] = "%Y"; // 2009 - datetimeToCodes["year2"] = "%y"; // 09 - datetimeToCodes["mth"] = "%b"; // Aug - datetimeToCodes["month"] = "%B"; // August - datetimeToCodes["mthnum"] = "%m"; // 08 - datetimeToCodes["day"] = "%d"; // 31 - datetimeToCodes["hour24"] = "%H"; // 14 - datetimeToCodes["hour"] = "%H"; // 14 - datetimeToCodes["hour12"] = "%I"; // 02 - datetimeToCodes["min"] = "%M"; // 59 - datetimeToCodes["ampm"] = "%p"; // AM - datetimeToCodes["second"] = "%S"; // 59 - datetimeToCodes["timezone"] = "%Z"; // PST - --> - - <string name="TimeHour">hour,datetime,slt</string> - <string name="TimeMin">min,datetime,slt</string> - <string name="TimeYear">year,datetime,slt</string> - <string name="TimeDay">day,datetime,slt</string> - <string name="TimeMonth">mthnum,datetime,slt</string> - <string name="TimeWeek">wkday,datetime,slt</string> - <string name="TimeAMPM">ampm,datetime,slt</string> - <string name="TimeHour12">hour12,datetime,slt</string> - - <string name="LTimeMthNum">mthnum,datetime,local</string> - <string name="LTimeWeek">wkday,datetime,local</string> - <string name="LTimeMonth">mth,datetime,local</string> - <string name="LTimeDay">day,datetime,local</string> - <string name="LTimeSec">second,datetime,local</string> - <string name="LTimeHour">hour,datetime,local</string> - <string name="LTimeMin">min,datetime,local</string> - <string name="LTimeYear">year,datetime,local</string> - - <string name="UTCTimeWeek">weekday,datetime,utc</string> - <string name="UTCTimeDay">day,datetime,utc</string> - <string name="UTCTimeMth">mth,datetime,utc</string> - <string name="UTCTimeYr">year,datetime,utc</string> - <string name="UTCTimeHr">hour,datetime,utc</string> - <string name="UTCTimeMin">min,datetime,utc</string> - <string name="UTCTimeSec">second,datetime,utc</string> - <string name="UTCTimeTimezone">timezone,datetime,utc</string> - - </strings> diff --git a/indra/newview/skins/default/xui/en/widgets/combo_box.xml b/indra/newview/skins/default/xui/en/widgets/combo_box.xml index a042a61a26..d7369d0726 100644 --- a/indra/newview/skins/default/xui/en/widgets/combo_box.xml +++ b/indra/newview/skins/default/xui/en/widgets/combo_box.xml @@ -10,8 +10,7 @@ scale_image="true" image_unselected="ComboButton_Off" image_selected="ComboButton_Selected" - image_disabled="ComboButton_Disabled" - image_disabled_selected="ComboButton_Disabled_Selected" /> + image_disabled="ComboButton_Disabled" /> <combo_box.drop_down_button name="Drop Down Button" label="" hover_glow_amount="0.15" @@ -20,8 +19,7 @@ pad_right="24" image_unselected="DropDown_Off" image_selected="DropDown_Selected" - image_disabled="DropDown_Disabled" - image_disabled_selected="DropDown_Disabled_Selected" /> + image_disabled="DropDown_Disabled" /> <combo_box.combo_list bg_writeable_color="MenuDefaultBgColor" /> <combo_box.combo_editor name="Combo Text Entry" select_on_focus="true" diff --git a/indra/newview/skins/default/xui/en/widgets/filter_editor.xml b/indra/newview/skins/default/xui/en/widgets/filter_editor.xml index f77aa396ec..aef3363259 100644 --- a/indra/newview/skins/default/xui/en/widgets/filter_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/filter_editor.xml @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<filter_editor select_on_focus="true"
- background="TextField_Search_Off" >
+ background="TextField_Search_Off"
+ background_image_disabled="TextField_Search_Disabled"
+ background_image_focused="TextField_Search_Active">
<clear_filter_button label=""
image_unselected="Icon_Close_Foreground"
image_selected="Icon_Close_Press" />
diff --git a/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml b/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml index 45b1e1eb9f..17e9a7beb2 100644 --- a/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml +++ b/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<combo_box font="SansSerifSmall" +<gesture_combo_box font="SansSerifSmall" list_position="below" max_chars="20" follows="right|top"> - <combo_box.combo_button name="Combobox Button" + <gesture_combo_box.combo_button name="Combobox Button" label="" hover_glow_amount="0.15" font="SansSerifSmall" @@ -12,7 +12,7 @@ image_selected="ComboButton_Selected" image_disabled="ComboButton_Disabled" image_disabled_selected="ComboButton_Disabled_Selected" /> - <combo_box.drop_down_button name="Drop Down Button" + <gesture_combo_box.drop_down_button name="Drop Down Button" label="" hover_glow_amount="0.15" font="SansSerifSmall" @@ -22,8 +22,9 @@ image_selected="DropDown_Selected" image_disabled="DropDown_Disabled" image_disabled_selected="DropDown_Disabled_Selected" /> - <combo_box.combo_list bg_writeable_color="white" /> - <combo_box.combo_editor name="Combo Text Entry" + <gesture_combo_box.combo_list bg_writeable_color="MenuDefaultBgColor" /> + <gesture_combo_box.combo_editor name="Combo Text Entry" select_on_focus="true" font="SansSerifSmall" /> -</combo_box> + <gesture_combo_box.item label="Gestures" /> +</gesture_combo_box> diff --git a/indra/newview/skins/default/xui/en/widgets/line_editor.xml b/indra/newview/skins/default/xui/en/widgets/line_editor.xml index 08205cacbc..8b4126952e 100644 --- a/indra/newview/skins/default/xui/en/widgets/line_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/line_editor.xml @@ -9,7 +9,7 @@ ignore_tab="true" cursor_color="TextCursorColor" text_color="TextFgColor" - text_readonly_color="Green" + text_readonly_color="TextFgReadOnlyColor" text_tentative_color="TextFgTentativeColor" highlight_color="EmphasisColor" preedit_bg_color="White" diff --git a/indra/newview/skins/default/xui/en/widgets/menu.xml b/indra/newview/skins/default/xui/en/widgets/menu.xml index 10bc124ea3..58543338f6 100644 --- a/indra/newview/skins/default/xui/en/widgets/menu.xml +++ b/indra/newview/skins/default/xui/en/widgets/menu.xml @@ -2,5 +2,6 @@ <menu bg_color="MenuDefaultBgColor" bg_visible="true" drop_shadow="true" - tear_off="false"> + tear_off="false" + shortcut_pad="15"> </menu> diff --git a/indra/newview/skins/default/xui/en/widgets/output_monitor.xml b/indra/newview/skins/default/xui/en/widgets/output_monitor.xml index 2f6d808125..505c7ba936 100644 --- a/indra/newview/skins/default/xui/en/widgets/output_monitor.xml +++ b/indra/newview/skins/default/xui/en/widgets/output_monitor.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <output_monitor image_mute="mute_icon.tga" - image_off="icn_voice_ptt-off.tga" - image_on="icn_voice_ptt-on.tga" - image_level_1="icn_voice_ptt-on-lvl1.tga" - image_level_2="icn_voice_ptt-on-lvl2.tga" - image_level_3="icn_voice_ptt-on-lvl3.tga" + image_off="VoicePTT_Off" + image_on="VoicePTT_On" + image_level_1="VoicePTT_Lvl1" + image_level_2="VoicePTT_Lvl2" + image_level_3="VoicePTT_Lvl3" /> diff --git a/indra/newview/skins/default/xui/en/widgets/progress_bar.xml b/indra/newview/skins/default/xui/en/widgets/progress_bar.xml index 39cd464872..339e53fbb8 100644 --- a/indra/newview/skins/default/xui/en/widgets/progress_bar.xml +++ b/indra/newview/skins/default/xui/en/widgets/progress_bar.xml @@ -1,19 +1,10 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <progress_bar image_bar="ProgressTrack" image_fill="ProgressBar" - image_shadow="rounded_square_soft.tga" color_bar.red="0.5764" color_bar.green="0.6627" color_bar.blue="0.8352" color_bar.alpha="1" - color_bar2.red="0.5764" - color_bar2.green="0.6627" - color_bar2.blue="0.8352" - color_bar2.alpha="1" - color_shadow.red="0.2000" - color_shadow.green="0.2000" - color_shadow.blue="0.4000" - color_shadow="1" color_bg.red="0.3254" color_bg.green="0.4000" color_bg.blue="0.5058" diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml index 3b195c6b33..4ad11c41da 100644 --- a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml +++ b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml @@ -1,7 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<scroll_bar thumb_image="ScrollThumb_Vert" - track_image="ScrollTrack_Vert" - track_color="ScrollbarTrackColor" +<scroll_bar thumb_image_vertical ="ScrollThumb_Vert" + thumb_image_horizontal ="ScrollThumb_Horiz" + track_image_vertical ="ScrollTrack_Vert" + track_image_horizontal ="ScrollTrack_Horiz" + track_color="ScrollbarTrackColor" thumb_color="ScrollbarThumbColor" thickness="15"> <up_button image_unselected="ScrollArrow_Up" diff --git a/indra/newview/skins/default/xui/en/widgets/search_editor.xml b/indra/newview/skins/default/xui/en/widgets/search_editor.xml index 6f557e239d..15b23ea9b3 100644 --- a/indra/newview/skins/default/xui/en/widgets/search_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/search_editor.xml @@ -1,10 +1,15 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <search_editor + text_pad_left="4" select_on_focus="true" background_image="TextField_Search_Off" background_image_disabled="TextField_Search_Disabled" background_image_focused="TextField_Search_Active" > <search_button label="" + top_pad="4" + left_pad="4" + width="13" + height="13" image_unselected="Search" image_selected="Search" /> </search_editor> diff --git a/indra/newview/skins/default/xui/es/language_settings.xml b/indra/newview/skins/default/xui/es/language_settings.xml new file mode 100644 index 0000000000..71418d446a --- /dev/null +++ b/indra/newview/skins/default/xui/es/language_settings.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- This file contains strings that used to be hardcoded in the source.--> +<strings> + + <!-- Locale Information --> + <string name="MicrosoftLocale">english</string> + <string name="DarwinLocale">C</string> + <string name="LinuxLocale">C</string> + + <!-- + datetimeToCodes["wkday"] = "%a"; // Thu + datetimeToCodes["weekday"] = "%A"; // Thursday + datetimeToCodes["year4"] = "%Y"; // 2009 + datetimeToCodes["year"] = "%Y"; // 2009 + datetimeToCodes["year2"] = "%y"; // 09 + datetimeToCodes["mth"] = "%b"; // Aug + datetimeToCodes["month"] = "%B"; // August + datetimeToCodes["mthnum"] = "%m"; // 08 + datetimeToCodes["day"] = "%d"; // 31 + datetimeToCodes["hour24"] = "%H"; // 14 + datetimeToCodes["hour"] = "%H"; // 14 + datetimeToCodes["hour12"] = "%I"; // 02 + datetimeToCodes["min"] = "%M"; // 59 + datetimeToCodes["ampm"] = "%p"; // AM + datetimeToCodes["second"] = "%S"; // 59 + datetimeToCodes["timezone"] = "%Z"; // PST + --> + + <string name="TimeHour">hour,datetime,slt</string> + <string name="TimeMin">min,datetime,slt</string> + <string name="TimeYear">year,datetime,slt</string> + <string name="TimeDay">day,datetime,slt</string> + <string name="TimeMonth">mthnum,datetime,slt</string> + <string name="TimeWeek">wkday,datetime,slt</string> + <string name="TimeAMPM">ampm,datetime,slt</string> + <string name="TimeHour12">hour12,datetime,slt</string> + + <string name="LTimeMthNum">mthnum,datetime,local</string> + <string name="LTimeWeek">wkday,datetime,local</string> + <string name="LTimeMonth">mth,datetime,local</string> + <string name="LTimeDay">day,datetime,local</string> + <string name="LTimeSec">second,datetime,local</string> + <string name="LTimeHour">hour,datetime,local</string> + <string name="LTimeMin">min,datetime,local</string> + <string name="LTimeYear">year,datetime,local</string> + + <string name="UTCTimeWeek">weekday,datetime,utc</string> + <string name="UTCTimeDay">day,datetime,utc</string> + <string name="UTCTimeMth">mth,datetime,utc</string> + <string name="UTCTimeYr">year,datetime,utc</string> + <string name="UTCTimeHr">hour,datetime,utc</string> + <string name="UTCTimeMin">min,datetime,utc</string> + <string name="UTCTimeSec">second,datetime,utc</string> + <string name="UTCTimeTimezone">timezone,datetime,utc</string> +</strings> diff --git a/indra/newview/skins/default/xui/fr/language_settings.xml b/indra/newview/skins/default/xui/fr/language_settings.xml new file mode 100644 index 0000000000..71418d446a --- /dev/null +++ b/indra/newview/skins/default/xui/fr/language_settings.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- This file contains strings that used to be hardcoded in the source.--> +<strings> + + <!-- Locale Information --> + <string name="MicrosoftLocale">english</string> + <string name="DarwinLocale">C</string> + <string name="LinuxLocale">C</string> + + <!-- + datetimeToCodes["wkday"] = "%a"; // Thu + datetimeToCodes["weekday"] = "%A"; // Thursday + datetimeToCodes["year4"] = "%Y"; // 2009 + datetimeToCodes["year"] = "%Y"; // 2009 + datetimeToCodes["year2"] = "%y"; // 09 + datetimeToCodes["mth"] = "%b"; // Aug + datetimeToCodes["month"] = "%B"; // August + datetimeToCodes["mthnum"] = "%m"; // 08 + datetimeToCodes["day"] = "%d"; // 31 + datetimeToCodes["hour24"] = "%H"; // 14 + datetimeToCodes["hour"] = "%H"; // 14 + datetimeToCodes["hour12"] = "%I"; // 02 + datetimeToCodes["min"] = "%M"; // 59 + datetimeToCodes["ampm"] = "%p"; // AM + datetimeToCodes["second"] = "%S"; // 59 + datetimeToCodes["timezone"] = "%Z"; // PST + --> + + <string name="TimeHour">hour,datetime,slt</string> + <string name="TimeMin">min,datetime,slt</string> + <string name="TimeYear">year,datetime,slt</string> + <string name="TimeDay">day,datetime,slt</string> + <string name="TimeMonth">mthnum,datetime,slt</string> + <string name="TimeWeek">wkday,datetime,slt</string> + <string name="TimeAMPM">ampm,datetime,slt</string> + <string name="TimeHour12">hour12,datetime,slt</string> + + <string name="LTimeMthNum">mthnum,datetime,local</string> + <string name="LTimeWeek">wkday,datetime,local</string> + <string name="LTimeMonth">mth,datetime,local</string> + <string name="LTimeDay">day,datetime,local</string> + <string name="LTimeSec">second,datetime,local</string> + <string name="LTimeHour">hour,datetime,local</string> + <string name="LTimeMin">min,datetime,local</string> + <string name="LTimeYear">year,datetime,local</string> + + <string name="UTCTimeWeek">weekday,datetime,utc</string> + <string name="UTCTimeDay">day,datetime,utc</string> + <string name="UTCTimeMth">mth,datetime,utc</string> + <string name="UTCTimeYr">year,datetime,utc</string> + <string name="UTCTimeHr">hour,datetime,utc</string> + <string name="UTCTimeMin">min,datetime,utc</string> + <string name="UTCTimeSec">second,datetime,utc</string> + <string name="UTCTimeTimezone">timezone,datetime,utc</string> +</strings> diff --git a/indra/newview/skins/default/xui/it/language_settings.xml b/indra/newview/skins/default/xui/it/language_settings.xml new file mode 100644 index 0000000000..71418d446a --- /dev/null +++ b/indra/newview/skins/default/xui/it/language_settings.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- This file contains strings that used to be hardcoded in the source.--> +<strings> + + <!-- Locale Information --> + <string name="MicrosoftLocale">english</string> + <string name="DarwinLocale">C</string> + <string name="LinuxLocale">C</string> + + <!-- + datetimeToCodes["wkday"] = "%a"; // Thu + datetimeToCodes["weekday"] = "%A"; // Thursday + datetimeToCodes["year4"] = "%Y"; // 2009 + datetimeToCodes["year"] = "%Y"; // 2009 + datetimeToCodes["year2"] = "%y"; // 09 + datetimeToCodes["mth"] = "%b"; // Aug + datetimeToCodes["month"] = "%B"; // August + datetimeToCodes["mthnum"] = "%m"; // 08 + datetimeToCodes["day"] = "%d"; // 31 + datetimeToCodes["hour24"] = "%H"; // 14 + datetimeToCodes["hour"] = "%H"; // 14 + datetimeToCodes["hour12"] = "%I"; // 02 + datetimeToCodes["min"] = "%M"; // 59 + datetimeToCodes["ampm"] = "%p"; // AM + datetimeToCodes["second"] = "%S"; // 59 + datetimeToCodes["timezone"] = "%Z"; // PST + --> + + <string name="TimeHour">hour,datetime,slt</string> + <string name="TimeMin">min,datetime,slt</string> + <string name="TimeYear">year,datetime,slt</string> + <string name="TimeDay">day,datetime,slt</string> + <string name="TimeMonth">mthnum,datetime,slt</string> + <string name="TimeWeek">wkday,datetime,slt</string> + <string name="TimeAMPM">ampm,datetime,slt</string> + <string name="TimeHour12">hour12,datetime,slt</string> + + <string name="LTimeMthNum">mthnum,datetime,local</string> + <string name="LTimeWeek">wkday,datetime,local</string> + <string name="LTimeMonth">mth,datetime,local</string> + <string name="LTimeDay">day,datetime,local</string> + <string name="LTimeSec">second,datetime,local</string> + <string name="LTimeHour">hour,datetime,local</string> + <string name="LTimeMin">min,datetime,local</string> + <string name="LTimeYear">year,datetime,local</string> + + <string name="UTCTimeWeek">weekday,datetime,utc</string> + <string name="UTCTimeDay">day,datetime,utc</string> + <string name="UTCTimeMth">mth,datetime,utc</string> + <string name="UTCTimeYr">year,datetime,utc</string> + <string name="UTCTimeHr">hour,datetime,utc</string> + <string name="UTCTimeMin">min,datetime,utc</string> + <string name="UTCTimeSec">second,datetime,utc</string> + <string name="UTCTimeTimezone">timezone,datetime,utc</string> +</strings> diff --git a/indra/newview/skins/default/xui/ja/language_settings.xml b/indra/newview/skins/default/xui/ja/language_settings.xml new file mode 100644 index 0000000000..71418d446a --- /dev/null +++ b/indra/newview/skins/default/xui/ja/language_settings.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- This file contains strings that used to be hardcoded in the source.--> +<strings> + + <!-- Locale Information --> + <string name="MicrosoftLocale">english</string> + <string name="DarwinLocale">C</string> + <string name="LinuxLocale">C</string> + + <!-- + datetimeToCodes["wkday"] = "%a"; // Thu + datetimeToCodes["weekday"] = "%A"; // Thursday + datetimeToCodes["year4"] = "%Y"; // 2009 + datetimeToCodes["year"] = "%Y"; // 2009 + datetimeToCodes["year2"] = "%y"; // 09 + datetimeToCodes["mth"] = "%b"; // Aug + datetimeToCodes["month"] = "%B"; // August + datetimeToCodes["mthnum"] = "%m"; // 08 + datetimeToCodes["day"] = "%d"; // 31 + datetimeToCodes["hour24"] = "%H"; // 14 + datetimeToCodes["hour"] = "%H"; // 14 + datetimeToCodes["hour12"] = "%I"; // 02 + datetimeToCodes["min"] = "%M"; // 59 + datetimeToCodes["ampm"] = "%p"; // AM + datetimeToCodes["second"] = "%S"; // 59 + datetimeToCodes["timezone"] = "%Z"; // PST + --> + + <string name="TimeHour">hour,datetime,slt</string> + <string name="TimeMin">min,datetime,slt</string> + <string name="TimeYear">year,datetime,slt</string> + <string name="TimeDay">day,datetime,slt</string> + <string name="TimeMonth">mthnum,datetime,slt</string> + <string name="TimeWeek">wkday,datetime,slt</string> + <string name="TimeAMPM">ampm,datetime,slt</string> + <string name="TimeHour12">hour12,datetime,slt</string> + + <string name="LTimeMthNum">mthnum,datetime,local</string> + <string name="LTimeWeek">wkday,datetime,local</string> + <string name="LTimeMonth">mth,datetime,local</string> + <string name="LTimeDay">day,datetime,local</string> + <string name="LTimeSec">second,datetime,local</string> + <string name="LTimeHour">hour,datetime,local</string> + <string name="LTimeMin">min,datetime,local</string> + <string name="LTimeYear">year,datetime,local</string> + + <string name="UTCTimeWeek">weekday,datetime,utc</string> + <string name="UTCTimeDay">day,datetime,utc</string> + <string name="UTCTimeMth">mth,datetime,utc</string> + <string name="UTCTimeYr">year,datetime,utc</string> + <string name="UTCTimeHr">hour,datetime,utc</string> + <string name="UTCTimeMin">min,datetime,utc</string> + <string name="UTCTimeSec">second,datetime,utc</string> + <string name="UTCTimeTimezone">timezone,datetime,utc</string> +</strings> diff --git a/indra/newview/skins/default/xui/nl/language_settings.xml b/indra/newview/skins/default/xui/nl/language_settings.xml new file mode 100644 index 0000000000..71418d446a --- /dev/null +++ b/indra/newview/skins/default/xui/nl/language_settings.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- This file contains strings that used to be hardcoded in the source.--> +<strings> + + <!-- Locale Information --> + <string name="MicrosoftLocale">english</string> + <string name="DarwinLocale">C</string> + <string name="LinuxLocale">C</string> + + <!-- + datetimeToCodes["wkday"] = "%a"; // Thu + datetimeToCodes["weekday"] = "%A"; // Thursday + datetimeToCodes["year4"] = "%Y"; // 2009 + datetimeToCodes["year"] = "%Y"; // 2009 + datetimeToCodes["year2"] = "%y"; // 09 + datetimeToCodes["mth"] = "%b"; // Aug + datetimeToCodes["month"] = "%B"; // August + datetimeToCodes["mthnum"] = "%m"; // 08 + datetimeToCodes["day"] = "%d"; // 31 + datetimeToCodes["hour24"] = "%H"; // 14 + datetimeToCodes["hour"] = "%H"; // 14 + datetimeToCodes["hour12"] = "%I"; // 02 + datetimeToCodes["min"] = "%M"; // 59 + datetimeToCodes["ampm"] = "%p"; // AM + datetimeToCodes["second"] = "%S"; // 59 + datetimeToCodes["timezone"] = "%Z"; // PST + --> + + <string name="TimeHour">hour,datetime,slt</string> + <string name="TimeMin">min,datetime,slt</string> + <string name="TimeYear">year,datetime,slt</string> + <string name="TimeDay">day,datetime,slt</string> + <string name="TimeMonth">mthnum,datetime,slt</string> + <string name="TimeWeek">wkday,datetime,slt</string> + <string name="TimeAMPM">ampm,datetime,slt</string> + <string name="TimeHour12">hour12,datetime,slt</string> + + <string name="LTimeMthNum">mthnum,datetime,local</string> + <string name="LTimeWeek">wkday,datetime,local</string> + <string name="LTimeMonth">mth,datetime,local</string> + <string name="LTimeDay">day,datetime,local</string> + <string name="LTimeSec">second,datetime,local</string> + <string name="LTimeHour">hour,datetime,local</string> + <string name="LTimeMin">min,datetime,local</string> + <string name="LTimeYear">year,datetime,local</string> + + <string name="UTCTimeWeek">weekday,datetime,utc</string> + <string name="UTCTimeDay">day,datetime,utc</string> + <string name="UTCTimeMth">mth,datetime,utc</string> + <string name="UTCTimeYr">year,datetime,utc</string> + <string name="UTCTimeHr">hour,datetime,utc</string> + <string name="UTCTimeMin">min,datetime,utc</string> + <string name="UTCTimeSec">second,datetime,utc</string> + <string name="UTCTimeTimezone">timezone,datetime,utc</string> +</strings> diff --git a/indra/newview/skins/default/xui/pl/language_settings.xml b/indra/newview/skins/default/xui/pl/language_settings.xml new file mode 100644 index 0000000000..71418d446a --- /dev/null +++ b/indra/newview/skins/default/xui/pl/language_settings.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- This file contains strings that used to be hardcoded in the source.--> +<strings> + + <!-- Locale Information --> + <string name="MicrosoftLocale">english</string> + <string name="DarwinLocale">C</string> + <string name="LinuxLocale">C</string> + + <!-- + datetimeToCodes["wkday"] = "%a"; // Thu + datetimeToCodes["weekday"] = "%A"; // Thursday + datetimeToCodes["year4"] = "%Y"; // 2009 + datetimeToCodes["year"] = "%Y"; // 2009 + datetimeToCodes["year2"] = "%y"; // 09 + datetimeToCodes["mth"] = "%b"; // Aug + datetimeToCodes["month"] = "%B"; // August + datetimeToCodes["mthnum"] = "%m"; // 08 + datetimeToCodes["day"] = "%d"; // 31 + datetimeToCodes["hour24"] = "%H"; // 14 + datetimeToCodes["hour"] = "%H"; // 14 + datetimeToCodes["hour12"] = "%I"; // 02 + datetimeToCodes["min"] = "%M"; // 59 + datetimeToCodes["ampm"] = "%p"; // AM + datetimeToCodes["second"] = "%S"; // 59 + datetimeToCodes["timezone"] = "%Z"; // PST + --> + + <string name="TimeHour">hour,datetime,slt</string> + <string name="TimeMin">min,datetime,slt</string> + <string name="TimeYear">year,datetime,slt</string> + <string name="TimeDay">day,datetime,slt</string> + <string name="TimeMonth">mthnum,datetime,slt</string> + <string name="TimeWeek">wkday,datetime,slt</string> + <string name="TimeAMPM">ampm,datetime,slt</string> + <string name="TimeHour12">hour12,datetime,slt</string> + + <string name="LTimeMthNum">mthnum,datetime,local</string> + <string name="LTimeWeek">wkday,datetime,local</string> + <string name="LTimeMonth">mth,datetime,local</string> + <string name="LTimeDay">day,datetime,local</string> + <string name="LTimeSec">second,datetime,local</string> + <string name="LTimeHour">hour,datetime,local</string> + <string name="LTimeMin">min,datetime,local</string> + <string name="LTimeYear">year,datetime,local</string> + + <string name="UTCTimeWeek">weekday,datetime,utc</string> + <string name="UTCTimeDay">day,datetime,utc</string> + <string name="UTCTimeMth">mth,datetime,utc</string> + <string name="UTCTimeYr">year,datetime,utc</string> + <string name="UTCTimeHr">hour,datetime,utc</string> + <string name="UTCTimeMin">min,datetime,utc</string> + <string name="UTCTimeSec">second,datetime,utc</string> + <string name="UTCTimeTimezone">timezone,datetime,utc</string> +</strings> diff --git a/indra/newview/skins/default/xui/pt/language_settings.xml b/indra/newview/skins/default/xui/pt/language_settings.xml new file mode 100644 index 0000000000..71418d446a --- /dev/null +++ b/indra/newview/skins/default/xui/pt/language_settings.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- This file contains strings that used to be hardcoded in the source.--> +<strings> + + <!-- Locale Information --> + <string name="MicrosoftLocale">english</string> + <string name="DarwinLocale">C</string> + <string name="LinuxLocale">C</string> + + <!-- + datetimeToCodes["wkday"] = "%a"; // Thu + datetimeToCodes["weekday"] = "%A"; // Thursday + datetimeToCodes["year4"] = "%Y"; // 2009 + datetimeToCodes["year"] = "%Y"; // 2009 + datetimeToCodes["year2"] = "%y"; // 09 + datetimeToCodes["mth"] = "%b"; // Aug + datetimeToCodes["month"] = "%B"; // August + datetimeToCodes["mthnum"] = "%m"; // 08 + datetimeToCodes["day"] = "%d"; // 31 + datetimeToCodes["hour24"] = "%H"; // 14 + datetimeToCodes["hour"] = "%H"; // 14 + datetimeToCodes["hour12"] = "%I"; // 02 + datetimeToCodes["min"] = "%M"; // 59 + datetimeToCodes["ampm"] = "%p"; // AM + datetimeToCodes["second"] = "%S"; // 59 + datetimeToCodes["timezone"] = "%Z"; // PST + --> + + <string name="TimeHour">hour,datetime,slt</string> + <string name="TimeMin">min,datetime,slt</string> + <string name="TimeYear">year,datetime,slt</string> + <string name="TimeDay">day,datetime,slt</string> + <string name="TimeMonth">mthnum,datetime,slt</string> + <string name="TimeWeek">wkday,datetime,slt</string> + <string name="TimeAMPM">ampm,datetime,slt</string> + <string name="TimeHour12">hour12,datetime,slt</string> + + <string name="LTimeMthNum">mthnum,datetime,local</string> + <string name="LTimeWeek">wkday,datetime,local</string> + <string name="LTimeMonth">mth,datetime,local</string> + <string name="LTimeDay">day,datetime,local</string> + <string name="LTimeSec">second,datetime,local</string> + <string name="LTimeHour">hour,datetime,local</string> + <string name="LTimeMin">min,datetime,local</string> + <string name="LTimeYear">year,datetime,local</string> + + <string name="UTCTimeWeek">weekday,datetime,utc</string> + <string name="UTCTimeDay">day,datetime,utc</string> + <string name="UTCTimeMth">mth,datetime,utc</string> + <string name="UTCTimeYr">year,datetime,utc</string> + <string name="UTCTimeHr">hour,datetime,utc</string> + <string name="UTCTimeMin">min,datetime,utc</string> + <string name="UTCTimeSec">second,datetime,utc</string> + <string name="UTCTimeTimezone">timezone,datetime,utc</string> +</strings> |