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