Human readable in joblist for purged, joblevel and job type.
Possibly a stack of past screens so that when you open a window from another,
-closing would brint the previous one back.
+closing would bring the previous one back.
Is there a way to query the director/database for whether a storage is currently
mounted so I am not presenting both mount and unmount to the user??
{
QTreeWidgetItem *clientItem, *topItem;
+ if (!m_console->preventInUseConnect())
+ return;
m_checkcurwidget = false;
mp_treeWidget->clear();
m_checkcurwidget = true;
if (is_connected()) {
return true;
} else {
+ QString message("Director ");
+ message += " is curerntly disconnected\n Please reconnect!!";
+ QMessageBox::warning(this, tr("Bat"),
+ tr(message.toUtf8().data()), QMessageBox::Ok );
+ return false;
+ }
+}
+
+/*
+ * A temporary function to prevent connecting to the director if the director
+ * is busy with a restore.
+ */
+bool Console::preventInUseConnect()
+{
+ if (!is_connected()) {
QString message("Director ");
message += m_dir->name();
message += " is curerntly disconnected\n Please reconnect!!";
QMessageBox::warning(this, tr("Bat"),
tr(message.toUtf8().data()), QMessageBox::Ok );
return false;
+ } else if (!m_at_main_prompt){
+ QString message("Director ");
+ message += m_dir->name();
+ message += " is curerntly busy\n Please complete restore or other "
+" operation !! This is a limitation that will be resolved before a beta"
+" release. This is currently an alpa release.";
+ QMessageBox::warning(this, tr("Bat"),
+ tr(message.toUtf8().data()), QMessageBox::Ok );
+ return false;
+ } else if (!m_at_prompt){
+ QString message("Director ");
+ message += m_dir->name();
+ message += " is curerntly not at a prompt\n Please try again!!";
+ QMessageBox::warning(this, tr("Bat"),
+ tr(message.toUtf8().data()), QMessageBox::Ok );
+ return false;
+ } else {
+ return true;
}
}
bool authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons);
bool is_connected() { return m_sock != NULL; };
bool is_connectedGui();
+ bool preventInUseConnect();
const QFont get_font();
void writeSettings();
void readSettings();
{
QTreeWidgetItem *filesetItem, *topItem;
+ if (!m_console->preventInUseConnect())
+ return;
m_checkcurwidget = false;
mp_treeWidget->clear();
QString resultline;
QBrush blackBrush(Qt::black);
+ if (!m_console->preventInUseConnect())
+ return;
+
/* Can't do this in constructor because not neccesarily conected in constructor */
if (!m_populated) {
clientsComboBox->addItem("Any");
QString heading("<A href=\"#top\">Log records for job ");
heading += m_jobId + "</A>\n";
textEdit->insertHtml(heading);
+
+ if (!m_console->preventInUseConnect())
+ return;
QString query("");
query = "SELECT Time, LogText FROM Log WHERE JobId='" + m_jobId + "'";
m_status = "";
m_slot = 0;
-
setupUi(this);
+ if (!m_console->preventInUseConnect())
+ return;
+
/* The media's pool */
poolCombo->addItems(console->pool_list);
{
QTreeWidgetItem *mediatreeitem, *pooltreeitem, *topItem;
+ if (!m_console->preventInUseConnect())
+ return;
+
QStringList headerlist = (QStringList()
<< "Volume Name" << "Id" << "Status" << "Enabled"
<< "Bytes" << "Files" << "Jobs" << "Retention"
*/
void Pages::consoleCommand(QString &command)
{
- if (!m_console->is_connectedGui()) {
+ /*if (!m_console->is_connectedGui())
+ return;*/
+ if (!m_console->preventInUseConnect())
return;
- }
/* Bring this directors console to the front of the stack */
setConsoleCurrent();
QString displayhtml("<font color=\"blue\">");
m_console->notify(false);
m_closeable = true;
+ if (!m_console->preventInUseConnect())
+ return;
+
jobCombo->addItems(m_console->job_list);
filesetCombo->addItems(m_console->fileset_list);
clientCombo->addItems(m_console->client_list);
cmd += pri;
cmd += " yes\n";
- consoleCommand(cmd);
+ setConsoleCurrent();
+ QString displayhtml("<font color=\"blue\">");
+ displayhtml += cmd + "</font>\n";
+ m_console->display_html(displayhtml);
+ m_console->display_text("\n");
+ m_console->write_dir(cmd.toUtf8().data());
+ m_console->displayToPrompt();
+// consoleCommand(cmd); ***FIXME set back to consoleCommand when connection issue is resolved
+
m_console->notify(true);
closeStackPage();
}
{
QTreeWidgetItem *storageItem, *topItem;
+ if (!m_console->preventInUseConnect())
+ return;
+
m_checkcurwidget = false;
mp_treeWidget->clear();
m_checkcurwidget = true;