diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 265fca7bb6..44865861d8 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -20389,5 +20389,16 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0.9 + FSEditGrid + + Comment + Allows editing a grid from the grid manager + Persist + 0 + Type + Boolean + Value + 0 + diff --git a/indra/newview/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp index 53c8bd4d11..29d5c1b336 100644 --- a/indra/newview/fsgridhandler.cpp +++ b/indra/newview/fsgridhandler.cpp @@ -638,8 +638,8 @@ void LLGridManager::addGrid(const std::string& loginuri) // // -// LLGridManager::addGrid - add a grid to the grid list, populating the needed values -// if they're not populated yet. +/// LLGridManager::addGrid - add a grid to the grid list, populating the needed values +/// if they're not populated yet. // void LLGridManager::addGrid(GridEntry* grid_entry, AddState state) { diff --git a/indra/newview/fsgridhandler.h b/indra/newview/fsgridhandler.h index 9d7710f550..0d6a990417 100644 --- a/indra/newview/fsgridhandler.h +++ b/indra/newview/fsgridhandler.h @@ -116,6 +116,7 @@ public: FETCH, FETCHTEMP, SYSTEM, + MANUAL, RETRY, LOCAL, FINISH, @@ -254,10 +255,10 @@ public: void saveGridList(); // void clearFavorites(); + void addGrid(GridEntry* grid_info, AddState state); private: friend class GridInfoRequestResponder; - void addGrid(GridEntry* grid_info, AddState state); void incResponderCount(){++mResponderCount;} void decResponderCount(){--mResponderCount;} void gridInfoResponderCB(GridEntry* grid_data); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 843f2bbe1f..f505c015ee 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -3497,33 +3497,59 @@ void LLFloaterPreference::applySelection(LLScrollListCtrl* control,BOOL all) } // -#ifdef OPENSIM// -// +// +#ifdef OPENSIM static LLRegisterPanelClassWrapper t_pref_opensim("panel_preference_opensim"); LLPanelPreferenceOpensim::LLPanelPreferenceOpensim() : LLPanelPreference(), mGridListControl(NULL) { -// mCommitCallbackRegistrar.add("Pref.ClearDebugSearchURL", boost::bind(&LLPanelPreferenceOpensim::onClickClearDebugSearchURL, this)); mCommitCallbackRegistrar.add("Pref.PickDebugSearchURL", boost::bind(&LLPanelPreferenceOpensim::onClickPickDebugSearchURL, this)); -// -// mCommitCallbackRegistrar.add("Pref.AddGrid", boost::bind(&LLPanelPreferenceOpensim::onClickAddGrid, this)); mCommitCallbackRegistrar.add("Pref.ClearGrid", boost::bind(&LLPanelPreferenceOpensim::onClickClearGrid, this)); mCommitCallbackRegistrar.add("Pref.RefreshGrid", boost::bind( &LLPanelPreferenceOpensim::onClickRefreshGrid, this)); mCommitCallbackRegistrar.add("Pref.RemoveGrid", boost::bind( &LLPanelPreferenceOpensim::onClickRemoveGrid, this)); -// + mCommitCallbackRegistrar.add("Pref.SaveGrid", boost::bind(&LLPanelPreferenceOpensim::onClickSaveGrid, this)); } -// + BOOL LLPanelPreferenceOpensim::postBuild() { + mEditorGridName = findChild("name_edit"); + mEditorGridURI = findChild("grid_uri_edit"); + mEditorLoginPage = findChild("login_page_edit"); + mEditorHelperURI = findChild("helper_uri_edit"); + mEditorWebsite = findChild("website_edit"); + mEditorSupport = findChild("support_edit"); + mEditorRegister = findChild("register_edit"); + mEditorPassword = findChild("password_edit"); + mEditorSearch = findChild("search_edit"); + mEditorGridMessage = findChild("message_edit"); mGridListControl = getChild("grid_list"); + mGridListControl->setCommitCallback(boost::bind(&LLPanelPreferenceOpensim::onSelectGrid, this)); refreshGridList(); return LLPanelPreference::postBuild(); } +void LLPanelPreferenceOpensim::onSelectGrid() +{ + LLSD grid_info; + std::string grid = mGridListControl->getSelectedValue(); + LLGridManager::getInstance()->getGridData(grid, grid_info); + + mEditorGridName->setText(grid_info[GRID_LABEL_VALUE].asString()); + mEditorGridURI->setText(grid_info[GRID_LOGIN_URI_VALUE][0].asString()); + mEditorLoginPage->setText(grid_info[GRID_LOGIN_PAGE_VALUE].asString()); + mEditorHelperURI->setText(grid_info[GRID_HELPER_URI_VALUE].asString()); + mEditorWebsite->setText(grid_info["about"].asString()); + mEditorSupport->setText(grid_info["help"].asString()); + mEditorRegister->setText(grid_info[GRID_REGISTER_NEW_ACCOUNT].asString()); + mEditorPassword->setText(grid_info[GRID_FORGOT_PASSWORD].asString()); + mEditorSearch->setText(grid_info["search"].asString()); + mEditorGridMessage->setText(grid_info["message"].asString()); +} + void LLPanelPreferenceOpensim::apply() { LLGridManager::getInstance()->saveGridList(); @@ -3553,11 +3579,34 @@ void LLPanelPreferenceOpensim::addedGrid(bool success) if (success) { onClickClearGrid(); - LLPanelLogin::updateServerCombo(); } refreshGridList(success); } +// TODO: Save changes to grid entries +void LLPanelPreferenceOpensim::onClickSaveGrid() +{ + LLSD grid_info; + grid_info[GRID_VALUE] = mGridListControl->getSelectedValue(); + grid_info[GRID_LABEL_VALUE] = mEditorGridName->getValue(); + grid_info[GRID_LOGIN_URI_VALUE][0] = mEditorGridURI->getValue(); + grid_info[GRID_LOGIN_PAGE_VALUE] = mEditorLoginPage->getValue(); + grid_info[GRID_HELPER_URI_VALUE] = mEditorHelperURI->getValue(); + grid_info["about"] = mEditorWebsite->getValue(); + grid_info["help"] = mEditorSupport->getValue(); + grid_info[GRID_REGISTER_NEW_ACCOUNT] = mEditorRegister->getValue(); + grid_info[GRID_FORGOT_PASSWORD] = mEditorPassword->getValue(); + grid_info["search"] = mEditorSearch->getValue(); + grid_info["message"] = mEditorGridMessage->getValue(); + GridEntry* grid_entry = new GridEntry; + grid_entry->grid = grid_info; + grid_entry->set_current = false; + + //getChild("grid_management_panel")->setEnabled(FALSE); + //LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&LLPanelPreferenceOpensim::addedGrid, this, _1)); + //LLGridManager::getInstance()->addGrid(grid_entry, LLGridManager::MANUAL); +} + void LLPanelPreferenceOpensim::onClickClearGrid() { gSavedSettings.setString("OpensimPrefsAddGrid", std::string()); @@ -3598,7 +3647,6 @@ bool LLPanelPreferenceOpensim::removeGridCB(const LLSD& notification, const LLSD getChild("grid_management_panel")->setEnabled(FALSE); /*mGridListChanged =*/ LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&LLPanelPreferenceOpensim::refreshGridList, this, _1)); LLGridManager::getInstance()->removeGrid(grid); - LLPanelLogin::updateServerCombo(); } return false; } @@ -3648,8 +3696,7 @@ void LLPanelPreferenceOpensim::refreshGridList(bool success) } } } -// -// + void LLPanelPreferenceOpensim::onClickClearDebugSearchURL() { LLNotificationsUtil::add("ConfirmClearDebugSearchURL", LLSD(), LLSD(), callback_clear_debug_search); @@ -3660,7 +3707,6 @@ void LLPanelPreferenceOpensim::onClickPickDebugSearchURL() LLNotificationsUtil::add("ConfirmPickDebugSearchURL", LLSD(), LLSD(),callback_pick_debug_search ); } -// -// -#endif // OPENSIM // +#endif // OPENSIM +// diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index e0bf2933de..f76624239a 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -35,6 +35,7 @@ #include "llfloater.h" #include "llavatarpropertiesprocessor.h" +#include "lllineeditor.h" // class LLPanelPreference; class LLPanelLCD; @@ -346,7 +347,9 @@ protected: void addedGrid(bool success); void onClickClearGrid(); void onClickRefreshGrid(); + void onClickSaveGrid(); void onClickRemoveGrid(); + void onSelectGrid(); bool removeGridCB(const LLSD& notification, const LLSD& response); // // @@ -356,6 +359,17 @@ protected: void refreshGridList(bool success = true); LLScrollListCtrl* mGridListControl; +private: + LLLineEditor* mEditorGridName; + LLLineEditor* mEditorGridURI; + LLLineEditor* mEditorLoginPage; + LLLineEditor* mEditorHelperURI; + LLLineEditor* mEditorWebsite; + LLLineEditor* mEditorSupport; + LLLineEditor* mEditorRegister; + LLLineEditor* mEditorPassword; + LLLineEditor* mEditorSearch; + LLLineEditor* mEditorGridMessage; }; // #endif // OPENSIM // @@ -385,7 +399,6 @@ private: bool mSocksSettingsDirty; typedef std::map control_values_map_t; control_values_map_t mSavedValues; - }; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 1d0c0597f0..2dc69f9625 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -293,6 +293,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLPanelLogin::onUpdateStartSLURL(start_slurl); // updates grid if needed } + updateServerCombo(); loadLoginPage(); // } diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index fa9458fd01..2aa3ba1b16 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -88,7 +88,6 @@ public: /// to be called from LLStartUp::setStartSLURL static void onUpdateStartSLURL(const LLSLURL& new_start_slurl); - static void updateServerCombo(); private: friend class LLPanelLoginListener; @@ -110,6 +109,7 @@ private: static void onClickForgotPassword(void*); static void onClickHelp(void*); static void onPassKey(LLLineEditor* caller, void* user_data); + static void updateServerCombo(); // static void onClickRemove(void*); static void onClickGridMgrHelp(void*); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_opensim.xml b/indra/newview/skins/default/xui/en/panel_preferences_opensim.xml index cd9a781ee0..b454e4e452 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_opensim.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_opensim.xml @@ -9,15 +9,26 @@ width="540" label="Opensim" name="opensim_panel"> + - + + + Grid Name: + + + + + + Grid URI: + + + + Login Page: + + + + + Helper URI: + + + + Grid Website: + + + + Grid Support: + + + + Grid Registration: + + + + Grid Password URI: + + + + Grid Search: + + + + Grid Message URI: + + + - + - - - Override current search url: (no override if empty) - - + Override current search url: (no override if empty) + + - - + + +