MCPcopy Create free account
hub / github.com/MrKepzie/Natron / createDir

Method createDir

Gui/SequenceFileDialog.cpp:1422–1451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1420}
1421
1422void
1423SequenceFileDialog::createDir()
1424{
1425 _favoriteView->clearSelection();
1426
1427 NATRON_PYTHON_NAMESPACE::PyModalDialog dialog(_gui);
1428 dialog.setWindowTitle( tr("New Folder") );
1429 boost::shared_ptr<NATRON_PYTHON_NAMESPACE::StringParam> folderName( dialog.createStringParam( QString::fromUtf8("folderName"), QString::fromUtf8("Folder Name") ) );
1430 dialog.refreshUserParamsGUI();
1431 if ( dialog.exec() ) {
1432 QString newFolderString = folderName->getValue();
1433 if ( !newFolderString.isEmpty() ) {
1434 QString folderName = newFolderString;
1435 QString prefix = currentDirectory().absolutePath();
1436 StrUtils::ensureLastPathSeparator(prefix);
1437 if ( QFile::exists(prefix + folderName) ) {
1438 qlonglong suffix = 2;
1439 while ( QFile::exists(prefix + folderName) ) {
1440 folderName = newFolderString + QString::number(suffix);
1441 ++suffix;
1442 }
1443 }
1444 QModelIndex index = _model->mkdir(_view->rootIndex(), folderName);
1445 if ( !index.isValid() ) {
1446 return;
1447 }
1448 enterDirectory(index);
1449 }
1450 }
1451}
1452
1453
1454void

Callers

nothing calls this directly

Calls 9

createStringParamMethod · 0.80
refreshUserParamsGUIMethod · 0.80
execMethod · 0.80
absolutePathMethod · 0.80
mkdirMethod · 0.80
clearSelectionMethod · 0.45
getValueMethod · 0.45
isEmptyMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected