Commit 8c14d264 authored by Leander Schulten's avatar Leander Schulten
Browse files

Add Help for ControlPane #4

parent e0bb1bd3
Pipeline #172935 passed with stage
in 2 minutes and 14 seconds
......@@ -44,12 +44,14 @@ class ControlItemData : public QObject
Q_PROPERTY(int startYBlock READ getStartYBlock WRITE setStartYBlock NOTIFY startYBlockChanged)
Q_PROPERTY(bool isVisibleForUser READ isVisibleForUser NOTIFY isVisibleForUserChanged)
Q_PROPERTY(QAbstractListModel* userVisibilityModel READ getUserVisibilityModel CONSTANT)
Q_PROPERTY(Type type MEMBER type CONSTANT)
private:
int startXBlock=0;
int startYBlock=0;
UserVisibilityModel userVisibilityModel;
public:
enum Type{PROGRAMM, SWITCH_GROUP, DIMMER_GROUP, PROGRAM_BLOCK};
Q_ENUM(Type)
private:
Type type;
public:
......
......@@ -47,6 +47,7 @@
#include "sortedmodelview.h"
#include "updater.h"
#include <QSslSocket>
#include "gui/controlitemdata.h"
#ifdef DrMinGW
#include "exchndl.h"
......@@ -185,6 +186,7 @@ int main(int argc, char *argv[])
qRegisterMetaType<DMXChannelFilter::Operation>("Operation");
qmlRegisterUncreatableType<UserManagment>("custom.licht",1,0,"Permission","Singletone in c++");
qmlRegisterUncreatableMetaObject(Updater::staticMetaObject,"custom.licht",1,0,"UpdaterState",QStringLiteral("Enum in c++"));
qmlRegisterUncreatableMetaObject(ControlItemData::staticMetaObject,"custom.licht",1,0,"ControlType",QStringLiteral("Enum in c++"));
qRegisterMetaType<UserManagment::Permission>("Permission");
qRegisterMetaType<Modules::detail::PropertyInformation::Type>("Type");
qRegisterMetaType<Modules::ValueType>("ValueType");
......
......@@ -91,6 +91,7 @@ ControlItemTemplate{
easing.type: Easing.OutExpo
}
}
property Menu menu: menu
onOpenPopup: {
menu.x = x;
menu.y = y;
......@@ -129,6 +130,7 @@ ControlItemTemplate{
}
}
property Popup popup;
property Popup visibilityPopup: visibilityPopup;
Popup{
id: visibilityPopup
......
......@@ -4,6 +4,7 @@ import QtQuick.Layouts 1.0
import QtGraphicalEffects 1.0
import QtQuick.Dialogs 1.2
import custom.licht 1.0
import "../HelpSystem"
ControlPanel{
......@@ -14,6 +15,8 @@ ControlPanel{
Program
}
id: controlPane
onExitMenuArea: programm.width = programm.height
menuHeight: height-programBlock.y
menuWidth: width-programm.x
......@@ -182,5 +185,150 @@ ControlPanel{
}
}
Help{
id: help
property SwitchGroupControl switchControl: null
property DimmerGroupControl dimmerControl: null
property DimmerGroupControl programControl: null
property DimmerGroupControl control: null
helpButton.anchors.right: programm.left
enableAnimations: false
tooltipText: "Control Pane Explanation"
onStart: {
switchControl = null;
dimmerControl = null;
control = null;
// enum Type{PROGRAMM, SWITCH_GROUP, DIMMER_GROUP, PROGRAM_BLOCK};
for(let i = 0; i < controlPane.children.length;++i){
if(!(controlPane.children[i] instanceof ControlItem))
continue;
if(control === null)
control = controlPane.children[i];
if(switchControl === null && controlPane.children[i].controlData.type === ControlType.SWITCH_GROUP){
switchControl = controlPane.children[i];
}else if(dimmerControl === null && controlPane.children[i].controlData.type === ControlType.DIMMER_GROUP){
dimmerControl = controlPane.children[i];
}else if(programControl === null && controlPane.children[i].controlData.type === ControlType.PROGRAMM){
programControl = controlPane.children[i];
}
}
}
allowEntryJumping: true
HelpEntry{
titel: "Move Control Items"
explanation: "You can drag a control item to a different location"
component: help.control
visible: help.control !== null && UserManagment.currentUser.havePermission(Permission.MOVE_CONTROL_ITEM);
}
HelpEntry{
titel: "Control Item Properties"
explanation: "Right click a control item to open the menu of the item. (click next)"
component: help.control
visible: help.control !== null && (UserManagment.currentUser.havePermission(Permission.REMOVE_CONTROL_ITEM) || UserManagment.currentUser.havePermission(Permission.CHANGE_CONTROL_ITEM_VISIBILITY));
}
HelpEntry{
titel: "Control Item Properties"
explanation: "Here you can open the settings, change the visibility and delete a control item."
component: help.control ? help.control.menu.contentItem : null
visible: help.control !== null && (UserManagment.currentUser.havePermission(Permission.REMOVE_CONTROL_ITEM) || UserManagment.currentUser.havePermission(Permission.CHANGE_CONTROL_ITEM_VISIBILITY));
onEnter: {
help.control.menu.x = help.control.width/2;
help.control.menu.y = help.control.height/2;
help.control.menu.visible = true;
}
onLeave: help.control.menu.visible = false;
}
HelpEntry{
titel: "Control Item Visibility"
explanation: "Here you can change the visibility of the control item for different users. So you can hide a item for users."
component: help.control ? help.control.visibilityPopup.contentItem : null
visible: help.control !== null && UserManagment.currentUser.havePermission(Permission.CHANGE_CONTROL_ITEM_VISIBILITY);
onEnter: {
help.control.visibilityPopup.x = help.control.width/2;
help.control.visibilityPopup.y = help.control.height/2;
help.control.visibilityPopup.visible = true;
}
onLeave: help.control.visibilityPopup.visible = false;
}
HelpEntry{
titel: "Switch Group"
explanation: "With a switch group you can turn on and off multiple devices."
component: help.switchControl
visible: help.switchControl !== null
}
HelpEntry{
titel: "Switch Group Settings"
explanation: "Here you can change the name and the timeouts of the group. You can also select the devices that should be switched on and off."
component: help.switchControl ? help.switchControl.popup.contentItem : null
visible: help.switchControl !== null && (UserManagment.currentUser.havePermission(Permission.CHANGE_TIMEOUTS) || UserManagment.currentUser.havePermission(Permission.CHANGE_GROUP_NAME) || UserManagment.currentUser.havePermission(Permission.CHANGE_GROUP_DEVICES));
onEnter: {
help.switchControl.popup.x = help.switchControl.width/2;
help.switchControl.popup.y = help.switchControl.height/2;
help.switchControl.popup.visible = true;
}
onLeave: help.switchControl.popup.visible = false;
}
HelpEntry{
titel: "Dimmer Group"
explanation: "With a dimmer group you can change the brightness of a group of devices."
component: help.dimmerControl
visible: help.dimmerControl !== null
}
HelpEntry{
titel: "Open Settings"
explanation: "Hover about the top right corner of a control item and click the gear to open the settings of a control item. (click next)"
component: help.dimmerControl
yShift: component ? -help.dimmerControl.height/2 + 9 : 0
visible: help.dimmerControl !== null
}
function enterDimmerControl(){
help.dimmerControl.popup.x = help.dimmerControl.width/2;
help.dimmerControl.popup.y = help.dimmerControl.height/2;
help.dimmerControl.popup.visible = true;
help.dimmerControl.popup.closePolicy = Popup.NoAutoClose;
}
function leaveDimmerControl(){
help.dimmerControl.popup.closePolicy = Popup.CloseOnEscape | Popup.CloseOnPressOutside;
if(currentIndex<=7||currentIndex>10)
help.dimmerControl.popup.visible = false;
}
HelpEntry{
titel: "Dimmer Min Max Mapping"
explanation: "Here you can change the name of the dimmer group. You can also change the min max mapping of the group. A device is gets a default value and maybe a value from a program. This value is filtered by this min max mapping. The moving black number represents the given brightness of the devices and under it you can see the resulting brightness after the filtering."
component: help.dimmerControl ? help.dimmerControl.popup.background : null
yShift: -65
visible: help.dimmerControl !== null && (UserManagment.currentUser.havePermission(Permission.CHANGE_MIN_MAX_MAPPING) || UserManagment.currentUser.havePermission(Permission.CHANGE_GROUP_NAME));
onEnter: help.enterDimmerControl();
onLeave: help.leaveDimmerControl();
}
HelpEntry{
titel: "Dimmer Override Setting"
explanation: "The value of a Device can be determined in two ways. Either a default value is set, then programs run and the result gets mapped to a different range. Alternatively, the value can simply be set to a specific value that overwrites alternative 1. 'Use value as default' describes alternative 1, 'Override with value' alternative 2."
component: help.dimmerControl ? help.dimmerControl.popup.background : null
yShift: 30
visible: help.dimmerControl !== null && (UserManagment.currentUser.havePermission(Permission.CHANGE_MIN_MAX_MAPPING));
onEnter: help.enterDimmerControl();
onLeave: help.leaveDimmerControl();
}
HelpEntry{
titel: "Dimmer Group Devices"
explanation: "Here you can select the devices that are affected by this dimmer group."
component: help.dimmerControl ? help.dimmerControl.popup.background : null
yShift: 65
visible: help.dimmerControl !== null && (UserManagment.currentUser.havePermission(Permission.CHANGE_GROUP_DEVICES));
onEnter: help.enterDimmerControl();
onLeave: help.leaveDimmerControl();
}
HelpEntry{
titel: "Program"
explanation: "With this item you can start and stop programs. In the settings of this control item you can change the speed of the program."
component: help.programControl
visible: help.dimmerControl !== null
position: HelpEntry.Position.West
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment