diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-01-05 13:17:42 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-01-05 13:17:42 +0100 |
commit | 613c01dab5222a99fa642a466ce37ade53f1c072 (patch) | |
tree | 76e7397ed67679d168a40b36035d898b406b1430 /MultiMC.h | |
parent | 76f58eb42ccc2c19f6952cbae501c17c06c3671b (diff) | |
download | MultiMC-613c01dab5222a99fa642a466ce37ade53f1c072.tar MultiMC-613c01dab5222a99fa642a466ce37ade53f1c072.tar.gz MultiMC-613c01dab5222a99fa642a466ce37ade53f1c072.tar.lz MultiMC-613c01dab5222a99fa642a466ce37ade53f1c072.tar.xz MultiMC-613c01dab5222a99fa642a466ce37ade53f1c072.zip |
Some more updater fixes
Paths were wrong - still used work directory instead of root
Diffstat (limited to 'MultiMC.h')
-rw-r--r-- | MultiMC.h | 38 |
1 files changed, 21 insertions, 17 deletions
@@ -6,6 +6,7 @@ #include <memory> #include "logger/QsLog.h" #include "logger/QsLogDest.h" +#include <QFlag> class MinecraftVersionList; class LWJGLVersionList; @@ -32,9 +33,19 @@ enum InstSortMode // Sort alphabetically by name. Sort_Name, // Sort by which instance was launched most recently. - Sort_LastLaunch, + Sort_LastLaunch }; +enum UpdateFlag +{ + None = 0x0, + RestartOnFinish = 0x1, + DryRun = 0x2, + OnExit = 0x4 +}; +Q_DECLARE_FLAGS(UpdateFlags, UpdateFlag); +Q_DECLARE_OPERATORS_FOR_FLAGS(UpdateFlags); + class MultiMC : public QApplication { Q_OBJECT @@ -43,7 +54,7 @@ public: { Failed, Succeeded, - Initialized, + Initialized }; public: @@ -110,21 +121,7 @@ public: std::shared_ptr<JavaVersionList> javalist(); - /*! - * Installs update from the given update files directory. - */ - void installUpdates(const QString &updateFilesDir, bool restartOnFinish = false); - - /*! - * Sets MultiMC to install updates from the given directory when it exits. - */ - void setUpdateOnExit(const QString &updateFilesDir); - - /*! - * Gets the path to install updates from on exit. - * If this is an empty string, no updates should be installed on exit. - */ - QString getExitUpdatePath() const; + void installUpdates(const QString updateFilesDir, UpdateFlags flags = None); /*! * Opens a json file using either a system default editor, or, if note empty, the editor @@ -155,6 +152,12 @@ public: return origcwdPath; } +private slots: + /** + * Do all the things that should be done before we exit + */ + void onExit(); + private: void initLogger(); @@ -187,6 +190,7 @@ private: QsLogging::DestinationPtr m_debugDestination; QString m_updateOnExitPath; + UpdateFlags m_updateOnExitFlags = None; QString rootPath; QString binPath; |