]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/bcomm/dircomm.cpp
Did not intend to leave those debugging lines there.
[bacula/bacula] / bacula / src / qt-console / bcomm / dircomm.cpp
index c3de1c6e90526af1735757e5e0af5e316b5b9913..86f52651a3e0293447c07c7e5c3433db458401c7 100644 (file)
@@ -42,9 +42,7 @@
 
 static int tls_pem_callback(char *buf, int size, const void *userdata);
 
-DirComm::DirComm(Console *parent, int conn):
-m_notifier(NULL),
-m_api_set(false)
+DirComm::DirComm(Console *parent, int conn):  m_notifier(NULL),  m_api_set(false)
 {
    m_console = parent;
    m_sock = NULL;
@@ -267,7 +265,11 @@ int DirComm::sock_read()
  */
 int DirComm::read()
 {
-   int stat = 0;
+   int stat = -1;
+
+   if (!m_sock) {
+      return -1;
+   }
    while (m_sock) {
       for (;;) {
          if (!m_sock) break;
@@ -277,12 +279,12 @@ int DirComm::read()
          } 
          app->processEvents();
          if (m_api_set && m_console->is_messagesPending() && is_notify_enabled() && m_console->hasFocus()) {
-            m_console->write_dir(m_conn, ".messages");
+            m_console->write_dir(m_conn, ".messages", false);
             m_console->messagesPending(false);
          }
       }
       if (!m_sock) {
-         return BNET_HARDEOF;
+         return -1;
       }
       m_sock->msg[0] = 0;
       stat = sock_read();
@@ -298,7 +300,7 @@ int DirComm::read()
       case BNET_MSGS_PENDING :
          if (is_notify_enabled() && m_console->hasFocus()) {
             if (mainWin->m_commDebug) Pmsg1(000, "conn %i MSGS PENDING\n", m_conn);
-            m_console->write_dir(m_conn, ".messages");
+            m_console->write_dir(m_conn, ".messages", false);
             m_console->displayToPrompt(m_conn);
             m_console->messagesPending(false);
          }
@@ -351,8 +353,9 @@ int DirComm::read()
          }
          continue;
       case BNET_START_SELECT:
+         notify(false);
          if (mainWin->m_commDebug) Pmsg1(000, "conn %i START SELECT\n", m_conn);
-         new selectDialog(m_console);
+         new selectDialog(m_console, m_conn);
          break;
       case BNET_YESNO:
          if (mainWin->m_commDebug) Pmsg1(000, "conn %i YESNO\n", m_conn);
@@ -378,8 +381,7 @@ int DirComm::read()
       case BNET_WARNING_MSG:
          if (mainWin->m_commDebug) Pmsg1(000, "conn %i WARNING MSG\n", m_conn);
          stat = sock_read();          /* get the message */
-         m_console->display_text(msg());
-         QMessageBox::critical(m_console, "Warning", msg(), QMessageBox::Ok);
+         /* QMessageBox::critical(m_console, "Warning", msg(), QMessageBox::Ok); */
          break;
       case BNET_INFO_MSG:
          if (mainWin->m_commDebug) Pmsg1(000, "conn %i INFO MSG\n", m_conn);