OK, I found the problem: duplication of state for the "autosave" option.

Let's just use the QAction, as does everything else.
This commit is contained in:
Andrzej Kapolka 2013-06-07 13:42:49 -07:00
parent 9da10df9f2
commit 75c89f2c22
2 changed files with 3 additions and 10 deletions

View file

@ -215,7 +215,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
_window->setCentralWidget(_glWidget);
// these are used, for example, to identify the application's preferences
// these are used, for example, to identify the application settings
setApplicationName("Interface");
setOrganizationDomain("highfidelity.io");
setOrganizationName("High Fidelity");
@ -968,7 +968,7 @@ void Application::terminate() {
// Close serial port
// close(serial_fd);
if (_autosave) {
if (_settingsAutosave->isChecked()) {
saveSettings();
_settings->sync();
}
@ -1471,7 +1471,7 @@ void Application::initMenu() {
debugMenu->addAction("Wants View Delta Sending", this, SLOT(setWantsDelta(bool)))->setCheckable(true);
QMenu* settingsMenu = menuBar->addMenu("Settings");
(_settingsAutosave = settingsMenu->addAction("Autosave", this, SLOT(setAutosave(bool))))->setCheckable(true);
(_settingsAutosave = settingsMenu->addAction("Autosave"))->setCheckable(true);
_settingsAutosave->setChecked(true);
settingsMenu->addAction("Load settings", this, SLOT(loadSettings()));
settingsMenu->addAction("Save settings", this, SLOT(saveSettings()));
@ -2521,10 +2521,6 @@ void Application::saveAction(QSettings* set, QAction* action) {
set->setValue(action->text(), action->isChecked());
}
void Application::setAutosave(bool wantsAutosave) {
_autosave = wantsAutosave;
}
void Application::loadSettings(QSettings* set) {
if (!set) set = getSettings();

View file

@ -112,7 +112,6 @@ private slots:
void decreaseVoxelSize();
void increaseVoxelSize();
void chooseVoxelPaintColor();
void setAutosave(bool wantsAutosave);
void loadSettings(QSettings* set = NULL);
void saveSettings(QSettings* set = NULL);
void importSettings();
@ -293,8 +292,6 @@ private:
int _packetsPerSecond;
int _bytesPerSecond;
int _bytesCount;
bool _autosave; // True if the autosave is on.
};
#endif /* defined(__interface__Application__) */