cmodlistview_moc.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #pragma once
  2. #include "../../Global.h"
  3. #include "../../lib/CConfigHandler.h"
  4. namespace Ui {
  5. class CModListView;
  6. }
  7. class CModManager;
  8. class CModListModel;
  9. class CModFilterModel;
  10. class CDownloadManager;
  11. class QTableWidgetItem;
  12. class CModEntry;
  13. class CModListView : public QWidget
  14. {
  15. Q_OBJECT
  16. CModManager * manager;
  17. CModListModel * modModel;
  18. CModFilterModel * filterModel;
  19. CDownloadManager * dlManager;
  20. SettingsListener settingsListener;
  21. bool repositoriesChanged;
  22. void showEvent(QShowEvent * event);
  23. void keyPressEvent(QKeyEvent * event);
  24. void setupModModel();
  25. void setupFilterModel();
  26. void setupModsView();
  27. void loadRepositories();
  28. void checkManagerErrors();
  29. // find mods unknown to mod list (not present in repo and not installed)
  30. QStringList findInvalidDependencies(QString mod);
  31. // find mods that block enabling of this mod: conflicting with this mod or one of required mods
  32. QStringList findBlockingMods(QString mod);
  33. // find mods that depend on this one
  34. QStringList findDependentMods(QString mod, bool excludeDisabled);
  35. void downloadFile(QString file, QString url, QString description);
  36. void installMods(QStringList archives);
  37. void installFiles(QStringList mods);
  38. QString genChangelogText(CModEntry & mod);
  39. QString genModInfoText(CModEntry & mod);
  40. public:
  41. explicit CModListView(QWidget *parent = 0);
  42. ~CModListView();
  43. void showModInfo();
  44. void hideModInfo();
  45. void loadScreenshots();
  46. void enableModInfo();
  47. void disableModInfo();
  48. void selectMod(const QModelIndex & index);
  49. private slots:
  50. void dataChanged(const QModelIndex & topleft, const QModelIndex & bottomRight);
  51. void modSelected(const QModelIndex & current, const QModelIndex & previous);
  52. void downloadProgress(qint64 current, qint64 max);
  53. void downloadFinished(QStringList savedFiles, QStringList failedFiles, QStringList errors);
  54. void modelReset ();
  55. void hideProgressBar();
  56. void on_hideModInfoButton_clicked();
  57. void on_lineEdit_textChanged(const QString &arg1);
  58. void on_comboBox_currentIndexChanged(int index);
  59. void on_enableButton_clicked();
  60. void on_disableButton_clicked();
  61. void on_updateButton_clicked();
  62. void on_uninstallButton_clicked();
  63. void on_installButton_clicked();
  64. void on_pushButton_clicked();
  65. void on_allModsView_activated(const QModelIndex &index);
  66. void on_tabWidget_currentChanged(int index);
  67. void on_screenshotsList_clicked(const QModelIndex &index);
  68. void on_showInfoButton_clicked();
  69. private:
  70. Ui::CModListView *ui;
  71. };