| 403 | } |
| 404 | |
| 405 | void StatisticsBrowser::exportStatistics(QWidget *widget, Contest *curContest) { |
| 406 | if (! curContest) { |
| 407 | QMessageBox::warning(widget, tr("LemonLime"), tr("No contest yet"), QMessageBox::Ok); |
| 408 | return; |
| 409 | } |
| 410 | |
| 411 | QList<Task *> taskList = curContest->getTaskList(); |
| 412 | QList<Contestant *> contestantList = curContest->getContestantList(); |
| 413 | |
| 414 | if (taskList.empty()) { |
| 415 | QMessageBox::warning(widget, tr("LemonLime"), tr("No task yet"), QMessageBox::Ok); |
| 416 | return; |
| 417 | } |
| 418 | |
| 419 | if (contestantList.empty()) { |
| 420 | QMessageBox::warning(widget, tr("LemonLime"), tr("No contestant yet"), QMessageBox::Ok); |
| 421 | return; |
| 422 | } |
| 423 | |
| 424 | QString filter = tr("HTML Document (*.html)"); |
| 425 | QString fileName = QFileDialog::getSaveFileName( |
| 426 | widget, tr("Export Statistics"), QDir::currentPath() + QDir::separator() + "statistics.html", filter); |
| 427 | |
| 428 | if (fileName.isEmpty()) |
| 429 | return; |
| 430 | |
| 431 | if (QFileInfo(fileName).suffix() == "html") |
| 432 | exportStatisticsHtml(widget, fileName); |
| 433 | } |
nothing calls this directly
no test coverage detected