]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/tray-monitor/conf.h
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / bacula / src / qt-console / tray-monitor / conf.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2017 Kern Sibbald
5
6    The original author of Bacula is Kern Sibbald, with contributions
7    from many others, a complete list can be found in the file AUTHORS.
8
9    You may use this file and others of this release according to the
10    license defined in the LICENSE file, which includes the Affero General
11    Public License, v3.0 ("AGPLv3") and some additional permissions and
12    terms pursuant to its AGPLv3 Section 7.
13
14    This notice must be preserved when any source code is
15    conveyed and/or propagated.
16
17    Bacula(R) is a registered trademark of Kern Sibbald.
18 */
19
20 #ifndef CONF_H
21 #define CONF_H
22
23 #include "common.h"
24 #include "ui_main-conf.h"
25 #include "ui_res-conf.h"
26 #include "tray_conf.h"
27
28 class Conf: public QDialog
29 {
30    Q_OBJECT
31
32 private:
33    CONFIG *config;
34    RES_HEAD **rhead;
35 public:
36    int items;
37    QLineEdit::EchoMode passtype;
38    Ui::Conf UIConf;
39    Conf();
40    ~Conf();
41    bool parse_config();
42    void addResource(RESMON *res, const char *title);
43    void addRes(int type, const char *title); /* create the resource */
44 public slots:
45    void accept();
46    void selectCommandDir();
47    void addDir();
48    void addStore();
49    void addClient();
50    void togglePassword();
51 };
52
53 class ConfTab: public QWidget
54 {
55    Q_OBJECT
56
57 public:
58    Ui::ResConf ui;
59    RESMON *res;
60    int  type;
61    bool new_resource;
62    ConfTab(RESMON *r): QWidget() {
63       res = r;
64       type = r->type;
65       new_resource = r->new_resource;
66       ui.setupUi(this);
67       connect(ui.bpDelete, SIGNAL(clicked()), this, SLOT(disable()));
68    };
69    ~ConfTab() {
70       if (new_resource && res) {
71          free_resource((RES*) res, res->type);
72          res = NULL;
73       }
74    };
75 public slots:
76    void disable() {
77       setEnabled(false);
78    };
79    void selectCaCertificateFile();
80    void selectCaCertificateDir();
81    void selectCertificate();
82    void selectKey();
83 };
84
85 #endif