| 130 | } |
| 131 | |
| 132 | void FileBar::on_actionOpen_triggered() |
| 133 | { |
| 134 | //open data file |
| 135 | AppConfig &app = AppConfig::Instance(); |
| 136 | |
| 137 | if (_session->have_hardware_data() && _session->is_first_store_confirm()){ |
| 138 | if (MsgBox::Confirm(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SAVE_CAPDATE), "Save captured data?"))){ |
| 139 | sig_save(); |
| 140 | return; |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | // Show the dialog |
| 145 | const QString file_name = QFileDialog::getOpenFileName( |
| 146 | this, |
| 147 | L_S(STR_PAGE_DLG, S_ID(IDS_DLG_OPEN_FILE), "Open File"), |
| 148 | app.userHistory.openDir, |
| 149 | "DSView Data (*.dsl)"); |
| 150 | |
| 151 | if (!file_name.isEmpty()) { |
| 152 | QString fname = path::GetDirectoryName(file_name); |
| 153 | if (fname != app.userHistory.openDir){ |
| 154 | app.userHistory.openDir = fname; |
| 155 | app.SaveHistory(); |
| 156 | } |
| 157 | |
| 158 | sig_load_file(file_name); |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | void FileBar::on_actionLoad_triggered() |
| 163 | { |
nothing calls this directly
no test coverage detected