Merge pull request #3350 from huffman/19935

Code Review for Job #19935
This commit is contained in:
Clément Brisset 2014-09-04 12:36:51 -07:00
commit 4940615a83
5 changed files with 33 additions and 14 deletions

View file

@ -3932,6 +3932,7 @@ void Application::setPreviousScriptLocation(const QString& previousScriptLocatio
_previousScriptLocation = previousScriptLocation;
QMutexLocker locker(&_settingsMutex);
_settings->setValue("LastScriptLocation", _previousScriptLocation);
bumpSettings();
}
void Application::loadDialog() {

View file

@ -725,6 +725,9 @@ void Menu::loadSettings(QSettings* settings) {
Application::getInstance()->updateWindowTitle();
NodeList::getInstance()->loadData(settings);
// notify that a settings has changed
connect(&NodeList::getInstance()->getDomainHandler(), &DomainHandler::hostnameChanged, this, &Menu::bumpSettings);
// MyAvatar caches some menu options, so we have to update them whenever we load settings.
// TODO: cache more settings in MyAvatar that are checked with very high frequency.
MyAvatar* myAvatar = Application::getInstance()->getAvatar();
@ -894,6 +897,8 @@ void Menu::handleViewFrustumOffsetKeyModifier(int key) {
default:
break;
}
bumpSettings();
}
void Menu::addDisabledActionAndSeparator(QMenu* destinationMenu, const QString& actionName, int menuItemLocation) {
@ -1000,7 +1005,7 @@ QAction* Menu::addCheckableActionToQMenuAndActionHash(QMenu* destinationMenu,
QAction::NoRole, menuItemLocation);
action->setCheckable(true);
action->setChecked(checked);
connect(action, SIGNAL(changed()), Application::getInstance(), SLOT(bumpSettings()));
connect(action, SIGNAL(changed()), this, SLOT(bumpSettings()));
return action;
}
@ -1042,6 +1047,10 @@ void Menu::aboutApp() {
InfoView::forcedShow();
}
void Menu::bumpSettings() {
Application::getInstance()->bumpSettings();
}
void sendFakeEnterEvent() {
QPoint lastCursorPosition = QCursor::pos();
QGLWidget* glWidget = Application::getInstance()->getGLWidget();
@ -1115,6 +1124,8 @@ void Menu::changePrivateKey() {
// pull the private key from the dialog
_walletPrivateKey = privateKeyDialog.textValue().toUtf8();
}
bumpSettings();
sendFakeEnterEvent();
}
@ -1637,10 +1648,12 @@ void Menu::resetLODAdjust() {
void Menu::setVoxelSizeScale(float sizeScale) {
_voxelSizeScale = sizeScale;
bumpSettings();
}
void Menu::setBoundaryLevelAdjust(int boundaryLevelAdjust) {
_boundaryLevelAdjust = boundaryLevelAdjust;
bumpSettings();
}
void Menu::lodTools() {
@ -1930,5 +1943,6 @@ QString Menu::getSnapshotsLocation() const {
void Menu::setScriptsLocation(const QString& scriptsLocation) {
_scriptsLocation = scriptsLocation;
bumpSettings();
emit scriptLocationChanged(scriptsLocation);
}

View file

@ -92,20 +92,20 @@ public:
const InboundAudioStream::Settings& getReceivedAudioStreamSettings() const { return _receivedAudioStreamSettings; }
void setReceivedAudioStreamSettings(const InboundAudioStream::Settings& receivedAudioStreamSettings) { _receivedAudioStreamSettings = receivedAudioStreamSettings; }
float getFieldOfView() const { return _fieldOfView; }
void setFieldOfView(float fieldOfView) { _fieldOfView = fieldOfView; }
void setFieldOfView(float fieldOfView) { _fieldOfView = fieldOfView; bumpSettings(); }
float getRealWorldFieldOfView() const { return _realWorldFieldOfView; }
void setRealWorldFieldOfView(float realWorldFieldOfView) { _realWorldFieldOfView = realWorldFieldOfView; }
void setRealWorldFieldOfView(float realWorldFieldOfView) { _realWorldFieldOfView = realWorldFieldOfView; bumpSettings(); }
float getOculusUIAngularSize() const { return _oculusUIAngularSize; }
void setOculusUIAngularSize(float oculusUIAngularSize) { _oculusUIAngularSize = oculusUIAngularSize; }
void setOculusUIAngularSize(float oculusUIAngularSize) { _oculusUIAngularSize = oculusUIAngularSize; bumpSettings(); }
float getSixenseReticleMoveSpeed() const { return _sixenseReticleMoveSpeed; }
void setSixenseReticleMoveSpeed(float sixenseReticleMoveSpeed) { _sixenseReticleMoveSpeed = sixenseReticleMoveSpeed; }
void setSixenseReticleMoveSpeed(float sixenseReticleMoveSpeed) { _sixenseReticleMoveSpeed = sixenseReticleMoveSpeed; bumpSettings(); }
bool getInvertSixenseButtons() const { return _invertSixenseButtons; }
void setInvertSixenseButtons(bool invertSixenseButtons) { _invertSixenseButtons = invertSixenseButtons; }
void setInvertSixenseButtons(bool invertSixenseButtons) { _invertSixenseButtons = invertSixenseButtons; bumpSettings(); }
float getFaceshiftEyeDeflection() const { return _faceshiftEyeDeflection; }
void setFaceshiftEyeDeflection(float faceshiftEyeDeflection) { _faceshiftEyeDeflection = faceshiftEyeDeflection; }
void setFaceshiftEyeDeflection(float faceshiftEyeDeflection) { _faceshiftEyeDeflection = faceshiftEyeDeflection; bumpSettings(); }
QString getSnapshotsLocation() const;
void setSnapshotsLocation(QString snapshotsLocation) { _snapshotsLocation = snapshotsLocation; }
void setSnapshotsLocation(QString snapshotsLocation) { _snapshotsLocation = snapshotsLocation; bumpSettings(); }
const QString& getScriptsLocation() const { return _scriptsLocation; }
void setScriptsLocation(const QString& scriptsLocation);
@ -128,13 +128,13 @@ public:
void resetLODAdjust();
void setVoxelSizeScale(float sizeScale);
float getVoxelSizeScale() const { return _voxelSizeScale; }
void setAutomaticAvatarLOD(bool automaticAvatarLOD) { _automaticAvatarLOD = automaticAvatarLOD; }
void setAutomaticAvatarLOD(bool automaticAvatarLOD) { _automaticAvatarLOD = automaticAvatarLOD; bumpSettings(); }
bool getAutomaticAvatarLOD() const { return _automaticAvatarLOD; }
void setAvatarLODDecreaseFPS(float avatarLODDecreaseFPS) { _avatarLODDecreaseFPS = avatarLODDecreaseFPS; }
void setAvatarLODDecreaseFPS(float avatarLODDecreaseFPS) { _avatarLODDecreaseFPS = avatarLODDecreaseFPS; bumpSettings(); }
float getAvatarLODDecreaseFPS() const { return _avatarLODDecreaseFPS; }
void setAvatarLODIncreaseFPS(float avatarLODIncreaseFPS) { _avatarLODIncreaseFPS = avatarLODIncreaseFPS; }
void setAvatarLODIncreaseFPS(float avatarLODIncreaseFPS) { _avatarLODIncreaseFPS = avatarLODIncreaseFPS; bumpSettings(); }
float getAvatarLODIncreaseFPS() const { return _avatarLODIncreaseFPS; }
void setAvatarLODDistanceMultiplier(float multiplier) { _avatarLODDistanceMultiplier = multiplier; }
void setAvatarLODDistanceMultiplier(float multiplier) { _avatarLODDistanceMultiplier = multiplier; bumpSettings(); }
float getAvatarLODDistanceMultiplier() const { return _avatarLODDistanceMultiplier; }
void setBoundaryLevelAdjust(int boundaryLevelAdjust);
int getBoundaryLevelAdjust() const { return _boundaryLevelAdjust; }
@ -145,7 +145,7 @@ public:
// User Tweakable PPS from Voxel Server
int getMaxVoxelPacketsPerSecond() const { return _maxVoxelPacketsPerSecond; }
void setMaxVoxelPacketsPerSecond(int maxVoxelPacketsPerSecond) { _maxVoxelPacketsPerSecond = maxVoxelPacketsPerSecond; }
void setMaxVoxelPacketsPerSecond(int maxVoxelPacketsPerSecond) { _maxVoxelPacketsPerSecond = maxVoxelPacketsPerSecond; bumpSettings(); }
QAction* addActionToQMenuAndActionHash(QMenu* destinationMenu,
const QString& actionName,
@ -206,6 +206,7 @@ public slots:
private slots:
void aboutApp();
void bumpSettings();
void editPreferences();
void editAttachments();
void editAnimations();

View file

@ -210,7 +210,6 @@ void PreferencesDialog::savePreferences() {
if (shouldDispatchIdentityPacket) {
myAvatar->sendIdentityPacket();
Application::getInstance()->bumpSettings();
}
if (!Menu::getInstance()->isOptionChecked(MenuOption::DisableActivityLogger)
@ -263,4 +262,6 @@ void PreferencesDialog::savePreferences() {
Application::getInstance()->resizeGL(Application::getInstance()->getGLWidget()->width(),
Application::getInstance()->getGLWidget()->height());
Application::getInstance()->bumpSettings();
}

View file

@ -88,11 +88,13 @@ bool RearMirrorTools::mousePressEvent(int x, int y) {
if (_headZoomIconRect.contains(x, y)) {
_zoomLevel = HEAD;
Application::getInstance()->bumpSettings();
return true;
}
if (_bodyZoomIconRect.contains(x, y)) {
_zoomLevel = BODY;
Application::getInstance()->bumpSettings();
return true;
}