MagicSmoke  $VERSION$
servercfg.h
Go to the documentation of this file.
1 //
2 // C++ Interface: print @ home, client config
3 //
4 // Description:
5 //
6 //
7 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2016
8 //
9 // Copyright: See README/COPYING.GPL files that come with this distribution
10 //
11 //
12 
13 #ifndef MSMOKE_PAH_SERVER_H
14 #define MSMOKE_PAH_SERVER_H
15 
16 #include <QDialog>
17 #include <QMap>
18 #include <QList>
19 #include <QDateTime>
20 #include <QPair>
21 
22 #include "MOContactType"
23 #include "MOShipping"
24 
25 class QCheckBox;
26 class QLineEdit;
27 class QComboBox;
28 class QSpinBox;
29 
30 class MPServerConfig:public QDialog
31 {
32  Q_OBJECT
33 public:
34  MPServerConfig(QWidget*parent=nullptr);
35 
37  static QStringList mailContactTypes();
39  static QList<int> mailContactTypeIds();
40 
42  static QList<int> shippingIds();
43 
45  static bool validateConfig();
46 
48  static QString ticketTemplateName(){return ticketTemplateCS().second;}
50  static QString voucherTemplateName(){return voucherTemplateCS().second;}
52  static QString billTemplateName(){return invoiceTemplateCS().second;}
54  static QString mailTemplateName(){return mailTemplateCS().second;}
55 
57  static QString ticketFileName();
59  static QString voucherFileName();
61  static QString billFileName();
62 public slots:
63  void save();
64 
65 private:
66  QComboBox*mticket,*mvoucher,*minvoice,*mmail;
67  QLineEdit*mticketn,*mvouchern,*minvoicen;
68  QMap<int,QCheckBox*>mcontacts,mshipping;
69  static QMap<QString,QString>msettings;
70  static QList<MOContactType>mcontacttypes;
71  static QList<MOShipping>mshiptypes;
72  static QDateTime mlastinit;
73 
74  static QPair<QString,QString> ticketTemplateCS();
75  static QPair<QString,QString> voucherTemplateCS();
76  static QPair<QString,QString> invoiceTemplateCS();
77  static QPair<QString,QString> mailTemplateCS();
78  static void init(bool force=false);
79 };
80 
81 #endif
static QList< int > shippingIds()
returns the IDs of shipping types used for PrintAtHome
Definition: servercfg.cpp:274
static QString billFileName()
returns the name under which the bill/invoice PDF should be stored on the server
Definition: servercfg.cpp:293
static QString ticketFileName()
returns the name under which the ticket PDF should be stored on the server
Definition: servercfg.cpp:283
static bool validateConfig()
returns true if the server configuration is consistent
Definition: servercfg.cpp:298
Definition: servercfg.h:30
static QString voucherTemplateName()
returns the template name for vouchers
Definition: servercfg.h:50
void save()
Definition: servercfg.cpp:199
static QString voucherFileName()
returns the name under which the voucher PDF should be stored on the server
Definition: servercfg.cpp:288
static QString billTemplateName()
returns the template name for bills
Definition: servercfg.h:52
static QStringList mailContactTypes()
returns all contact types that are mail addresses
Definition: servercfg.cpp:255
static QList< int > mailContactTypeIds()
returns the IDs of all contact types that are mail addresses
Definition: servercfg.cpp:265
static QString mailTemplateName()
returns the template name for mails
Definition: servercfg.h:54
static QString ticketTemplateName()
returns the template name for tickets
Definition: servercfg.h:48
MPServerConfig(QWidget *parent=nullptr)
Definition: servercfg.cpp:79