MAINT-8540 Eliminated a lot of xui related log warnings on startup and opening preferences

andreykproductengine 2018-04-20 20:21:20 +03:00
parent 449a4f9b06
commit 66502df050
20 changed files with 91 additions and 84 deletions

View File

@ -258,7 +258,7 @@ int LLFile::remove(const std::string& filename, int supress_error)
return warnif("remove", filename, rc, supress_error);
}
int LLFile::rename(const std::string& filename, const std::string& newname)
int LLFile::rename(const std::string& filename, const std::string& newname, int supress_error)
{
#if LL_WINDOWS
std::string utf8filename = filename;
@ -269,7 +269,7 @@ int LLFile::rename(const std::string& filename, const std::string& newname)
#else
int rc = ::rename(filename.c_str(),newname.c_str());
#endif
return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, rc);
return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, rc, supress_error);
}
bool LLFile::copy(const std::string from, const std::string to)

View File

@ -74,7 +74,7 @@ public:
static int rmdir(const std::string& filename);
static int remove(const std::string& filename, int supress_error = 0);
static int rename(const std::string& filename,const std::string& newname);
static int rename(const std::string& filename,const std::string& newname, int supress_error = 0);
static bool copy(const std::string from, const std::string to);
static int stat(const std::string& filename,llstat* file_status);

View File

@ -34,11 +34,11 @@ LLViewerEventRecorder::LLViewerEventRecorder() {
logEvents = false;
// Remove any previous event log file
std::string old_log_ui_events_to_llsd_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife_Events_log.old");
LLFile::remove(old_log_ui_events_to_llsd_file);
LLFile::remove(old_log_ui_events_to_llsd_file, ENOENT);
mLogFilename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife_Events_log.llsd");
LLFile::rename(mLogFilename, old_log_ui_events_to_llsd_file);
LLFile::rename(mLogFilename, old_log_ui_events_to_llsd_file, ENOENT);
}

View File

