diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp index eed008527328d508a77bc4ddf1e6c101489b6687..50d59f79f4eb837356e2391d3c547278e6f7975d 100644 --- a/indra/llui/llmenubutton.cpp +++ b/indra/llui/llmenubutton.cpp @@ -35,9 +35,16 @@ static LLDefaultChildRegistry::Register<LLMenuButton> r("menu_button"); +void LLMenuButton::MenuPositions::declareValues() +{ + declare("topleft", MP_TOP_LEFT); + declare("topright", MP_TOP_RIGHT); + declare("bottomleft", MP_BOTTOM_LEFT); +} LLMenuButton::Params::Params() -: menu_filename("menu_filename") +: menu_filename("menu_filename"), + position("position", MP_BOTTOM_LEFT) { } @@ -45,7 +52,7 @@ LLMenuButton::Params::Params() LLMenuButton::LLMenuButton(const LLMenuButton::Params& p) : LLButton(p), mIsMenuShown(false), - mMenuPosition(MP_BOTTOM_LEFT) + mMenuPosition(p.position) { std::string menu_filename = p.menu_filename; diff --git a/indra/llui/llmenubutton.h b/indra/llui/llmenubutton.h index 7b657595da7c6881544872b8e4133fe835427f74..e2396e7fb2a9366ab539ec3992b7f99218b6bfa7 100644 --- a/indra/llui/llmenubutton.h +++ b/indra/llui/llmenubutton.h @@ -35,21 +35,30 @@ class LLMenuButton : public LLButton { public: + typedef enum e_menu_position + { + MP_TOP_LEFT, + MP_TOP_RIGHT, + MP_BOTTOM_LEFT + } EMenuPosition; + + struct MenuPositions + : public LLInitParam::TypeValuesHelper<EMenuPosition, MenuPositions> + { + static void declareValues(); + }; + struct Params : public LLInitParam::Block<Params, LLButton::Params> { // filename for it's toggleable menu Optional<std::string> menu_filename; + Optional<EMenuPosition> position; Params(); }; - typedef enum e_menu_position - { - MP_TOP_LEFT, - MP_TOP_RIGHT, - MP_BOTTOM_LEFT - } EMenuPosition; + boost::signals2::connection setMouseDownCallback( const mouse_signal_t::slot_type& cb ); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 27f341b4f6d449a9711a506c3bdd27adcaa40cb1..bef809f3a71749423ad6e8f6c0c28cc16401f13c 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -154,10 +154,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, } updateLocationCombo(false); - LLUICtrl& mode_combo = getChildRef<LLUICtrl>("mode_combo"); - mode_combo.setValue(gSavedSettings.getString("SessionSettingsFile")); - mode_combo.setCommitCallback(boost::bind(&LLPanelLogin::onModeChange, this, getChild<LLUICtrl>("mode_combo")->getValue(), _2)); - LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo"); server_choice_combo->setCommitCallback(onSelectServer, NULL); server_choice_combo->setFocusLostCallback(boost::bind(onServerComboLostFocus, _1)); @@ -1025,32 +1021,6 @@ void LLPanelLogin::updateLoginPanelLinks() sInstance->getChildView("forgot_password_text")->setVisible( system_grid); } -void LLPanelLogin::onModeChange(const LLSD& original_value, const LLSD& new_value) -{ - if (original_value.asString() != new_value.asString()) - { - LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(&LLPanelLogin::onModeChangeConfirm, this, original_value, new_value, _1, _2)); - } -} - -void LLPanelLogin::onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - switch (option) - { - case 0: - gSavedSettings.getControl("SessionSettingsFile")->set(new_value); - LLAppViewer::instance()->forceQuit(); - break; - case 1: - // revert to original value - getChild<LLUICtrl>("mode_combo")->setValue(original_value); - break; - default: - break; - } -} - std::string canonicalize_username(const std::string& name) { std::string cname = name; diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 11273453bae6788d01921a3aa344ff2ff1e1a19f..b29b3af7ca753881de967a53903f0f41393852df 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -97,8 +97,6 @@ class LLPanelLogin: static void onServerComboLostFocus(LLFocusableElement*); static void updateServerCombo(); static void updateStartSLURL(); - void onModeChange(const LLSD& original_value, const LLSD& new_value); - void onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response); static void updateLoginPanelLinks(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 1cbf99dbe75d89a0c128125b8ee131b3eacb57ee..14f1beab03e056aa803a022b7d33b584c3442463 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -720,7 +720,13 @@ bool idle_startup() timeout_count = 0; - initialize_edit_menu(); + // Login screen needs menus for preferences, but we can enter + // this startup phase more than once. + if (gLoginMenuBarView == NULL) + { + initialize_edit_menu(); + init_menus(); + } if (show_connect_box) { @@ -755,19 +761,6 @@ bool idle_startup() LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); } - // *NOTE: This is where LLViewerParcelMgr::getInstance() used to get allocated before becoming LLViewerParcelMgr::getInstance(). - - // *NOTE: This is where gHUDManager used to bet allocated before becoming LLHUDManager::getInstance(). - - // *NOTE: This is where gMuteList used to get allocated before becoming LLMuteList::getInstance(). - - // Login screen needs menus for preferences, but we can enter - // this startup phase more than once. - if (gLoginMenuBarView == NULL) - { - init_menus(); - } - gViewerWindow->setNormalControlsVisible( FALSE ); gLoginMenuBarView->setVisible( TRUE ); gLoginMenuBarView->setEnabled( TRUE ); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f74bcafc5c530c9353c02f0b4b9e0a21c45cd7d0..e5dfa51e7fc2c082aaf3c2a51a26b550d9b4c0cd 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -831,7 +831,8 @@ U32 feature_from_string(std::string feature) }; -class LLAdvancedToggleFeature : public view_listener_t{ +class LLAdvancedToggleFeature : public view_listener_t +{ bool handleEvent(const LLSD& userdata) { U32 feature = feature_from_string( userdata.asString() ); @@ -844,18 +845,19 @@ class LLAdvancedToggleFeature : public view_listener_t{ }; class LLAdvancedCheckFeature : public view_listener_t -{bool handleEvent(const LLSD& userdata) { - U32 feature = feature_from_string( userdata.asString() ); - bool new_value = false; - - if ( feature != 0 ) + bool handleEvent(const LLSD& userdata) { - new_value = LLPipeline::toggleRenderDebugFeatureControl( (void*)feature ); - } + U32 feature = feature_from_string( userdata.asString() ); + bool new_value = false; - return new_value; -} + if ( feature != 0 ) + { + new_value = LLPipeline::toggleRenderDebugFeatureControl( (void*)feature ); + } + + return new_value; + } }; void toggle_destination_and_avatar_picker(const LLSD& show) @@ -7774,6 +7776,55 @@ class LLToggleUIHints : public view_listener_t } }; +class LLCheckSessionsSettings : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string expected = userdata.asString(); + return gSavedSettings.getString("SessionSettingsFile") == expected; + } +}; + +class LLChangeMode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string mode = userdata.asString(); + if (mode == "basic") + { + if (gSavedSettings.getString("SessionSettingsFile") != "settings_minimal.xml") + { + LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(onModeChangeConfirm, "settings_minimal.xml", _1, _2)); + } + return true; + } + else if (mode == "advanced") + { + if (gSavedSettings.getString("SessionSettingsFile") != "") + { + LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(onModeChangeConfirm, "", _1, _2)); + } + return true; + } + return false; + } + + static void onModeChangeConfirm(const std::string& new_session_settings_file, const LLSD& notification, const LLSD& response) + { + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + switch (option) + { + case 0: + gSavedSettings.getControl("SessionSettingsFile")->set(new_session_settings_file); + LLAppViewer::instance()->forceQuit(); + break; + case 1: + default: + break; + } + } +}; + void LLUploadCostCalculator::calculateCost() { S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); @@ -8263,6 +8314,8 @@ void initialize_menus() view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); + view_listener_t::addMenu(new LLCheckSessionsSettings(), "CheckSessionSettings"); + view_listener_t::addMenu(new LLChangeMode(), "ChangeMode"); commit.add("Destination.show", boost::bind(&toggle_destination_and_avatar_picker, 0)); commit.add("Avatar.show", boost::bind(&toggle_destination_and_avatar_picker, 1)); diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 8d0f1437e642f4e2b5567b4c29df2212a6f7b1a0..0bc1be666e45805528ecd861be2f023cd84e99f7 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -117,33 +117,16 @@ label="Remember password" name="connect_btn" top="35" width="90" /> - <text - follows="left|bottom" - font="SansSerifSmall" - height="15" - left_pad="10" - name="mode_selection_text" - top="20" - width="130"> - Mode: - </text> -<combo_box - follows="left|bottom" + <menu_button + left_pad="5" + top="35" + width="80" height="23" - max_chars="128" + label="Mode â–²" + name="mode_menu" tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features." - top_pad="0" - name="mode_combo" - width="110"> -<combo_box.item - label="Basic" - name="Basic" - value="settings_minimal.xml" /> -<combo_box.item - label="Advanced" - name="Advanced" - value="" /> -</combo_box> + menu_filename="menu_mode_change.xml" + /> <text follows="left|bottom" font="SansSerifSmall" diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index d756dfb7de6d53b13bdaabb3f059651fa0973fa0..4f8a0f3306c2b3d45348d1920e79f34a49b1bb81 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -77,6 +77,17 @@ top="0" width="55" /> </panel> + <menu_button + image_color="0 0 0 0" + hover_glow_amount="0" + left_pad="2" + top="0" + width="55" + height="18" + label="Mode â–¼" + tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features." + menu_filename="menu_mode_change.xml" + /> <text type="string" font="SansSerifSmall" @@ -89,7 +100,7 @@ left_pad="0" name="TimeText" tool_tip="Current time (Pacific)" - width="145"> + width="70"> 24:00 AM PST </text> <button diff --git a/indra/newview/skins/minimal/xui/en/main_view.xml b/indra/newview/skins/minimal/xui/en/main_view.xml index 6e8ad9adaff83a94c45cea5300231af839f20350..ec2683880a30fafc8f40d5b6d5fcf9ecd4151bb7 100644 --- a/indra/newview/skins/minimal/xui/en/main_view.xml +++ b/indra/newview/skins/minimal/xui/en/main_view.xml @@ -187,9 +187,9 @@ name="status_bar_container" tab_stop="false" height="30" - left="-70" + left="-120" top="0" - width="70" + width="120" visible="false"/> <panel follows="top|bottom" height="500" diff --git a/indra/newview/skins/minimal/xui/en/panel_login.xml b/indra/newview/skins/minimal/xui/en/panel_login.xml index 3903658e71578fccf50f8bd4e2aa727596ff7ba6..d89a0c6be16f0dde4d728281dfd62d743103d01e 100644 --- a/indra/newview/skins/minimal/xui/en/panel_login.xml +++ b/indra/newview/skins/minimal/xui/en/panel_login.xml @@ -118,33 +118,16 @@ label="Remember password" name="connect_btn" top="35" width="90" /> - <text - follows="left|bottom" - font="SansSerifSmall" - height="15" - left_pad="10" - name="mode_selection_text" -top="20" - width="130"> - Mode: - </text> -<combo_box - follows="left|bottom" - height="23" - max_chars="128" - top_pad="0" - tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features." - name="mode_combo" - width="120"> -<combo_box.item - label="Basic" - name="Basic" - value="settings_minimal.xml" /> -<combo_box.item - label="Advanced" - name="Advanced" - value="" /> -</combo_box> + <menu_button +left_pad="10" +top="35" +width="80" +height="23" +label="Mode â–²" +name="mode_menu" +tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features." +menu_filename="menu_mode_change.xml" + /> </layout_panel> <layout_panel tab_stop="false" diff --git a/indra/newview/skins/minimal/xui/en/panel_navigation_bar.xml b/indra/newview/skins/minimal/xui/en/panel_navigation_bar.xml index 6dc1a1c9b021deaccc091c8f974a0eac2ced835b..e50911b8d2187558df98b76e58b7627cd2eaba89 100644 --- a/indra/newview/skins/minimal/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/minimal/xui/en/panel_navigation_bar.xml @@ -63,7 +63,7 @@ width="31" /> mouse_opaque="false" name="location_combo" top_delta="0" - width="440"> + width="390"> </location_input> <icon follows="right" height="20" diff --git a/indra/newview/skins/minimal/xui/en/panel_status_bar.xml b/indra/newview/skins/minimal/xui/en/panel_status_bar.xml index 6ccd0e938d7948c36e2aac871e5adb3ff251933e..52223d5b134b816325e535bb24f52126ab41ca67 100644 --- a/indra/newview/skins/minimal/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/minimal/xui/en/panel_status_bar.xml @@ -12,7 +12,7 @@ name="status" top="19" tab_stop="false" - width="70"> + width="120"> <panel.string name="packet_loss_tooltip"> Packet Loss @@ -33,6 +33,17 @@ name="buycurrencylabel"> L$ [AMT] </panel.string> + <menu_button + image_color="0 0 0 0" + hover_glow_amount="0" + left="2" + top="7" + width="50" + height="18" + label="Mode â–¼" + tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features." + menu_filename="menu_mode_change.xml" + /> <button follows="right|top" height="16" @@ -41,7 +52,7 @@ image_pressed="Pause_Press" image_pressed_selected="Play_Press" is_toggle="true" - left="15" + left="65" top="7" name="media_toggle_btn" tool_tip="Start/Stop All Media (Music, Video, Web pages)"