| 902 | } |
| 903 | |
| 904 | bool MainWindow::ProjectOpen() { |
| 905 | if (!ReconstructionOverwrite()) { |
| 906 | return false; |
| 907 | } |
| 908 | |
| 909 | const std::string project_path = |
| 910 | QFileDialog::getOpenFileName(this, |
| 911 | tr("Select project file"), |
| 912 | GetLastOpen(kLastDirProject), |
| 913 | tr("Project file (*.ini)")) |
| 914 | .toUtf8() |
| 915 | .constData(); |
| 916 | |
| 917 | if (project_path.empty()) { |
| 918 | // Selection cancelled. |
| 919 | return false; |
| 920 | } |
| 921 | |
| 922 | if (options_.ReRead(project_path)) { |
| 923 | *options_.project_path = project_path; |
| 924 | project_widget_->SetDatabasePath(*options_.database_path); |
| 925 | project_widget_->SetImagePath(*options_.image_path); |
| 926 | UpdateWindowTitle(); |
| 927 | SetLastOpen(kLastDirProject, QString::fromStdString(project_path)); |
| 928 | return true; |
| 929 | } |
| 930 | |
| 931 | ShowInvalidProjectError(); |
| 932 | |
| 933 | return false; |
| 934 | } |
| 935 | |
| 936 | void MainWindow::ProjectEdit() { |
| 937 | project_widget_->show(); |
nothing calls this directly
no test coverage detected