X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=inline;f=bacula%2Fsrc%2Fqt-console%2Fconsole%2Fconsole.h;h=98668318124cf1976c60ba9921a16bffc17a9977;hb=456f8bb9c78bfbb10dd9dcdfd5594e8624caa54a;hp=f9f1c88eb6575392582ba9fa3d58b787d8630f41;hpb=f071c3aa22690057dbfb833e07ced7b7d571f45f;p=bacula%2Fbacula diff --git a/bacula/src/qt-console/console/console.h b/bacula/src/qt-console/console/console.h index f9f1c88eb6..9866831812 100644 --- a/bacula/src/qt-console/console/console.h +++ b/bacula/src/qt-console/console/console.h @@ -1,10 +1,9 @@ #ifndef _CONSOLE_H_ #define _CONSOLE_H_ - /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2007 Free Software Foundation Europe e.V. + Copyright (C) 2007-2007 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -35,8 +34,10 @@ */ #include +#include "pages.h" #include "ui_console.h" #include "restore.h" +#include "select.h" #ifndef MAX_NAME_LENGTH #define MAX_NAME_LENGTH 128 @@ -64,30 +65,40 @@ class BSOCK; class JCR; class CONRES; -class Console : public QWidget, public Ui::ConsoleForm +class Console : public Pages, public Ui::ConsoleForm { Q_OBJECT public: Console(QStackedWidget *parent); + ~Console(); void display_text(const char *buf); void display_text(const QString buf); void display_textf(const char *fmt, ...); void update_cursor(void); void write_dir(const char *buf); + bool dir_cmd(const char *cmd, QStringList &results); + bool dir_cmd(QString &cmd, QStringList &results); + bool sql_cmd(const char *cmd, QStringList &results); + bool sql_cmd(QString &cmd, QStringList &results); bool authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons); bool is_connected() { return m_sock != NULL; }; + bool is_connectedGui(); const QFont get_font(); void writeSettings(); void readSettings(); char *msg(); - void setEnabled(bool enable) { m_notifier->setEnabled(enable); }; + void notify(bool enable); QStringList get_list(char *cmd); bool get_job_defaults(struct job_defaults &); void terminate(); void beginNewCommand(); void displayToPrompt(); void discardToPrompt(); + void setDirectorTreeItem(QTreeWidgetItem *); + void setDirRes(DIRRES *dir); + QTreeWidgetItem *directorTreeItem() { return m_directorTreeItem; }; + void getDirResName(QString &); QStringList job_list; QStringList client_list; @@ -98,14 +109,16 @@ public: QStringList type_list; QStringList level_list; + public slots: - void connect(void); + void connect(); void read_dir(int fd); int read(void); int write(const char *msg); int write(QString msg); void status_dir(void); void set_font(void); + void poll_messages(void); private: QTextEdit *m_textEdit; @@ -114,8 +127,10 @@ private: bool m_at_prompt; QSocketNotifier *m_notifier; QTextCursor *m_cursor; - QTreeWidgetItem *m_consoleItem; + QTreeWidgetItem *m_directorTreeItem; bool m_api_set; + bool m_messages_pending; + QTimer *m_timer; }; #endif /* _CONSOLE_H_ */