]> git.sur5r.net Git - bacula/bacula/commitdiff
Separate console ui from main.ui
authorKern Sibbald <kern@sibbald.com>
Sat, 3 Feb 2007 11:33:09 +0000 (11:33 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 3 Feb 2007 11:33:09 +0000 (11:33 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4091 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/Makefile
bacula/src/qt-console/bat.pro
bacula/src/qt-console/console/console.cpp
bacula/src/qt-console/console/console.h
bacula/src/qt-console/console/console.ui [new file with mode: 0644]
bacula/src/qt-console/main.ui
bacula/src/qt-console/mainwin.cpp

index f3ed7a0990fdfc097475c5f19e53305dee4e92b3..a15efb5ef16f8cffe2ecda9f3fc5a8a05ce3d21a 100644 (file)
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: bat
-# Generated by qmake (2.01a) (Qt 4.2.1) on: Thu Feb 1 11:50:08 2007
+# Generated by qmake (2.01a) (Qt 4.2.1) on: Sat Feb 3 11:19:57 2007
 # Project:  bat.pro
 # Template: app
 # Command: /usr/bin/qmake -unix -o Makefile bat.pro
@@ -105,7 +105,7 @@ first: all
 
 all: Makefile $(TARGET)
 
-$(TARGET): ui_main.h ui_label.h $(OBJECTS)  
+$(TARGET): ui_main.h ui_label.h ui_console.h $(OBJECTS)  
        $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
 
 Makefile: bat.pro  /usr/share/qt4/mkspecs/default/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
@@ -150,7 +150,7 @@ qmake:  FORCE
 
 dist: 
        @$(CHK_DIR_EXISTS) .tmp/bat1.0.0 || $(MKDIR) .tmp/bat1.0.0 
-       $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/bat1.0.0/ && $(COPY_FILE) --parents mainwin.h bat.h bat_conf.h console/console.h .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.qrc .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.cpp bat_conf.cpp mainwin.cpp console/authenticate.cpp console/console.cpp .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.ui label.ui .tmp/bat1.0.0/ && (cd `dirname .tmp/bat1.0.0` && $(TAR) bat1.0.0.tar bat1.0.0 && $(COMPRESS) bat1.0.0.tar) && $(MOVE) `dirname .tmp/bat1.0.0`/bat1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/bat1.0.0
+       $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/bat1.0.0/ && $(COPY_FILE) --parents mainwin.h bat.h bat_conf.h console/console.h .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.qrc .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.cpp bat_conf.cpp mainwin.cpp console/authenticate.cpp console/console.cpp .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.ui label.ui console/console.ui .tmp/bat1.0.0/ && (cd `dirname .tmp/bat1.0.0` && $(TAR) bat1.0.0.tar bat1.0.0 && $(COMPRESS) bat1.0.0.tar) && $(MOVE) `dirname .tmp/bat1.0.0`/bat1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/bat1.0.0
 
 
 yaccclean:
@@ -212,15 +212,18 @@ compiler_image_collection_clean:
        -$(DEL_FILE) qmake_image_collection.cpp
 compiler_moc_source_make_all:
 compiler_moc_source_clean:
-compiler_uic_make_all: ui_main.h ui_label.h
+compiler_uic_make_all: ui_main.h ui_label.h ui_console.h
 compiler_uic_clean:
-       -$(DEL_FILE) ui_main.h ui_label.h
+       -$(DEL_FILE) ui_main.h ui_label.h ui_console.h
 ui_main.h: main.ui
        /usr/bin/uic main.ui -o ui_main.h
 
 ui_label.h: label.ui
        /usr/bin/uic label.ui -o ui_label.h
 
+ui_console.h: console/console.ui
+       /usr/bin/uic console/console.ui -o ui_console.h
+
 compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_image_collection_clean compiler_moc_source_clean compiler_uic_clean 
 
 ####### Compile
index a4daac13840255c6549c1651ee62a8cf3a19b2c2..57f9454e26f71af2f58db87ea1122e8f04868b54 100644 (file)
@@ -16,6 +16,7 @@ RESOURCES = main.qrc
 FORMS += main.ui
 # Label dialog
 FORMS += label.ui
+FORMS += console/console.ui
 
 
 HEADERS += mainwin.h bat.h bat_conf.h 
index 6590d283557a9d0d319b32b03e6e2651c5d4ddad..4e210998d933b7dabab627a99b923064dad449b0 100644 (file)
 #include "bat.h"
 #include "console.h"
 
-Console::Console()
+Console::Console(QStackedWidget *parent)
 {
    QFont font;
    QTreeWidgetItem *item, *topItem;
    QTreeWidget *treeWidget = mainWin->treeWidget;
 
+   setupUi(this);
+   parent->addWidget(this);
    m_sock = NULL;
    m_at_prompt = false;
-   m_textEdit = mainWin->textEdit;   /* our console screen */
+   m_textEdit = textEdit;   /* our console screen */
    m_cursor = new QTextCursor(m_textEdit->document());
    mainWin->actionConnect->setIcon(QIcon(QString::fromUtf8("images/disconnected.png")));
 
@@ -85,7 +87,7 @@ void Console::connect()
 {
    JCR jcr;
 
-   m_textEdit = mainWin->textEdit;   /* our console screen */
+   m_textEdit = textEdit;   /* our console screen */
 
    if (!m_dir) {          
       mainWin->set_status("No Director found.");
index 921b1f9245b931f50dda0e901a88f456a046864e..924c728a3d8e97e118884963e745a66f2420c18f 100644 (file)
@@ -3,18 +3,19 @@
 #define _CONSOLE_H_
 
 #include <QtGui>
+#include "ui_console.h"
 
 class DIRRES;
 class BSOCK;
 class JCR;
 class CONRES;
 
-class Console : public QWidget
+class Console : public QWidget, public Ui::ConsoleForm
 {
    Q_OBJECT 
 
 public:
-   Console();
+   Console(QStackedWidget *parent);
    void set_text(const char *buf);
    void set_text(const QString buf);
    void set_textf(const char *fmt, ...);
diff --git a/bacula/src/qt-console/console/console.ui b/bacula/src/qt-console/console/console.ui
new file mode 100644 (file)
index 0000000..7386c26
--- /dev/null
@@ -0,0 +1,91 @@
+<ui version="4.0" >
+ <class>ConsoleForm</class>
+ <widget class="QWidget" name="ConsoleForm" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>432</width>
+    <height>422</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Console</string>
+  </property>
+  <layout class="QGridLayout" >
+   <property name="margin" >
+    <number>9</number>
+   </property>
+   <property name="spacing" >
+    <number>6</number>
+   </property>
+   <item row="0" column="0" >
+    <widget class="QDockWidget" name="dockWidget" >
+     <widget class="QWidget" name="dockWidgetContents" >
+      <layout class="QGridLayout" >
+       <property name="margin" >
+        <number>9</number>
+       </property>
+       <property name="spacing" >
+        <number>6</number>
+       </property>
+       <item row="0" column="0" >
+        <widget class="QTextEdit" name="textEdit" >
+         <property name="sizePolicy" >
+          <sizepolicy>
+           <hsizetype>7</hsizetype>
+           <vsizetype>7</vsizetype>
+           <horstretch>200</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize" >
+          <size>
+           <width>0</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="sizeIncrement" >
+          <size>
+           <width>1</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="focusPolicy" >
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops" >
+          <bool>false</bool>
+         </property>
+         <property name="toolTip" >
+          <string comment="Console Window" />
+         </property>
+         <property name="statusTip" >
+          <string comment="Console Window" />
+         </property>
+         <property name="whatsThis" >
+          <string comment="Console Window" />
+         </property>
+         <property name="horizontalScrollBarPolicy" >
+          <enum>Qt::ScrollBarAsNeeded</enum>
+         </property>
+         <property name="documentTitle" >
+          <string comment="Console Window" />
+         </property>
+         <property name="lineWrapMode" >
+          <enum>QTextEdit::NoWrap</enum>
+         </property>
+         <property name="readOnly" >
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
index 606e7ffcc0b6689a80476bee74b26be220cc7478..747b73ae3439041560b873132e2fbec5bdd8cd27 100644 (file)
         </size>
        </property>
        <property name="currentIndex" >
-        <number>0</number>
+        <number>-1</number>
        </property>
-       <widget class="QWidget" name="pageConsole" >
-        <layout class="QGridLayout" >
-         <property name="margin" >
-          <number>9</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item row="0" column="0" >
-          <widget class="QTextEdit" name="textEdit" >
-           <property name="sizePolicy" >
-            <sizepolicy>
-             <hsizetype>7</hsizetype>
-             <vsizetype>7</vsizetype>
-             <horstretch>200</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="minimumSize" >
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="sizeIncrement" >
-            <size>
-             <width>1</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="focusPolicy" >
-            <enum>Qt::NoFocus</enum>
-           </property>
-           <property name="acceptDrops" >
-            <bool>false</bool>
-           </property>
-           <property name="toolTip" >
-            <string comment="Console Window" />
-           </property>
-           <property name="statusTip" >
-            <string comment="Console Window" />
-           </property>
-           <property name="whatsThis" >
-            <string comment="Console Window" />
-           </property>
-           <property name="horizontalScrollBarPolicy" >
-            <enum>Qt::ScrollBarAsNeeded</enum>
-           </property>
-           <property name="documentTitle" >
-            <string comment="Console Window" />
-           </property>
-           <property name="lineWrapMode" >
-            <enum>QTextEdit::NoWrap</enum>
-           </property>
-           <property name="readOnly" >
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-       <widget class="QWidget" name="Restore" >
-        <layout class="QGridLayout" >
-         <property name="margin" >
-          <number>9</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item row="0" column="0" >
-          <widget class="QTabWidget" name="tabWidget" >
-           <property name="currentIndex" >
-            <number>0</number>
-           </property>
-           <widget class="QWidget" name="restore_1" >
-            <attribute name="title" >
-             <string>Restore 1</string>
-            </attribute>
-           </widget>
-           <widget class="QWidget" name="restore_2" >
-            <attribute name="title" >
-             <string>Restore 2</string>
-            </attribute>
-           </widget>
-          </widget>
-         </item>
-        </layout>
-       </widget>
       </widget>
      </widget>
     </item>
     <number>4</number>
    </attribute>
    <addaction name="actionConnect" />
-   <addaction name="actionSave" />
-   <addaction name="actionPrint" />
    <addaction name="actionStatusDir" />
    <addaction name="actionLabel" />
    <addaction name="actionRestore" />
index db26d49de21a5f113bf3797117063d4b11a9802f..69eb2ac96c6355795be05d05031844aa57006a0d 100644 (file)
@@ -39,11 +39,11 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
 {
    mainWin = this;
    setupUi(this);                     /* Setup UI defined by main.ui (designer) */
-   stackedWidget->setCurrentIndex(0);
 
    statusBar()->showMessage("Director not connected. Click on connect button.");
 
-   m_console = new Console();
+   m_console = new Console(stackedWidget);
+   stackedWidget->setCurrentIndex(0);
 
    lineEdit->setFocus();