| 1169 | } |
| 1170 | |
| 1171 | void MainWindow::hookUpWindowTutorials() |
| 1172 | { |
| 1173 | QDirIterator dirIter(QApplication::applicationDirPath() + "/tutorials", |
| 1174 | QStringList("*.js"), QDir::Files); |
| 1175 | while (dirIter.hasNext()) { |
| 1176 | dirIter.next(); |
| 1177 | QString fileName = dirIter.fileName(); |
| 1178 | QFile file(dirIter.filePath()); |
| 1179 | if (!file.open(QIODevice::ReadOnly)) { |
| 1180 | log::error("Failed to open {}", fileName); |
| 1181 | continue; |
| 1182 | } |
| 1183 | QString firstLine = QString::fromUtf8(file.readLine()); |
| 1184 | if (firstLine.startsWith("//WIN")) { |
| 1185 | QString windowName = firstLine.mid(6).trimmed(); |
| 1186 | if (!m_OrganizerCore.settings().interface().isTutorialCompleted(windowName)) { |
| 1187 | TutorialManager::instance().activateTutorial(windowName, fileName); |
| 1188 | } |
| 1189 | } |
| 1190 | } |
| 1191 | } |
| 1192 | |
| 1193 | bool MainWindow::shouldStartTutorial() const |
| 1194 | { |
nothing calls this directly
no test coverage detected