]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/console/console.h
Create first cut prerestore and restore dialogs
[bacula/bacula] / bacula / src / qt-console / console / console.h
1
2 #ifndef _CONSOLE_H_
3 #define _CONSOLE_H_
4
5 #include <QtGui>
6 #include "ui_console.h"
7 #include "restore.h"
8
9 class DIRRES;
10 class BSOCK;
11 class JCR;
12 class CONRES;
13
14 class Console : public QWidget, public Ui::ConsoleForm
15 {
16    Q_OBJECT 
17
18 public:
19    Console(QStackedWidget *parent);
20    void set_text(const char *buf);
21    void set_text(const QString buf);
22    void set_textf(const char *fmt, ...);
23    void update_cursor(void);
24    void write_dir(const char *buf);
25    bool authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons);
26    bool is_connected() { return m_sock != NULL; };
27    const QFont get_font();
28    void writeSettings();
29    void readSettings();
30    char *msg();
31    void setEnabled(bool enable) { m_notifier->setEnabled(enable); };
32    QStringList get_list(char *cmd);
33
34    QStringList job_list;
35    QStringList client_list;
36    QStringList fileset_list;
37    QStringList messages_list;
38    QStringList pool_list;
39    QStringList storage_list;
40    QStringList type_list;
41    QStringList level_list;
42
43 public slots:
44    void connect(void);
45    void read_dir(int fd);
46    int read(void);
47    int write(const char *msg);
48    void status_dir(void);
49    void set_font(void);
50
51 private:
52    QTextEdit *m_textEdit;
53    DIRRES *m_dir;
54    BSOCK *m_sock;   
55    bool m_at_prompt;
56    QSocketNotifier *m_notifier;
57    QTextCursor *m_cursor;
58    QTreeWidgetItem *m_consoleItem;
59 };
60
61 #endif /* _CONSOLE_H_ */