diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llcommandmanager.cpp | 4 | ||||
-rw-r--r-- | indra/llui/llcommandmanager.h | 6 | ||||
-rw-r--r-- | indra/llui/lltoolbar.cpp | 12 | ||||
-rw-r--r-- | indra/llui/lltoolbarview.cpp | 44 | ||||
-rw-r--r-- | indra/llui/lltoolbarview.h | 6 | ||||
-rw-r--r-- | indra/llui/lluictrl.cpp | 10 | ||||
-rw-r--r-- | indra/llui/lluictrl.h | 3 | ||||
-rw-r--r-- | indra/newview/app_settings/commands.xml | 42 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
-rw-r--r-- | indra/newview/llfloatertoybox.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_nearby_chat.xml | 50 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_toybox.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 4 |
14 files changed, 78 insertions, 132 deletions
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 783990780b..b1147134c2 100644 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -53,7 +53,7 @@ LLCommand::Params::Params() , icon("icon") , label_ref("label_ref") , name("name") - , param("param") + , parameter("parameter") , tooltip_ref("tooltip_ref") { } @@ -64,7 +64,7 @@ LLCommand::LLCommand(const LLCommand::Params& p) , mIcon(p.icon) , mIdentifier(p.name) , mLabelRef(p.label_ref) - , mParam(p.param) + , mParameter(p.parameter) , mTooltipRef(p.tooltip_ref) { } diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h index 4781f77177..6481a05689 100644 --- a/indra/llui/llcommandmanager.h +++ b/indra/llui/llcommandmanager.h @@ -93,7 +93,7 @@ public: Mandatory<std::string> icon; Mandatory<std::string> label_ref; Mandatory<std::string> name; - Optional<std::string> param; + Optional<LLSD> parameter; Mandatory<std::string> tooltip_ref; Params(); @@ -106,7 +106,7 @@ public: const std::string& icon() const { return mIcon; } const LLCommandId& id() const { return mIdentifier; } const std::string& labelRef() const { return mLabelRef; } - const std::string& param() const { return mParam; } + const LLSD& parameter() const { return mParameter; } const std::string& tooltipRef() const { return mTooltipRef; } private: @@ -116,7 +116,7 @@ private: std::string mFunction; std::string mIcon; std::string mLabelRef; - std::string mParam; + LLSD mParameter; std::string mTooltipRef; }; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index fe989cee22..caad896a06 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -204,7 +204,7 @@ bool LLToolBar::addCommand(const LLCommandId& commandId) LLCommand * command = LLCommandManager::instance().getCommand(commandId); if (!command) return false; - mButtonCommands.push_back(commandId); + mButtonCommands.push_back(commandId); LLToolBarButton* button = createButton(commandId); mButtons.push_back(button); mButtonPanel->addChild(button); @@ -505,14 +505,24 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) if (!commandp) return NULL; LLToolBarButton::Params button_p; + button_p.name = id.name(); button_p.label = LLTrans::getString(commandp->labelRef()); button_p.tool_tip = button_p.label(); button_p.image_overlay = LLUI::getUIImage(commandp->icon()); button_p.overwriteFrom(mButtonParams[mButtonType]); LLToolBarButton* button = LLUICtrlFactory::create<LLToolBarButton>(button_p); + if (!mReadOnly) + { + LLUICtrl::CommitCallbackParam cbParam; + cbParam.function_name = commandp->functionName(); + cbParam.parameter = commandp->parameter(); + button->setCommitCallback(cbParam); + } + button->setCommandId(id); return button; + } // diff --git a/indra/llui/lltoolbarview.cpp b/indra/llui/lltoolbarview.cpp index 0c3a6bd0ac..bb4ea815c9 100644 --- a/indra/llui/lltoolbarview.cpp +++ b/indra/llui/lltoolbarview.cpp @@ -55,10 +55,7 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p) : LLUICtrl(p), mToolbarLeft(NULL), mToolbarRight(NULL), - mToolbarBottom(NULL), - mDragButton(NULL), - mMouseX(0), - mMouseY(0) + mToolbarBottom(NULL) { } @@ -79,9 +76,6 @@ BOOL LLToolBarView::postBuild() mToolbarRight = getChild<LLToolBar>("toolbar_right"); mToolbarBottom = getChild<LLToolBar>("toolbar_bottom"); - // Load the toolbars from the settings - loadToolbars(); - return TRUE; } @@ -286,40 +280,4 @@ void LLToolBarView::draw() //gl_rect_2d(right_rect, back_color_vert, TRUE); LLUICtrl::draw(); - - if (mDragButton) - { - S32 cursor_x, cursor_y; - mDragButton->setOrigin(mMouseX - mDragButton->getRect().getWidth(), mMouseY - mDragButton->getRect().getHeight()); - drawChild(mDragButton); - } -} - -void LLToolBarView::startDrag(LLToolBarButton* button) -{ - mDragButton = button; - addChild(mDragButton); - gFocusMgr.setMouseCapture(this); -} - -BOOL LLToolBarView::handleHover(S32 x, S32 y, MASK mask) -{ - mMouseX = x; - mMouseY = y; - return LLUICtrl::handleHover(x, y, mask); -} - -BOOL LLToolBarView::handleMouseUp(S32 x, S32 y, MASK mask) -{ - if (hasMouseCapture()) - { - gFocusMgr.setMouseCapture(NULL); - } - return LLUICtrl::handleMouseUp(x, y, mask); -} - -void LLToolBarView::onMouseCaptureLost() -{ - delete mDragButton; - mDragButton = NULL; } diff --git a/indra/llui/lltoolbarview.h b/indra/llui/lltoolbarview.h index cbe3d6c083..ea3422f04e 100644 --- a/indra/llui/lltoolbarview.h +++ b/indra/llui/lltoolbarview.h @@ -70,7 +70,10 @@ public: virtual void onMouseCaptureLost(); void startDrag(LLToolBarButton*); // Toolbar view interface with the rest of the world + // Checks if the commandId is being used somewhere in one of the toolbars bool hasCommand(const LLCommandId& commandId) const; + // Loads the toolbars from the existing user or default settings + bool loadToolbars(); // return false if load fails protected: friend class LLUICtrlFactory; @@ -79,10 +82,9 @@ protected: void initFromParams(const Params&); private: - // Loads the toolbars from the existing user or default settings - bool loadToolbars(); // return false if load fails void saveToolbars() const; bool addCommand(const LLCommandId& commandId, LLToolBar* toolbar); + void addToToolset(command_id_list_t& command_list, Toolbar& toolbar) const; // Pointers to the toolbars handled by the toolbar view LLToolBar* mToolbarLeft; diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index d58df5801b..5e8bf498c0 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -992,6 +992,16 @@ void LLUICtrl::setTransparencyType(ETypeTransparency type) mTransparencyType = type; } +boost::signals2::connection LLUICtrl::setCommitCallback(const CommitCallbackParam& cb) +{ + return setCommitCallback(initCommitCallback(cb)); +} + +boost::signals2::connection LLUICtrl::setValidateCallback(const EnableCallbackParam& cb) +{ + return setValidateCallback(initEnableCallback(cb)); +} + boost::signals2::connection LLUICtrl::setCommitCallback( const commit_signal_t::slot_type& cb ) { if (!mCommitSignal) mCommitSignal = new commit_signal_t(); diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 09bed9b958..fc56e5fc35 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -235,6 +235,9 @@ public: // topic then put in help_topic_out bool findHelpTopic(std::string& help_topic_out); + boost::signals2::connection setCommitCallback(const CommitCallbackParam& cb); + boost::signals2::connection setValidateCallback(const EnableCallbackParam& cb); + boost::signals2::connection setCommitCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setValidateCallback( const enable_signal_t::slot_type& cb ); diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 4a33b24075..5fbd9248c1 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -6,7 +6,7 @@ label_ref="Command_Avatar_Label" tooltip_ref="Command_Avatar_Tooltip" function="Floater.ToolbarToggle" - param="avatar" + parameter="avatar" /> <command name="build" available_in_toybox="true" @@ -14,7 +14,7 @@ label_ref="Command_Build_Label" tooltip_ref="Command_Build_Tooltip" function="Floater.ToolbarToggle" - param="build" + parameter="build" /> <command name="chat" available_in_toybox="true" @@ -22,7 +22,7 @@ label_ref="Command_Chat_Label" tooltip_ref="Command_Chat_Tooltip" function="Floater.ToolbarToggle" - param="chat" + parameter="chat" /> <command name="compass" available_in_toybox="false" @@ -30,7 +30,7 @@ label_ref="Command_Compass_Label" tooltip_ref="Command_Compass_Tooltip" function="Floater.ToolbarToggle" - param="compass" + parameter="compass" /> <command name="gestures" available_in_toybox="true" @@ -38,7 +38,7 @@ label_ref="Command_Gestures_Label" tooltip_ref="Command_Gestures_Tooltip" function="Floater.ToolbarToggle" - param="gestures" + parameter="gestures" /> <command name="howto" available_in_toybox="true" @@ -46,7 +46,7 @@ label_ref="Command_HowTo_Label" tooltip_ref="Command_HowTo_Tooltip" function="Floater.ToolbarToggle" - param="howto" + parameter="howto" /> <command name="landmarks" available_in_toybox="true" @@ -54,7 +54,7 @@ label_ref="Command_Landmarks_Label" tooltip_ref="Command_Landmarks_Tooltip" function="Floater.ToolbarToggle" - param="landmarks" + parameter="landmarks" /> <command name="map" available_in_toybox="true" @@ -62,7 +62,7 @@ label_ref="Command_Map_Label" tooltip_ref="Command_Map_Tooltip" function="Floater.ToolbarToggle" - param="map" + parameter="map" /> <command name="minimap" available_in_toybox="true" @@ -70,7 +70,7 @@ label_ref="Command_MiniMap_Label" tooltip_ref="Command_MiniMap_Tooltip" function="Floater.ToolbarToggle" - param="minimap" + parameter="minimap" /> <command name="move" available_in_toybox="true" @@ -78,7 +78,7 @@ label_ref="Command_Move_Label" tooltip_ref="Command_Move_Tooltip" function="Floater.ToolbarToggle" - param="move" + parameter="move" /> <command name="myland" available_in_toybox="true" @@ -86,7 +86,7 @@ label_ref="Command_MyLand_Label" tooltip_ref="Command_MyLand_Tooltip" function="Floater.ToolbarToggle" - param="myland" + parameter="myland" /> <command name="mystuff" available_in_toybox="true" @@ -94,7 +94,7 @@ label_ref="Command_MyStuff_Label" tooltip_ref="Command_MyStuff_Tooltip" function="Floater.ToolbarToggle" - param="mystuff" + parameter="mystuff" /> <command name="people" available_in_toybox="true" @@ -102,7 +102,7 @@ label_ref="Command_People_Label" tooltip_ref="Command_People_Tooltip" function="Floater.ToolbarToggle" - param="people" + parameter="people" /> <command name="places" available_in_toybox="true" @@ -110,7 +110,7 @@ label_ref="Command_Places_Label" tooltip_ref="Command_Places_Tooltip" function="Floater.ToolbarToggle" - param="places" + parameter="places" /> <command name="search" available_in_toybox="true" @@ -118,7 +118,7 @@ label_ref="Command_Search_Label" tooltip_ref="Command_Search_Tooltip" function="Floater.ToolbarToggle" - param="search" + parameter="search" /> <command name="settings" available_in_toybox="true" @@ -126,7 +126,7 @@ label_ref="Command_Settings_Label" tooltip_ref="Command_Settings_Tooltip" function="Floater.ToolbarToggle" - param="settings" + parameter="settings" /> <command name="shop" available_in_toybox="true" @@ -134,7 +134,7 @@ label_ref="Command_Shop_Label" tooltip_ref="Command_Shop_Tooltip" function="Floater.ToolbarToggle" - param="shop" + parameter="shop" /> <command name="snapshot" available_in_toybox="true" @@ -142,7 +142,7 @@ label_ref="Command_Snapshot_Label" tooltip_ref="Command_Snapshot_Tooltip" function="Floater.ToolbarToggle" - param="snapshot" + parameter="snapshot" /> <command name="speak" available_in_toybox="true" @@ -150,7 +150,7 @@ label_ref="Command_Speak_Label" tooltip_ref="Command_Speak_Tooltip" function="Floater.ToolbarToggle" - param="speak" + parameter="speak" /> <command name="upload" available_in_toybox="true" @@ -158,7 +158,7 @@ label_ref="Command_Upload_Label" tooltip_ref="Command_Upload_Tooltip" function="Floater.ToolbarToggle" - param="upload" + parameter="upload" /> <command name="view" available_in_toybox="true" @@ -166,6 +166,6 @@ label_ref="Command_View_Label" tooltip_ref="Command_View_Tooltip" function="Floater.ToolbarToggle" - param="view" + parameter="view" /> </commands> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9a06423422..148b80e817 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1493,7 +1493,7 @@ <key>Type</key> <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> <key>ChatBubbleOpacity</key> <map> diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp index beb928ea36..c3fa322f85 100644 --- a/indra/newview/llfloatertoybox.cpp +++ b/indra/newview/llfloatertoybox.cpp @@ -67,9 +67,6 @@ BOOL LLFloaterToybox::postBuild() if (command->availableInToybox()) { mToolBar->addCommand(command->id()); - - llassert(gToolBarView != NULL); - mToolBar->enableCommand(command->id(), !gToolBarView->hasCommand(command->id())); } } @@ -93,17 +90,29 @@ void LLFloaterToybox::onClose(bool app_quitting) void LLFloaterToybox::draw() { + llassert(gToolBarView != NULL); + + LLCommandManager& cmdMgr = LLCommandManager::instance(); + + for (U32 i = 0; i < cmdMgr.commandCount(); i++) + { + LLCommand * command = cmdMgr.getCommand(i); + + if (command->availableInToybox()) + { + mToolBar->enableCommand(command->id(), !gToolBarView->hasCommand(command->id())); + } + } + LLFloater::draw(); } void LLFloaterToybox::onFocusReceived() { - } void LLFloaterToybox::onBtnRestoreDefaults() { - } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 7c930b80c2..6c9ee17a76 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1950,9 +1950,11 @@ void LLViewerWindow::initWorldUI() buttons_panel->setFollowsAll(); buttons_panel_container->addChild(buttons_panel); - // Make the toolbars visible + // Load and make the toolbars visible + // Note: we need to load the toolbars only *after* the user is logged in and IW if (gToolBarView) { + gToolBarView->loadToolbars(); gToolBarView->setVisible(TRUE); } } diff --git a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml deleted file mode 100644 index ab966dbb0e..0000000000 --- a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater - border_visible="false" - border="false" - legacy_header_height="18" - can_minimize="true" - can_tear_off="false" - can_resize="true" - can_drag_on_left="false" - can_close="false" - can_dock="true" - bevel_style="in" - height="300" - min_width="235" - layout="topleft" - name="nearby_chat" - help_topic="nearby_chat" - save_rect="true" - title="NEARBY CHAT" - save_dock_state="true" - save_visibility="true" - single_instance="true" - width="320"> - <check_box - bottom_delta="36" - control_name="TranslateChat" - enabled="true" - height="16" - label="Translate chat (powered by Google)" - layout="topleft" - left="5" - name="translate_chat_checkbox" - width="230" /> - <chat_history - parse_urls="true" - bg_readonly_color="ChatHistoryBgColor" - bg_writeable_color="ChatHistoryBgColor" - follows="all" - left="5" - top_delta="17" - layout="topleft" - height="260" - name="chat_history" - parse_highlights="true" - text_color="ChatHistoryTextColor" - text_readonly_color="ChatHistoryTextColor" - right_widget_pad="5" - left_widget_pad="0" - width="315" /> -</floater> diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml index 092eddaa53..feb19571b2 100644 --- a/indra/newview/skins/default/xui/en/floater_toybox.xml +++ b/indra/newview/skins/default/xui/en/floater_toybox.xml @@ -59,7 +59,9 @@ read_only="true" right="-20" side="top" - top="85" /> + top="85"> + <button_panel background_visible="false" /> + </toolbar> <panel bevel_style="none" border="true" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 5ec62d82c0..733b97d827 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -227,10 +227,10 @@ use_mac_ctrl="true"> <menu_item_check.on_check function="Floater.Visible" - parameter="nearby_chat" /> + parameter="chat_bar" /> <menu_item_check.on_click function="Floater.Toggle" - parameter="nearby_chat" /> + parameter="chat_bar" /> </menu_item_check> <menu_item_call label="Nearby People" |