From feec626054e2c1e8d33857ae0f38e54ff18f3807 Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Wed, 21 May 2008 11:37:18 +0000 Subject: [PATCH] This is a patch from Riccardo. It is for updating translations. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7000 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/clients/clients.cpp | 84 ++++--- bacula/src/qt-console/fileset/fileset.cpp | 51 ++-- bacula/src/qt-console/joblist/joblist.cpp | 67 ++--- bacula/src/qt-console/jobs/jobs.cpp | 71 +++--- bacula/src/qt-console/mainwin.cpp | 12 +- bacula/src/qt-console/pages.cpp | 16 +- bacula/src/qt-console/prefs.ui | 243 ++++++++++++++----- bacula/src/qt-console/run/run.cpp | 1 + bacula/src/qt-console/util/fmtwidgetitem.cpp | 28 +-- 9 files changed, 360 insertions(+), 213 deletions(-) diff --git a/bacula/src/qt-console/clients/clients.cpp b/bacula/src/qt-console/clients/clients.cpp index e38e7e4c39..60c2645eea 100644 --- a/bacula/src/qt-console/clients/clients.cpp +++ b/bacula/src/qt-console/clients/clients.cpp @@ -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; cnterresizeColumnToContents(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); } + diff --git a/bacula/src/qt-console/fileset/fileset.cpp b/bacula/src/qt-console/fileset/fileset.cpp index 47d6b762d9..17564b4a0c 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -39,6 +39,7 @@ #include #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; cnterresizeColumnToContents(cnter); - } + /* set default sorting */ + tableWidget->sortByColumn(headerlist.indexOf(tr("Create Time")), Qt::DescendingOrder); + tableWidget->setSortingEnabled(true); + + /* Resize rows and columns */ + tableWidget->resizeColumnsToContents(); + tableWidget->resizeRowsToContents(); } /* diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index 0107eff392..c410600213 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -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")); } } diff --git a/bacula/src/qt-console/jobs/jobs.cpp b/bacula/src/qt-console/jobs/jobs.cpp index e1288c3c4d..02faf49839 100644 --- a/bacula/src/qt-console/jobs/jobs.cpp +++ b/bacula/src/qt-console/jobs/jobs.cpp @@ -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; columnsetText(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; cnterresizeColumnToContents(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() diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index e52342b1ab..b01a62c595 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -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("

bat " VERSION "(" BDATE "), by Dirk H Bartley and Kern Sibbald

" - "

Copyright © 2007-" BYEAR " Free Software Foundation Europe e.V." + tr("

bat %1 (%2), by Dirk H Bartley and Kern Sibbald

" + "

Copyright © 2007-%3 Free Software Foundation Europe e.V." "

The bat is an administrative console" - " interface to the Director.")); + " interface to the Director.").arg(VERSION).arg(BDATE).arg(BYEAR)); } void MainWin::help() diff --git a/bacula/src/qt-console/pages.cpp b/bacula/src/qt-console/pages.cpp index df33358815..d8da0986ca 100644 --- a/bacula/src/qt-console/pages.cpp +++ b/bacula/src/qt-console/pages.cpp @@ -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); diff --git a/bacula/src/qt-console/prefs.ui b/bacula/src/qt-console/prefs.ui index b8c739f41d..dbcccc253f 100644 --- a/bacula/src/qt-console/prefs.ui +++ b/bacula/src/qt-console/prefs.ui @@ -10,9 +10,7 @@ - - 0 - 0 + 0 0 @@ -24,16 +22,28 @@ images/bat.png - + 9 - + + 9 + + + 9 + + + 9 + + + 6 + + 6 - 0 + 2 @@ -49,9 +59,7 @@ - - 0 - 0 + 0 0 @@ -109,9 +117,7 @@ - - 0 - 0 + 0 0 @@ -154,12 +160,12 @@ 24 - - 3600 - 15 + + 3600 + @@ -168,18 +174,28 @@ Joblist - + 9 - + + 9 + + + 9 + + + 9 + + + 6 + + 6 - - 0 - 0 + 0 0 @@ -188,18 +204,42 @@ Jolist Limit Options - + 9 - + + 9 + + + 9 + + + 9 + + + 6 + + 6 - + + 0 + + + 0 + + + 0 + + 0 - + + 6 + + 6 @@ -211,12 +251,12 @@ - - 10000 - 1 + + 10000 + 7 @@ -224,12 +264,12 @@ - - 10000 - 1 + + 10000 + 25 @@ -288,7 +328,7 @@ - Convert Bytes with IEC 1000B = KB + Display Bytes using IEC units (1024B = 1 KiB) @@ -301,7 +341,7 @@ - Convert Bytes with 1024B = KB + Display Bytes using SI units (1000B = 1KB) @@ -318,10 +358,22 @@ Context Sensitive List Commands - + + 9 + + + 9 + + 9 - + + 9 + + + 6 + + 6 @@ -391,18 +443,28 @@ Debug - + 9 - + + 9 + + + 9 + + + 9 + + + 6 + + 6 - - 0 - 0 + 0 0 @@ -411,18 +473,42 @@ Debugging Options - + 9 - + + 9 + + + 9 + + + 9 + + + 6 + + 6 - + + 0 + + + 0 + + + 0 + + 0 - + + 6 + + 6 @@ -472,18 +558,28 @@ RestoreTree - + + 9 + + + 9 + + + 9 + + 9 - + + 6 + + 6 - - 0 - 0 + 0 0 @@ -492,18 +588,42 @@ Debugging Options - + + 9 + + + 9 + + 9 - + + 9 + + + 6 + + 6 - + + 0 + + + 0 + + 0 - + + 0 + + + 6 + + 6 @@ -611,12 +731,21 @@ - - 0 - 6 + + 0 + + + 0 + + + 0 + + + 0 + @@ -633,9 +762,7 @@ - - 0 - 0 + 0 0 diff --git a/bacula/src/qt-console/run/run.cpp b/bacula/src/qt-console/run/run.cpp index 68f0300321..d6a0ccf905 100644 --- a/bacula/src/qt-console/run/run.cpp +++ b/bacula/src/qt-console/run/run.cpp @@ -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("

"+job_defs.type+"

"); 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)); diff --git a/bacula/src/qt-console/util/fmtwidgetitem.cpp b/bacula/src/qt-console/util/fmtwidgetitem.cpp index bfca07fac4..bb97e1d441 100644 --- a/bacula/src/qt-console/util/fmtwidgetitem.cpp +++ b/bacula/src/qt-console/util/fmtwidgetitem.cpp @@ -42,6 +42,7 @@ #include #include #include +#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 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 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); } -- 2.39.5