while ((stat = read()) > 0) {
if (mainWin->m_displayAll) {
display_text(msg());
- display_text("\n");
+ display_text("\n");
}
strip_trailing_junk(msg());
results << msg();
if (mainWin->m_commDebug) Pmsg0(000, "DisplaytoPrompt\n");
while (!m_at_prompt) {
if ((stat=read()) > 0) {
- buf += msg();
- if (buf.size() >= 8196 || m_messages_pending) {
- display_text(buf);
- buf.clear();
- m_messages_pending = false;
- }
+ buf += msg();
+ if (buf.size() >= 8196 || m_messages_pending) {
+ display_text(buf);
+ buf.clear();
+ m_messages_pending = false;
+ }
}
}
display_text(buf);
displayToPrompt();
} else {
while (!m_at_prompt) {
- stat=read();
+ stat=read();
}
}
if (mainWin->m_commDebug) Pmsg1(000, "endDiscardToPrompt=%d\n", stat);
}
+int Console::sock_read()
+{
+ int stat;
+#ifdef HAVE_WIN32
+ bool isEnabled = m_notifier->isEnabled();
+ if (isEnabled) {
+ m_notifier->setEnabled(false);
+ }
+ stat = m_sock->recv();
+ if (isEnabled) {
+ m_notifier->setEnabled(true);
+ }
+#else
+ stat = m_sock->recv();
+#endif
+ return stat;
+}
/*
* Blocking read from director
}
}
m_sock->msg[0] = 0;
- stat = m_sock->recv();
+ stat = sock_read();
if (stat >= 0) {
if (mainWin->m_commDebug) Pmsg1(000, "got: %s\n", m_sock->msg);
if (m_at_prompt) {
break;
case BNET_ERROR_MSG:
if (mainWin->m_commDebug) Pmsg0(000, "ERROR MSG\n");
- m_sock->recv(); /* get the message */
+ stat = sock_read(); /* get the message */
display_text(msg());
QMessageBox::critical(this, "Error", msg(), QMessageBox::Ok);
break;
case BNET_WARNING_MSG:
if (mainWin->m_commDebug) Pmsg0(000, "WARNING MSG\n");
- m_sock->recv(); /* get the message */
+ stat = sock_read(); /* get the message */
display_text(msg());
QMessageBox::critical(this, "Warning", msg(), QMessageBox::Ok);
break;
case BNET_INFO_MSG:
if (mainWin->m_commDebug) Pmsg0(000, "INFO MSG\n");
- m_sock->recv(); /* get the message */
+ stat = sock_read(); /* get the message */
display_text(msg());
mainWin->set_status(msg());
break;
{
if (!is_connected()) {
QString message = tr("Director %1 is currently disconnected\n"
- "Please reconnect!").arg(m_dir->name());
+ "Please reconnect!").arg(m_dir->name());
QMessageBox::warning(this, "Bat", message, QMessageBox::Ok );
return false;
} else if (!m_at_main_prompt){
QString message = tr("Director %1 is currently busy\n Please complete "
- "restore or other operation! This is a limitation "
- "that will be resolved before a beta release. "
- "This is currently an alpha release.").arg(m_dir->name());
+ "restore or other operation! This is a limitation "
+ "that will be resolved before a beta release. "
+ "This is currently an alpha release.").arg(m_dir->name());
QMessageBox::warning(this, "Bat", message, QMessageBox::Ok );
return false;
} else if (!m_at_prompt){
QString message = tr("Director %1 is currently not at a prompt\n"
- " Please try again!").arg(m_dir->name());
+ " Please try again!").arg(m_dir->name());
QMessageBox::warning(this, "Bat", message, QMessageBox::Ok );
return false;
} else {
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2007-2008 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 display_html(const QString buf);
void update_cursor(void);
void write_dir(const char *buf);
+ int sock_read();
bool dir_cmd(const char *cmd, QStringList &results);
bool dir_cmd(QString &cmd, QStringList &results);
bool sql_cmd(const char *cmd, QStringList &results);