Initial ProjectModel implementation

This commit is contained in:
Jack Andersen
2018-07-16 18:48:38 -10:00
parent 7a38fd0676
commit 3f265cdb46
29 changed files with 1337 additions and 224 deletions

View File

@@ -20,18 +20,18 @@ QString SysStringToQString(const boo::SystemString& str)
#endif
}
bool MkPath(const QString& path, QWidget* parent)
bool MkPath(const QString& path, UIMessenger& messenger)
{
QFileInfo fInfo(path);
return MkPath(fInfo.dir(), fInfo.fileName(), parent);
return MkPath(fInfo.dir(), fInfo.fileName(), messenger);
}
bool MkPath(const QDir& dir, const QString& file, QWidget* parent)
bool MkPath(const QDir& dir, const QString& file, UIMessenger& messenger)
{
if (!dir.mkpath(file))
{
QString msg = QString(parent->tr("A directory at '%1/%2' could not be created.")).arg(dir.path()).arg(file);
QMessageBox::critical(parent, parent->tr("Unable to create directory"), msg);
QString msg = QString(QObject::tr("A directory at '%1/%2' could not be created.")).arg(dir.path()).arg(file);
messenger.critical(QObject::tr("Unable to create directory"), msg);
return false;
}
return true;