From 07412a56658c19c3fe80eaf716df56d67c2d5366 Mon Sep 17 00:00:00 2001 From: Holy Date: Sun, 17 Jun 2012 16:11:50 -0400 Subject: [PATCH] FIRE-6340 & FIRE-6567 -Setting Bandwidth via quick preferences doesn't work and setting bandwidth via cmd_line - combined jira's because of way everything was linked with the Preferences Panel. --- indra/newview/app_settings/settings.xml | 13 + indra/newview/chatbar_as_cmdline.cpp | 29 +- indra/newview/llfloaterpreference.cpp | 95 ++- indra/newview/llviewercontrol.cpp | 24 +- indra/newview/llviewerthrottle.cpp | 4 + .../default/xui/en/floater_quickprefs.xml | 16 +- .../xui/en/panel_preferences_firestorm.xml | 776 ++++++++++-------- .../newview/skins/default/xui/en/strings.xml | 5 + 8 files changed, 545 insertions(+), 417 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d164aa4911..c8b404b6cf 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -15835,6 +15835,19 @@ Change of this parameter will affect the layout of buttons in notification toast Value tp2 + + FSCmdLineBandWidth + + Comment + Change max. bandwidth quickly + Persist + 1 + Type + String + Value + bw + + FSWLParcelEnabled Comment diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index c92a87774a..09a428d5d3 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -82,7 +82,7 @@ #include "llagentcamera.h" #include "lggcontactsetsfloater.h" - +#include "lltrans.h" // FIRE-6340, FIRE-6567 - Setting Bandwidth issues void cmdline_printchat(std::string message); void cmdline_rezplat(bool use_saved_value = true, F32 visual_radius = 30.0); @@ -515,6 +515,8 @@ bool cmd_line_chat(std::string revised_text, EChatType type, bool from_gesture) static LLCachedControl sFSCmdLineMedia(gSavedSettings, "FSCmdLineMedia"); static LLCachedControl sFSCmdLineMusic(gSavedSettings, "FSCmdLineMusic"); static LLCachedControl sFSCmdLineAutocorrect(gSavedSettings, "FSCmdLineAutocorrect"); + // FIRE-6340, FIRE-6567 - Setting Bandwidth issues + static LLCachedControl sFSCmdLineBandwidth(gSavedSettings, "FSCmdLineBandWidth"); if(sFSCmdLine) { @@ -593,6 +595,31 @@ bool cmd_line_chat(std::string revised_text, EChatType type, bool from_gesture) } } } + + // FIRE-6340, FIRE-6567 - Setting Bandwidth issues + else if(command == std::string(sFSCmdLineBandwidth)) + { + int band_width; + if(i >> band_width) + { + if ( band_width < 100 ) + { + band_width = 100; + } + else if (band_width > 3000 ) + { + band_width = 3000; + } + gSavedSettings.setF32("ThrottleBandwidthKBPS", band_width); + LLStringUtil::format_map_t args; + std::string bw_cmd_respond; + args["[VALUE]"] = llformat ("%d", band_width); + bw_cmd_respond = LLTrans::getString("FSCmdLineRSP", args); + cmdline_printchat(bw_cmd_respond); + return false; + } + } + // FIRE-6340, FIRE-6567 - Setting Bandwidth issues #if 0 else if(command == std::string(sFSCmdLineMusic)) { diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 17ff2555cd..bb4fc5f54c 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -130,7 +130,8 @@ const F32 MAX_USER_FAR_CLIP = 512.f; const F32 MIN_USER_FAR_CLIP = 64.f; -const F32 BANDWIDTH_UPDATER_TIMEOUT = 0.5f; +// FIRE-6340, FIRE-6567 - Setting Bandwidth issues +//const F32 BANDWIDTH_UPDATER_TIMEOUT = 0.5f; //control value for middle mouse as talk2push button const static std::string MIDDLE_MOUSE_CV = "MiddleMouse"; @@ -1886,55 +1887,59 @@ static void updateBandwidthWarning() } // -static bool handleBandwidthChanged(const LLSD& newvalue) -{ - gViewerThrottle.setMaxBandwidth((F32) newvalue.asReal()); - updateBandwidthWarning(); // Add warning on high bandwidth setting - return true; -} +// FIRE-6340, FIRE-6567 - Setting Bandwidth issues +//static bool handleBandwidthChanged(const LLSD& newvalue) +//{ +// gViewerThrottle.setMaxBandwidth((F32) newvalue.asReal()); +// updateBandwidthWarning(); // Add warning on high bandwidth setting +// return true; +//} -class LLPanelPreference::Updater : public LLEventTimer -{ +//class LLPanelPreference::Updater : public LLEventTimer +//{ -public: +//public: - typedef boost::function callback_t; +// typedef boost::function callback_t; - Updater(callback_t cb, F32 period) - :LLEventTimer(period), - mCallback(cb) - { - mEventTimer.stop(); - } +// Updater(callback_t cb, F32 period) +// :LLEventTimer(period), +// mCallback(cb) +// { +// mEventTimer.stop(); +// } - virtual ~Updater(){} +// virtual ~Updater(){} - void update(const LLSD& new_value) - { - mNewValue = new_value; - mEventTimer.start(); - } +// void update(const LLSD& new_value) +// { +// mNewValue = new_value; +// mEventTimer.start(); +// } -protected: +//protected: - BOOL tick() - { - mCallback(mNewValue); - mEventTimer.stop(); +// BOOL tick() +// { +// mCallback(mNewValue); +// mEventTimer.stop(); - return FALSE; - } +// return FALSE; +// } -private: +//private: + +// LLSD mNewValue; +// callback_t mCallback; +//}; +//---------------------------------------------------------------------------- */ +// FIRE-6340, FIRE-6567 - Setting Bandwidth issues - LLSD mNewValue; - callback_t mCallback; -}; -//---------------------------------------------------------------------------- static LLRegisterPanelClassWrapper t_places("panel_preference"); LLPanelPreference::LLPanelPreference() -: LLPanel(), - mBandWidthUpdater(NULL) +// FIRE-6340, FIRE-6567 - Setting Bandwidth issues +//: LLPanel(), + //mBandWidthUpdater(NULL) { mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2)); mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1)); @@ -2022,9 +2027,11 @@ BOOL LLPanelPreference::postBuild() if (hasChild("max_bandwidth_layout")) // { - mBandWidthUpdater = new LLPanelPreference::Updater(boost::bind(&handleBandwidthChanged, _1), BANDWIDTH_UPDATER_TIMEOUT); - gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&LLPanelPreference::Updater::update, mBandWidthUpdater, _2)); + // FIRE-6340, FIRE-6567 - Setting Bandwidth issues + //mBandWidthUpdater = new LLPanelPreference::Updater(boost::bind(&handleBandwidthChanged, _1), BANDWIDTH_UPDATER_TIMEOUT); + //gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&LLPanelPreference::Updater::update, mBandWidthUpdater, _2)); updateBandwidthWarning(); // Add warning on high bandwidth setting + // FIRE-6340, FIRE-6567 - Setting Bandwidth issues } // Fix for visually broken browser choice radiobuttons @@ -2061,10 +2068,12 @@ BOOL LLPanelPreference::postBuild() LLPanelPreference::~LLPanelPreference() { - if (mBandWidthUpdater) - { - delete mBandWidthUpdater; - } + // FIRE-6340, FIRE-6567 - Setting Bandwidth issues + //if (mBandWidthUpdater) + //{ + // delete mBandWidthUpdater; + //} + // FIRE-6340, FIRE-6567 - Setting Bandwidth issues } void LLPanelPreference::apply() { diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 7ca5f7d739..9285934a0b 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -74,6 +74,7 @@ #include "llcombobox.h" #include "llstatusbar.h" #include "llupdaterservice.h" +#include "lltrans.h" // FIRE-6340, FIRE-6567 - Setting Bandwidth issues // [SL:KB] - Patch: Misc-Spellcheck | Checked: 2010-07-02 (Catznip-2.7.0a) | Added: Catznip-2.7.0a #include "llhunspell.h" // [/SL:KB] @@ -97,6 +98,9 @@ std::string gLastRunVersion; extern BOOL gResizeScreenTexture; extern BOOL gDebugGL; extern BOOL gAuditTexture; + +LLTimer throttle_timer;// FIRE-6340, FIRE-6567 - Setting Bandwidth issues +void cmdline_printchat(std::string message);// FIRE-6340, FIRE-6567 - Setting Bandwidth issues //////////////////////////////////////////////////////////////////////////// // Listeners @@ -113,7 +117,23 @@ static bool handleRenderFarClipChanged(const LLSD& newvalue) LLWorld::getInstance()->setLandFarClip(draw_distance); return true; } - +// FIRE-6340, FIRE-6567 - Setting Bandwidth issues +static bool handleBandWidthChanged(const LLSD& newvalue) +{ + F32 throttletimer = throttle_timer.getElapsedTimeF32(); + if (throttletimer > 0.25f) + { + F32 bandwidth = (F32) newvalue.asReal(); + gViewerThrottle.setMaxBandwidth((F32) bandwidth); + if ( gSavedSettings.getBOOL("BandwidthSettingTooHigh") ) + { + cmdline_printchat(LLTrans::getString("FSCmdLineBWTooHigh")); + } + throttle_timer.reset(); + } + return true; +} +// FIRE-6340, FIRE-6567 - Setting Bandwidth issues static bool handleTerrainDetailChanged(const LLSD& newvalue) { LLDrawPoolTerrain::sDetailMode = newvalue.asInteger(); @@ -676,6 +696,8 @@ void settings_setup_listeners() { gSavedSettings.getControl("FirstPersonAvatarVisible")->getSignal()->connect(boost::bind(&handleRenderAvatarMouselookChanged, _2)); gSavedSettings.getControl("RenderFarClip")->getSignal()->connect(boost::bind(&handleRenderFarClipChanged, _2)); + // FIRE-6340, FIRE-6567 - Setting Bandwidth issues + gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&handleBandWidthChanged, _2)); gSavedSettings.getControl("RenderTerrainDetail")->getSignal()->connect(boost::bind(&handleTerrainDetailChanged, _2)); gSavedSettings.getControl("OctreeStaticObjectSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2)); gSavedSettings.getControl("OctreeDistanceFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2)); diff --git a/indra/newview/llviewerthrottle.cpp b/indra/newview/llviewerthrottle.cpp index 5147272122..4199e28897 100644 --- a/indra/newview/llviewerthrottle.cpp +++ b/indra/newview/llviewerthrottle.cpp @@ -147,6 +147,10 @@ LLViewerThrottleGroup LLViewerThrottleGroup::operator-(const LLViewerThrottleGro void LLViewerThrottleGroup::sendToSim() const { llinfos << "Sending throttle settings, total BW " << mThrottleTotal << llendl; + // FIRE-6340, FIRE-6567 - Setting Bandwidth issues + S32 newBandwidth=(S32) gSavedSettings.getF32("ThrottleBandwidthKBPS"); + gSavedSettings.setBOOL("BandwidthSettingTooHigh",newBandwidth>1500); + // FIRE-6340, FIRE-6567 - Setting Bandwidth issues LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_AgentThrottle); diff --git a/indra/newview/skins/default/xui/en/floater_quickprefs.xml b/indra/newview/skins/default/xui/en/floater_quickprefs.xml index cbb92adb21..0722b202b6 100644 --- a/indra/newview/skins/default/xui/en/floater_quickprefs.xml +++ b/indra/newview/skins/default/xui/en/floater_quickprefs.xml @@ -52,10 +52,9 @@ name="DrawDistance" top_delta="-2" width="150" - label_width="3"/> - - - + ---> - + width="144" /> + + + + + . + + + Calc. expressions (usage: cmd SIN(2+2)) + + + + + Add autocorrect word(cmd list|bad|good) + + + + + Change Draw Dist (usage: cmd meters) + + + + + Max. Bandwidth (usage: cmd kbps) + + + + + Rez a platform (usage: cmd 0 - 30) + + + - - + + + + Get avatar name from key (usage: cmd key) + + + + + Turn AO on/off (usage: cmd on/off) + + + + + Clear the chat history (usage: cmd) + + + + + Set the media url (usage: cmd url type) + + + + + Set the music stream url (usage: cmd url) + + + - - - - Teleport within sim (usage: cmd x y z) - - + + - - Teleport to ground (usage: cmd) - - - - - Teleport to altitude (usage: cmd z) - - - - - Teleport home (usage: cmd) - - - - - Rez a platform (usage: cmd 0 - 30) - - - - - - Teleport to sim x (usage: cmd simname) - - - - - - Calc. expressions (usage: cmd SIN(2+2)) - - - - - Add autocorrect word(cmd list|bad|good) - - - - - - - Change Draw Distance (usage: cmd meters) - - - - - Teleport to cam position (usage: cmd) - - - - - Get avatar name from key (usage: cmd key) - - - - - Offer teleport to avatar (usage: cmd key) - - - - - Teleport to avatar (usage: cmd name) - - - - - Turn AO on/off (usage: cmd on/off) - - - - - Clear the chat history (usage: cmd) - - - - - Set the media url (usage: cmd url type) - - - - - Set the music stream url (usage: cmd url) - - - + + + + Teleport within sim (usage: cmd x y z) + + + + + Teleport to ground (usage: cmd) + + + + + Teleport to altitude (usage: cmd z) + + + + + Teleport to sim x (usage: cmd simname) + + + + + + + Teleport to cam position (usage: cmd) + + + + + Offer teleport to avatar (usage: cmd key) + + + + + Teleport to avatar (usage: cmd name) + + + + + Teleport home (usage: cmd) + + + + (unknown region) (unknown position) + + + Maximum Bandwidth Set To: [VALUE]kbps. + We strongly advise not to set the Bandwidth over 1500 kbps. +