summaryrefslogtreecommitdiff
path: root/src/installationmanager.h
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-05-22 18:16:56 +0200
committerTannin <devnull@localhost>2013-05-22 18:16:56 +0200
commitf0ba6ce95c1f30524453ce996fa536a888f018da (patch)
treeff6fc7ad1de0e4813a0485cc7ab90baf23c51595 /src/installationmanager.h
parent45f6cd21a2c730b9dea322b0dba30120cdc40521 (diff)
- added NCC to repository
- deleting files from download manager now moves them to recycle bin instead of deleting permanentyl - cleanup in installation manager - ini editor (old) can now be configured to open files in external editor - bugfix: .net check in ncc installer was broken - bugfix: mod-overwrite dialog wasn't displayed for complex installers
Diffstat (limited to 'src/installationmanager.h')
-rw-r--r--src/installationmanager.h34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/installationmanager.h b/src/installationmanager.h
index 5bf64e94..818558b8 100644
--- a/src/installationmanager.h
+++ b/src/installationmanager.h
@@ -57,16 +57,17 @@ public:
~InstallationManager();
+ void setModsDirectory(const QString &modsDirectory) { m_ModsDirectory = modsDirectory; }
+
/**
* @brief install a mod from an archive
*
* @param fileName absolute file name of the archive to install
- * @param modsDirectory directory to install mods to
* @param modName suggested name of the mod. If this is empty (the default), a name will be guessed based on the filename. The user will always have a chance to rename the mod
* @return true if the archive was installed, false if installation failed or was refused
* @exception std::exception an exception may be thrown if the archive can't be opened (maybe the format is invalid or the file is damaged)
**/
- bool install(const QString &fileName, const QString &modsDirectory, MOBase::GuessedValue<QString> &modName, bool &hasIniTweaks);
+ bool install(const QString &fileName, MOBase::GuessedValue<QString> &modName, bool &hasIniTweaks);
/**
* @return true if the installation was canceled
@@ -82,8 +83,6 @@ public:
**/
static QString getErrorString(Archive::Error errorCode);
- void installManual(MOBase::DirectoryTree::Node *baseNode, MOBase::DirectoryTree *filesTree, bool &hasIniTweaks, QString &modName, int categoryID, const QString &modsDirectory, QString newestVersion, QString version, int modID, bool success, bool manualRequest);
-
/**
* @brief register an installer-plugin
* @param the installer to register
@@ -125,6 +124,13 @@ public:
*/
virtual MOBase::IPluginInstaller::EInstallResult installArchive(MOBase::GuessedValue<QString> &modName, const QString &archiveName);
+ /**
+ * @brief test if the specified mod name is free. If not, query the user how to proceed
+ * @param modName current possible names for the mod
+ * @return true if we can proceed with the installation, false if the user canceled or in case of an unrecoverable error
+ */
+ virtual bool testOverwrite(MOBase::GuessedValue<QString> &modName) const;
+
private:
void queryPassword(LPSTR password);
@@ -142,30 +148,20 @@ private:
// recursive worker function for mapToArchive
void mapToArchive(const MOBase::DirectoryTree::Node *node, std::wstring path, FileData * const *data);
- bool unpackPackageTXT();
bool unpackSingleFile(const QString &fileName);
bool isSimpleArchiveTopLayer(const MOBase::DirectoryTree::Node *node, bool bainStyle);
MOBase::DirectoryTree::Node *getSimpleArchiveBase(MOBase::DirectoryTree *dataTree);
- bool checkBainPackage(MOBase::DirectoryTree *dataTree);
- bool checkFomodPackage(MOBase::DirectoryTree *dataTree, QString &offset, bool &xmlInstaller);
- bool checkNMMInstaller();
-
-// static bool fixModName(QString &name);
bool testOverwrite(const QString &modsDirectory, MOBase::GuessedValue<QString> &modName);
- bool doInstall(const QString &modsDirectory, MOBase::GuessedValue<QString> &modName,
+ bool doInstall(MOBase::GuessedValue<QString> &modName,
int modID, const QString &version, const QString &newestVersion, int categoryID);
- bool installFomodExternal(const QString &fileName, const QString &pluginsFileName, const QString &modDirectory);
- bool installFomodInternal(MOBase::DirectoryTree *&baseNode, const QString &fomodPath, const QString &modsDirectory,
- int modID, const QString &version, const QString &newestVersion,
- int categoryID, QString &modName, bool nameGuessed, bool &manualRequest);
- QString generateBackupName(const QString &directoryName);
+ QString generateBackupName(const QString &directoryName) const;
- bool ensureValidModName(MOBase::GuessedValue<QString> &name);
+ bool ensureValidModName(MOBase::GuessedValue<QString> &name) const;
private slots:
@@ -191,11 +187,11 @@ private:
QWidget *m_ParentWidget;
+ QString m_ModsDirectory;
+
std::vector<MOBase::IPluginInstaller*> m_Installers;
std::set<QString, CaseInsensitive> m_SupportedExtensions;
- QString m_NCCPath;
-
Archive *m_CurrentArchive;
QString m_CurrentFile;