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