Fix Companion Script

This commit is contained in:
Florian Märkl 2018-08-25 13:23:31 +02:00
parent d510897ad1
commit ec2807a897

View File

@ -314,14 +314,13 @@ void MainWindow::openNewFile(InitialOptions options, bool skipOptionsDialog)
/* Prompt to load filename.r2 script */
if (options.script.isEmpty()) {
QString script = QString("%1.r2").arg(this->filename);
QString loadScript;
if (r_file_exists(script.toStdString().data())) {
QMessageBox mb;
mb.setWindowTitle(tr("Script loading"));
mb.setText(tr("Do you want to load the '%1' script?").arg(script));
mb.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
if (mb.exec() == QMessageBox::Yes) {
loadScript = script;
options.script = script;
}
}
}