]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/console/console.h
Separate console ui from main.ui
[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
30 public slots:
31    void connect(void);
32    void read_dir(int fd);
33    void status_dir(void);
34    void set_font(void);
35
36 private:
37    QTextEdit *m_textEdit;
38    DIRRES *m_dir;
39    BSOCK *m_sock;   
40    bool m_at_prompt;
41    QSocketNotifier *m_notifier;
42    QTextCursor *m_cursor;
43    QTreeWidgetItem *m_consoleItem;
44 };
45
46 #endif /* _CONSOLE_H_ */