]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/pages.h
Allow closing of all tabs + close tab clicked
[bacula/bacula] / bacula / src / qt-console / pages.h
1 #ifndef _PAGES_H_
2 #define _PAGES_H_
3 /*
4    Bacula® - The Network Backup Solution
5
6    Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
7
8    The main author of Bacula is Kern Sibbald, with contributions from
9    many others, a complete list can be found in the file AUTHORS.
10    This program is Free Software; you can redistribute it and/or
11    modify it under the terms of version three of the GNU Affero General Public
12    License as published by the Free Software Foundation and included
13    in the file LICENSE.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU Affero General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25    Bacula® is a registered trademark of Kern Sibbald.
26    The licensor of Bacula is the Free Software Foundation Europe
27    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
28    Switzerland, email:ftf@fsfeurope.org.
29 */
30 /*
31  *   Version $Id$
32  *
33  *   Dirk Bartley, March 2007
34  */
35
36 #include <QtGui>
37 #include <QList>
38
39 /*
40  *  The Pages Class
41  *
42  *  This class is inherited by all widget windows which are on the stack
43  *  It is for the purpose of having a consistent set of functions and properties
44  *  in all of the subclasses to accomplish tasks such as pulling a window out
45  *  of or into the stack.  It also provides virtual functions called
46  *  from in mainwin so that subclasses can contain functions to allow them
47  *  to populate the screens at the time of first viewing, (when selected) as
48  *  opposed to  the first creation of the console connection.  The 
49  *  console is not connected until after the page selector tree has been
50  *  populated.
51  */
52
53 class Console;
54
55 class Pages : public QWidget
56 {
57 public:
58    Pages();
59    void dockPage();
60    void undockPage();
61    void hidePage();
62    void togglePageDocking();
63    bool isDocked();
64    bool isOnceDocked();
65    bool isCloseable();
66    QTabWidget *m_parent;
67    QList<QAction*> m_contextActions;
68    virtual void PgSeltreeWidgetClicked();
69    virtual void currentStackItem();
70    void closeStackPage();
71    Console *console() { return m_console; };
72    void setCurrent();
73    void setContextMenuDockText();
74    void setTreeWidgetItemDockColor();
75    void consoleCommand(QString &);
76    void consoleCommand(QString &, int conn);
77    void consoleCommand(QString &, bool setCurrent);
78    void consoleCommand(QString &, int conn, bool setCurrent);
79    QString &name() { return m_name; };
80    void getVolumeList(QStringList &);
81    void getStatusList(QStringList &);
82    void firstUseDock();
83
84 public slots:
85    /* closeEvent is a virtual function inherited from QWidget */
86    virtual void closeEvent(QCloseEvent* event);
87
88 protected:
89    void pgInitialize();
90    void pgInitialize(const QString &);
91    void pgInitialize(const QString &, QTreeWidgetItem *);
92    virtual void treeWidgetName(QString &);
93    virtual void changeEvent(QEvent *event);
94    void setConsoleCurrent();
95    void setTitle();
96    bool m_closeable;
97    bool m_docked;
98    bool m_onceDocked;
99    bool m_dockOnFirstUse;
100    Console *m_console;
101    QString m_name;
102 };
103
104 #endif /* _PAGES_H_ */