Fixed problems with MySQL user management

This commit is contained in:
Patrick Linstruth
2018-10-08 18:09:45 -07:00
parent a62d13b14b
commit 2e8819dfa8
2 changed files with 47 additions and 5 deletions

View File

@@ -176,7 +176,6 @@ void MainWidget::updateLabels()
db = new Db(&err_msg,rd_config);
if (!db->isOpen()) {
QMessageBox::information(this,tr("Cannot Open Database"),tr("Unable to open database. The connection parameters of the [Mysql] section of rd.conf may be incorrect or you may need to create a new database."));
label_schema->setVisible(false);
db_backup_button->setEnabled(false);
db_restore_button->setEnabled(false);
@@ -234,6 +233,8 @@ void MainWidget::createData()
delete db_create;
updateLabels();
startDaemons();
}
@@ -348,7 +349,9 @@ void MainWidget::resizeEvent(QResizeEvent *e)
void MainWidget::stopDaemons()
{
if(system("/usr/bin/systemctl status rivendell")==0) {
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
system("/usr/bin/systemctl stop rivendell");
QApplication::restoreOverrideCursor();
db_daemon_start_needed=true;
}
}
@@ -357,7 +360,9 @@ void MainWidget::stopDaemons()
void MainWidget::startDaemons()
{
if(db_daemon_start_needed) {
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
system("/usr/bin/systemctl start rivendell");
QApplication::restoreOverrideCursor();
}
}