summaryrefslogtreecommitdiff
path: root/src/moapplication.h
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-11-09 04:27:12 -0500
committerGitHub <noreply@github.com>2020-11-09 04:27:12 -0500
commit84e53f3ab3cd2b89eed3e37be734da3e997f4032 (patch)
tree2b14f10377b1ca2b85317c62267a6cf74c64d102 /src/moapplication.h
parentd23b38b4dfbc61ffe509dd2627ecbf3589409409 (diff)
parentefdda8e7385446096a1032c2b7c2aeaf57132c78 (diff)
Merge pull request #1284 from isanae/command-line-cleanup
Command line cleanup
Diffstat (limited to 'src/moapplication.h')
-rw-r--r--src/moapplication.h41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/moapplication.h b/src/moapplication.h
index c67c4622..91b8023a 100644
--- a/src/moapplication.h
+++ b/src/moapplication.h
@@ -23,14 +23,26 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QApplication>
#include <QFileSystemWatcher>
+class Settings;
+class MOMultiProcess;
+class Instance;
+class PluginContainer;
+
+namespace MOBase { class IPluginGame; }
+namespace cl { class CommandLine; }
class MOApplication : public QApplication
{
Q_OBJECT
public:
- static MOApplication create(int& argc, char** argv);
- virtual bool notify (QObject* receiver, QEvent* event);
+ MOApplication(cl::CommandLine& cl, int& argc, char** argv);
+
+ // sets up everything, creates the main window and runs it
+ //
+ int run(MOMultiProcess& multiProcess);
+
+ virtual bool notify(QObject* receiver, QEvent* event);
public slots:
bool setStyleFile(const QString& style);
@@ -41,9 +53,32 @@ private slots:
private:
QFileSystemWatcher m_StyleWatcher;
QString m_DefaultStyle;
+ cl::CommandLine& m_cl;
- MOApplication(int& argc, char** argv);
+ int doOneRun(MOMultiProcess& multiProcess);
+
+ std::optional<Instance> getCurrentInstance();
+ std::optional<int> setupInstanceLoop(Instance& currentInstance, PluginContainer& pc);
+ void purgeOldFiles();
+ void resetForRestart();
};
+class MOSplash
+{
+public:
+ MOSplash(
+ const Settings& settings, const QString& dataPath,
+ const MOBase::IPluginGame* game);
+
+ void close();
+
+private:
+ std::unique_ptr<QSplashScreen> ss_;
+
+ QString getSplashPath(
+ const Settings& settings, const QString& dataPath,
+ const MOBase::IPluginGame* game) const;
+};
+
#endif // MOAPPLICATION_H