From 45f6cd21a2c730b9dea322b0dba30120cdc40521 Mon Sep 17 00:00:00 2001 From: Tannin Date: Fri, 17 May 2013 20:44:40 +0200 Subject: - extended plugin interface to allow plugins access to download manager - extended plugin interface to allow installation of mods from files - improved detection of online state - download tab now also displays files supported through plugins - batch installer now has basic functionality (downloads and installes files) --- src/downloadmanager.h | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'src/downloadmanager.h') diff --git a/src/downloadmanager.h b/src/downloadmanager.h index 407acd3c..46e852aa 100644 --- a/src/downloadmanager.h +++ b/src/downloadmanager.h @@ -21,6 +21,7 @@ along with Mod Organizer. If not, see . #define DOWNLOADMANAGER_H #include "nexusinterface.h" +#include #include #include #include @@ -52,7 +53,7 @@ Q_DECLARE_METATYPE(NexusInfo) /*! * \brief manages downloading of files and provides progress information for gui elements **/ -class DownloadManager : public QObject +class DownloadManager : public MOBase::IDownloadManager { Q_OBJECT @@ -145,15 +146,10 @@ public: QString getOutputDirectory() const { return m_OutputDirectory; } /** - * @brief start a download from a url - * - * @param url the url to download from - * @param modID the nexus mod id this download belongs to - * @param fileID the nexus file id this download belongs to, if known. Defaults to 0. - * @param nexusInfo information previously retrieved from the nexus network - * @return true if the download was started, false if it wasn't. The latter currently only happens if there is a duplicate and the user decides not to download again - **/ - bool addDownload(const QStringList &URLs, int modID, int fileID = 0, const NexusInfo &nexusInfo = NexusInfo()); + * @brief set the list of supported extensions + * @param extensions list of supported extensions + */ + void setSupportedExtensions(const QStringList &extensions); /** * @brief download from an already open network connection @@ -263,6 +259,11 @@ public: */ static bool ServerByPreference(const QVariant &LHS, const QVariant &RHS); + + virtual int startDownloadURLs(const QStringList &urls); + virtual int startDownloadNexusFile(int modID, int fileID); + virtual QString downloadPath(int id); + signals: void aboutToUpdate(); @@ -330,6 +331,17 @@ private: void startDownload(QNetworkReply *reply, DownloadInfo *newDownload, bool resume); + /** + * @brief start a download from a url + * + * @param url the url to download from + * @param modID the nexus mod id this download belongs to + * @param fileID the nexus file id this download belongs to, if known. Defaults to 0. + * @param nexusInfo information previously retrieved from the nexus network + * @return true if the download was started, false if it wasn't. The latter currently only happens if there is a duplicate and the user decides not to download again + **/ + bool addDownload(const QStringList &URLs, int modID, int fileID = 0, const NexusInfo &nexusInfo = NexusInfo()); + // important: the caller has to lock the list-mutex, otherwise the DownloadInfo-pointer might get invalidated at any time DownloadInfo *findDownload(QObject *reply, int *index = NULL) const; @@ -353,6 +365,7 @@ private: QVector m_ActiveDownloads; QString m_OutputDirectory; + QStringList m_SupportedExtensions; std::set m_RequestIDs; QVector m_AlphabeticalTranslation; -- cgit v1.3.1