add some more box settings
This commit is contained in:
parent
91b6a6141d
commit
2278be6c4a
@ -1 +1 @@
|
|||||||
Subproject commit 2990b858e6334fae4dd37a77c770336bd6e1b2d9
|
Subproject commit 09116a9bf84082688e9f2cd24cfd08788c71650c
|
||||||
@ -103,14 +103,14 @@ void BasicConfiguration::setTcpServerConfiguration(ServerConfiguration *configur
|
|||||||
m_client->sendCommand("Configuration.SetTcpServerConfiguration", params);
|
m_client->sendCommand("Configuration.SetTcpServerConfiguration", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasicConfiguration::deleteTcpServerConfiguration(const QString &id) const
|
void BasicConfiguration::deleteTcpServerConfiguration(const QString &id)
|
||||||
{
|
{
|
||||||
QVariantMap params;
|
QVariantMap params;
|
||||||
params.insert("id", id);
|
params.insert("id", id);
|
||||||
m_client->sendCommand("Configuration.DeleteTcpServerConfiguration", params, this, "deleteTcpConfigReply");
|
m_client->sendCommand("Configuration.DeleteTcpServerConfiguration", params, this, "deleteTcpConfigReply");
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasicConfiguration::deleteWebsocketServerConfiguration(const QString &id) const
|
void BasicConfiguration::deleteWebsocketServerConfiguration(const QString &id)
|
||||||
{
|
{
|
||||||
QVariantMap params;
|
QVariantMap params;
|
||||||
params.insert("id", id);
|
params.insert("id", id);
|
||||||
@ -205,6 +205,11 @@ void BasicConfiguration::deleteTcpConfigReply(const QVariantMap ¶ms)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BasicConfiguration::deleteWebSocketConfigReply(const QVariantMap ¶ms)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void BasicConfiguration::notificationReceived(const QVariantMap ¬ification)
|
void BasicConfiguration::notificationReceived(const QVariantMap ¬ification)
|
||||||
{
|
{
|
||||||
QString notif = notification.value("notification").toString();
|
QString notif = notification.value("notification").toString();
|
||||||
|
|||||||
@ -53,8 +53,8 @@ public:
|
|||||||
void setTcpServerConfiguration(ServerConfiguration *configuration) const;
|
void setTcpServerConfiguration(ServerConfiguration *configuration) const;
|
||||||
void setWebsocketServerConfiguration(ServerConfiguration *configuration) const;
|
void setWebsocketServerConfiguration(ServerConfiguration *configuration) const;
|
||||||
|
|
||||||
Q_INVOKABLE void deleteTcpServerConfiguration(const QString &id) const;
|
Q_INVOKABLE void deleteTcpServerConfiguration(const QString &id);
|
||||||
Q_INVOKABLE void deleteWebsocketServerConfiguration(const QString &id) const;
|
Q_INVOKABLE void deleteWebsocketServerConfiguration(const QString &id);
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
|
|||||||
@ -37,14 +37,38 @@ void PluginsProxy::setPlugins(Plugins *plugins)
|
|||||||
{
|
{
|
||||||
m_plugins = plugins;
|
m_plugins = plugins;
|
||||||
setSourceModel(plugins);
|
setSourceModel(plugins);
|
||||||
|
setSortRole(Plugins::NameRole);
|
||||||
sort(0);
|
sort(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PluginsProxy::lessThan(const QModelIndex &left, const QModelIndex &right) const
|
bool PluginsProxy::showOnlyConfigurable() const
|
||||||
{
|
{
|
||||||
QVariant leftName = sourceModel()->data(left);
|
return m_showOnlyConfigurable;
|
||||||
QVariant rightName = sourceModel()->data(right);
|
|
||||||
|
|
||||||
return QString::localeAwareCompare(leftName.toString(), rightName.toString()) < 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PluginsProxy::setShowOnlyConfigurable(bool showOnlyConfigurable)
|
||||||
|
{
|
||||||
|
if (m_showOnlyConfigurable != showOnlyConfigurable) {
|
||||||
|
m_showOnlyConfigurable = showOnlyConfigurable;
|
||||||
|
emit showOnlyConfigurableChanged();
|
||||||
|
invalidateFilter();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin *PluginsProxy::get(int index) const
|
||||||
|
{
|
||||||
|
return m_plugins->get(mapToSource(this->index(index, 0)).row());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PluginsProxy::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(source_parent)
|
||||||
|
|
||||||
|
Plugin *plugin = m_plugins->get(source_row);
|
||||||
|
if (m_showOnlyConfigurable) {
|
||||||
|
if (plugin->paramTypes()->rowCount() == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|||||||
@ -31,19 +31,28 @@
|
|||||||
class PluginsProxy : public QSortFilterProxyModel
|
class PluginsProxy : public QSortFilterProxyModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(Plugins* plugins READ plugins WRITE setPlugins NOTIFY pluginsChanged)
|
||||||
|
Q_PROPERTY(bool showOnlyConfigurable READ showOnlyConfigurable WRITE setShowOnlyConfigurable NOTIFY showOnlyConfigurableChanged)
|
||||||
public:
|
public:
|
||||||
explicit PluginsProxy(QObject *parent = 0);
|
explicit PluginsProxy(QObject *parent = nullptr);
|
||||||
|
|
||||||
Plugins *plugins();
|
Plugins *plugins();
|
||||||
void setPlugins(Plugins *plugins);
|
void setPlugins(Plugins *plugins);
|
||||||
|
|
||||||
private:
|
bool showOnlyConfigurable() const;
|
||||||
Plugins *m_plugins;
|
void setShowOnlyConfigurable(bool showOnlyConfigurable);
|
||||||
|
|
||||||
|
Q_INVOKABLE Plugin* get(int index) const;
|
||||||
protected:
|
protected:
|
||||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE;
|
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void pluginsChanged();
|
||||||
|
void showOnlyConfigurableChanged();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Plugins *m_plugins = nullptr;
|
||||||
|
bool m_showOnlyConfigurable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PLUGINSPROXY_H
|
#endif // PLUGINSPROXY_H
|
||||||
|
|||||||
@ -138,13 +138,6 @@ Page {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MeaListItemDelegate {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
iconName: "../images/network-vpn.svg"
|
|
||||||
text: qsTr("Server interfaces")
|
|
||||||
onClicked: pageStack.push(Qt.resolvedUrl("system/ConnectionInterfacesPage.qml"))
|
|
||||||
}
|
|
||||||
|
|
||||||
MeaListItemDelegate {
|
MeaListItemDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
iconName: "../images/cloud.svg"
|
iconName: "../images/cloud.svg"
|
||||||
@ -152,24 +145,28 @@ Page {
|
|||||||
visible: engine.jsonRpcClient.ensureServerVersion("1.9")
|
visible: engine.jsonRpcClient.ensureServerVersion("1.9")
|
||||||
onClicked: pageStack.push(Qt.resolvedUrl("system/CloudSettingsPage.qml"))
|
onClicked: pageStack.push(Qt.resolvedUrl("system/CloudSettingsPage.qml"))
|
||||||
}
|
}
|
||||||
|
|
||||||
MeaListItemDelegate {
|
MeaListItemDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
iconName: "../images/plugin.svg"
|
iconName: "../images/plugin.svg"
|
||||||
text: qsTr("Plugins")
|
text: qsTr("Plugins")
|
||||||
onClicked:pageStack.push(Qt.resolvedUrl("system/PluginsPage.qml"))
|
onClicked:pageStack.push(Qt.resolvedUrl("system/PluginsPage.qml"))
|
||||||
}
|
}
|
||||||
|
|
||||||
MeaListItemDelegate {
|
MeaListItemDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
iconName: "../images/logs.svg"
|
iconName: "../images/logs.svg"
|
||||||
text: qsTr("Log viewer")
|
text: qsTr("Log viewer")
|
||||||
onClicked: pageStack.push(Qt.resolvedUrl("system/LogViewerPage.qml"))
|
onClicked: pageStack.push(Qt.resolvedUrl("system/LogViewerPage.qml"))
|
||||||
}
|
}
|
||||||
|
MeaListItemDelegate {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
iconName: "../images/network-vpn.svg"
|
||||||
|
text: qsTr("Server interfaces")
|
||||||
|
onClicked: pageStack.push(Qt.resolvedUrl("system/ConnectionInterfacesPage.qml"))
|
||||||
|
}
|
||||||
MeaListItemDelegate {
|
MeaListItemDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
iconName: "../images/info.svg"
|
iconName: "../images/info.svg"
|
||||||
text: qsTr("About nymea")
|
text: qsTr("About %1:core").arg(app.systemName)
|
||||||
onClicked: pageStack.push(Qt.resolvedUrl("system/AboutNymeaPage.qml"))
|
onClicked: pageStack.push(Qt.resolvedUrl("system/AboutNymeaPage.qml"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ MeaListItemDelegate {
|
|||||||
text: model.address
|
text: model.address
|
||||||
subText: model.port
|
subText: model.port
|
||||||
iconName: "../images/network-wifi-symbolic.svg"
|
iconName: "../images/network-wifi-symbolic.svg"
|
||||||
|
progressive: false
|
||||||
iconColor: {
|
iconColor: {
|
||||||
if ((engine.connection.hostAddress === model.address || model.address === "0.0.0.0")
|
if ((engine.connection.hostAddress === model.address || model.address === "0.0.0.0")
|
||||||
&& engine.connection.port === model.port) {
|
&& engine.connection.port === model.port) {
|
||||||
@ -21,5 +22,5 @@ MeaListItemDelegate {
|
|||||||
tertiaryIconName: "../images/network-secure.svg"
|
tertiaryIconName: "../images/network-secure.svg"
|
||||||
tertiaryIconColor: model.sslEnabled ? app.accentColor : tertiaryIconKeyColor
|
tertiaryIconColor: model.sslEnabled ? app.accentColor : tertiaryIconKeyColor
|
||||||
|
|
||||||
canDelete: true
|
// canDelete: true
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,18 +11,46 @@ Page {
|
|||||||
text: qsTr("Plugins")
|
text: qsTr("Plugins")
|
||||||
backButtonVisible: true
|
backButtonVisible: true
|
||||||
onBackPressed: pageStack.pop()
|
onBackPressed: pageStack.pop()
|
||||||
}
|
|
||||||
|
|
||||||
ListView {
|
HeaderButton {
|
||||||
anchors.fill: parent
|
imageSource: "../images/configure.svg"
|
||||||
model: engine.deviceManager.plugins
|
color: pluginsProxy.showOnlyConfigurable ? app.accentColor : keyColor
|
||||||
clip: true
|
onClicked: {
|
||||||
|
pluginsProxy.showOnlyConfigurable = !pluginsProxy.showOnlyConfigurable
|
||||||
delegate: MeaListItemDelegate {
|
}
|
||||||
width: parent.width
|
|
||||||
iconName: "../images/plugin.svg"
|
|
||||||
text: model.name
|
|
||||||
onClicked: pageStack.push(Qt.resolvedUrl("PluginParamsPage.qml"), {plugin: engine.deviceManager.plugins.get(index)})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Label {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.margins: app.margins
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
text: qsTr("This list shows the list of installed plugins on this %1 box.").arg(app.systemName)
|
||||||
|
}
|
||||||
|
|
||||||
|
ThinDivider {}
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
model: PluginsProxy {
|
||||||
|
id: pluginsProxy
|
||||||
|
plugins: engine.deviceManager.plugins
|
||||||
|
}
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
delegate: MeaListItemDelegate {
|
||||||
|
property var plugin: pluginsProxy.get(index)
|
||||||
|
width: parent.width
|
||||||
|
iconName: "../images/plugin.svg"
|
||||||
|
text: model.name
|
||||||
|
progressive: plugin.paramTypes.count > 0
|
||||||
|
onClicked: pageStack.push(Qt.resolvedUrl("PluginParamsPage.qml"), {plugin: plugin})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user