#include "findlib/find.h"
/* Imported variables */
+extern struct s_jl joblevels[];
+extern struct s_jt jobtypes[];
/* Imported functions */
extern void do_messages(UAContext *ua, const char *cmd);
static bool levelscmd(UAContext *ua, const char *cmd)
{
- ua->send_msg("Incremental\n");
- ua->send_msg("Full\n");
- ua->send_msg("Differential\n");
- ua->send_msg("VirtualFull\n");
- ua->send_msg("Catalog\n");
- ua->send_msg("InitCatalog\n");
- ua->send_msg("VolumeToCatalog\n");
- ua->send_msg("Base\n");
+ int i;
+ /* Note some levels are blank, which means none is needed */
+ if (ua->argc == 1) {
+ for (i=0; joblevels[i].level_name; i++) {
+ if (joblevels[i].level_name[0] != ' ') {
+ ua->send_msg("%s\n", joblevels[i].level_name);
+ }
+ }
+ } else if (ua->argc == 2) {
+ int jobtype = 0;
+ /* Assume that first argument is the Job Type */
+ for (i=0; jobtypes[i].type_name; i++) {
+ if (strcasecmp(ua->argk[1], jobtypes[i].type_name) == 0) {
+ jobtype = jobtypes[i].job_type;
+ break;
+ }
+ }
+ for (i=0; joblevels[i].level_name; i++) {
+ if ((joblevels[i].job_type == jobtype) && (joblevels[i].level_name[0] != ' ')) {
+ ua->send_msg("%s\n", joblevels[i].level_name);
+ }
+ }
+ }
+
return true;
}
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2007-2010 Free Software Foundation Europe e.V.
+ Copyright (C) 2007-2011 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
(void)index;
job_defs.job_name = jobCombo->currentText();
if (m_console->get_job_defaults(job_defs)) {
+ QString cmd;
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));
poolCombo->setCurrentIndex(poolCombo->findText(job_defs.pool_name, Qt::MatchExactly));
storageCombo->setCurrentIndex(storageCombo->findText(job_defs.store_name, Qt::MatchExactly));
messagesCombo->setCurrentIndex(messagesCombo->findText(job_defs.messages_name, Qt::MatchExactly));
+ m_console->level_list.clear();
+ cmd = ".levels " + job_defs.type;
+ m_console->dir_cmd(cmd, m_console->level_list);
+ levelCombo->clear();
+ levelCombo->addItems(m_console->level_list);
+ levelCombo->setCurrentIndex(levelCombo->findText(job_defs.level, 0 /*Qt::MatchExactly*/));
}
}