]> git.sur5r.net Git - bacula/bacula/commitdiff
Changed running from a table widget to a text widget.
authorDirk H Bartley <dbartley@schupan.com>
Wed, 12 Mar 2008 00:37:50 +0000 (00:37 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Wed, 12 Mar 2008 00:37:50 +0000 (00:37 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6589 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/status/clientstat.cpp
bacula/src/qt-console/status/clientstat.h
bacula/src/qt-console/status/clientstat.ui

index 99ba982f09d610579899154baf7b4ad4cfa7dfc1..91e4bd04057dabfc3bfb1a538e877a3df22a1606 100644 (file)
@@ -48,7 +48,7 @@ ClientStat::ClientStat(QString &client, QTreeWidgetItem *parentTreeWidgetItem)
    pgInitialize(parentTreeWidgetItem);
    QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
    thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/status.png")));
-   m_cursor = new QTextCursor(textEdit->document());
+   m_cursor = new QTextCursor(textEditHeader->document());
 
    readSettings();
    dockPage();
@@ -62,7 +62,7 @@ ClientStat::ClientStat(QString &client, QTreeWidgetItem *parentTreeWidgetItem)
 
 void ClientStat::getFont()
 {
-   QFont font = textEdit->font();
+   QFont font = textEditHeader->font();
 
    QString dirname;
    m_console->getDirResName(dirname);
@@ -72,7 +72,7 @@ void ClientStat::getFont()
    font.setPointSize(settings.value("consolePointSize", 10).toInt());
    font.setFixedPitch(settings.value("consoleFixedPitch", true).toBool());
    settings.endGroup();
-   textEdit->setFont(font);
+   textEditHeader->setFont(font);
 }
 
 /*
@@ -114,12 +114,12 @@ void ClientStat::populateHeader()
 {
    QString command = QString(".status client=\"" + m_client + "\" header");
    QStringList results;
-   textEdit->clear();
+   textEditHeader->clear();
 
    if (m_console->dir_cmd(command, results)) {
       foreach (QString line, results) {
          line += "\n";
-         textEdit->insertPlainText(line);
+         textEditHeader->insertPlainText(line);
       }
    }
 }
@@ -179,46 +179,21 @@ void ClientStat::populateTerminated()
 }
 
 /*
- * Populate running table
+ * Populate running text
  */
 void ClientStat::populateRunning()
 {
    QString command = QString(".status client=\"" + m_client + "\" running");
    Pmsg1(100, "Clients running cmd : %s\n",command.toUtf8().data());
    QStringList results;
-   QBrush blackBrush(Qt::black);
-
-   runningTable->clear();
-   QStringList headerlist = (QStringList()
-      << tr("Job Id") << tr("Job Level") << tr("Job Data") << tr("Job Info"));
-
-   runningTable->setColumnCount(headerlist.size());
-   runningTable->setHorizontalHeaderLabels(headerlist);
+   textEditRunning->clear();
 
    if (m_console->dir_cmd(command, results)) {
-      int row = 0;
-      QTableWidgetItem* p_tableitem;
-      runningTable->setRowCount(results.size());
       foreach (QString line, results) {
-         /* Iterate through the record returned from the query */
-         QStringList fieldlist = line.split("\t");
-         int column = 0;
-         QString statusCode("");
-         /* Iterate through fields in the record */
-         foreach (QString field, fieldlist) {
-            field = field.trimmed();  /* strip leading & trailing spaces */
-            p_tableitem = new QTableWidgetItem(field, 1);
-            p_tableitem->setForeground(blackBrush);
-            p_tableitem->setFlags(0);
-            runningTable->setItem(row, column, p_tableitem);
-            column += 1;
-         }
-         row += 1;
+         line += "\n";
+         textEditRunning->insertPlainText(line);
       }
    }
-   runningTable->resizeColumnsToContents();
-   runningTable->resizeRowsToContents();
-   runningTable->verticalHeader()->hide();
 }
 
 /*
@@ -253,12 +228,6 @@ void ClientStat::createConnections()
 {
    connect(actionRefresh, SIGNAL(triggered()), this,
                    SLOT(populateAll()));
-   connect(actionCancelRunning, SIGNAL(triggered()), this,
-                   SLOT(consoleCancelJob()));
-
-   runningTable->setContextMenuPolicy(Qt::ActionsContextMenu);
-   runningTable->addAction(actionRefresh);
-   runningTable->addAction(actionCancelRunning);
 }
 
 /*
@@ -278,24 +247,9 @@ void ClientStat::writeSettings()
 void ClientStat::readSettings()
 {
    m_groupText = "ClientStatPage";
-   m_splitText = "splitterSizes_0";
+   m_splitText = "splitterSizes_1";
    QSettings settings(m_console->m_dir->name(), "bat");
    settings.beginGroup(m_groupText);
    splitter->restoreState(settings.value(m_splitText).toByteArray());
    settings.endGroup();
 }
-
-/*
- * Cancel a running job
- */
-void ClientStat::consoleCancelJob()
-{
-   int currentrow = runningTable->currentRow();
-   QTableWidgetItem *item = runningTable->item(currentrow, 0);
-   if (item) {
-      QString text = item->text();
-      QString cmd("cancel jobid=");
-      cmd += text;
-      consoleCommand(cmd);
-   }
-}
index b3896a7987d0f0ba80056df6450598aa3ecff1bf..3f47f01afbd9a955e7bc7063e96d86342c7c0a71 100644 (file)
@@ -56,7 +56,6 @@ public slots:
 
 private slots:
    void timerTriggered();
-   void consoleCancelJob();
 
 private:
    void createConnections();
index 1af11ec46d3c3da26cb346d9448b8b13687e3dfd..57026d968528c4f0d2e71b70d060c65652650972 100644 (file)
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>504</width>
-    <height>410</height>
+    <width>618</width>
+    <height>630</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>Form</string>
   </property>
   <layout class="QGridLayout" >
-   <property name="leftMargin" >
-    <number>9</number>
-   </property>
-   <property name="topMargin" >
-    <number>9</number>
-   </property>
-   <property name="rightMargin" >
-    <number>9</number>
-   </property>
-   <property name="bottomMargin" >
-    <number>9</number>
-   </property>
-   <property name="horizontalSpacing" >
-    <number>6</number>
-   </property>
-   <property name="verticalSpacing" >
-    <number>6</number>
-   </property>
    <item row="0" column="0" >
     <widget class="QSplitter" name="splitter" >
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
      </property>
-     <widget class="QTextEdit" name="textEdit" >
-      <property name="sizePolicy" >
-       <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
-        <horstretch>200</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
-      </property>
-      <property name="minimumSize" >
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize" >
-       <size>
-        <width>16777215</width>
-        <height>100</height>
-       </size>
-      </property>
-      <property name="sizeIncrement" >
-       <size>
-        <width>1</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="focusPolicy" >
-       <enum>Qt::StrongFocus</enum>
-      </property>
-      <property name="acceptDrops" >
-       <bool>false</bool>
-      </property>
-      <property name="toolTip" >
-       <string comment="Joblog Window" />
-      </property>
-      <property name="statusTip" >
-       <string comment="Joblog Window" />
-      </property>
-      <property name="whatsThis" >
-       <string comment="Joblog Window" />
-      </property>
-      <property name="horizontalScrollBarPolicy" >
-       <enum>Qt::ScrollBarAsNeeded</enum>
-      </property>
-      <property name="autoFormatting" >
-       <set>QTextEdit::AutoNone</set>
-      </property>
-      <property name="tabChangesFocus" >
-       <bool>false</bool>
-      </property>
-      <property name="documentTitle" >
-       <string comment="Joblog Window" />
-      </property>
-      <property name="lineWrapMode" >
-       <enum>QTextEdit::NoWrap</enum>
-      </property>
-      <property name="readOnly" >
-       <bool>true</bool>
-      </property>
-     </widget>
-     <widget class="QWidget" name="layoutWidget_2" >
+     <widget class="QWidget" name="" >
       <layout class="QVBoxLayout" >
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <property name="leftMargin" >
-        <number>0</number>
-       </property>
-       <property name="topMargin" >
-        <number>0</number>
-       </property>
-       <property name="rightMargin" >
-        <number>0</number>
-       </property>
-       <property name="bottomMargin" >
-        <number>0</number>
-       </property>
        <item>
-        <widget class="QLabel" name="runningLabel" >
+        <widget class="QLabel" name="runningLabel_2" >
          <property name="layoutDirection" >
           <enum>Qt::LeftToRight</enum>
          </property>
           <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
 p, li { white-space: pre-wrap; }
 &lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:13pt; font-weight:600;">Running Jobs&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:13pt; font-weight:600;">Header&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
          </property>
          <property name="alignment" >
           <set>Qt::AlignCenter</set>
@@ -129,28 +37,94 @@ p, li { white-space: pre-wrap; }
         </widget>
        </item>
        <item>
-        <widget class="QTableWidget" name="runningTable" />
+        <widget class="QTextEdit" name="textEditHeader" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+           <horstretch>200</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize" >
+          <size>
+           <width>0</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="maximumSize" >
+          <size>
+           <width>16777215</width>
+           <height>16777215</height>
+          </size>
+         </property>
+         <property name="sizeIncrement" >
+          <size>
+           <width>1</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="focusPolicy" >
+          <enum>Qt::StrongFocus</enum>
+         </property>
+         <property name="acceptDrops" >
+          <bool>false</bool>
+         </property>
+         <property name="toolTip" >
+          <string comment="Joblog Window" />
+         </property>
+         <property name="statusTip" >
+          <string comment="Joblog Window" />
+         </property>
+         <property name="whatsThis" >
+          <string comment="Joblog Window" />
+         </property>
+         <property name="horizontalScrollBarPolicy" >
+          <enum>Qt::ScrollBarAsNeeded</enum>
+         </property>
+         <property name="autoFormatting" >
+          <set>QTextEdit::AutoNone</set>
+         </property>
+         <property name="tabChangesFocus" >
+          <bool>false</bool>
+         </property>
+         <property name="documentTitle" >
+          <string comment="Joblog 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="layoutWidget" >
-      <layout class="QVBoxLayout" >
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <property name="leftMargin" >
-        <number>0</number>
-       </property>
-       <property name="topMargin" >
-        <number>0</number>
-       </property>
-       <property name="rightMargin" >
-        <number>0</number>
-       </property>
-       <property name="bottomMargin" >
-        <number>0</number>
-       </property>
-       <item>
+     <widget class="QWidget" name="" >
+      <layout class="QGridLayout" >
+       <item row="0" column="0" >
+        <widget class="QLabel" name="runningLabel" >
+         <property name="layoutDirection" >
+          <enum>Qt::LeftToRight</enum>
+         </property>
+         <property name="text" >
+          <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+p, li { white-space: pre-wrap; }
+&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:13pt; font-weight:600;">Running&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
+         </property>
+         <property name="alignment" >
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0" >
+        <widget class="QTextEdit" name="textEditRunning" />
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="" >
+      <layout class="QGridLayout" >
+       <item row="0" column="0" >
         <widget class="QLabel" name="terminatedLabel" >
          <property name="layoutDirection" >
           <enum>Qt::LeftToRight</enum>
@@ -166,7 +140,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item>
+       <item row="1" column="0" >
         <widget class="QTableWidget" name="terminatedTable" />
        </item>
       </layout>