]> git.sur5r.net Git - bacula/bacula/commitdiff
This is a patch from Riccardo. It is for updating translations.
authorDirk H Bartley <dbartley@schupan.com>
Wed, 21 May 2008 11:37:18 +0000 (11:37 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Wed, 21 May 2008 11:37:18 +0000 (11:37 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7000 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/clients/clients.cpp
bacula/src/qt-console/fileset/fileset.cpp
bacula/src/qt-console/joblist/joblist.cpp
bacula/src/qt-console/jobs/jobs.cpp
bacula/src/qt-console/mainwin.cpp
bacula/src/qt-console/pages.cpp
bacula/src/qt-console/prefs.ui
bacula/src/qt-console/run/run.cpp
bacula/src/qt-console/util/fmtwidgetitem.cpp

index e38e7e4c392151b100c1e1f2d29cbfca77456762..60c2645eea95915279d8f0cc6070e857505d97c1 100644 (file)
@@ -41,6 +41,7 @@
 #include "clients/clients.h"
 #include "run/run.h"
 #include "status/clientstat.h"
+#include "util/fmtwidgetitem.h"
 
 Clients::Clients()
 {
@@ -71,22 +72,33 @@ Clients::~Clients()
  */
 void Clients::populateTable()
 {
-   QTableWidgetItem *tableItem;
    QBrush blackBrush(Qt::black);
 
    if (!m_console->preventInUseConnect())
       return;
-   m_checkcurwidget = false;
-   tableWidget->clear();
-   m_checkcurwidget = true;
 
    QStringList headerlist = (QStringList() << tr("Client Name") << tr("File Retention")
        << tr("Job Retention") << tr("AutoPrune") << tr("ClientId") << tr("Uname") );
 
+   int sortcol = headerlist.indexOf(tr("Client Name"));
+   Qt::SortOrder sortord = Qt::AscendingOrder;
+   if (tableWidget->rowCount()) {
+      sortcol = tableWidget->horizontalHeader()->sortIndicatorSection();
+      sortord = tableWidget->horizontalHeader()->sortIndicatorOrder();
+   }
+
+   m_checkcurwidget = false;
+   tableWidget->clear();
+   m_checkcurwidget = true;
+
    tableWidget->setColumnCount(headerlist.count());
    tableWidget->setHorizontalHeaderLabels(headerlist);
+   tableWidget->horizontalHeader()->setHighlightSections(false);
    tableWidget->setRowCount(m_console->client_list.count());
    tableWidget->verticalHeader()->hide();
+   tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
+   tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
+   tableWidget->setSortingEnabled(false); /* rows move on insert if sorting enabled */
    int row = 0;
 
    foreach (QString clientName, m_console->client_list){
@@ -106,31 +118,45 @@ void Clients::populateTable()
       if (m_console->sql_cmd(query, results)) {
          int resultCount = results.count();
          if (resultCount){
-            QString resultline;
-            QString field;
-            QStringList fieldlist;
-            resultline = results[resultCount - 1];
-            fieldlist = resultline.split("\t");
-
-            int column = 0;
-            /* Iterate through fields in the record */
-            foreach (field, fieldlist) {
-               field = field.trimmed();  /* strip leading & trailing spaces */
-               tableItem = new QTableWidgetItem(field, 1);
-               tableItem->setFlags(Qt::ItemIsSelectable);
-               tableItem->setForeground(blackBrush);
-               tableItem->setData(Qt::UserRole, 1);
-               tableWidget->setItem(row, column, tableItem);
-               column++;
-            }
+            /* only use the last one */
+            QString resultline = results[resultCount - 1];
+            QStringList fieldlist = resultline.split("\t");
+
+           TableItemFormatter item(*tableWidget, row);
+
+           /* Iterate through fields in the record */
+           QStringListIterator fld(fieldlist);
+           int col = 0;
+
+           /* name */
+           item.setTextFld(col++, fld.next());
+
+           /* file retention */
+           item.setDurationFld(col++, fld.next());
+
+           /* job retention */
+           item.setDurationFld(col++, fld.next());
+
+           /* autoprune */
+           item.setBoolFld(col++, fld.next());
+
+           /* client id */
+           item.setNumericFld(col++, fld.next());
+
+           /* uname */
+           item.setTextFld(col++, fld.next());
+
          }
       }
       row ++;
    }
-   /* Resize the columns */
-   for(int cnter=0; cnter<headerlist.size(); cnter++) {
-      tableWidget->resizeColumnToContents(cnter);
-   }
+   /* set default sorting */
+   tableWidget->sortByColumn(sortcol, sortord);
+   tableWidget->setSortingEnabled(true);
+   
+   /* Resize rows and columns */
+   tableWidget->resizeColumnsToContents();
+   tableWidget->resizeRowsToContents();
 }
 
 /*
@@ -246,7 +272,7 @@ void Clients::currentStackItem()
 void Clients::consolePurgeJobs()
 {
    if (QMessageBox::warning(this, "Bat",
-      tr("Are you sure you want to purge ??  !!!.\n"
+      tr("Are you sure you want to purge all jobs of client \"%1\" ?\n"
 "The Purge command will delete associated Catalog database records from Jobs and"
 " Volumes without considering the retention period. Purge  works only on the"
 " Catalog database and does not affect data written to Volumes. This command can"
@@ -255,8 +281,9 @@ void Clients::consolePurgeJobs()
 " you are doing.\n\n"
 " Is there any way I can get you to click Cancel here?  You really don't want to do"
 " this\n\n"
-      "Press OK to proceed with the purge operation?"),
-      QMessageBox::Ok | QMessageBox::Cancel)
+        "Press OK to proceed with the purge operation?").arg(m_currentlyselected),
+        QMessageBox::Ok | QMessageBox::Cancel,
+        QMessageBox::Cancel)
       == QMessageBox::Cancel) { return; }
 
    QString cmd("purge jobs client=");
@@ -280,3 +307,4 @@ void Clients::statusClientWindow()
    QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
    new ClientStat(m_currentlyselected, parentItem);
 }
+
index 47d6b762d96bdb216bba7d98dae8ea4598c116a2..17564b4a0c45b9d941973d810972b938fc9f7f2b 100644 (file)
@@ -39,6 +39,7 @@
 #include <QMenu>
 #include "bat.h"
 #include "fileset/fileset.h"
+#include "util/fmtwidgetitem.h"
 
 FileSet::FileSet()
 {
@@ -70,7 +71,6 @@ FileSet::~FileSet()
  */
 void FileSet::populateTable()
 {
-   QTableWidgetItem *tableItem;
    QBrush blackBrush(Qt::black);
 
    if (!m_console->preventInUseConnect())
@@ -85,8 +85,12 @@ void FileSet::populateTable()
 
    tableWidget->setColumnCount(headerlist.count());
    tableWidget->setHorizontalHeaderLabels(headerlist);
+   tableWidget->horizontalHeader()->setHighlightSections(false);
    tableWidget->setRowCount(m_console->fileset_list.count());
    tableWidget->verticalHeader()->hide();
+   tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
+   tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
+   tableWidget->setSortingEnabled(false); /* rows move on insert if sorting enabled */
    int row = 0;
 
    foreach(QString filesetName, m_console->fileset_list) {
@@ -106,31 +110,36 @@ void FileSet::populateTable()
       if (m_console->sql_cmd(query, results)) {
          int resultCount = results.count();
          if (resultCount) {
-            QString resultline;
-            QString field;
-            QStringList fieldlist;
             /* only use the last one */
-            resultline = results[resultCount - 1];
-            fieldlist = resultline.split("\t");
-            int column = 0;
-            /* Iterate through fields in the record */
-            foreach (field, fieldlist) {
-               field = field.trimmed();  /* strip leading & trailing spaces */
-               tableItem = new QTableWidgetItem(field, 1);
-               tableItem->setFlags(Qt::ItemIsSelectable);
-               tableItem->setForeground(blackBrush);
-               tableItem->setData(Qt::UserRole, 1);
-               tableWidget->setItem(row, column, tableItem);
-               column++;
-            }
+            QString resultline = results[resultCount - 1];
+            QStringList fieldlist = resultline.split("\t");
+
+           TableItemFormatter item(*tableWidget, row);
+  
+           /* Iterate through fields in the record */
+           QStringListIterator fld(fieldlist);
+           int col = 0;
+
+           /* name */
+           item.setTextFld(col++, fld.next());
+
+           /* id */
+           item.setNumericFld(col++, fld.next());
+
+           /* creation time */
+           item.setTextFld(col++, fld.next());
+
          }
       }
       row++;
    }
-   /* Resize the columns */
-   for (int cnter=0; cnter<headerlist.size(); cnter++) {
-      tableWidget->resizeColumnToContents(cnter);
-   }
+   /* set default sorting */
+   tableWidget->sortByColumn(headerlist.indexOf(tr("Create Time")), Qt::DescendingOrder);
+   tableWidget->setSortingEnabled(true);
+   
+   /* Resize rows and columns */
+   tableWidget->resizeColumnsToContents();
+   tableWidget->resizeRowsToContents();
 }
 
 /*
index 0107eff392280bbcd80d1aa1d033d1dfd8fe2067..c410600213881e619ef3d643e265883f41105fb2 100644 (file)
@@ -137,6 +137,7 @@ void JobList::populateTable()
    m_checkCurrentWidget = true;
    mp_tableWidget->setColumnCount(headerlist.size());
    mp_tableWidget->setHorizontalHeaderLabels(headerlist);
+   mp_tableWidget->horizontalHeader()->setHighlightSections(false);
    mp_tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
    mp_tableWidget->setSortingEnabled(false); /* rows move on insert if sorting enabled */
 
@@ -195,10 +196,7 @@ void JobList::populateTable()
          jobitem.setJobStatusFld(col++, shortstatus, longstatus);
 
         /* purged */
-         if (fld.next().toInt())
-           jobitem.setTextFld(col++, tr("IS"), true);
-        else
-           jobitem.setTextFld(col++, tr("NOT"), true);
+        jobitem.setBoolFld(col++, fld.next());
 
         /* fileset */
          jobitem.setTextFld(col++, fld.next());
@@ -246,10 +244,23 @@ void JobList::prepareFilterWidgets()
       if (jobIndex != -1) {
          jobComboBox->setCurrentIndex(jobIndex);
       }
+
       levelComboBox->addItem(tr("Any"));
-      levelComboBox->addItems( QStringList() << "F" << "D" << "I");
-      purgedComboBox->addItem(tr("Any"));
-      purgedComboBox->addItems( QStringList() << "0" << "1");
+      levelComboBox->addItem(job_level_to_str(L_FULL), L_FULL);
+      levelComboBox->addItem(job_level_to_str(L_INCREMENTAL), L_INCREMENTAL);
+      levelComboBox->addItem(job_level_to_str(L_DIFFERENTIAL), L_DIFFERENTIAL);
+      levelComboBox->addItem(job_level_to_str(L_SINCE), L_SINCE);
+      levelComboBox->addItem(job_level_to_str(L_VERIFY_CATALOG), L_VERIFY_CATALOG);
+      levelComboBox->addItem(job_level_to_str(L_VERIFY_INIT), L_VERIFY_INIT);
+      levelComboBox->addItem(job_level_to_str(L_VERIFY_VOLUME_TO_CATALOG), L_VERIFY_VOLUME_TO_CATALOG);
+      levelComboBox->addItem(job_level_to_str(L_VERIFY_DISK_TO_CATALOG), L_VERIFY_DISK_TO_CATALOG);
+      levelComboBox->addItem(job_level_to_str(L_VERIFY_DATA), L_VERIFY_DATA);
+      /* levelComboBox->addItem(job_level_to_str(L_BASE), L_BASE);  base jobs ignored */ 
+
+      purgedComboBox->addItem(tr("Any"), -1);
+      purgedComboBox->addItem(tr("No"), 0);
+      purgedComboBox->addItem(tr("Yes"), 1);
+
       fileSetComboBox->addItem(tr("Any"));
       fileSetComboBox->addItems(m_console->fileset_list);
       int filesetIndex = fileSetComboBox->findText(m_filesetName, Qt::MatchExactly);
@@ -302,15 +313,15 @@ void JobList::fillQueryString(QString &query)
    }
    int levelIndex = levelComboBox->currentIndex();
    if ((levelIndex != -1) && (levelComboBox->itemText(levelIndex) != tr("Any"))) {
-      conditions.append("Job.Level='" + levelComboBox->itemText(levelIndex) + "'");
+      conditions.append( QString("Job.Level='%1'").arg(levelComboBox->itemData(levelIndex).toChar()) );
    }
    int statusIndex = statusComboBox->currentIndex();
    if ((statusIndex != -1) && (statusComboBox->itemText(statusIndex) != tr("Any"))) {
       conditions.append("Status.JobStatusLong='" + statusComboBox->itemText(statusIndex) + "'");
    }
    int purgedIndex = purgedComboBox->currentIndex();
-   if ((purgedIndex != -1) && (purgedComboBox->itemText(purgedIndex) != tr("Any"))) {
-      conditions.append("Job.PurgedFiles='" + purgedComboBox->itemText(purgedIndex) + "'");
+   if (purgedIndex != -1 && purgedComboBox->itemData(purgedIndex).toInt() >= 0 ) {
+      conditions.append("Job.PurgedFiles='" + purgedComboBox->itemData(purgedIndex).toString() + "'");
    }
    int fileSetIndex = fileSetComboBox->currentIndex();
    if (fileSetIndex != -1)
@@ -372,22 +383,16 @@ void JobList::currentStackItem()
  */
 void JobList::treeWidgetName(QString &desc)
 {
-   if ((m_mediaName == "") && (m_clientName == "") && (m_jobName == "") && (m_filesetName == "")) {
-      desc = "JobList";
+   if (m_mediaName != "" ) {
+     desc = tr("JobList of Volume %1").arg(m_mediaName);
+   } else if (m_clientName != "" ) {
+     desc = tr("JobList of Client %1").arg(m_clientName);
+   } else if (m_jobName != "" ) {
+     desc = tr("JobList of Job %1").arg(m_jobName);
+   } else if (m_filesetName != "" ) {
+     desc = tr("JobList of fileset %1").arg(m_filesetName);
    } else {
-      desc = "JobList ";
-      if (m_mediaName != "" ) {
-         desc += "of Volume " + m_mediaName;
-      }
-      if (m_clientName != "" ) {
-         desc += "of Client " + m_clientName;
-      }
-      if (m_jobName != "" ) {
-         desc += "of Job " + m_jobName;
-      }
-      if (m_filesetName != "" ) {
-         desc += "of fileset " + m_filesetName;
-      }
+     desc = tr("JobList");
    }
 }
 
@@ -406,7 +411,7 @@ void JobList::tableItemChanged(QTableWidgetItem *currentItem, QTableWidgetItem *
       jobitem = mp_tableWidget->item(row, m_purgedIndex);
       QString purged = jobitem->text();
       mp_tableWidget->removeAction(actionPurgeFiles);
-      if (purged == "NOT") {
+      if (purged == tr("No") ) {
          mp_tableWidget->addAction(actionPurgeFiles);
       }
       /* include restore from time and job action or not */
@@ -414,7 +419,7 @@ void JobList::tableItemChanged(QTableWidgetItem *currentItem, QTableWidgetItem *
       QString type = jobitem->text();
       mp_tableWidget->removeAction(actionRestoreFromJob);
       mp_tableWidget->removeAction(actionRestoreFromTime);
-      if (type == "Backup") {
+      if (type == tr("Backup")) {
          mp_tableWidget->addAction(actionRestoreFromJob);
          mp_tableWidget->addAction(actionRestoreFromTime);
       }
@@ -422,7 +427,7 @@ void JobList::tableItemChanged(QTableWidgetItem *currentItem, QTableWidgetItem *
       jobitem = mp_tableWidget->item(row, m_statusIndex);
       QString status = jobitem->text();
       mp_tableWidget->removeAction(actionCancelJob);
-      if (status == "Running") {
+      if (status == tr("Running")) {
          mp_tableWidget->addAction(actionCancelJob);
       }
    }
@@ -681,9 +686,9 @@ void JobList::selectedJobsGet()
    }
    m_selectedJobsCount = rowList.count();
    if (m_selectedJobsCount > 1) {
-      QString text = QString("Delete list of %1 Jobs").arg(m_selectedJobsCount);
-      actionDeleteJob->setText(text);
+     QString text = QString( tr("Delete list of %1 Jobs")).arg(m_selectedJobsCount);
+       actionDeleteJob->setText(text);
    } else {
-      actionDeleteJob->setText("Delete Single Job");
+     actionDeleteJob->setText(tr("Delete Single Job"));
    }
 }
index e1288c3c4d22aa5dd33897c9de54851cf6894187..02faf498399c74984b53e6b9246598345ee1ebe3 100644 (file)
@@ -38,6 +38,7 @@
 #include "bat.h"
 #include "jobs/jobs.h"
 #include "run/run.h"
+#include "util/fmtwidgetitem.h"
 
 Jobs::Jobs()
 {
@@ -68,7 +69,6 @@ Jobs::~Jobs()
  */
 void Jobs::populateTable()
 {
-   QTableWidgetItem *tableItem;
    QBrush blackBrush(Qt::black);
 
    if (!m_console->preventInUseConnect())
@@ -86,56 +86,42 @@ void Jobs::populateTable()
 
    tableWidget->setColumnCount(headerlist.count());
    tableWidget->setHorizontalHeaderLabels(headerlist);
+   tableWidget->horizontalHeader()->setHighlightSections(false);
    tableWidget->setRowCount(m_console->job_list.count());
    tableWidget->verticalHeader()->hide();
-   int row = 0;
-
+   tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
+   tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
+   tableWidget->setSortingEnabled(false); /* rows move on insert if sorting enabled */
 
+   int row = 0;
    foreach (QString jobName, m_console->job_list){
       job_defaults job_defs;
       job_defs.job_name = jobName;
       if (m_console->get_job_defaults(job_defs)) {
+        int col = 0;
+        TableItemFormatter jobsItem(*tableWidget, row);
+        jobsItem.setTextFld(col++, jobName); 
+        jobsItem.setTextFld(col++, job_defs.pool_name);
+        jobsItem.setTextFld(col++, job_defs.messages_name);
+        jobsItem.setTextFld(col++, job_defs.client_name);
+        jobsItem.setTextFld(col++, job_defs.store_name);
+        jobsItem.setTextFld(col++, job_defs.level);
+        jobsItem.setTextFld(col++, job_defs.type);
+        jobsItem.setTextFld(col++, job_defs.fileset_name);
+        jobsItem.setTextFld(col++, job_defs.catalog_name);
+        jobsItem.setBoolFld(col++, job_defs.enabled);
+        jobsItem.setTextFld(col++, job_defs.where);
 
-        for (int column=0; column<headerlist.count(); column++) {
-            tableItem = new QTableWidgetItem(1);
-            if (column == 0) 
-               tableItem->setText(job_defs.job_name);
-            if (column == 1) 
-               tableItem->setText(job_defs.pool_name);
-            if (column == 2) 
-               tableItem->setText(job_defs.messages_name);
-            if (column == 3) 
-               tableItem->setText(job_defs.client_name);
-            if (column == 4) 
-               tableItem->setText(job_defs.store_name);
-            if (column == 5) 
-               tableItem->setText(job_defs.level);
-            if (column == 6) 
-               tableItem->setText(job_defs.type);
-            if (column == 7) 
-               tableItem->setText(job_defs.fileset_name);
-            if (column == 8) 
-               tableItem->setText(job_defs.catalog_name);
-            if (column == 9) {
-               if (job_defs.enabled)
-                  tableItem->setText("Yes");
-               else
-                  tableItem->setText("No");
-            }
-            if (column == 10) 
-               tableItem->setText(job_defs.where);
-
-            /* tableItem->setFlags(Qt::ItemIsSelectable); */
-            tableItem->setForeground(blackBrush);
-            tableWidget->setItem(row, column, tableItem);
-         }
       }
       row++;
    }
-   /* Resize the columns */
-   for(int cnter=0; cnter<headerlist.size(); cnter++) {
-      tableWidget->resizeColumnToContents(cnter);
-   }
+   /* set default sorting */
+   tableWidget->sortByColumn(headerlist.indexOf(tr("Job Name")), Qt::AscendingOrder);
+   tableWidget->setSortingEnabled(true);
+   
+   /* Resize rows and columns */
+   tableWidget->resizeColumnsToContents();
+   tableWidget->resizeRowsToContents();
 }
 
 /*
@@ -180,8 +166,7 @@ void Jobs::tableItemChanged(QTableWidgetItem *currentwidgetitem, QTableWidgetIte
          tableWidget->addAction(actionConsoleDisableJob);
          tableWidget->addAction(actionConsoleCancel);
          tableWidget->addAction(actionJobListQuery);
-         if (type == tr("Backup"))
-            tableWidget->addAction(actionRunJob);
+         tableWidget->addAction(actionRunJob);
       }
    }
 }
@@ -274,7 +259,7 @@ void Jobs::listJobs()
 }
 
 /*
- * Open a new job run page with the currentley selected "Backup" job 
+ * Open a new job run page with the currently selected job 
  * defaulted In
  */
 void Jobs::runJob()
index e52342b1ab6f04ed14ffbaf8bfe16068cc2d47a3..b01a62c595faab4b281c896515d0db2d46aded3f 100644 (file)
@@ -74,7 +74,7 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
    readPreferences();
    treeWidget->clear();
    treeWidget->setColumnCount(1);
-   treeWidget->setHeaderLabel("Select Page");
+   treeWidget->setHeaderLabel( tr("Select Page") );
    treeWidget->setContextMenuPolicy(Qt::ActionsContextMenu);
 
    createPages();
@@ -125,7 +125,7 @@ void MainWin::createPages()
 
       /* Create Tree Widget Item */
       item = new QTreeWidgetItem(topItem);
-      item->setText(0, "Console");
+      item->setText(0, tr("Console"));
       if (!m_firstItem){ m_firstItem = item; }
       item->setIcon(0,QIcon(QString::fromUtf8(":images/utilities-terminal.png")));
 
@@ -453,7 +453,7 @@ void MainWin::statusPageButtonClicked()
    bool found = false;
    foreach(Pages *page, m_pagehash) {
       if (m_currentConsole == page->console()) {
-         if (page->name() == "Director Status") {
+        if (page->name() == tr("Director Status")) {
             found = true;
             page->setCurrent();
          }
@@ -500,10 +500,10 @@ void MainWin::input_line()
 void MainWin::about()
 {
    QMessageBox::about(this, tr("About bat"),
-      tr("<br><h2>bat " VERSION "(" BDATE "), by Dirk H Bartley and Kern Sibbald</h2>"
-         "<p>Copyright &copy; 2007-" BYEAR " Free Software Foundation Europe e.V."
+      tr("<br><h2>bat %1 (%2), by Dirk H Bartley and Kern Sibbald</h2>"
+         "<p>Copyright &copy; 2007-%3 Free Software Foundation Europe e.V."
          "<p>The <b>bat</b> is an administrative console"
-         " interface to the Director."));
+         " interface to the Director.").arg(VERSION).arg(BDATE).arg(BYEAR));
 }
 
 void MainWin::help()
index df333588159d87769f5382c0c872078967220378..d8da0986caa933fe9cf5800235ecb198fb815987 100644 (file)
@@ -258,11 +258,10 @@ void Pages::changeEvent(QEvent *event)
  */
 void Pages::setTitle()
 {
-   QString title, director;
-   treeWidgetName(title);
+   QString wdgname, director;
+   treeWidgetName(wdgname);
    m_console->getDirResName(director);
-   title += tr(" of Director ");
-   title += director;
+   QString title = tr("%1 of Director %2").arg(wdgname).arg(director);
    setWindowTitle(title);
 }
 
@@ -289,13 +288,12 @@ void Pages::setCurrent()
 void Pages::setContextMenuDockText()
 {
    QTreeWidgetItem *item = mainWin->getFromHash(this);
-   QString docktext("");
+   QString docktext;
    if (isDocked()) {
-       docktext += tr("UnDock ");
+      docktext = tr("UnDock %1 Window").arg(item->text(0));
    } else {
-       docktext += tr("ReDock ");
+      docktext = tr("ReDock %1 Window").arg(item->text(0));
    }
-   docktext += item->text(0) += tr(" Window");
       
    mainWin->actionToggleDock->setText(docktext);
    setTreeWidgetItemDockColor();
@@ -309,7 +307,7 @@ void Pages::setTreeWidgetItemDockColor()
 {
    QTreeWidgetItem* item = mainWin->getFromHash(this);
    if (item) {
-      if (item->text(0) != "Console") {
+      if (item->text(0) != tr("Console")) {
          if (isDocked()) {
          /* Set the brush to blue if undocked */
             QBrush blackBrush(Qt::black);
index b8c739f41d873c3414080720f9451207c081e1eb..dbcccc253fed13b522b7a6b62e331ff50a368136 100644 (file)
@@ -10,9 +10,7 @@
    </rect>
   </property>
   <property name="sizePolicy" >
-   <sizepolicy>
-    <hsizetype>0</hsizetype>
-    <vsizetype>0</vsizetype>
+   <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
    <iconset>images/bat.png</iconset>
   </property>
   <layout class="QGridLayout" >
-   <property name="margin" >
+   <property name="leftMargin" >
     <number>9</number>
    </property>
-   <property name="spacing" >
+   <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="1" column="0" >
     <widget class="QTabWidget" name="tabWidget" >
      <property name="currentIndex" >
-      <number>0</number>
+      <number>2</number>
      </property>
      <widget class="QWidget" name="tab" >
       <attribute name="title" >
@@ -49,9 +59,7 @@
         </rect>
        </property>
        <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>0</hsizetype>
-         <vsizetype>0</vsizetype>
+        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
         </rect>
        </property>
        <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>0</hsizetype>
-         <vsizetype>0</vsizetype>
+        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
           <height>24</height>
          </rect>
         </property>
-        <property name="maximum" >
-         <number>3600</number>
-        </property>
         <property name="minimum" >
          <number>15</number>
         </property>
+        <property name="maximum" >
+         <number>3600</number>
+        </property>
        </widget>
       </widget>
      </widget>
        <string>Joblist</string>
       </attribute>
       <layout class="QGridLayout" >
-       <property name="margin" >
+       <property name="leftMargin" >
         <number>9</number>
        </property>
-       <property name="spacing" >
+       <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="QGroupBox" name="groupBox_2" >
          <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>0</hsizetype>
-           <vsizetype>0</vsizetype>
+          <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
           <string>Jolist Limit Options</string>
          </property>
          <layout class="QGridLayout" >
-          <property name="margin" >
+          <property name="leftMargin" >
            <number>9</number>
           </property>
-          <property name="spacing" >
+          <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" >
            <layout class="QGridLayout" >
-            <property name="margin" >
+            <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>
-            <property name="spacing" >
+            <property name="horizontalSpacing" >
+             <number>6</number>
+            </property>
+            <property name="verticalSpacing" >
              <number>6</number>
             </property>
             <item row="2" column="0" >
             </item>
             <item row="3" column="0" >
              <widget class="QSpinBox" name="daysSpinBox" >
-              <property name="maximum" >
-               <number>10000</number>
-              </property>
               <property name="minimum" >
                <number>1</number>
               </property>
+              <property name="maximum" >
+               <number>10000</number>
+              </property>
               <property name="singleStep" >
                <number>7</number>
               </property>
             </item>
             <item row="1" column="0" >
              <widget class="QSpinBox" name="recordSpinBox" >
-              <property name="maximum" >
-               <number>10000</number>
-              </property>
               <property name="minimum" >
                <number>1</number>
               </property>
+              <property name="maximum" >
+               <number>10000</number>
+              </property>
               <property name="singleStep" >
                <number>25</number>
               </property>
          </rect>
         </property>
         <property name="text" >
-         <string>Convert Bytes with IEC 1000B = KB</string>
+         <string>Display Bytes using IEC units (1024B = 1 KiB)</string>
         </property>
        </widget>
        <widget class="QRadioButton" name="radioConvertStandard" >
          </rect>
         </property>
         <property name="text" >
-         <string>Convert Bytes with 1024B = KB</string>
+         <string>Display Bytes using SI units (1000B = 1KB)</string>
         </property>
        </widget>
       </widget>
         <string>Context Sensitive List Commands</string>
        </property>
        <layout class="QGridLayout" >
-        <property name="margin" >
+        <property name="leftMargin" >
+         <number>9</number>
+        </property>
+        <property name="topMargin" >
+         <number>9</number>
+        </property>
+        <property name="rightMargin" >
          <number>9</number>
         </property>
-        <property name="spacing" >
+        <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" >
        <string>Debug</string>
       </attribute>
       <layout class="QGridLayout" >
-       <property name="margin" >
+       <property name="leftMargin" >
         <number>9</number>
        </property>
-       <property name="spacing" >
+       <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="QGroupBox" name="groupBox_3" >
          <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>0</hsizetype>
-           <vsizetype>0</vsizetype>
+          <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
           <string>Debugging Options</string>
          </property>
          <layout class="QGridLayout" >
-          <property name="margin" >
+          <property name="leftMargin" >
            <number>9</number>
           </property>
-          <property name="spacing" >
+          <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" >
            <layout class="QGridLayout" >
-            <property name="margin" >
+            <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>
-            <property name="spacing" >
+            <property name="horizontalSpacing" >
+             <number>6</number>
+            </property>
+            <property name="verticalSpacing" >
              <number>6</number>
             </property>
             <item row="0" column="0" >
        <string>RestoreTree</string>
       </attribute>
       <layout class="QGridLayout" >
-       <property name="margin" >
+       <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="spacing" >
+       <property name="horizontalSpacing" >
+        <number>6</number>
+       </property>
+       <property name="verticalSpacing" >
         <number>6</number>
        </property>
        <item row="0" column="0" >
         <widget class="QGroupBox" name="groupBox_5" >
          <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>0</hsizetype>
-           <vsizetype>0</vsizetype>
+          <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
           <string>Debugging Options</string>
          </property>
          <layout class="QGridLayout" >
-          <property name="margin" >
+          <property name="leftMargin" >
+           <number>9</number>
+          </property>
+          <property name="topMargin" >
+           <number>9</number>
+          </property>
+          <property name="rightMargin" >
            <number>9</number>
           </property>
-          <property name="spacing" >
+          <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" >
            <layout class="QGridLayout" >
-            <property name="margin" >
+            <property name="leftMargin" >
+             <number>0</number>
+            </property>
+            <property name="topMargin" >
+             <number>0</number>
+            </property>
+            <property name="rightMargin" >
              <number>0</number>
             </property>
-            <property name="spacing" >
+            <property name="bottomMargin" >
+             <number>0</number>
+            </property>
+            <property name="horizontalSpacing" >
+             <number>6</number>
+            </property>
+            <property name="verticalSpacing" >
              <number>6</number>
             </property>
             <item row="10" column="0" >
    </item>
    <item row="0" column="0" >
     <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
      <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>
       <spacer>
        <property name="orientation" >
      <item>
       <widget class="QLabel" name="headingLabel" >
        <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>0</hsizetype>
-         <vsizetype>0</vsizetype>
+        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
index 68f0300321f87696df2fc0a262c8287e698000ed..d6a0ccf9059cf27ff4846a56cbae058341c0df2e 100644 (file)
@@ -133,6 +133,7 @@ void runPage::job_name_change(int index)
    (void)index;
    job_defs.job_name = jobCombo->currentText();
    if (m_console->get_job_defaults(job_defs)) {
+      typeLabel->setText("<H3>"+job_defs.type+"</H3>");
       filesetCombo->setCurrentIndex(filesetCombo->findText(job_defs.fileset_name, Qt::MatchExactly));
       levelCombo->setCurrentIndex(levelCombo->findText(job_defs.level, Qt::MatchExactly));
       clientCombo->setCurrentIndex(clientCombo->findText(job_defs.client_name, Qt::MatchExactly));
index bfca07fac4b8c1d1bf904aacf7a93953745b63da..bb97e1d4418221885287cf2a39f28d3c97302431 100644 (file)
@@ -42,6 +42,7 @@
 #include <QString>
 #include <QStringList>
 #include <math.h>
+#include "bacula.h"
 #include "fmtwidgetitem.h"
 
 /***********************************************
@@ -295,29 +296,22 @@ void ItemFormatterBase::setJobStatusFld(int index, const QString &shortstatus,
 
 void ItemFormatterBase::setJobTypeFld(int index, const QString &fld, bool center)
 {
-   static QHash<QString, QString> jobt;
-   if (jobt.isEmpty()) {
-      jobt.insert("B", QObject::tr("Backup"));
-      jobt.insert("R", QObject::tr("Restore"));
-      jobt.insert("V", QObject::tr("Verify"));
-      jobt.insert("A", QObject::tr("Admin"));
+   QByteArray jtype(fld.trimmed().toAscii());
+   if (jtype.size()) {
+      setTextFld(index, job_type_to_str(jtype[0]), center);
+   } else {
+      setTextFld(index, "", center);
    }
-
-   setTextFld(index, jobt.value(fld.trimmed(), fld.trimmed()), center);
 }
 
 void ItemFormatterBase::setJobLevelFld(int index, const QString &fld, bool center)
 {
-   static QHash<QString, QString> jobt;
-   if (jobt.isEmpty()) {
-      jobt.insert("F", QObject::tr("Full"));
-      jobt.insert("D", QObject::tr("Differential"));
-      jobt.insert("I", QObject::tr("Incremental"));
-      jobt.insert("C", QObject::tr("Catalog"));
-      jobt.insert("O", QObject::tr("VolToCatalog"));
+   QByteArray lvl(fld.trimmed().toAscii());
+   if (lvl.size()) {
+      setTextFld(index, job_level_to_str(lvl[0]), center);
+   } else {
+      setTextFld(index, "", center);
    }
-
-   setTextFld(index, jobt.value(fld.trimmed(), fld.trimmed()), center);
 }