Skip to content

Commit

Permalink
Fixed missing settings.
Browse files Browse the repository at this point in the history
Fixed missing logging settings in the GUI settings dialog by adding
them. These options are logging enabled and port number. Also changed
the logging to be disabled by default.
  • Loading branch information
4ctrl-alt-del committed Oct 15, 2019
1 parent 61c103c commit 4310891
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/ace_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const char* Settings::_chunkPrefixDefault {"chunk"};
const char* Settings::_chunkExtensionDefault {"abd"};
/*!
*/
const bool Settings::_loggingEnabledDefault {true};
const bool Settings::_loggingEnabledDefault {false};
/*!
*/
const int Settings::_loggingPortDefault {40000};
Expand Down
14 changes: 14 additions & 0 deletions src/gui/ace_settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <QLineEdit>
#include <QPushButton>
#include <QIcon>
#include <QCheckBox>
#include "../core/ace_settings.h"
#include "../core/cuda_device.h"
#include "../core/opencl_platform.h"
Expand Down Expand Up @@ -105,6 +106,9 @@ void SettingsDialog::applyClicked()
settings.setChunkDir(_chunkDirEdit->text());
settings.setChunkPrefix(_chunkPrefixEdit->text());
settings.setChunkExtension(_chunkExtensionEdit->text());

settings.setLoggingEnabled(_loggingEdit->isChecked());
settings.setLoggingPort(_loggingPortEdit->value());
}


Expand Down Expand Up @@ -193,6 +197,13 @@ QLayout* SettingsDialog::createForm()
_chunkExtensionEdit = new QLineEdit;
_chunkExtensionEdit->setText(settings.chunkExtension());

_loggingEdit = new QCheckBox(tr("Enabled"));
_loggingEdit->setChecked(settings.loggingEnabled());
_loggingPortEdit = new QSpinBox;
_loggingPortEdit->setMinimum(0);
_loggingPortEdit->setMaximum(65535);
_loggingPortEdit->setValue(settings.loggingPort());

// .
QFormLayout* ret {new QFormLayout};
ret->addRow(new QLabel(tr("CUDA Device:")),createCUDA());
Expand All @@ -203,6 +214,9 @@ QLayout* SettingsDialog::createForm()
ret->addRow(new QLabel(tr("Chunk Prefix:")),_chunkPrefixEdit);
ret->addRow(new QLabel(tr("Chunk Extension:")),_chunkExtensionEdit);

ret->addRow(new QLabel(tr("Logging:")),_loggingEdit);
ret->addRow(new QLabel(tr("Logging Port:")),_loggingPortEdit);

// .
return ret;
}
Expand Down
3 changes: 3 additions & 0 deletions src/gui/ace_settingsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class QComboBox;
class QSpinBox;
class QLineEdit;
class QCheckBox;
//


Expand Down Expand Up @@ -64,6 +65,8 @@ namespace Ace
* The line edit for this dialog used to edit the chunk extension setting.
*/
QLineEdit* _chunkExtensionEdit;
QCheckBox* _loggingEdit;
QSpinBox* _loggingPortEdit;
};
}

Expand Down

0 comments on commit 4310891

Please sign in to comment.