| 1314 | } |
| 1315 | |
| 1316 | void ModListViewActions::createModFromOverwrite() const |
| 1317 | { |
| 1318 | GuessedValue<QString> name; |
| 1319 | name.setFilter(&fixDirectoryName); |
| 1320 | |
| 1321 | while (name->isEmpty()) { |
| 1322 | bool ok; |
| 1323 | name.update( |
| 1324 | QInputDialog::getText( |
| 1325 | m_parent, tr("Create Mod..."), |
| 1326 | tr("This will move all files from overwrite into a new, regular mod.\n" |
| 1327 | "Please enter a name:"), |
| 1328 | QLineEdit::Normal, "", &ok), |
| 1329 | GUESS_USER); |
| 1330 | if (!ok) { |
| 1331 | return; |
| 1332 | } |
| 1333 | } |
| 1334 | |
| 1335 | if (m_core.modList()->getMod(name) != nullptr) { |
| 1336 | reportError(tr("A mod with this name already exists")); |
| 1337 | return; |
| 1338 | } |
| 1339 | |
| 1340 | const IModInterface* newMod = m_core.createMod(name); |
| 1341 | if (newMod == nullptr) { |
| 1342 | return; |
| 1343 | } |
| 1344 | |
| 1345 | moveOverwriteContentsTo(newMod->absolutePath()); |
| 1346 | } |
| 1347 | |
| 1348 | void ModListViewActions::moveOverwriteContentToExistingMod() const |
| 1349 | { |
no test coverage detected