cmodlistview_moc.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 genModInfoText(CModEntry & mod);
  39. public:
  40. explicit CModListView(QWidget *parent = 0);
  41. ~CModListView();
  42. void showModInfo();
  43. void hideModInfo();
  44. void enableModInfo();
  45. void disableModInfo();
  46. void selectMod(int index);
  47. private slots:
  48. void modSelected(const QModelIndex & current, const QModelIndex & previous);
  49. void downloadProgress(qint64 current, qint64 max);
  50. void downloadFinished(QStringList savedFiles, QStringList failedFiles, QStringList errors);
  51. void modelReset ();
  52. void hideProgressBar();
  53. void on_hideModInfoButton_clicked();
  54. void on_allModsView_doubleClicked(const QModelIndex &index);
  55. void on_lineEdit_textChanged(const QString &arg1);
  56. void on_comboBox_currentIndexChanged(int index);
  57. void on_enableButton_clicked();
  58. void on_disableButton_clicked();
  59. void on_updateButton_clicked();
  60. void on_uninstallButton_clicked();
  61. void on_installButton_clicked();
  62. void on_pushButton_clicked();
  63. private:
  64. Ui::CModListView *ui;
  65. };