| 1284 | } |
| 1285 | |
| 1286 | void MainWindow::PopulateRecentCaptureFiles() |
| 1287 | { |
| 1288 | ui->menu_Recent_Capture_Files->clear(); |
| 1289 | |
| 1290 | ui->menu_Recent_Capture_Files->setEnabled(false); |
| 1291 | |
| 1292 | int idx = 1; |
| 1293 | for(int i = m_Ctx.Config().RecentCaptureFiles.count() - 1; i >= 0; i--) |
| 1294 | { |
| 1295 | QString filename = m_Ctx.Config().RecentCaptureFiles[i]; |
| 1296 | QString filenameDisplay = filename; |
| 1297 | filenameDisplay.replace(QLatin1Char('&'), lit("&&")); |
| 1298 | ui->menu_Recent_Capture_Files->addAction(QFormatStr("&%1 %2").arg(idx).arg(filenameDisplay), |
| 1299 | [this, filename] { recentCaptureFile(filename); }); |
| 1300 | idx++; |
| 1301 | |
| 1302 | ui->menu_Recent_Capture_Files->setEnabled(true); |
| 1303 | |
| 1304 | // only populate the 9 most recent, even if more exist in memory |
| 1305 | if(idx == 10) |
| 1306 | break; |
| 1307 | } |
| 1308 | |
| 1309 | ui->menu_Recent_Capture_Files->addSeparator(); |
| 1310 | ui->menu_Recent_Capture_Files->addAction(ui->action_Clear_Capture_Files_History); |
| 1311 | } |
| 1312 | |
| 1313 | void MainWindow::ClearRecentCaptureSettings() |
| 1314 | { |
no test coverage detected