diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-12-31 01:37:50 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-12-31 01:37:50 +0100 |
commit | 4340068a84d1532d9f5ca4de4d12cbf1b7a7bd52 (patch) | |
tree | d19500716c8c4fe9cdec4361ffae47d47f806f0a /application/pages | |
parent | c7032ce68ac3e48c1aace5742cc719e80dbf719b (diff) | |
download | MultiMC-4340068a84d1532d9f5ca4de4d12cbf1b7a7bd52.tar MultiMC-4340068a84d1532d9f5ca4de4d12cbf1b7a7bd52.tar.gz MultiMC-4340068a84d1532d9f5ca4de4d12cbf1b7a7bd52.tar.lz MultiMC-4340068a84d1532d9f5ca4de4d12cbf1b7a7bd52.tar.xz MultiMC-4340068a84d1532d9f5ca4de4d12cbf1b7a7bd52.zip |
NOISSUE add button for creating empty, properly registered, components
Diffstat (limited to 'application/pages')
-rw-r--r-- | application/pages/VersionPage.cpp | 19 | ||||
-rw-r--r-- | application/pages/VersionPage.h | 1 | ||||
-rw-r--r-- | application/pages/VersionPage.ui | 10 |
3 files changed, 30 insertions, 0 deletions
diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index c86e76d5..50cc825f 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -24,6 +24,7 @@ #include "dialogs/CustomMessageBox.h" #include "dialogs/VersionSelectDialog.h" +#include "dialogs/NewComponentDialog.h" #include "dialogs/ModEditDialogCommon.h" #include "dialogs/ProgressDialog.h" @@ -402,6 +403,24 @@ void VersionPage::on_forgeBtn_clicked() } } +void VersionPage::on_addEmptyBtn_clicked() +{ + NewComponentDialog compdialog(QString(), QString(), this); + QStringList blacklist; + for(int i = 0; i < m_profile->rowCount(); i++) + { + auto comp = m_profile->getComponent(i); + blacklist.push_back(comp->getID()); + } + compdialog.setBlacklist(blacklist); + if (compdialog.exec()) + { + qDebug() << "name:" << compdialog.name(); + qDebug() << "uid:" << compdialog.uid(); + m_profile->installEmpty(compdialog.uid(), compdialog.name()); + } +} + void VersionPage::on_liteloaderBtn_clicked() { auto vlist = ENV.metadataIndex()->get("com.mumfrey.liteloader"); diff --git a/application/pages/VersionPage.h b/application/pages/VersionPage.h index b4c18367..d4b65983 100644 --- a/application/pages/VersionPage.h +++ b/application/pages/VersionPage.h @@ -50,6 +50,7 @@ public: private slots: void on_forgeBtn_clicked(); + void on_addEmptyBtn_clicked(); void on_liteloaderBtn_clicked(); void on_reloadBtn_clicked(); void on_removeBtn_clicked(); diff --git a/application/pages/VersionPage.ui b/application/pages/VersionPage.ui index b6da3294..1d2adff7 100644 --- a/application/pages/VersionPage.ui +++ b/application/pages/VersionPage.ui @@ -218,6 +218,13 @@ </widget> </item> <item> + <widget class="QPushButton" name="addEmptyBtn"> + <property name="text"> + <string>Add Empty</string> + </property> + </widget> + </item> + <item> <widget class="QPushButton" name="reloadBtn"> <property name="toolTip"> <string>Reload all packages.</string> @@ -290,7 +297,10 @@ <tabstop>liteloaderBtn</tabstop> <tabstop>modBtn</tabstop> <tabstop>jarmodBtn</tabstop> + <tabstop>jarBtn</tabstop> + <tabstop>addEmptyBtn</tabstop> <tabstop>reloadBtn</tabstop> + <tabstop>tabWidget</tabstop> </tabstops> <resources/> <connections/> |