#include "clients/clients.h"
#include "run/run.h"
#include "status/clientstat.h"
+#include "util/fmtwidgetitem.h"
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){
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();
}
/*
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"
" 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=");
QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
new ClientStat(m_currentlyselected, parentItem);
}
+
#include <QMenu>
#include "bat.h"
#include "fileset/fileset.h"
+#include "util/fmtwidgetitem.h"
FileSet::FileSet()
{
*/
void FileSet::populateTable()
{
- QTableWidgetItem *tableItem;
QBrush blackBrush(Qt::black);
if (!m_console->preventInUseConnect())
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) {
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();
}
/*
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 */
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());
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);
}
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)
*/
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");
}
}
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 */
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);
}
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);
}
}
}
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"));
}
}
#include "bat.h"
#include "jobs/jobs.h"
#include "run/run.h"
+#include "util/fmtwidgetitem.h"
Jobs::Jobs()
{
*/
void Jobs::populateTable()
{
- QTableWidgetItem *tableItem;
QBrush blackBrush(Qt::black);
if (!m_console->preventInUseConnect())
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();
}
/*
tableWidget->addAction(actionConsoleDisableJob);
tableWidget->addAction(actionConsoleCancel);
tableWidget->addAction(actionJobListQuery);
- if (type == tr("Backup"))
- tableWidget->addAction(actionRunJob);
+ tableWidget->addAction(actionRunJob);
}
}
}
}
/*
- * 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()
readPreferences();
treeWidget->clear();
treeWidget->setColumnCount(1);
- treeWidget->setHeaderLabel("Select Page");
+ treeWidget->setHeaderLabel( tr("Select Page") );
treeWidget->setContextMenuPolicy(Qt::ActionsContextMenu);
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")));
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();
}
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 © 2007-" BYEAR " Free Software Foundation Europe e.V."
+ tr("<br><h2>bat %1 (%2), by Dirk H Bartley and Kern Sibbald</h2>"
+ "<p>Copyright © 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()
*/
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);
}
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();
{
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);
</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" >
</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>
(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));
#include <QString>
#include <QStringList>
#include <math.h>
+#include "bacula.h"
#include "fmtwidgetitem.h"
/***********************************************
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);
}