2 Bacula® - The Network Backup Solution
4 Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
6 The main author of Bacula is Kern Sibbald, with contributions from
7 many others, a complete list can be found in the file AUTHORS.
8 This program is Free Software; you can redistribute it and/or
9 modify it under the terms of version two of the GNU General Public
10 License as published by the Free Software Foundation plus additions
11 that are listed in the file LICENSE.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 Bacula® is a registered trademark of John Walker.
24 The licensor of Bacula is the Free Software Foundation Europe
25 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
26 Switzerland, email:ftf@fsfeurope.org.
30 * Main Window control for qt-console
32 * Kern Sibbald, January MMVI
36 #include "mainwindow.h"
38 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
40 setupUi(this); /* Setup UI defined by main.ui (designer) */
41 stackedWidget->setCurrentIndex(0);
42 /* Dummy message ***FIXME*** remove a bit later */
43 textEdit->setPlainText("Hello Baculites\nThis is the main console window.");
44 /* Connect command line edit to input_line */
45 connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(input_line()));
50 * The user just finished typing a line in the command line edit box
52 void MainWindow::input_line()
54 QString cmdStr = lineEdit->text(); /* Get the text */
55 lineEdit->clear(); /* clear the lineEdit box */
56 textEdit->append(cmdStr); /* append text on screen */
59 void set_textf(const char *fmt, ...)
64 va_start(arg_ptr, fmt);
65 len = bvsnprintf(buf, sizeof(buf), fmt, arg_ptr);
67 mainWin->textEdit->append(buf);
70 void set_text(const char *buf)
72 mainWin->textEdit->append(buf);
75 void set_statusf(const char *fmt, ...)
80 va_start(arg_ptr, fmt);
81 len = bvsnprintf(buf, sizeof(buf), fmt, arg_ptr);
83 // gtk_label_set_text(GTK_LABEL(status1), buf);
84 // set_scroll_bar_to_end();
88 void set_status_ready()
90 mainWin->statusBar()->showMessage("Ready");
92 // set_scroll_bar_to_end();
95 void set_status(const char *buf)
97 mainWin->statusBar()->showMessage(buf);