MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / hookUpWindowTutorials

Method hookUpWindowTutorials

src/mainwindow.cpp:1171–1191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1169}
1170
1171void 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
1193bool MainWindow::shouldStartTutorial() const
1194{

Callers

nothing calls this directly

Calls 4

openMethod · 0.80
isTutorialCompletedMethod · 0.80
nextMethod · 0.45
settingsMethod · 0.45

Tested by

no test coverage detected