MCPcopy Create free account
hub / github.com/Project-LemonLime/Project_LemonLime / exportStatistics

Method exportStatistics

src/statisticsbrowser.cpp:405–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405void 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}

Callers

nothing calls this directly

Calls 2

getTaskListMethod · 0.80
getContestantListMethod · 0.80

Tested by

no test coverage detected