Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two minor input generator bugs #1033

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions avogadro/molequeue/inputgeneratorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,15 +449,6 @@ void InputGeneratorWidget::saveSingleFile(const QString& fileName)
settings.setValue(settingsKey("outputDirectory"),
QFileInfo(filePath).absoluteDir().absolutePath());

QFileInfo info(filePath);

// Don't check for overwrite: the file save dialog takes care of this.
// Attempt to open the file for writing
if (!QFile(fileName).open(QFile::WriteOnly)) {
showError(tr("%1: File exists and is not writable.").arg(fileName));
return;
}

QTextEdit* edit = m_textEdits.value(fileName, nullptr);
if (!edit) {
showError(tr("Internal error: could not find text widget for filename '%1'")
Expand Down Expand Up @@ -629,10 +620,17 @@ void InputGeneratorWidget::connectButtons()
SLOT(updatePreviewText()));
connect(m_ui->defaultsButton, SIGNAL(clicked()), SLOT(defaultsClicked()));
connect(m_ui->generateButton, SIGNAL(clicked()), SLOT(generateClicked()));
connect(m_ui->computeButton, SIGNAL(clicked()), SLOT(computeClicked()));
connect(m_ui->closeButton, SIGNAL(clicked()), SIGNAL(closeClicked()));
connect(m_ui->warningTextButton, SIGNAL(clicked()),
SLOT(toggleWarningText()));

// disable the compute button if Molequeue is not running
MoleQueueManager& mqManager = MoleQueueManager::instance();
if (!mqManager.connectIfNeeded()) {
m_ui->computeButton->setEnabled(false);
} else {
connect(m_ui->computeButton, SIGNAL(clicked()), SLOT(computeClicked()));
}
}

void InputGeneratorWidget::updateOptions()
Expand Down