Loading...
Searching...
No Matches
score-plugin-packagemanager/PackageManager/View.hpp
1#pragma once
2#include <Library/LibrarySettings.hpp>
3
4#include <score/application/ApplicationContext.hpp>
5#include <score/plugins/settingsdelegate/SettingsDelegateView.hpp>
6
7#include <QComboBox>
8#include <QGridLayout>
9#include <QLabel>
10#include <QNetworkAccessManager>
11#include <QProgressBar>
12#include <QPushButton>
13#include <QStorageInfo>
14#include <QTabWidget>
15#include <QTableView>
16#include <QWidget>
17
18#include <PackageManager/PluginItemModel.hpp>
19
20#include <verdigris>
21class QObject;
22
23namespace PM
24{
25class PluginSettingsPresenter;
27{
28 W_OBJECT(PluginSettingsView)
29public:
31
32 QTableView* localView() { return m_addonsOnSystem; }
33 QTableView* remoteView() { return m_remoteAddons; }
34
35 QPushButton& installButton() const { return *m_install; }
36
37 QWidget* getWidget() override;
38
39 // From model
40 void on_message(QNetworkReply* rep);
41 void set_info();
42 void show_progress();
43 void update_progress(double);
44 void reset_progress();
45 void progress_from_bytes(qint64 bytesReceived, qint64 bytesTotal);
46 void updateCategoryFilter();
47
48 // To model
49 void refresh() W_SIGNAL(refresh);
50 void requestInformation(QUrl url) W_SIGNAL(requestInformation, url);
51 void installAddon(const Package& addon) W_SIGNAL(installAddon, addon);
52 void installLibrary(const Package& addon) W_SIGNAL(installLibrary, addon);
53 void installSDK() W_SIGNAL(installSDK);
54
55private:
56 PackagesModel* getCurrentModel();
57 int getCurrentRow(const QTableView* t);
58 Package selectedPackage(const PackagesModel* model, int row);
59
60 void openLink();
61 void install();
62 void install_package(const Package& addon);
63 void uninstall();
64 void checkAll();
65 void update();
66 void updateAll();
67 QTableView* getCurrentView();
68 void updateCategoryComboBox();
69 void applyCategoryFilter();
70
71 QWidget* m_widget{new QWidget};
72
73 QTableView* m_addonsOnSystem{new QTableView};
74 QTableView* m_remoteAddons{new QTableView};
75
76 QPushButton* m_link{new QPushButton{tr("Open link")}};
77 QPushButton* m_install{new QPushButton{tr("Install")}};
78 QPushButton* m_uninstall{new QPushButton{tr("Uninstall")}};
79 QPushButton* m_update{new QPushButton{tr("Update")}};
80 QPushButton* m_updateAll{new QPushButton{tr("Update all")}};
81
82 QProgressBar* m_progress{new QProgressBar};
83
84 QStorageInfo storage;
85 QLabel* m_storage{new QLabel};
86 QComboBox* m_categoryComboBox = nullptr;
87};
88
89}
Definition PluginItemModel.hpp:51
Definition score-plugin-packagemanager/PackageManager/View.hpp:27
Definition SettingsDelegateView.hpp:18
Definition PluginItemModel.hpp:24