diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-06-10 00:46:05 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-06-10 00:46:05 +0200 |
commit | 9ec6deea848f8cdbebeb5c6be8b042c754ad9de7 (patch) | |
tree | fe6f72f3575ae9eb03cdb859e0d747e0fadd245c /gui/pages | |
parent | 0bccc94471d0223cf493ad860fa890614480433d (diff) | |
download | MultiMC-9ec6deea848f8cdbebeb5c6be8b042c754ad9de7.tar MultiMC-9ec6deea848f8cdbebeb5c6be8b042c754ad9de7.tar.gz MultiMC-9ec6deea848f8cdbebeb5c6be8b042c754ad9de7.tar.lz MultiMC-9ec6deea848f8cdbebeb5c6be8b042c754ad9de7.tar.xz MultiMC-9ec6deea848f8cdbebeb5c6be8b042c754ad9de7.zip |
Add close button to page dialog. Add help button to page dialog.
Smile.
Diffstat (limited to 'gui/pages')
-rw-r--r-- | gui/pages/BasePage.h | 12 | ||||
-rw-r--r-- | gui/pages/InstanceSettingsPage.cpp | 5 | ||||
-rw-r--r-- | gui/pages/InstanceSettingsPage.h | 2 | ||||
-rw-r--r-- | gui/pages/InstanceSettingsPage.ui | 12 | ||||
-rw-r--r-- | gui/pages/LegacyJarModPage.h | 1 | ||||
-rw-r--r-- | gui/pages/LegacyUpgradePage.h | 1 | ||||
-rw-r--r-- | gui/pages/ModFolderPage.cpp | 3 | ||||
-rw-r--r-- | gui/pages/ModFolderPage.h | 5 | ||||
-rw-r--r-- | gui/pages/ResourcePackPage.h | 3 | ||||
-rw-r--r-- | gui/pages/TexturePackPage.h | 2 | ||||
-rw-r--r-- | gui/pages/VersionPage.h | 1 |
11 files changed, 16 insertions, 31 deletions
diff --git a/gui/pages/BasePage.h b/gui/pages/BasePage.h index feb19a79..93ce3f35 100644 --- a/gui/pages/BasePage.h +++ b/gui/pages/BasePage.h @@ -25,14 +25,6 @@ public: virtual QString id() = 0; virtual QString displayName() = 0; virtual QIcon icon() = 0; - virtual bool accept() - { - return true; - } - virtual bool reject() - { - return true; - } virtual bool apply() { return true; @@ -41,6 +33,10 @@ public: { return true; } + virtual QString helpPage() + { + return QString(); + } int stackIndex = -1; int listIndex = -1; }; diff --git a/gui/pages/InstanceSettingsPage.cpp b/gui/pages/InstanceSettingsPage.cpp index 0bcfc7f2..b4a6405f 100644 --- a/gui/pages/InstanceSettingsPage.cpp +++ b/gui/pages/InstanceSettingsPage.cpp @@ -28,10 +28,6 @@ InstanceSettingsPage::InstanceSettingsPage(SettingsObject *s, QWidget *parent) { ui->setupUi(this); loadSettings(); - connect(ui->buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked(bool)), this, - SLOT(applySettings())); - connect(ui->buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked(bool)), this, - SLOT(loadSettings())); } InstanceSettingsPage::~InstanceSettingsPage() @@ -42,7 +38,6 @@ InstanceSettingsPage::~InstanceSettingsPage() bool InstanceSettingsPage::apply() { applySettings(); - loadSettings(); return true; } diff --git a/gui/pages/InstanceSettingsPage.h b/gui/pages/InstanceSettingsPage.h index 7b736b0b..583cab0e 100644 --- a/gui/pages/InstanceSettingsPage.h +++ b/gui/pages/InstanceSettingsPage.h @@ -38,7 +38,7 @@ public: virtual QIcon icon() override; virtual QString id() override; virtual bool apply(); - + virtual QString helpPage() override { return "InstanceSettingsPage"; }; private: void updateCheckboxStuff(); private slots: diff --git a/gui/pages/InstanceSettingsPage.ui b/gui/pages/InstanceSettingsPage.ui index 3c76d94b..b8af6c60 100644 --- a/gui/pages/InstanceSettingsPage.ui +++ b/gui/pages/InstanceSettingsPage.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>458</width> - <height>476</height> + <height>426</height> </rect> </property> <property name="windowTitle"> @@ -425,16 +425,6 @@ </widget> </widget> </item> - <item> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Apply|QDialogButtonBox::Reset</set> - </property> - </widget> - </item> </layout> </widget> <resources/> diff --git a/gui/pages/LegacyJarModPage.h b/gui/pages/LegacyJarModPage.h index a2a7f74e..5bbd7cde 100644 --- a/gui/pages/LegacyJarModPage.h +++ b/gui/pages/LegacyJarModPage.h @@ -37,6 +37,7 @@ public: virtual QString displayName(); virtual QIcon icon(); virtual QString id(); + virtual QString helpPage() override { return "LegacyJarModPage"; }; private slots: diff --git a/gui/pages/LegacyUpgradePage.h b/gui/pages/LegacyUpgradePage.h index 549c8bf3..7f533310 100644 --- a/gui/pages/LegacyUpgradePage.h +++ b/gui/pages/LegacyUpgradePage.h @@ -36,6 +36,7 @@ public: virtual QString displayName() override; virtual QIcon icon() override; virtual QString id() override; + virtual QString helpPage() override { return "LegacyUpgradePage"; }; private slots: void on_upgradeButton_clicked(); diff --git a/gui/pages/ModFolderPage.cpp b/gui/pages/ModFolderPage.cpp index de51edfa..6d5c6226 100644 --- a/gui/pages/ModFolderPage.cpp +++ b/gui/pages/ModFolderPage.cpp @@ -49,7 +49,7 @@ QString ModFolderPage::id() } ModFolderPage::ModFolderPage(std::shared_ptr<ModList> mods, QString id, QString iconName, - QString displayName, QWidget *parent) + QString displayName, QString helpPage, QWidget *parent) : QWidget(parent), ui(new Ui::ModFolderPage) { ui->setupUi(this); @@ -57,6 +57,7 @@ ModFolderPage::ModFolderPage(std::shared_ptr<ModList> mods, QString id, QString m_id = id; m_displayName = displayName; m_iconName = iconName; + m_helpName = helpPage; ui->modTreeView->setModel(m_mods.get()); ui->modTreeView->installEventFilter(this); m_mods->startWatching(); diff --git a/gui/pages/ModFolderPage.h b/gui/pages/ModFolderPage.h index 276e23d5..b4e05928 100644 --- a/gui/pages/ModFolderPage.h +++ b/gui/pages/ModFolderPage.h @@ -33,12 +33,12 @@ class ModFolderPage : public QWidget, public BasePage public: explicit ModFolderPage(std::shared_ptr<ModList> mods, QString id, QString iconName, - QString displayName, QWidget *parent = 0); + QString displayName, QString helpPage = "" , QWidget *parent = 0); virtual ~ModFolderPage(); virtual QString displayName() override; virtual QIcon icon() override; virtual QString id() override; - + virtual QString helpPage() override { return m_helpName; }; protected: bool eventFilter(QObject *obj, QEvent *ev); bool modListFilter(QKeyEvent *ev); @@ -49,6 +49,7 @@ private: QString m_iconName; QString m_id; QString m_displayName; + QString m_helpName; public slots: void modCurrent(const QModelIndex ¤t, const QModelIndex &previous); diff --git a/gui/pages/ResourcePackPage.h b/gui/pages/ResourcePackPage.h index 14321b9b..0c239bf1 100644 --- a/gui/pages/ResourcePackPage.h +++ b/gui/pages/ResourcePackPage.h @@ -6,7 +6,7 @@ class ResourcePackPage : public ModFolderPage public: explicit ResourcePackPage(BaseInstance *instance, QWidget *parent = 0) : ModFolderPage(instance->texturePackList(), "resourcepacks", "resourcepacks", - tr("Resource packs"), parent) + tr("Resource packs"), "TexturePacksPage", parent) { m_inst = instance; } @@ -17,7 +17,6 @@ public: return !m_inst->traits().contains("no-texturepacks") && !m_inst->traits().contains("texturepacks"); } - private: BaseInstance *m_inst; }; diff --git a/gui/pages/TexturePackPage.h b/gui/pages/TexturePackPage.h index ddb1fa49..f807bea5 100644 --- a/gui/pages/TexturePackPage.h +++ b/gui/pages/TexturePackPage.h @@ -6,7 +6,7 @@ class TexturePackPage : public ModFolderPage public: explicit TexturePackPage(BaseInstance *instance, QWidget *parent = 0) : ModFolderPage(instance->texturePackList(), "texturepacks", "resourcepacks", - tr("Texture packs"), parent) + tr("Texture packs"), "ResourcePacksPage", parent) { m_inst = instance; } diff --git a/gui/pages/VersionPage.h b/gui/pages/VersionPage.h index 55e244b3..be271074 100644 --- a/gui/pages/VersionPage.h +++ b/gui/pages/VersionPage.h @@ -36,6 +36,7 @@ public: virtual QString displayName() override; virtual QIcon icon() override; virtual QString id() override; + virtual QString helpPage() override { return "VersionPage"; }; private slots: |