AlarmNotifications
PANDA Slow Control Alarm Daemon
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
configscreen.cpp
Go to the documentation of this file.
1 
34 #include <iostream>
35 #include <QtGui/QDoubleSpinBox>
36 #include <QtGui/QVBoxLayout>
37 
38 #include "configscreen.h"
39 
40 using namespace AlarmNotifications;
41 
43  : KConfigDialog ( nullptr, "AlarmNotifications Configuration", AlarmConfiguration::instance().internal_skel() ),
44  _conf ( AlarmConfiguration::instance().internal_skel() ),
45  _confman ( new KConfigDialogManager ( this, _conf ) ),
46  _activemqscreen ( new QWidget ),
47  _lactivemqscreen ( new QFormLayout ( _activemqscreen ) )
48 {
50 
51  _activemqscreen->setLayout ( _lactivemqscreen );
52  _confman->updateWidgets();
53  setButtons ( KDialog::ButtonCode::Ok | KDialog::ButtonCode::Apply | KDialog::ButtonCode::Cancel );
54  addPage ( _activemqscreen, _conf, "Alarm notifications", "mail-forwarded", "Alarm notification settings" );
55  setWindowTitle ( "AlarmNotifications Configuration" );
56  setWindowIcon ( KIcon ( "preferences-system", nullptr ) );
57 }
58 
60 {
61 
62 }
63 
65 {
66  QLineEdit* activemquri = new QLineEdit ( _activemqscreen );
67  activemquri->setObjectName ( "kcfg_ActiveMQURI" );
68  _lactivemqscreen->addRow ( "ActiveMQ URI:", activemquri );
69  _confman->addWidget ( activemquri );
70  QLineEdit* activemqusername = new QLineEdit ( _activemqscreen );
71  activemqusername->setObjectName ( "kcfg_ActiveMQUsername" );
72  _lactivemqscreen->addRow ( "ActiveMQ username:", activemqusername );
73  _confman->addWidget ( activemqusername );
74  QLineEdit* activemqpassword = new QLineEdit ( _activemqscreen );
75  activemqpassword->setObjectName ( "kcfg_ActiveMQPassword" );
76  _lactivemqscreen->addRow ( "ActiveMQ password:", activemqpassword );
77  _confman->addWidget ( activemqpassword );
78  QLineEdit* activemqtopicname = new QLineEdit ( _activemqscreen );
79  activemqtopicname->setObjectName ( "kcfg_ActiveMQTopicName" );
80  _lactivemqscreen->addRow ( "CSS Alarm Server topic name:", activemqtopicname );
81  _confman->addWidget ( activemqtopicname );
82  QSpinBox* laboratorynotificationtimeout = new QSpinBox ( _activemqscreen );
83  laboratorynotificationtimeout->setMinimum ( 0 );
84  laboratorynotificationtimeout->setMaximum ( 3600 );
85  laboratorynotificationtimeout->setSuffix ( QString::fromUtf8 ( " seconds" ) );
86  laboratorynotificationtimeout->setSpecialValueText ( QString::fromUtf8 ( "Notification disabled" ) );
87  laboratorynotificationtimeout->setObjectName ( "kcfg_LaboratoryNotificationTimeout" );
88  _lactivemqscreen->addRow ( "Laboratory notification timeout:", laboratorynotificationtimeout );
89  _confman->addWidget ( laboratorynotificationtimeout );
90  QSpinBox* desktopnotificationtimeout = new QSpinBox ( _activemqscreen );
91  desktopnotificationtimeout->setMinimum ( 0 );
92  desktopnotificationtimeout->setMaximum ( 3600 );
93  desktopnotificationtimeout->setSuffix ( QString::fromUtf8 ( " seconds" ) );
94  desktopnotificationtimeout->setSpecialValueText ( QString::fromUtf8 ( "Notification disabled" ) );
95  desktopnotificationtimeout->setObjectName ( "kcfg_DesktopNotificationTimeout" );
96  _lactivemqscreen->addRow ( "Desktop notification timeout:", desktopnotificationtimeout );
97  _confman->addWidget ( desktopnotificationtimeout );
98  QSpinBox* emailnotificationtimeout = new QSpinBox ( _activemqscreen );
99  emailnotificationtimeout->setMinimum ( 0 );
100  emailnotificationtimeout->setMaximum ( 3600 );
101  emailnotificationtimeout->setSuffix ( QString::fromUtf8 ( " seconds" ) );
102  emailnotificationtimeout->setSpecialValueText ( QString::fromUtf8 ( "Notification disabled" ) );
103  emailnotificationtimeout->setObjectName ( "kcfg_EMailNotificationTimeout" );
104  _lactivemqscreen->addRow ( "E-Mail notification timeout:", emailnotificationtimeout );
105  _confman->addWidget ( emailnotificationtimeout );
106  QLineEdit* emailnotificationfrom = new QLineEdit ( _activemqscreen );
107  emailnotificationfrom->setObjectName ( "kcfg_EMailNotificationFrom" );
108  _lactivemqscreen->addRow ( "E-Mail notification sender address:", emailnotificationfrom );
109  _confman->addWidget ( emailnotificationfrom );
110  QLineEdit* emailnotificationto = new QLineEdit ( _activemqscreen );
111  emailnotificationto->setObjectName ( "kcfg_EMailNotificationTo" );
112  _lactivemqscreen->addRow ( "E-Mail notification recipient address:", emailnotificationto );
113  _confman->addWidget ( emailnotificationto );
114  QLineEdit* emailnotificationservername = new QLineEdit ( _activemqscreen );
115  emailnotificationservername->setObjectName ( "kcfg_EMailNotificationServerName" );
116  _lactivemqscreen->addRow ( "SMTP server name:", emailnotificationservername );
117  _confman->addWidget ( emailnotificationservername );
118  QSpinBox* emailnotificationserverport = new QSpinBox ( _activemqscreen );
119  emailnotificationserverport->setMinimum ( 0 ); // Minimum port number in TCP standard
120  emailnotificationserverport->setMaximum ( 65535 ); // Maximum port number in TCP standard
121  emailnotificationserverport->setObjectName ( "kcfg_EMailNotificationServerPort" );
122  _lactivemqscreen->addRow ( "SMTP server port:", emailnotificationserverport );
123  _confman->addWidget ( emailnotificationserverport );
124  QLineEdit* flashlightrelaisdevicenode = new QLineEdit ( _activemqscreen );
125  flashlightrelaisdevicenode->setObjectName ( QString::fromUtf8 ( "kcfg_FlashLightRelaisDeviceNode" ) );
126  _lactivemqscreen->addRow ( QString::fromUtf8 ( "Device node of relais for red flash light:" ), flashlightrelaisdevicenode );
127  _confman->addWidget ( flashlightrelaisdevicenode );
128 }
129 
130 #include "configscreen.moc"
GUI dialog to configure this application.
KConfigSkeleton *const _conf
Definition: configscreen.h:58
#define nullptr
Allow using the nullptr keyword with GCC < 4.6.
Definition: oldgcccompat.h:56
KConfigDialogManager *const _confman
Definition: configscreen.h:59
Namespace for Alarm Notifications application.
Configuration of the AlarmNotifications application.
QFormLayout *const _lactivemqscreen
Definition: configscreen.h:61