@ -1249,6 +1249,8 @@ void LLFloaterPreference::refreshEnabledState()
// Cannot have floater active until caps have been received
getChild<LLButton>("default_creation_permissions")->setEnabled(LLStartUp::getStartupState() < STATE_STARTED ? false : true);
getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess());
}
void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState()
@ -1383,8 +1385,6 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState()
// now turn off any features that are unavailable
disableUnavailableSettings();
getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess());
}
// static
@ -2563,18 +2563,6 @@ BOOL LLPanelPreferenceGraphics::postBuild()
LLFloaterReg::showInstance("prefs_graphics_advanced");
LLFloaterReg::hideInstance("prefs_graphics_advanced");
// Don't do this on Mac as their braindead GL versioning
// sets this when 8x and 16x are indeed available
//
#if !LL_DARWIN
if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f)
{ //remove FSAA settings above "4x"
LLComboBox* combo = getChild<LLComboBox>("fsaa");
combo->remove("8x");
combo->remove("16x");
}
#endif
resetDirtyChilds();
setPresetText();
@ -2749,6 +2737,23 @@ LLFloaterPreferenceProxy::LLFloaterPreferenceProxy(const LLSD& key)
mCommitCallbackRegistrar.add("Proxy.Change", boost::bind(&LLFloaterPreferenceProxy::onChangeSocksSettings, this));
}
BOOL LLFloaterPreferenceGraphicsAdvanced::postBuild()
{
// Don't do this on Mac as their braindead GL versioning
// sets this when 8x and 16x are indeed available
//
#if !LL_DARWIN
if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f)
{ //remove FSAA settings above "4x"
LLComboBox* combo = getChild<LLComboBox>("fsaa");
combo->remove("8x");
combo->remove("16x");
}
#endif
return TRUE;
}
void LLFloaterPreferenceGraphicsAdvanced::onOpen(const LLSD& key)
{
refresh();

View File

@ -276,6 +276,7 @@ class LLFloaterPreferenceGraphicsAdvanced : public LLFloater
public:
LLFloaterPreferenceGraphicsAdvanced(const LLSD& key);
~LLFloaterPreferenceGraphicsAdvanced();
/*virtual*/ BOOL postBuild();
void onOpen(const LLSD& key);
void onClickCloseBtn(bool app_quitting);
void disableUnavailableSettings();

View File

@ -253,7 +253,6 @@ BOOL LLFloaterTools::postBuild()
mCheckStretchTexture = getChild<LLCheckBoxCtrl>("checkbox stretch textures");
getChild<LLUICtrl>("checkbox stretch textures")->setValue((BOOL)gSavedSettings.getBOOL("ScaleStretchTextures"));
mComboGridMode = getChild<LLComboBox>("combobox grid mode");
mCheckStretchUniformLabel = getChild<LLTextBox>("checkbox uniform label");
//
// Create Buttons

View File

@ -716,9 +716,9 @@ void LLPanelStandStopFlying::updatePosition()
left_tb_width = toolbar_left->getRect().getWidth();
}
if (!mStateManagementButtons.get())
if (!mStateManagementButtons.get()) // Obsolete?!!
{
LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container");
LLPanel* panel_ssf_container = gToolBarView->getChild<LLPanel>("state_management_buttons_container");
if (panel_ssf_container)
{
mStateManagementButtons = panel_ssf_container->getHandle();

View File

@ -271,9 +271,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text");
forgot_password_text->setClickedCallback(onClickForgotPassword, NULL);
LLTextBox* need_help_text = getChild<LLTextBox>("login_help");
need_help_text->setClickedCallback(onClickHelp, NULL);
// get the web browser control
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
web_browser->addObserver(this);
@ -924,16 +921,6 @@ void LLPanelLogin::onClickForgotPassword(void*)
}
}
//static
void LLPanelLogin::onClickHelp(void*)
{
if (sInstance)
{
LLViewerHelp* vhelp = LLViewerHelp::getInstance();
vhelp->showTopic(vhelp->preLoginTopic());
}
}
// static
void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
{

View File

@ -99,7 +99,6 @@ private:
static void onClickNewAccount(void*);
static void onClickVersion(void*);
static void onClickForgotPassword(void*);
static void onClickHelp(void*);
static void onPassKey(LLLineEditor* caller, void* user_data);
static void updateServerCombo();

View File

@ -448,20 +448,6 @@ void LLPanelObject::getState( )
S32 roots_selected = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount();
BOOL editable = root_objectp->permModify();
// Select Single Message
getChildView("select_single")->setVisible( FALSE);
getChildView("edit_object")->setVisible( FALSE);
if (!editable || single_volume || selected_count <= 1)
{
getChildView("edit_object")->setVisible( TRUE);
getChildView("edit_object")->setEnabled(TRUE);
}
else
{
getChildView("select_single")->setVisible( TRUE);
getChildView("select_single")->setEnabled(TRUE);
}
BOOL is_flexible = volobjp && volobjp->isFlexible();
BOOL is_permanent = root_objectp->flagObjectPermanent();
BOOL is_permanent_enforced = root_objectp->isPermanentEnforced();
@ -1893,10 +1879,6 @@ void LLPanelObject::clearCtrls()
mLabelTaper ->setEnabled( FALSE );
mLabelRadiusOffset->setEnabled( FALSE );
mLabelRevolutions->setEnabled( FALSE );
getChildView("select_single")->setVisible( FALSE);
getChildView("edit_object")->setVisible( TRUE);
getChildView("edit_object")->setEnabled(FALSE);
getChildView("scale_hole")->setEnabled(FALSE);
getChildView("scale_taper")->setEnabled(FALSE);

View File

@ -586,7 +586,6 @@ BOOL LLPanelPeople::postBuild()
getChild<LLFilterEditor>("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
getChild<LLFilterEditor>("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
getChild<LLFilterEditor>("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
getChild<LLFilterEditor>("fbc_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
if(gMaxAgentGroups <= BASE_MAX_AGENT_GROUPS)
{

View File

@ -282,7 +282,6 @@ void LLPanelVolume::getState( )
if (is_light && editable && single_volume)
{
getChildView("label color")->setEnabled(true);
//mLabelColor ->setEnabled( TRUE );
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
@ -325,7 +324,6 @@ void LLPanelVolume::getState( )
getChild<LLSpinCtrl>("Light Radius", true)->clear();
getChild<LLSpinCtrl>("Light Falloff", true)->clear();
getChildView("label color")->setEnabled(false);
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
@ -567,9 +565,7 @@ void LLPanelVolume::clearCtrls()
getChildView("select_single")->setVisible(true);
getChildView("edit_object")->setEnabled(false);
getChildView("edit_object")->setVisible(false);
getChildView("Light Checkbox Ctrl")->setEnabled(false);
getChildView("label color")->setEnabled(false);
getChildView("label color")->setEnabled(false);
getChildView("Light Checkbox Ctrl")->setEnabled(false);;
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{

View File

@ -35,6 +35,7 @@
// Linden libs
#include "llbutton.h"
#include "llcheckboxctrl.h"
#include "lltabcontainer.h"
#include "llfloaterreg.h"
#include "llfloaterpreference.h"
@ -52,17 +53,15 @@ LLPanelVolumePulldown::LLPanelVolumePulldown()
{
mHoverTimer.stop();
mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2));
mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2));
mCommitCallbackRegistrar.add("Vol.SetSounds", boost::bind(&LLPanelVolumePulldown::onClickSetSounds, this));
mCommitCallbackRegistrar.add("Vol.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelVolumePulldown::updateMediaAutoPlayCheckbox, this, _1));
mCommitCallbackRegistrar.add("Vol.GoAudioPrefs", boost::bind(&LLPanelVolumePulldown::onAdvancedButtonClick, this, _2));
buildFromFile( "panel_volume_pulldown.xml");
}
BOOL LLPanelVolumePulldown::postBuild()
{
// set the initial volume-slider's position to reflect reality
LLSliderCtrl* volslider = getChild<LLSliderCtrl>( "mastervolume" );
volslider->setValue(gSavedSettings.getF32("AudioLevelMaster"));
return LLPanel::postBuild();
}
@ -130,6 +129,28 @@ void LLPanelVolumePulldown::setControlFalse(const LLSD& user_data)
control->set(LLSD(FALSE));
}
void LLPanelVolumePulldown::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl)
{
std::string name = ctrl->getName();
// Disable "Allow Media to auto play" only when both
// "Streaming Music" and "Media" are unchecked. STORM-513.
if ((name == "enable_music") || (name == "enable_media"))
{
bool music_enabled = getChild<LLCheckBoxCtrl>("enable_music")->get();
bool media_enabled = getChild<LLCheckBoxCtrl>("enable_media")->get();
getChild<LLCheckBoxCtrl>("media_auto_play_btn")->setEnabled(music_enabled || media_enabled);
}
}
void LLPanelVolumePulldown::onClickSetSounds()
{
// Disable Enable gesture sounds checkbox if the master sound is disabled
// or if sound effects are disabled.
getChild<LLCheckBoxCtrl>("gesture_audio_play_btn")->setEnabled(!gSavedSettings.getBOOL("MuteSounds"));
}
//virtual
void LLPanelVolumePulldown::draw()
{

View File

@ -47,6 +47,10 @@ class LLPanelVolumePulldown : public LLPanel
private:
void setControlFalse(const LLSD& user_data);
void onClickSetSounds();
// Disables "Allow Media to auto play" check box only when both
// "Streaming Music" and "Media" are unchecked. Otherwise enables it.
void updateMediaAutoPlayCheckbox(LLUICtrl* ctrl);
void onAdvancedButtonClick(const LLSD& user_data);
LLFrameTimer mHoverTimer;

View File

@ -751,7 +751,6 @@ bool idle_startup()
if (gLoginMenuBarView == NULL)
{
LL_DEBUGS("AppInit") << "initializing menu bar" << LL_ENDL;
initialize_edit_menu();
initialize_spellcheck_menu();
init_menus();
}

View File

@ -108,7 +108,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
mTextTime(NULL),
mSGBandwidth(NULL),
mSGPacketLoss(NULL),
mBtnStats(NULL),
mBtnVolume(NULL),
mBoxBalance(NULL),
mBalance(0),
@ -168,8 +167,6 @@ BOOL LLStatusBar::postBuild()
mBoxBalance = getChild<LLTextBox>("balance");
mBoxBalance->setClickedCallback( &LLStatusBar::onClickBalance, this );
mBtnStats = getChildView("stat_btn");
mIconPresets = getChild<LLIconCtrl>( "presets_icon" );
mIconPresets->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterPresets, this));
@ -242,8 +239,6 @@ BOOL LLStatusBar::postBuild()
mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
mPanelNearByMedia->setVisible(FALSE);
mScriptOut = getChildView("scriptout");
return TRUE;
}
@ -297,7 +292,6 @@ void LLStatusBar::refresh()
mSGBandwidth->setVisible(net_stats_visible);
mSGPacketLoss->setVisible(net_stats_visible);
mBtnStats->setEnabled(net_stats_visible);
// update the master volume button state
bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute();

View File

@ -105,12 +105,10 @@ private:
LLStatGraph *mSGBandwidth;
LLStatGraph *mSGPacketLoss;
LLView *mBtnStats;
LLIconCtrl *mIconPresets;
LLButton *mBtnVolume;
LLTextBox *mBoxBalance;
LLButton *mMediaToggle;
LLView *mScriptOut;
LLFrameTimer mClockUpdateTimer;
S32 mBalance;

View File

@ -7976,6 +7976,23 @@ void handle_web_browser_test(const LLSD& param)
LLWeb::loadURLInternal(url);
}
bool callback_clear_cache_immediately(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if ( option == 0 ) // YES
{
//clear cache
LLAppViewer::instance()->purgeCacheImmediate();
}
return false;
}
void handle_cache_clear_immediately()
{
LLNotificationsUtil::add("ConfirmClearCache", LLSD(), LLSD(), callback_clear_cache_immediately);
}
void handle_web_content_test(const LLSD& param)
{
std::string url = param.asString();
@ -9026,6 +9043,8 @@ void initialize_menus()
//Develop (Texture Fetch Debug Console)
view_listener_t::addMenu(new LLDevelopTextureFetchDebugger(), "Develop.SetTexFetchDebugger");
//Develop (clear cache immediately)
commit.add("Develop.ClearCache", boost::bind(&handle_cache_clear_immediately) );
// Admin >Object
view_listener_t::addMenu(new LLAdminForceTakeCopy(), "Admin.ForceTakeCopy");

View File

@ -1946,6 +1946,10 @@ void LLViewerWindow::initBase()
// Create global views
// Login screen and main_view.xml need edit menus for preferences and browser
LL_DEBUGS("AppInit") << "initializing edit menu" << LL_ENDL;
initialize_edit_menu();
// Create the floater view at the start so that other views can add children to it.
// (But wait to add it as a child of the root view so that it will be in front of the
// other views.)

View File

@ -29,7 +29,7 @@
top="10"
volume="true">
<slider.commit_callback
function="Pref.setControlFalse"
function="Vol.setControlFalse"
parameter="MuteAudio" />
</slider>
<button
@ -61,7 +61,7 @@
top_pad="4"
volume="true">
<slider.commit_callback
function="Pref.setControlFalse"
function="Vol.setControlFalse"
parameter="MuteUI" />
</slider>
<button
@ -94,7 +94,7 @@
top_pad="4"
volume="true">
<slider.commit_callback
function="Pref.setControlFalse"
function="Vol.setControlFalse"
parameter="MuteAmbient" />
</slider>
<button
@ -127,7 +127,7 @@
top_pad="4"
volume="true">
<slider.commit_callback
function="Pref.setControlFalse"
function="Vol.setControlFalse"
parameter="MuteSounds" />
</slider>
<button
@ -144,7 +144,7 @@
tab_stop="false"
width="16">
<button.commit_callback
function="Pref.SetSounds"/>
function="Vol.SetSounds"/>
</button>
<check_box
name="gesture_audio_play_btn"
@ -173,7 +173,7 @@
top_pad="4"
volume="true">
<slider.commit_callback
function="Pref.setControlFalse"
function="Vol.setControlFalse"
parameter="MuteMusic" />
</slider>
<button
@ -199,7 +199,7 @@
top_delta="2"
width="350">
<check_box.commit_callback
function="Pref.updateMediaAutoPlayCheckbox"/>
function="Vol.updateMediaAutoPlayCheckbox"/>
</check_box>
<slider
control_name="AudioLevelMedia"
@ -218,7 +218,7 @@
top_pad="4"
volume="true">
<slider.commit_callback
function="Pref.setControlFalse"
function="Vol.setControlFalse"
parameter="MuteMedia" />
</slider>
<button
@ -246,7 +246,7 @@
name="enable_media"
width="110">
<check_box.commit_callback
function="Pref.updateMediaAutoPlayCheckbox"/>
function="Vol.updateMediaAutoPlayCheckbox"/>
</check_box>
<slider
control_name="AudioLevelVoice"
@ -265,7 +265,7 @@
show_text="false"
volume="true">
<slider.commit_callback
function="Pref.setControlFalse"
function="Vol.setControlFalse"
parameter="MuteVoice" />
</slider>
<button