--nowriteaccess first steps
This commit is contained in:
@@ -28,6 +28,8 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c)
|
|||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
|
if (myConfig->readConfigInt("CLA_NoWriteAccess")) { groupBox_logOnOff->setDisabled(TRUE); }
|
||||||
|
|
||||||
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( isAccepted() ) );
|
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( isAccepted() ) );
|
||||||
connect( lineEdit_humanPlayerName, SIGNAL( textChanged( const QString &) ), this, SLOT( playerNickChanged() ) );
|
connect( lineEdit_humanPlayerName, SIGNAL( textChanged( const QString &) ), this, SLOT( playerNickChanged() ) );
|
||||||
connect( lineEdit_Opponent1Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
|
connect( lineEdit_Opponent1Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
|
||||||
@@ -245,18 +247,21 @@ void settingsDialogImpl::isAccepted() {
|
|||||||
|
|
||||||
// Log
|
// Log
|
||||||
myConfig->writeConfigInt("LogOnOff", groupBox_logOnOff->isChecked());
|
myConfig->writeConfigInt("LogOnOff", groupBox_logOnOff->isChecked());
|
||||||
if(QDir::QDir(lineEdit_logDir->text()).exists() && lineEdit_logDir->text() != "") { myConfig->writeConfigString("LogDir", lineEdit_logDir->text().toUtf8().constData()); }
|
if (myConfig->readConfigInt("LogOnOff")) {
|
||||||
else {
|
// if log On
|
||||||
QMessageBox::warning(this, tr("Settings Error"),
|
if(QDir::QDir(lineEdit_logDir->text()).exists() && lineEdit_logDir->text() != "") { myConfig->writeConfigString("LogDir", lineEdit_logDir->text().toUtf8().constData()); }
|
||||||
tr("The log file directory doesn't exists.\n"
|
else {
|
||||||
"Please select an valid directory!"),
|
QMessageBox::warning(this, tr("Settings Error"),
|
||||||
QMessageBox::Ok);
|
tr("The log file directory doesn't exists.\n"
|
||||||
settingsCorrect = FALSE;
|
"Please select an valid directory!"),
|
||||||
|
QMessageBox::Ok);
|
||||||
|
settingsCorrect = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
myConfig->writeConfigInt("LogStoreDuration", spinBox_logStoreDuration->value());
|
||||||
|
myConfig->writeConfigInt("LogInterval", comboBox_logInterval->currentIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
myConfig->writeConfigInt("LogStoreDuration", spinBox_logStoreDuration->value());
|
|
||||||
myConfig->writeConfigInt("LogInterval", comboBox_logInterval->currentIndex());
|
|
||||||
|
|
||||||
//Wenn alles richtig eingegeben wurde --> Dialog schließen
|
//Wenn alles richtig eingegeben wurde --> Dialog schließen
|
||||||
if(settingsCorrect) { this->hide(); }
|
if(settingsCorrect) { this->hide(); }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user