diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-03-12 16:00:06 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:20:01 +0200 |
commit | 8321187a20eec9871f327aa23f421e79dcfdd409 (patch) | |
tree | c765e3acdf9f01c27563e84d1fd4f27696a5996a /application | |
parent | ab868df50eb6f9f3958bdc0a7ab9199dcdf46b3c (diff) | |
download | MultiMC-8321187a20eec9871f327aa23f421e79dcfdd409.tar MultiMC-8321187a20eec9871f327aa23f421e79dcfdd409.tar.gz MultiMC-8321187a20eec9871f327aa23f421e79dcfdd409.tar.lz MultiMC-8321187a20eec9871f327aa23f421e79dcfdd409.tar.xz MultiMC-8321187a20eec9871f327aa23f421e79dcfdd409.zip |
NOISSUE fix downloading of metadata files
Diffstat (limited to 'application')
-rw-r--r-- | application/CMakeLists.txt | 6 | ||||
-rw-r--r-- | application/MultiMC.cpp | 2 | ||||
-rw-r--r-- | application/VersionProxyModel.cpp | 2 | ||||
-rw-r--r-- | application/pages/global/PackagesPage.cpp (renamed from application/pages/global/MetadataPage.cpp) | 42 | ||||
-rw-r--r-- | application/pages/global/PackagesPage.h (renamed from application/pages/global/MetadataPage.h) | 14 | ||||
-rw-r--r-- | application/pages/global/PackagesPage.ui (renamed from application/pages/global/MetadataPage.ui) | 12 |
6 files changed, 40 insertions, 38 deletions
diff --git a/application/CMakeLists.txt b/application/CMakeLists.txt index 55457b1c..1b6ff3fd 100644 --- a/application/CMakeLists.txt +++ b/application/CMakeLists.txt @@ -184,8 +184,8 @@ SET(MULTIMC_SOURCES pages/global/ProxyPage.h pages/global/PasteEEPage.cpp pages/global/PasteEEPage.h - pages/global/MetadataPage.cpp - pages/global/MetadataPage.h + pages/global/PackagesPage.cpp + pages/global/PackagesPage.h # GUI - dialogs dialogs/AboutDialog.cpp @@ -284,7 +284,7 @@ SET(MULTIMC_UIS pages/global/MultiMCPage.ui pages/global/ProxyPage.ui pages/global/PasteEEPage.ui - pages/global/MetadataPage.ui + pages/global/PackagesPage.ui # Dialogs dialogs/CopyInstanceDialog.ui diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp index 081de41c..3a91fb5f 100644 --- a/application/MultiMC.cpp +++ b/application/MultiMC.cpp @@ -10,6 +10,7 @@ #include "pages/global/ExternalToolsPage.h" #include "pages/global/AccountListPage.h" #include "pages/global/PasteEEPage.h" +#include "pages/global/PackagesPage.h" #include "themes/ITheme.h" #include "themes/SystemTheme.h" @@ -842,6 +843,7 @@ void MultiMC::initGlobalSettings() m_globalSettingsProvider->addPage<MinecraftPage>(); m_globalSettingsProvider->addPage<JavaPage>(); m_globalSettingsProvider->addPage<ProxyPage>(); + m_globalSettingsProvider->addPage<PackagesPage>(); m_globalSettingsProvider->addPage<ExternalToolsPage>(); m_globalSettingsProvider->addPage<AccountListPage>(); m_globalSettingsProvider->addPage<PasteEEPage>(); diff --git a/application/VersionProxyModel.cpp b/application/VersionProxyModel.cpp index 22df7e09..50b94d9e 100644 --- a/application/VersionProxyModel.cpp +++ b/application/VersionProxyModel.cpp @@ -313,9 +313,9 @@ void VersionProxyModel::setSourceModel(QAbstractItemModel *replacingRaw) auto replacing = dynamic_cast<BaseVersionList *>(replacingRaw); beginResetModel(); + m_columns.clear(); if(!replacing) { - m_columns.clear(); roles.clear(); filterModel->setSourceModel(replacing); return; diff --git a/application/pages/global/MetadataPage.cpp b/application/pages/global/PackagesPage.cpp index 4e355997..52efaf9a 100644 --- a/application/pages/global/MetadataPage.cpp +++ b/application/pages/global/PackagesPage.cpp @@ -13,8 +13,8 @@ * limitations under the License. */ -#include "MetadataPage.h" -#include "ui_MetadataPage.h" +#include "PackagesPage.h" +#include "ui_PackagesPage.h" #include <QDateTime> #include <QSortFilterProxyModel> @@ -49,9 +49,9 @@ static QString formatRequires(const VersionPtr &version) return lines.join('\n'); } -MetadataPage::MetadataPage(QWidget *parent) : +PackagesPage::PackagesPage(QWidget *parent) : QWidget(parent), - ui(new Ui::MetadataPage) + ui(new Ui::PackagesPage) { ui->setupUi(this); ui->tabWidget->tabBar()->hide(); @@ -77,29 +77,29 @@ MetadataPage::MetadataPage(QWidget *parent) : m_versionProxy = new VersionProxyModel(this); m_filterProxy->setSourceModel(m_versionProxy); - connect(ui->indexView->selectionModel(), &QItemSelectionModel::currentChanged, this, &MetadataPage::updateCurrentVersionList); - connect(ui->versionsView->selectionModel(), &QItemSelectionModel::currentChanged, this, &MetadataPage::updateVersion); - connect(m_filterProxy, &QSortFilterProxyModel::dataChanged, this, &MetadataPage::versionListDataChanged); + connect(ui->indexView->selectionModel(), &QItemSelectionModel::currentChanged, this, &PackagesPage::updateCurrentVersionList); + connect(ui->versionsView->selectionModel(), &QItemSelectionModel::currentChanged, this, &PackagesPage::updateVersion); + connect(m_filterProxy, &QSortFilterProxyModel::dataChanged, this, &PackagesPage::versionListDataChanged); updateCurrentVersionList(QModelIndex()); updateVersion(); } -MetadataPage::~MetadataPage() +PackagesPage::~PackagesPage() { delete ui; } -QIcon MetadataPage::icon() const +QIcon PackagesPage::icon() const { - return MMC->getThemedIcon("looney"); + return MMC->getThemedIcon("packages"); } -void MetadataPage::on_refreshIndexBtn_clicked() +void PackagesPage::on_refreshIndexBtn_clicked() { ProgressDialog(this).execWithTask(ENV.metadataIndex()->remoteUpdateTask()); } -void MetadataPage::on_refreshFileBtn_clicked() +void PackagesPage::on_refreshFileBtn_clicked() { VersionListPtr list = ui->indexView->currentIndex().data(Index::ListPtrRole).value<VersionListPtr>(); if (!list) @@ -108,7 +108,7 @@ void MetadataPage::on_refreshFileBtn_clicked() } ProgressDialog(this).execWithTask(list->remoteUpdateTask()); } -void MetadataPage::on_refreshVersionBtn_clicked() +void PackagesPage::on_refreshVersionBtn_clicked() { VersionPtr version = ui->versionsView->currentIndex().data(VersionList::VersionPtrRole).value<VersionPtr>(); if (!version) @@ -118,7 +118,7 @@ void MetadataPage::on_refreshVersionBtn_clicked() ProgressDialog(this).execWithTask(version->remoteUpdateTask()); } -void MetadataPage::on_fileSearchEdit_textChanged(const QString &search) +void PackagesPage::on_fileSearchEdit_textChanged(const QString &search) { if (search.isEmpty()) { @@ -131,7 +131,7 @@ void MetadataPage::on_fileSearchEdit_textChanged(const QString &search) m_fileProxy->setFilterRegExp(".*" + parts.join(".*") + ".*"); } } -void MetadataPage::on_versionSearchEdit_textChanged(const QString &search) +void PackagesPage::on_versionSearchEdit_textChanged(const QString &search) { if (search.isEmpty()) { @@ -145,7 +145,7 @@ void MetadataPage::on_versionSearchEdit_textChanged(const QString &search) } } -void MetadataPage::updateCurrentVersionList(const QModelIndex &index) +void PackagesPage::updateCurrentVersionList(const QModelIndex &index) { if (index.isValid()) { @@ -181,11 +181,11 @@ void MetadataPage::updateCurrentVersionList(const QModelIndex &index) ui->fileNameLabel->setEnabled(false); ui->fileName->clear(); m_versionProxy->setSourceModel(nullptr); - ui->refreshFileBtn->setText(tr("Refresh ___")); + ui->refreshFileBtn->setText(tr("Refresh")); } } -void MetadataPage::versionListDataChanged(const QModelIndex &tl, const QModelIndex &br) +void PackagesPage::versionListDataChanged(const QModelIndex &tl, const QModelIndex &br) { if (QItemSelection(tl, br).contains(ui->versionsView->currentIndex())) { @@ -193,7 +193,7 @@ void MetadataPage::versionListDataChanged(const QModelIndex &tl, const QModelInd } } -void MetadataPage::updateVersion() +void PackagesPage::updateVersion() { VersionPtr version = std::dynamic_pointer_cast<Version>( ui->versionsView->currentIndex().data(VersionList::VersionPointerRole).value<BaseVersionPtr>()); @@ -221,11 +221,11 @@ void MetadataPage::updateVersion() ui->versionType->clear(); ui->versionRequiresLabel->setEnabled(false); ui->versionRequires->clear(); - ui->refreshVersionBtn->setText(tr("Refresh ___")); + ui->refreshVersionBtn->setText(tr("Refresh")); } } -void MetadataPage::opened() +void PackagesPage::opened() { if (!ENV.metadataIndex()->isLocalLoaded()) { diff --git a/application/pages/global/MetadataPage.h b/application/pages/global/PackagesPage.h index f75b4952..80c2886d 100644 --- a/application/pages/global/MetadataPage.h +++ b/application/pages/global/PackagesPage.h @@ -20,21 +20,21 @@ #include "pages/BasePage.h" namespace Ui { -class MetadataPage; +class PackagesPage; } class QSortFilterProxyModel; class VersionProxyModel; -class MetadataPage : public QWidget, public BasePage +class PackagesPage : public QWidget, public BasePage { Q_OBJECT public: - explicit MetadataPage(QWidget *parent = 0); - ~MetadataPage(); + explicit PackagesPage(QWidget *parent = 0); + ~PackagesPage(); - QString id() const override { return "metadata-global"; } - QString displayName() const override { return tr("Metadata"); } + QString id() const override { return "packages-global"; } + QString displayName() const override { return tr("Packages"); } QIcon icon() const override; void opened() override; @@ -48,7 +48,7 @@ private slots: void versionListDataChanged(const QModelIndex &tl, const QModelIndex &br); private: - Ui::MetadataPage *ui; + Ui::PackagesPage *ui; QSortFilterProxyModel *m_fileProxy; QSortFilterProxyModel *m_filterProxy; VersionProxyModel *m_versionProxy; diff --git a/application/pages/global/MetadataPage.ui b/application/pages/global/PackagesPage.ui index 0bd33f32..158bf1b4 100644 --- a/application/pages/global/MetadataPage.ui +++ b/application/pages/global/PackagesPage.ui @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>MetadataPage</class> - <widget class="QWidget" name="MetadataPage"> + <class>PackagesPage</class> + <widget class="QWidget" name="PackagesPage"> <property name="geometry"> <rect> <x>0</x> <y>0</y> - <width>640</width> - <height>480</height> + <width>636</width> + <height>621</height> </rect> </property> <property name="windowTitle"> @@ -67,7 +67,7 @@ <item> <widget class="QPushButton" name="refreshVersionBtn"> <property name="text"> - <string>Refresh ___</string> + <string>Refresh</string> </property> </widget> </item> @@ -180,7 +180,7 @@ <item> <widget class="QPushButton" name="refreshFileBtn"> <property name="text"> - <string>Refresh ___</string> + <string>Refresh</string> </property> </widget> </item> |