/*
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.
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
-
/*
+ * Version $Id$
+ *
* qt-console main window class definition.
*
- * Written by Kern Sibbald, January MMVI
+ * Written by Kern Sibbald, January MMVII
*/
#ifndef _MAINWIN_H_
#define _MAINWIN_H_
#include <QtGui>
+#include <QList>
+#include "pages.h"
#include "ui_main.h"
#include "label/label.h"
+#include "run/run.h"
+#include "restore/restore.h"
+#include "medialist/medialist.h"
+#include "joblist/joblist.h"
+#include "clients/clients.h"
class Console;
void set_status(const char *buf);
void writeSettings();
void readSettings();
+ void resetFocus() { lineEdit->setFocus(); };
+ void setContextMenuDockText();
+ void setContextMenuDockText(Pages *, QTreeWidgetItem *);
+ void setTreeWidgetItemDockColor(Pages *, QTreeWidgetItem *);
+ void setTreeWidgetItemDockColor(Pages *);
+ void hashInsert(QTreeWidgetItem *, Pages *);
+ void hashRemove(Pages *);
+ void hashRemove(QTreeWidgetItem *, Pages *);
+ QTreeWidgetItem *topItem() { return m_topItem; };
+ Console *console() { return m_console; };
+ Pages* getFromHash(QTreeWidgetItem *);
+ QTreeWidgetItem* getFromHash(Pages *);
+ /* This hash is to get the page when the page selector widget is known */
+ QHash<QTreeWidgetItem*,Pages*> m_pagehash;
+ /* This hash is to get the page selector widget when the page is known */
+ QHash<Pages*,QTreeWidgetItem*> m_widgethash;
+ void createPageJobList(QString &, QString &, QTreeWidgetItem *parent,
+ Console *console);
public slots:
void input_line();
void treeItemClicked(QTreeWidgetItem *item, int column);
void treeItemDoubleClicked(QTreeWidgetItem *item, int column);
void labelDialogClicked();
+ void runDialogClicked();
+ void restoreDialogClicked();
+ void undockWindowButton();
+ void treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *);
+ void stackItemChanged(int);
+ void toggleDockContextWindow();
+ void closePage();
protected:
void closeEvent(QCloseEvent *event);
+ void keyPressEvent(QKeyEvent *event);
private:
void createConnections();
+ void createPages();
+ QTreeWidgetItem *createTopPage(char *name);
+ QTreeWidgetItem *createPage(char *name, QTreeWidgetItem *parent);
+ void createPagebRestore(QTreeWidgetItem *parent, Console *console);
+ void createPageMediaList(QTreeWidgetItem *parent, Console *console);
+ void createPageClients(QTreeWidgetItem *parent, Console *console);
private:
- QString m_UserInput;
Console *m_console;
+ QTreeWidgetItem *m_topItem;
+ Pages *m_pagespophold;
+ QStringList m_cmd_history;
+ int m_cmd_last;
};
#endif /* _MAINWIN_H_ */