1 /*
2    BAREOS® - Backup Archiving REcovery Open Sourced
3 
4    Copyright (C) 2013-2013 Bareos GmbH & Co. KG
5 
6    This program is Free Software; you can redistribute it and/or
7    modify it under the terms of version three of the GNU Affero General Public
8    License as published by the Free Software Foundation and included
9    in the file LICENSE.
10 
11    This program is distributed in the hope that it will be useful, but
12    WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14    Affero General Public License for more details.
15 
16    You should have received a copy of the GNU Affero General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19    02110-1301, USA.
20 */
21 #ifndef MONITORTAB_H
22 #define MONITORTAB_H
23 
24 class MonitorTab : public QObject {
25  public:
26   MonitorTab(QString tabRefString, QObject* parent = 0)
QObject(parent)27       : QObject(parent), tab(new QWidget), textEdit(new QPlainTextEdit(tab))
28   {
29     QVBoxLayout* vLayout = new QVBoxLayout(tab);
30     textEdit->setObjectName(tabRefString);
31     textEdit->setReadOnly(true);
32     textEdit->setFont(QFont("courier"));
33     vLayout->addWidget(textEdit);
34   }
35 
~MonitorTab()36   ~MonitorTab()
37   {
38     // do not delete widgets since they
39     // all have a parent that does the work
40   }
41 
getTabWidget()42   QWidget* getTabWidget() const { return tab; }
getTextEdit()43   QPlainTextEdit* getTextEdit() const { return textEdit; }
44 
45  private:
46   QWidget* tab;
47   QPlainTextEdit* textEdit;
48 };
49 
50 #endif  // MONITORTAB_H
51