summaryrefslogtreecommitdiff
path: root/src/moapplication.h
diff options
context:
space:
mode:
authorQudix <17361645+Qudix@users.noreply.github.com>2020-11-09 13:02:01 -0600
committerQudix <17361645+Qudix@users.noreply.github.com>2020-11-09 13:02:01 -0600
commit0a3bdad8afd18a21a3697804ae344abd09e3712e (patch)
tree0bf234b41dff43cdfe39afea48c7c1d8bdd995c2 /src/moapplication.h
parentb7b843d42badab83b262260035658259f24e4f9a (diff)
parentfef8543a58b4226242ce26c4c8876abaa64394cb (diff)
Merge branch 'master' of https://github.com/ModOrganizer2/modorganizer into master
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