Allow to run Cutter without any file opened #404 (#419)

* Allow to run Cutter without any file opened #404
This commit is contained in:
int 0x80 2018-03-25 15:36:14 +03:00 committed by xarkes
parent 152503a936
commit 0ecc0ed113
2 changed files with 9 additions and 2 deletions

View File

@ -273,7 +273,7 @@ bool NewFileDialog::fillProjectsList()
void NewFileDialog::loadFile(const QString &filename) void NewFileDialog::loadFile(const QString &filename)
{ {
if (!Core()->tryFile(filename, false)) { if (!ui->checkBox_FilelessOpen->isChecked() && !Core()->tryFile(filename, false)) {
QMessageBox msgBox(this); QMessageBox msgBox(this);
msgBox.setText(tr("Select a new program or a previous one before continuing.")); msgBox.setText(tr("Select a new program or a previous one before continuing."));
msgBox.exec(); msgBox.exec();
@ -293,7 +293,7 @@ void NewFileDialog::loadFile(const QString &filename)
// Close dialog and open MainWindow/OptionsDialog // Close dialog and open MainWindow/OptionsDialog
MainWindow *main = new MainWindow(); MainWindow *main = new MainWindow();
main->openNewFile(filename); main->openNewFile(filename);
close(); close();
} }

7
src/dialogs/NewfileDialog.ui Normal file → Executable file
View File

@ -274,6 +274,13 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QCheckBox" name="checkBox_FilelessOpen">
<property name="text">
<string>Don't open any file</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="loadFileButton"> <widget class="QPushButton" name="loadFileButton">
<property name="text"> <property name="text">