mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
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:
parent
9da10df9f2
commit
75c89f2c22
2 changed files with 3 additions and 10 deletions
|
@ -215,7 +215,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
|
||||||
|
|
||||||
_window->setCentralWidget(_glWidget);
|
_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");
|
setApplicationName("Interface");
|
||||||
setOrganizationDomain("highfidelity.io");
|
setOrganizationDomain("highfidelity.io");
|
||||||
setOrganizationName("High Fidelity");
|
setOrganizationName("High Fidelity");
|
||||||
|
@ -968,7 +968,7 @@ void Application::terminate() {
|
||||||
// Close serial port
|
// Close serial port
|
||||||
// close(serial_fd);
|
// close(serial_fd);
|
||||||
|
|
||||||
if (_autosave) {
|
if (_settingsAutosave->isChecked()) {
|
||||||
saveSettings();
|
saveSettings();
|
||||||
_settings->sync();
|
_settings->sync();
|
||||||
}
|
}
|
||||||
|
@ -1471,7 +1471,7 @@ void Application::initMenu() {
|
||||||
debugMenu->addAction("Wants View Delta Sending", this, SLOT(setWantsDelta(bool)))->setCheckable(true);
|
debugMenu->addAction("Wants View Delta Sending", this, SLOT(setWantsDelta(bool)))->setCheckable(true);
|
||||||
|
|
||||||
QMenu* settingsMenu = menuBar->addMenu("Settings");
|
QMenu* settingsMenu = menuBar->addMenu("Settings");
|
||||||
(_settingsAutosave = settingsMenu->addAction("Autosave", this, SLOT(setAutosave(bool))))->setCheckable(true);
|
(_settingsAutosave = settingsMenu->addAction("Autosave"))->setCheckable(true);
|
||||||
_settingsAutosave->setChecked(true);
|
_settingsAutosave->setChecked(true);
|
||||||
settingsMenu->addAction("Load settings", this, SLOT(loadSettings()));
|
settingsMenu->addAction("Load settings", this, SLOT(loadSettings()));
|
||||||
settingsMenu->addAction("Save settings", this, SLOT(saveSettings()));
|
settingsMenu->addAction("Save settings", this, SLOT(saveSettings()));
|
||||||
|
@ -2521,10 +2521,6 @@ void Application::saveAction(QSettings* set, QAction* action) {
|
||||||
set->setValue(action->text(), action->isChecked());
|
set->setValue(action->text(), action->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::setAutosave(bool wantsAutosave) {
|
|
||||||
_autosave = wantsAutosave;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application::loadSettings(QSettings* set) {
|
void Application::loadSettings(QSettings* set) {
|
||||||
if (!set) set = getSettings();
|
if (!set) set = getSettings();
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,6 @@ private slots:
|
||||||
void decreaseVoxelSize();
|
void decreaseVoxelSize();
|
||||||
void increaseVoxelSize();
|
void increaseVoxelSize();
|
||||||
void chooseVoxelPaintColor();
|
void chooseVoxelPaintColor();
|
||||||
void setAutosave(bool wantsAutosave);
|
|
||||||
void loadSettings(QSettings* set = NULL);
|
void loadSettings(QSettings* set = NULL);
|
||||||
void saveSettings(QSettings* set = NULL);
|
void saveSettings(QSettings* set = NULL);
|
||||||
void importSettings();
|
void importSettings();
|
||||||
|
@ -293,8 +292,6 @@ private:
|
||||||
int _packetsPerSecond;
|
int _packetsPerSecond;
|
||||||
int _bytesPerSecond;
|
int _bytesPerSecond;
|
||||||
int _bytesCount;
|
int _bytesCount;
|
||||||
|
|
||||||
bool _autosave; // True if the autosave is on.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__interface__Application__) */
|
#endif /* defined(__interface__Application__) */
|
||||||
|
|
Loading…
Reference in a new issue