2013-08-22 17:22:49 +03:00
|
|
|
#pragma once
|
|
|
|
|
2013-09-02 20:26:52 +03:00
|
|
|
#include "../../Global.h"
|
2013-08-24 23:11:51 +03:00
|
|
|
#include "../../lib/CConfigHandler.h"
|
|
|
|
|
2013-08-22 17:22:49 +03:00
|
|
|
namespace Ui {
|
|
|
|
class CModListView;
|
|
|
|
}
|
|
|
|
|
|
|
|
class CModManager;
|
|
|
|
class CModListModel;
|
|
|
|
class CModFilterModel;
|
|
|
|
class CDownloadManager;
|
|
|
|
class QTableWidgetItem;
|
|
|
|
|
|
|
|
class CModEntry;
|
|
|
|
|
|
|
|
class CModListView : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
CModManager * manager;
|
|
|
|
CModListModel * modModel;
|
|
|
|
CModFilterModel * filterModel;
|
|
|
|
CDownloadManager * dlManager;
|
|
|
|
|
2013-08-24 23:11:51 +03:00
|
|
|
SettingsListener settingsListener;
|
|
|
|
bool repositoriesChanged;
|
|
|
|
|
|
|
|
void showEvent(QShowEvent * event);
|
|
|
|
|
2013-08-22 17:22:49 +03:00
|
|
|
void keyPressEvent(QKeyEvent * event);
|
|
|
|
|
|
|
|
void setupModModel();
|
|
|
|
void setupFilterModel();
|
|
|
|
void setupModsView();
|
2013-08-24 23:11:51 +03:00
|
|
|
void loadRepositories();
|
2013-08-22 17:22:49 +03:00
|
|
|
|
2013-09-06 00:25:03 +03:00
|
|
|
void checkManagerErrors();
|
|
|
|
|
2013-08-22 17:22:49 +03:00
|
|
|
// find mods unknown to mod list (not present in repo and not installed)
|
|
|
|
QStringList findInvalidDependencies(QString mod);
|
|
|
|
// find mods that block enabling of this mod: conflicting with this mod or one of required mods
|
|
|
|
QStringList findBlockingMods(QString mod);
|
|
|
|
// find mods that depend on this one
|
|
|
|
QStringList findDependentMods(QString mod, bool excludeDisabled);
|
|
|
|
|
|
|
|
void downloadFile(QString file, QString url, QString description);
|
|
|
|
|
|
|
|
void installMods(QStringList archives);
|
|
|
|
void installFiles(QStringList mods);
|
|
|
|
|
2014-03-23 15:08:01 +03:00
|
|
|
QString genChangelogText(CModEntry & mod);
|
2013-08-22 17:22:49 +03:00
|
|
|
QString genModInfoText(CModEntry & mod);
|
|
|
|
public:
|
|
|
|
explicit CModListView(QWidget *parent = 0);
|
|
|
|
~CModListView();
|
|
|
|
|
|
|
|
void showModInfo();
|
|
|
|
void hideModInfo();
|
2014-03-23 15:08:01 +03:00
|
|
|
void loadScreenshots();
|
2013-08-22 17:22:49 +03:00
|
|
|
|
|
|
|
void enableModInfo();
|
|
|
|
void disableModInfo();
|
|
|
|
|
2014-03-20 20:06:25 +03:00
|
|
|
void selectMod(const QModelIndex & index);
|
2013-08-22 17:22:49 +03:00
|
|
|
|
|
|
|
private slots:
|
2014-03-20 20:06:25 +03:00
|
|
|
void dataChanged(const QModelIndex & topleft, const QModelIndex & bottomRight);
|
2013-08-22 17:22:49 +03:00
|
|
|
void modSelected(const QModelIndex & current, const QModelIndex & previous);
|
|
|
|
void downloadProgress(qint64 current, qint64 max);
|
|
|
|
void downloadFinished(QStringList savedFiles, QStringList failedFiles, QStringList errors);
|
|
|
|
void modelReset ();
|
|
|
|
void hideProgressBar();
|
|
|
|
|
|
|
|
void on_hideModInfoButton_clicked();
|
|
|
|
|
|
|
|
void on_lineEdit_textChanged(const QString &arg1);
|
|
|
|
|
|
|
|
void on_comboBox_currentIndexChanged(int index);
|
|
|
|
|
|
|
|
void on_enableButton_clicked();
|
|
|
|
|
|
|
|
void on_disableButton_clicked();
|
|
|
|
|
|
|
|
void on_updateButton_clicked();
|
|
|
|
|
|
|
|
void on_uninstallButton_clicked();
|
|
|
|
|
|
|
|
void on_installButton_clicked();
|
|
|
|
|
|
|
|
void on_pushButton_clicked();
|
|
|
|
|
2014-11-03 17:47:37 +02:00
|
|
|
void on_refreshButton_clicked();
|
|
|
|
|
2014-03-20 20:06:25 +03:00
|
|
|
void on_allModsView_activated(const QModelIndex &index);
|
|
|
|
|
2014-03-23 15:08:01 +03:00
|
|
|
void on_tabWidget_currentChanged(int index);
|
|
|
|
|
|
|
|
void on_screenshotsList_clicked(const QModelIndex &index);
|
|
|
|
|
2014-08-04 14:03:57 +03:00
|
|
|
void on_showInfoButton_clicked();
|
|
|
|
|
2013-08-22 17:22:49 +03:00
|
|
|
private:
|
|
|
|
Ui::CModListView *ui;
|
|
|
|
};
|