197 connect(document, &Document::newStatusText, [&](const QString& newStatusText) |
197 connect(document, &Document::newStatusText, [&](const QString& newStatusText) |
198 { |
198 { |
199 this->statusBar()->showMessage(newStatusText); |
199 this->statusBar()->showMessage(newStatusText); |
200 }); |
200 }); |
201 const QFileInfo fileInfo{*this->documents.modelPath(modelId)}; |
201 const QFileInfo fileInfo{*this->documents.modelPath(modelId)}; |
202 this->ui->tabs->addTab(document, fileInfo.baseName()); |
202 QString tabName = fileInfo.baseName(); |
|
203 if (tabName.isEmpty()) |
|
204 { |
|
205 tabName = tr("<unnamed>"); |
|
206 } |
|
207 this->ui->tabs->addTab(document, tabName); |
203 this->ui->tabs->setCurrentWidget(document); |
208 this->ui->tabs->setCurrentWidget(document); |
204 document->restoreSplitterState(this->documentSplitterState); |
209 document->restoreSplitterState(this->documentSplitterState); |
205 } |
210 } |
206 |
211 |
207 void MainWindow::runSettingsEditor() |
212 void MainWindow::runSettingsEditor() |