diff options
Diffstat (limited to 'indra/newview')
34 files changed, 365 insertions, 141 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 941cb6b9f9..97ccfeac29 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -168,6 +168,7 @@ set(viewer_SOURCE_FILES llfloaterabout.cpp llfloateranimpreview.cpp llfloaterauction.cpp + llfloateravatar.cpp llfloateravatarpicker.cpp llfloateravatartextures.cpp llfloaterbeacons.cpp @@ -733,6 +734,7 @@ set(viewer_HEADER_FILES llfloaterabout.h llfloateranimpreview.h llfloaterauction.h + llfloateravatar.h llfloateravatarpicker.h llfloateravatartextures.h llfloaterbeacons.h diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index f5581baa19..d758647d3a 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -187,10 +187,8 @@ icon="Command_Profile_Icon" label_ref="Command_Profile_Label" tooltip_ref="Command_Profile_Tooltip" - execute_function="Floater.ToolbarToggle" - execute_parameters="my_profile" - is_running_function="Floater.IsOpen" - is_running_parameters="my_profile" + execute_function="Avatar.ToggleMyProfile" + is_running_function="Avatar.IsMyProfileOpen" /> <command name="search" available_in_toybox="true" @@ -217,11 +215,11 @@ icon="Command_Speak_Icon" label_ref="Command_Speak_Label" tooltip_ref="Command_Speak_Tooltip" - execute_function="Floater.ToolbarToggle" + execute_function="Agent.ToggleMicrophone" execute_parameters="speak" is_enabled_function="Agent.IsActionAllowed" is_enabled_parameters="speak" - is_running_function="Floater.IsOpen" + is_running_function="Agent.IsMicrophoneOn" is_running_parameters="speak" /> <command name="view" diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index ed29ac7960..8303a5942d 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -174,12 +174,43 @@ bool LLAgent::isActionAllowed(const LLSD& sdname) } else if (param == "speak") { - retval = true; + if ( gAgent.isVoiceConnected() ) + { + retval = true; + } + else + { + retval = false; + } } return retval; } +// static +void LLAgent::toggleMicrophone(const LLSD& name) +{ + gAgent.mMicrophoneOn = ! gAgent.mMicrophoneOn; + + if ( gAgent.mMicrophoneOn ) + { + LLFirstUse::speak(false); + + LLVoiceClient::getInstance()->inputUserControlState(true); + LLVoiceClient::getInstance()->inputUserControlState(false); + } + else + { + LLVoiceClient::getInstance()->inputUserControlState(false); + LLVoiceClient::getInstance()->inputUserControlState(true); + } +} + +// static +bool LLAgent::isMicrophoneOn(const LLSD& sdname) +{ + return gAgent.mMicrophoneOn; +} // ************************************************************ // Enabled this definition to compile a 'hacked' viewer that @@ -261,6 +292,9 @@ LLAgent::LLAgent() : mCurrentFidget(0), mFirstLogin(FALSE), mGenderChosen(FALSE), + + mVoiceConnected(false), + mMicrophoneOn(false), mAppearanceSerialNum(0), @@ -280,6 +314,8 @@ LLAgent::LLAgent() : LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback)); LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2)); + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.ToggleMicrophone", boost::bind(&LLAgent::toggleMicrophone, _2)); + LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2)); } // Requires gSavedSettings to be initialized. diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 1775a0235c..0355e68b6e 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -282,7 +282,21 @@ public: static void toggleFlying(); static bool enableFlying(); BOOL canFly(); // Does this parcel allow you to fly? - + + //-------------------------------------------------------------------- + // Voice + //-------------------------------------------------------------------- +public: + bool isVoiceConnected() const { return mVoiceConnected; } + void setVoiceConnected(const bool b) { mVoiceConnected = b; } + + static void toggleMicrophone(const LLSD& name); + static bool isMicrophoneOn(const LLSD& sdname); + +private: + bool mVoiceConnected; + bool mMicrophoneOn; + //-------------------------------------------------------------------- // Chat //-------------------------------------------------------------------- diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index b14c02a5d6..b54f622986 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -316,12 +316,13 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa // PROFILES: open in webkit window const bool show_chrome = false; static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect"); - LLFloaterWebContent::create(LLFloaterWebContent::Params(). - url(url). - id(agent_id.asString()). - show_chrome(show_chrome). - window_class("profile"). - preferred_media_size(profile_rect)); + LLFloaterWebContent::Params p; + p.url(url). + id(agent_id.asString()). + show_chrome(show_chrome). + window_class("profile"). + preferred_media_size(profile_rect); + LLFloaterReg::showInstance("profile", p); } // static @@ -342,6 +343,12 @@ bool LLAvatarActions::profileVisible(const LLUUID& id) return browser && browser->isShown(); } +//static +LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& id) +{ + LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("profile", LLSD().with("id", id))); + return browser; +} //static void LLAvatarActions::hideProfile(const LLUUID& id) diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index fbfd815f41..748b7cb3d1 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -35,7 +35,7 @@ #include <vector> class LLInventoryPanel; - +class LLFloater; /** * Friend-related actions (add, remove, offer teleport, etc) @@ -96,6 +96,7 @@ public: static void showProfile(const LLUUID& id); static void hideProfile(const LLUUID& id); static bool profileVisible(const LLUUID& id); + static LLFloater* getProfileFloater(const LLUUID& id); /** * Show avatar on world map. diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 98712f1334..af91702f9b 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -387,6 +387,9 @@ void LLBottomTray::onChange(EStatusType status, const std::string &channelURI, b if (status != STATUS_JOINING && status!= STATUS_LEFT_CHANNEL) { bool voice_status = LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking(); + + gAgent.setVoiceConnected(voice_status); + getChild<LLButton>("speak_flyout_btn")->setEnabled(voice_status); gMenuBarView->getChild<LLView>("Nearby Voice")->setEnabled(voice_status); if (voice_status) diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 945a760d05..4c6ddc8be7 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -44,7 +44,6 @@ #include "llparticipantlist.h" #include "llspeakers.h" #include "lltextutil.h" -#include "lltransientfloatermgr.h" #include "llviewercontrol.h" #include "llviewerdisplayname.h" #include "llviewerwindow.h" @@ -97,7 +96,7 @@ static void* create_non_avatar_caller(void*) LLVoiceChannel* LLCallFloater::sCurrentVoiceChannel = NULL; LLCallFloater::LLCallFloater(const LLSD& key) -: LLTransientDockableFloater(NULL, false, key) +: LLFloater(key) , mSpeakerManager(NULL) , mParticipants(NULL) , mAvatarList(NULL) @@ -113,10 +112,6 @@ LLCallFloater::LLCallFloater(const LLSD& key) mFactoryMap["non_avatar_caller"] = LLCallbackMap(create_non_avatar_caller, NULL); LLVoiceClient::instance().addObserver(this); - LLTransientFloaterMgr::getInstance()->addControlView(this); - - // force docked state since this floater doesn't save it between recreations - setDocked(true); // update the agent's name if display name setting change LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&LLCallFloater::updateAgentModeratorState, this)); @@ -139,13 +134,11 @@ LLCallFloater::~LLCallFloater() { LLVoiceClient::getInstance()->removeObserver(this); } - LLTransientFloaterMgr::getInstance()->removeControlView(this); } // virtual BOOL LLCallFloater::postBuild() { - LLTransientDockableFloater::postBuild(); mAvatarList = getChild<LLAvatarList>("speakers_list"); mAvatarListRefreshConnection = mAvatarList->setRefreshCompleteCallback(boost::bind(&LLCallFloater::onAvatarListRefreshed, this)); @@ -154,12 +147,6 @@ BOOL LLCallFloater::postBuild() mNonAvatarCaller = findChild<LLNonAvatarCaller>("non_avatar_caller"); mNonAvatarCaller->setVisible(FALSE); - LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("speak_flyout_btn"); - - setDockControl(new LLDockControl( - anchor_panel, this, - getDockTongue(), LLDockControl::TOP)); - initAgentData(); connectToChannel(LLVoiceChannel::getCurrentVoiceChannel()); @@ -204,13 +191,13 @@ void LLCallFloater::draw() if (mParticipants) mParticipants->updateRecentSpeakersOrder(); - LLTransientDockableFloater::draw(); + LLFloater::draw(); } // virtual void LLCallFloater::setFocus( BOOL b ) { - LLTransientDockableFloater::setFocus(b); + LLFloater::setFocus(b); // Force using active floater transparency (STORM-730). // We have to override setFocus() for LLCallFloater because selecting an item diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index 00a3f76e56..ea78cd53b7 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -52,7 +52,7 @@ class LLSpeakersDelayActionsStorage; * When the Resident is engaged in any chat except Nearby Chat, the Voice Control Panel * also provides a 'Leave Call' button to allow the Resident to leave that voice channel. */ -class LLCallFloater : public LLTransientDockableFloater, LLVoiceClientParticipantObserver +class LLCallFloater : public LLFloater, LLVoiceClientParticipantObserver { public: diff --git a/indra/newview/llfloateravatar.cpp b/indra/newview/llfloateravatar.cpp new file mode 100644 index 0000000000..bdc5b581a9 --- /dev/null +++ b/indra/newview/llfloateravatar.cpp @@ -0,0 +1,54 @@ +/** + * @file llfloateravatar.h + * @author Leyla Farazha + * @brief floater for the avatar changer + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +/** + * Floater that appears when buying an object, giving a preview + * of its contents and their permissions. + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloateravatar.h" +#include "lluictrlfactory.h" + + +LLFloaterAvatar::LLFloaterAvatar(const LLSD& key) + : LLFloater(key) +{ +} + +LLFloaterAvatar::~LLFloaterAvatar() +{ +} + +BOOL LLFloaterAvatar::postBuild() +{ + enableResizeCtrls(true, true, false); + return TRUE; +} + + diff --git a/indra/newview/llfloateravatar.h b/indra/newview/llfloateravatar.h new file mode 100644 index 0000000000..cadc5e4028 --- /dev/null +++ b/indra/newview/llfloateravatar.h @@ -0,0 +1,43 @@ +/** + * @file llfloateravatar.h + * @author Leyla Farazha + * @brief floater for the avatar changer + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_FLOATER_AVATAR_H +#define LL_FLOATER_AVATAR_H + +#include "llfloater.h" + +class LLFloaterAvatar: + public LLFloater +{ + friend class LLFloaterReg; +private: + LLFloaterAvatar(const LLSD& key); + /*virtual*/ ~LLFloaterAvatar(); + /*virtual*/ BOOL postBuild(); +}; + +#endif diff --git a/indra/newview/llfloaterdestinations.cpp b/indra/newview/llfloaterdestinations.cpp index 52d1f67c36..af21cb593f 100644 --- a/indra/newview/llfloaterdestinations.cpp +++ b/indra/newview/llfloaterdestinations.cpp @@ -47,6 +47,7 @@ LLFloaterDestinations::~LLFloaterDestinations() BOOL LLFloaterDestinations::postBuild() { + enableResizeCtrls(true, true, false); return TRUE; } diff --git a/indra/newview/llfloaterhelpbrowser.cpp b/indra/newview/llfloaterhelpbrowser.cpp index 3012638d44..fd9c37ae73 100644 --- a/indra/newview/llfloaterhelpbrowser.cpp +++ b/indra/newview/llfloaterhelpbrowser.cpp @@ -39,6 +39,7 @@ #include "llurlhistory.h" #include "llmediactrl.h" #include "llviewermedia.h" +#include "llviewerhelp.h" LLFloaterHelpBrowser::LLFloaterHelpBrowser(const LLSD& key) @@ -74,6 +75,17 @@ void LLFloaterHelpBrowser::buildURLHistory() void LLFloaterHelpBrowser::onOpen(const LLSD& key) { gSavedSettings.setBOOL("HelpFloaterOpen", TRUE); + + std::string topic = key.asString(); + + if (topic == "__local") + { + mBrowser->navigateToLocalPage( "help-offline" , "index.html" ); + } + else + { + mBrowser->navigateTo(LLViewerHelp::instance().getURL(topic)); + } } //virtual @@ -148,8 +160,3 @@ void LLFloaterHelpBrowser::openMedia(const std::string& media_url) mBrowser->navigateTo(media_url, "text/html"); setCurrentURL(media_url); } - -void LLFloaterHelpBrowser::navigateToLocalPage( const std::string& subdir, const std::string& filename_in ) -{ - mBrowser->navigateToLocalPage(subdir, filename_in); -} diff --git a/indra/newview/llfloaterhelpbrowser.h b/indra/newview/llfloaterhelpbrowser.h index afe0f4df69..80b0ecc06b 100644 --- a/indra/newview/llfloaterhelpbrowser.h +++ b/indra/newview/llfloaterhelpbrowser.h @@ -48,8 +48,6 @@ class LLFloaterHelpBrowser : /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); void openMedia(const std::string& media_url); - - void navigateToLocalPage( const std::string& subdir, const std::string& filename_in ); private: void buildURLHistory(); diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 2c9a736aff..c76aeb0498 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -88,20 +88,6 @@ BOOL LLFloaterWebContent::postBuild() return TRUE; } -bool LLFloaterWebContent::matchesKey(const LLSD& key) -{ - LLUUID id = key["id"]; - if (id.notNull()) - { - return id == mKey["id"].asUUID(); - } - else - { - return key["target"].asString() == mKey["target"].asString(); - } -} - - void LLFloaterWebContent::initializeURLHistory() { // start with an empty list @@ -123,6 +109,20 @@ void LLFloaterWebContent::initializeURLHistory() } } +bool LLFloaterWebContent::matchesKey(const LLSD& key) +{ + Params p(mKey); + Params other_p(key); + if (!other_p.target().empty() && other_p.target() != "_blank") + { + return other_p.target() == p.target(); + } + else + { + return other_p.id() == p.id(); + } +} + //static LLFloater* LLFloaterWebContent::create( Params p) { @@ -139,14 +139,7 @@ LLFloater* LLFloaterWebContent::create( Params p) } S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit"); - - LLSD sd; - sd["target"] = p.target; - if(LLFloaterReg::findInstance(p.window_class, sd) != NULL) - { - // There's already a web browser for this tag, so we won't be opening a new window. - } - else if(browser_window_limit != 0) + if(browser_window_limit != 0) { // showInstance will open a new window. Figure out how many web browsers are already open, // and close the least recently opened one if this will put us over the limit. @@ -166,7 +159,7 @@ LLFloater* LLFloaterWebContent::create( Params p) } } - return LLFloaterReg::showInstance(p.window_class, p); + return new LLFloaterWebContent(p); } //static diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 0bdeb114f5..1f1e49726d 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -1122,16 +1122,7 @@ void LLMediaCtrl::onPopup(const LLSD& notification, const LLSD& response) lldebugs << "No gFloaterView for onPopuup()" << llendl; }; - // (for now) open web content floater if that's our parent, otherwise, open the current media floater - // (this will change soon) - if ( floater_name == "web_content" ) - { - LLWeb::loadWebURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); - } - else - { - LLWeb::loadURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); - } + LLWeb::loadURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); } else { diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index cba4fafe42..caa20b767c 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -452,6 +452,8 @@ BOOL LLNearbyChatBar::postBuild() mExpandedHeight = getMinHeight() + EXPANDED_HEIGHT; + enableResizeCtrls(true, true, false); + return TRUE; } @@ -462,6 +464,7 @@ void LLNearbyChatBar::applyRectControl() { getChildView("nearby_chat")->setVisible(true); mExpandedHeight = getRect().getHeight(); + enableResizeCtrls(true); } } @@ -707,13 +710,13 @@ void LLNearbyChatBar::onToggleNearbyChatPanel() mExpandedHeight = getRect().getHeight(); nearby_chat->setVisible(FALSE); reshape(getRect().getWidth(), getMinHeight()); - mResizeHandle[0]->setMaxHeight(getMinHeight()); + enableResizeCtrls(true, true, false); } else { nearby_chat->setVisible(TRUE); reshape(getRect().getWidth(), mExpandedHeight); - mResizeHandle[0]->setMaxHeight(S32_MAX); + enableResizeCtrls(true); } } diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index fd5c3362bb..27390fca78 100755 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -72,7 +72,7 @@ public: std::string agent_name = params[0]; llinfos << "Profile, agent_name " << agent_name << llendl; std::string url = getProfileURL(agent_name); - LLWeb::loadWebURLInternal(url); + LLWeb::loadURLInternal(url); return true; } diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index 44b244f163..7977faeab7 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -41,7 +41,6 @@ LLToolBarView* gToolBarView = NULL; static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view"); -bool LLToolBarView::sDragStarted = false; bool isToolDragged() { @@ -152,7 +151,7 @@ bool LLToolBarView::loadToolbars(bool force_default) LLXMLNodePtr root; if(!LLXMLNode::parseFile(toolbar_file, root, NULL)) { - llerrs << "Unable to load toolbars from file: " << toolbar_file << llendl; + llwarns << "Unable to load toolbars from file: " << toolbar_file << llendl; return false; } if(!root->hasName("toolbars")) @@ -331,18 +330,25 @@ void LLToolBarView::draw() void LLToolBarView::startDragTool( S32 x, S32 y, const LLUUID& uuid) { - //llinfos << "Merov debug: startDragTool() : x = " << x << ", y = " << y << llendl; + llinfos << "Merov debug: startDragTool() : x = " << x << ", y = " << y << ", uuid = " << uuid << llendl; + // Flag the tool dragging but don't start it yet + gToolBarView->mDragStarted = false; + gToolBarView->mDragCommand = LLCommandId::null; + gToolBarView->mDragRank = LLToolBar::RANK_NONE; + gToolBarView->mDragToolbar = NULL; LLToolDragAndDrop::getInstance()->setDragStart( x, y ); - sDragStarted = false; } BOOL LLToolBarView::handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type) { -// llinfos << "Merov debug: handleDragTool() : x = " << x << ", y = " << y << ", uuid = " << uuid << llendl; if (LLToolDragAndDrop::getInstance()->isOverThreshold( x, y )) { - if (!sDragStarted) + if (!gToolBarView->mDragStarted) { + llinfos << "Merov debug: handleDragTool() : x = " << x << ", y = " << y << ", uuid = " << uuid << llendl; + // Start the tool dragging: + + // First, create the global drag and drop object std::vector<EDragAndDropType> types; uuid_vec_t cargo_ids; types.push_back(DAD_WIDGET); @@ -350,9 +356,35 @@ BOOL LLToolBarView::handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp gClipboard.setSourceObject(uuid,LLAssetType::AT_WIDGET); LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_VIEWER; LLUUID srcID; - //llinfos << "Merov debug: handleDragTool() : beginMultiDrag()" << llendl; LLToolDragAndDrop::getInstance()->beginMultiDrag(types, cargo_ids, src, srcID); - sDragStarted = true; + llinfos << "Merov debug: beginMultiDrag() launched" << llendl; + + // Second, check if the command is present in one of the 3 toolbars + // If it is, store the command, the toolbar and the rank in the toolbar and + // set a callback on end drag so that we reinsert the command if no drop happened + /* + gToolBarView->mDragCommand = LLCommandId(uuid); + if ((gToolBarView->mDragRank = gToolBarView->mToolbarLeft->removeCommand(gToolBarView->mDragCommand)) != LLToolBar::RANK_NONE) + { + gToolBarView->mDragToolbar = gToolBarView->mToolbarLeft; + } + else if ((gToolBarView->mDragRank = gToolBarView->mToolbarRight->removeCommand(gToolBarView->mDragCommand)) != LLToolBar::RANK_NONE) + { + gToolBarView->mDragToolbar = gToolBarView->mToolbarRight; + } + else if ((gToolBarView->mDragRank = gToolBarView->mToolbarBottom->removeCommand(gToolBarView->mDragCommand)) != LLToolBar::RANK_NONE) + { + gToolBarView->mDragToolbar = gToolBarView->mToolbarBottom; + } + if (gToolBarView->mDragRank != LLToolBar::RANK_NONE) + { + llinfos << "Merov debug: rank of dragged tool = " << gToolBarView->mDragRank << llendl; + LLToolDragAndDrop::getInstance()->setEndDragCallback(boost::bind(&LLToolBarView::onEndDrag, gToolBarView)); + } + */ + + llinfos << "Merov debug: Drag started cleanly" << llendl; + gToolBarView->mDragStarted = true; return TRUE; } else @@ -375,7 +407,7 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t //llinfos << "Merov debug : handleDropTool. Drop source is a widget -> drop it in place..." << llendl; // Get the command from its uuid LLCommandManager& mgr = LLCommandManager::instance(); - LLCommandId command_id("",inv_item->getUUID()); + LLCommandId command_id(inv_item->getUUID()); LLCommand* command = mgr.getCommand(command_id); if (command) { @@ -408,5 +440,19 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t void LLToolBarView::stopDragTool() { - sDragStarted = false; + // Clear the saved command, toolbar and rank + gToolBarView->mDragStarted = false; + gToolBarView->mDragCommand = LLCommandId::null; + gToolBarView->mDragRank = LLToolBar::RANK_NONE; + gToolBarView->mDragToolbar = NULL; +} + +void LLToolBarView::onEndDrag() +{ + // If there's a saved command, reinsert it in the saved toolbar + if (gToolBarView->mDragRank != LLToolBar::RANK_NONE) + { + gToolBarView->mDragToolbar->addCommand(gToolBarView->mDragCommand,gToolBarView->mDragRank); + } + stopDragTool(); } diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index a0c526ac54..6623e63f8a 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -78,6 +78,7 @@ public: static BOOL handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type); static BOOL handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* toolbar); static void stopDragTool(); + void onEndDrag(); protected: friend class LLUICtrlFactory; @@ -94,12 +95,11 @@ private: LLToolBar* mToolbarLeft; LLToolBar* mToolbarRight; LLToolBar* mToolbarBottom; - bool mDragging; - LLToolBarButton* mDragButton; - S32 mMouseX; - S32 mMouseY; - static bool sDragStarted; + LLCommandId mDragCommand; + int mDragRank; + LLToolBar* mDragToolbar; + bool mDragStarted; }; extern LLToolBarView* gToolBarView; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index b0daf9f3c2..3463eec5d8 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -37,6 +37,7 @@ #include "llfloaterabout.h" #include "llfloateranimpreview.h" #include "llfloaterauction.h" +#include "llfloateravatar.h" #include "llfloateravatarpicker.h" #include "llfloateravatartextures.h" #include "llfloaterbeacons.h" @@ -168,7 +169,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("about_land", "floater_about_land.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLand>); LLFloaterReg::add("appearance", "floater_my_appearance.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>); LLFloaterReg::add("auction", "floater_auction.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAuction>); - LLFloaterReg::add("avatar", "floater_avatar.xml", &LLFloaterReg::build<LLFloater>); + LLFloaterReg::add("avatar", "floater_avatar.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAvatar>); LLFloaterReg::add("avatar_picker", "floater_avatar_picker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAvatarPicker>); LLFloaterReg::add("avatar_textures", "floater_avatar_textures.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAvatarTextures>); @@ -287,7 +288,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>); LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSnapshot>); LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearch>); - LLFloaterReg::add("profile", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWebContent>); + LLFloaterReg::add("profile", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); LLFloaterUIPreviewUtil::registerFloater(); @@ -300,7 +301,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("voice_controls", "floater_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLCallFloater>); LLFloaterReg::add("voice_effect", "floater_voice_effect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterVoiceEffect>); - LLFloaterReg::add("web_content", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWebContent>); + LLFloaterReg::add("web_content", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); LLFloaterReg::add("whitelist_entry", "floater_whitelist_entry.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWhiteListEntry>); LLFloaterWindowSizeUtil::registerFloater(); LLFloaterReg::add("world_map", "floater_world_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWorldMap>); diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 3a3d4f3881..d1120b6269 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -69,15 +69,12 @@ LLHelpHandler gHelpHandler; ////////////////////////////// // implement LLHelp interface -void LLViewerHelp::showTopic(const std::string &topic) +std::string LLViewerHelp::getURL(const std::string &topic) { // allow overriding the help server with a local help file if( gSavedSettings.getBOOL("HelpUseLocal") ) { - showHelp(); - LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser")); - helpbrowser->navigateToLocalPage( "help-offline" , "index.html" ); - return; + return "__local"; } // if the help topic is empty, use the default topic @@ -99,11 +96,12 @@ void LLViewerHelp::showTopic(const std::string &topic) } } - // work out the URL for this topic and display it - showHelp(); - - std::string helpURL = LLViewerHelpUtil::buildHelpURL( help_topic ); - setRawURL(helpURL); + return LLViewerHelpUtil::buildHelpURL( help_topic ); +} + +void LLViewerHelp::showTopic(const std::string& topic) +{ + LLFloaterReg::showInstance("help_browser", topic); } std::string LLViewerHelp::defaultTopic() @@ -146,23 +144,4 @@ std::string LLViewerHelp::getTopicFromFocus() return defaultTopic(); } -// static -void LLViewerHelp::showHelp() -{ - LLFloaterReg::showInstance("help_browser"); -} - -// static -void LLViewerHelp::setRawURL(std::string url) -{ - LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser")); - if (helpbrowser) - { - helpbrowser->openMedia(url); - } - else - { - llwarns << "Eep, help_browser floater not found" << llendl; - } -} diff --git a/indra/newview/llviewerhelp.h b/indra/newview/llviewerhelp.h index 7612986227..a983012e2e 100644 --- a/indra/newview/llviewerhelp.h +++ b/indra/newview/llviewerhelp.h @@ -45,6 +45,8 @@ class LLViewerHelp : public LLHelp, public LLSingleton<LLViewerHelp> /// display the specified help topic in the help viewer /*virtual*/ void showTopic(const std::string &topic); + std::string getURL(const std::string& topic); + // return topic derived from viewer UI focus, else default topic std::string getTopicFromFocus(); @@ -56,10 +58,6 @@ class LLViewerHelp : public LLHelp, public LLSingleton<LLViewerHelp> // return topic to use for the top-level help, invoked by F1 /*virtual*/ std::string f1HelpTopic(); - - private: - static void showHelp(); // make sure help UI is visible & raised - static void setRawURL(std::string url); // send URL to help UI }; #endif // header guard diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index fbfde711a9..bc0f38dd77 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5370,6 +5370,34 @@ class LLAvatarAddFriend : public view_listener_t } }; + +class LLAvatarToggleMyProfile : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloater* instance = LLAvatarActions::getProfileFloater(gAgent.getID()); + if (LLFloater::isMinimized(instance)) + { + instance->setMinimized(FALSE); + instance->setFocus(TRUE); + } + else if (!LLFloater::isShown(instance)) + { + LLAvatarActions::showProfile(gAgent.getID()); + } + else if (!instance->hasFocus() && !instance->getIsChrome()) + { + instance->setFocus(TRUE); + } + else + { + instance->closeFloater(); + } + return true; + } +}; + + class LLAvatarAddContact : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -7229,7 +7257,7 @@ void handle_web_browser_test(const LLSD& param) void handle_web_content_test(const LLSD& param) { std::string url = param.asString(); - LLWeb::loadWebURLInternal(url); + LLWeb::loadURLInternal(url); } void handle_buy_currency_test(void*) @@ -8165,6 +8193,8 @@ void initialize_menus() view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call"); enable.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall)); view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); + view_listener_t::addMenu(new LLAvatarToggleMyProfile(), "Avatar.ToggleMyProfile"); + enable.add("Avatar.IsMyProfileOpen", boost::bind(&LLAvatarActions::profileVisible, gAgent.getID())); view_listener_t::addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend"); enable.add("Avatar.EnableFreezeEject", boost::bind(&enable_freeze_eject, _2)); diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 6f7115ff6d..7bc5453688 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -125,7 +125,9 @@ void LLWeb::loadURLInternal(const std::string &url, const std::string& target, c // Explicitly open a Web URL using the Web content floater void LLWeb::loadWebURLInternal(const std::string &url, const std::string& target, const std::string& uuid) { - LLFloaterWebContent::create(LLFloaterWebContent::Params().url(url).target(target).id(uuid)); + LLFloaterWebContent::Params p; + p.url(url).target(target).id(uuid); + LLFloaterReg::showInstance("web_content", p); } // static diff --git a/indra/newview/llweb.h b/indra/newview/llweb.h index dc5958e57f..376abc0ece 100644 --- a/indra/newview/llweb.h +++ b/indra/newview/llweb.h @@ -46,21 +46,19 @@ public: static void loadURL(const std::string& url, const std::string& target, const std::string& uuid = LLStringUtil::null); static void loadURL(const std::string& url) { loadURL(url, LLStringUtil::null); } /// Load the given url in the user's preferred web browser - static void loadURL(const char* url, const std::string& target) { loadURL( ll_safe_string(url), target); } - static void loadURL(const char* url) { loadURL( ll_safe_string(url), LLStringUtil::null ); } + static void loadURL(const char* url, const std::string& target = LLStringUtil::null) { loadURL( ll_safe_string(url), target); } /// Load the given url in the Second Life internal web browser static void loadURLInternal(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null); - static void loadURLInternal(const std::string &url) { loadURLInternal(url, LLStringUtil::null); } + static void loadURLInternal(const std::string &url) { loadURLInternal(url, LLStringUtil::null, LLStringUtil::null);} /// Load the given url in the operating system's web browser, async if we want to return immediately /// before browser has spawned - static void loadURLExternal(const std::string& url) { loadURLExternal(url, LLStringUtil::null); }; + static void loadURLExternal(const std::string& url) {loadURLExternal(url, LLStringUtil::null);} static void loadURLExternal(const std::string& url, const std::string& uuid); static void loadURLExternal(const std::string& url, bool async, const std::string& uuid = LLStringUtil::null); // Explicitly open a Web URL using the Web content floater vs. the more general media browser static void loadWebURL(const std::string& url, const std::string& target, const std::string& uuid); - static void loadWebURLInternal(const std::string &url, const std::string& target, const std::string& uuid); - static void loadWebURLInternal(const std::string &url) { loadWebURLInternal(url, LLStringUtil::null, LLStringUtil::null); } + static void loadWebURLInternal(const std::string &url, const std::string& target = LLStringUtil::null, const std::string& uuid = LLStringUtil::null); /// Returns escaped url (eg, " " to "%20") - used by all loadURL methods static std::string escapeURL(const std::string& url); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index e7fb836f45..27577d42ea 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -149,6 +149,9 @@ with the same filename but different name <texture name="Command_Speak_Icon" file_name="toolbar_icons/speak.png" preload="true" /> <texture name="Command_View_Icon" file_name="toolbar_icons/view.png" preload="true" /> <texture name="Command_Voice_Icon" file_name="toolbar_icons/nearbyvoice.png" preload="true" /> + <texture name="Caret_Bottom_Icon" file_name="toolbar_icons/caret_bottom.png" preload="true" /> + <texture name="Caret_Right_Icon" file_name="toolbar_icons/caret_right.png" preload="true" /> + <texture name="Caret_Left_Icon" file_name="toolbar_icons/caret_left.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_Selected" file_name="widgets/ComboButton_Selected.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> diff --git a/indra/newview/skins/default/textures/toolbar_icons/caret_bottom.png b/indra/newview/skins/default/textures/toolbar_icons/caret_bottom.png Binary files differnew file mode 100644 index 0000000000..82f58b22b9 --- /dev/null +++ b/indra/newview/skins/default/textures/toolbar_icons/caret_bottom.png diff --git a/indra/newview/skins/default/textures/toolbar_icons/caret_left.png b/indra/newview/skins/default/textures/toolbar_icons/caret_left.png Binary files differnew file mode 100644 index 0000000000..75eecc84ed --- /dev/null +++ b/indra/newview/skins/default/textures/toolbar_icons/caret_left.png diff --git a/indra/newview/skins/default/textures/toolbar_icons/caret_right.png b/indra/newview/skins/default/textures/toolbar_icons/caret_right.png Binary files differnew file mode 100644 index 0000000000..677459ae1c --- /dev/null +++ b/indra/newview/skins/default/textures/toolbar_icons/caret_right.png diff --git a/indra/newview/skins/default/xui/en/floater_avatar.xml b/indra/newview/skins/default/xui/en/floater_avatar.xml index a0c1f4c021..666aa2d164 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar.xml @@ -3,11 +3,9 @@ legacy_header_height="225" can_minimize="true" can_close="true" - user_resize="true" can_resize="true" min_height="230" - min_width="455" - max_height="230" + min_width="445" height="230" layout="topleft" name="Avatar" @@ -19,7 +17,7 @@ <web_browser top="25" height="200" - width="435" + width="445" follows="all" name="avatar_picker_contents" trusted_content="true"/> diff --git a/indra/newview/skins/default/xui/en/floater_destinations.xml b/indra/newview/skins/default/xui/en/floater_destinations.xml index 9dd9338f37..669b7eb15a 100644 --- a/indra/newview/skins/default/xui/en/floater_destinations.xml +++ b/indra/newview/skins/default/xui/en/floater_destinations.xml @@ -7,7 +7,6 @@ can_resize="true" min_height="230" min_width="525" - max_height="230" height="230" layout="topleft" name="Destinations" @@ -15,11 +14,11 @@ help_topic="destinations" save_rect="true" title="Destinations" - width="445"> + width="525"> <web_browser top="25" height="200" - width="435" + width="525" follows="all" name="destination_guide_contents" start_url="http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/agni/guide.html" diff --git a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml index bc96bfbab5..5d6967ed32 100644 --- a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml +++ b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml @@ -47,6 +47,16 @@ bottom="-10" side="left" button_display_mode="icons_only"> + <icon layout="topleft" + height="7" + width="5" + follows="left|top" + top="20" + left="10" + tab_stop="false" + visible="false" + image_name="Caret_Left_Icon" + name="caret" /> </toolbar> </layout_panel> <layout_panel name="non_toolbar_panel" @@ -88,6 +98,16 @@ bottom="-10" side="right" button_display_mode="icons_only"> + <icon layout="topleft" + height="7" + width="5" + follows="left|top" + top="20" + left="10" + tab_stop="false" + visible="false" + image_name="Caret_Right_Icon" + name="caret" /> </toolbar> </layout_panel> </layout_stack> @@ -109,6 +129,16 @@ follows="left|right|bottom" button_display_mode="icons_with_text" visible="true"> + <icon layout="topleft" + height="5" + width="7" + follows="left|top" + top="20" + left="10" + tab_stop="false" + visible="false" + image_name="Caret_Bottom_Icon" + name="caret" /> </toolbar> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/en/widgets/toolbar.xml b/indra/newview/skins/default/xui/en/widgets/toolbar.xml index 09967de7cc..be5dfaf18c 100644 --- a/indra/newview/skins/default/xui/en/widgets/toolbar.xml +++ b/indra/newview/skins/default/xui/en/widgets/toolbar.xml @@ -31,6 +31,8 @@ flash_color="EmphasisColor"/> <button_icon pad_left="10" pad_right="10" + image_bottom_pad="10" + image_top_pad="10" image_pressed="PushButton_Press" image_pressed_selected="PushButton_Selected_Press" image_selected="PushButton_Selected_Press" |