From 32b3ed0a1362a4b0798ad71fac3450fb77cb7e41 Mon Sep 17 00:00:00 2001 From: Thomas Groman Date: Thu, 19 Sep 2019 00:41:48 -0700 Subject: merged from 0.6.7 codebase --- application/pages/instance/VersionPage.h | 108 ++++++++++++++++--------------- 1 file changed, 56 insertions(+), 52 deletions(-) (limited to 'application/pages/instance/VersionPage.h') diff --git a/application/pages/instance/VersionPage.h b/application/pages/instance/VersionPage.h index 85304ea5..31344eb9 100644 --- a/application/pages/instance/VersionPage.h +++ b/application/pages/instance/VersionPage.h @@ -1,4 +1,4 @@ -/* Copyright 2013-2018 MultiMC Contributors +/* Copyright 2013-2019 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ #pragma once -#include +#include #include "minecraft/MinecraftInstance.h" #include "minecraft/ComponentList.h" @@ -26,70 +26,74 @@ namespace Ui class VersionPage; } -class VersionPage : public QWidget, public BasePage +class VersionPage : public QMainWindow, public BasePage { - Q_OBJECT + Q_OBJECT public: - explicit VersionPage(MinecraftInstance *inst, QWidget *parent = 0); - virtual ~VersionPage(); - virtual QString displayName() const override - { - return tr("Version"); - } - virtual QIcon icon() const override; - virtual QString id() const override - { - return "version"; - } - virtual QString helpPage() const override - { - return "Instance-Version"; - } - virtual bool shouldDisplay() const override; + explicit VersionPage(MinecraftInstance *inst, QWidget *parent = 0); + virtual ~VersionPage(); + virtual QString displayName() const override + { + return tr("Version"); + } + virtual QIcon icon() const override; + virtual QString id() const override + { + return "version"; + } + virtual QString helpPage() const override + { + return "Instance-Version"; + } + virtual bool shouldDisplay() const override; private slots: - void on_forgeBtn_clicked(); - void on_addEmptyBtn_clicked(); - void on_liteloaderBtn_clicked(); - void on_reloadBtn_clicked(); - void on_removeBtn_clicked(); - void on_moveUpBtn_clicked(); - void on_moveDownBtn_clicked(); - void on_jarmodBtn_clicked(); - void on_jarBtn_clicked(); - void on_revertBtn_clicked(); - void on_editBtn_clicked(); - void on_modBtn_clicked(); - void on_customizeBtn_clicked(); - void on_downloadBtn_clicked(); + void on_actionChange_version_triggered(); + void on_actionInstall_Forge_triggered(); + void on_actionInstall_Fabric_triggered(); + void on_actionAdd_Empty_triggered(); + void on_actionInstall_LiteLoader_triggered(); + void on_actionReload_triggered(); + void on_actionRemove_triggered(); + void on_actionMove_up_triggered(); + void on_actionMove_down_triggered(); + void on_actionAdd_to_Minecraft_jar_triggered(); + void on_actionReplace_Minecraft_jar_triggered(); + void on_actionRevert_triggered(); + void on_actionEdit_triggered(); + void on_actionInstall_mods_triggered(); + void on_actionCustomize_triggered(); + void on_actionDownload_triggered(); - void updateVersionControls(); - void disableVersionControls(); - void on_changeVersionBtn_clicked(); + void updateVersionControls(); private: - Component * current(); - int currentRow(); - void updateButtons(int row = -1); - void preselect(int row = 0); - int doUpdate(); + Component * current(); + int currentRow(); + void updateButtons(int row = -1); + void preselect(int row = 0); + int doUpdate(); protected: - /// FIXME: this shouldn't be necessary! - bool reloadComponentList(); + QMenu * createPopupMenu() override; + + /// FIXME: this shouldn't be necessary! + bool reloadComponentList(); private: - Ui::VersionPage *ui; - std::shared_ptr m_profile; - MinecraftInstance *m_inst; - int currentIdx = 0; + Ui::VersionPage *ui; + std::shared_ptr m_profile; + MinecraftInstance *m_inst; + int currentIdx = 0; + bool controlsEnabled = false; public slots: - void versionCurrent(const QModelIndex ¤t, const QModelIndex &previous); + void versionCurrent(const QModelIndex ¤t, const QModelIndex &previous); private slots: - void onGameUpdateError(QString error); - void packageCurrent(const QModelIndex ¤t, const QModelIndex &previous); - + void updateRunningStatus(bool running); + void onGameUpdateError(QString error); + void packageCurrent(const QModelIndex ¤t, const QModelIndex &previous); + void ShowContextMenu(const QPoint &pos); }; -- cgit v1.2.3