Esempio n. 1
0
void notify_remote_exit(void *frontend)
{
    GuiTerminalWindow *f = static_cast<GuiTerminalWindow*>(frontend);
    int exitcode = f->backend->exitcode(f->backhandle);

    if (f->userClosingTab || f->isSockDisconnected)
        return;

    if (exitcode >=0) {
        if (f->cfg.close_on_exit == FORCE_ON ||
            (f->cfg.close_on_exit == AUTO && exitcode != INT_MAX)) {
            f->closeTerminal();
        } else {
            /* exitcode == INT_MAX indicates that the connection was closed
             * by a fatal error, so an error box will be coming our way and
             * we should not generate this informational one. */
            if (exitcode != INT_MAX) {
                qt_message_box(frontend, APPNAME " Fatal Error",
                               "Connection closed by remote host");
                f->setSessionTitle(f->getSessionTitle() + " (inactive)");
                // prevent recursive calling
                f->isSockDisconnected = true;
            }
        }
    }
}
Esempio n. 2
0
void qutty_connection_fatal(void *frontend, char *msg)
{
    GuiTerminalWindow *f = static_cast<GuiTerminalWindow*>(frontend);
    if (f->userClosingTab || f->isSockDisconnected)
        return;

    // prevent recursive calling
    f->isSockDisconnected = true;

    qt_critical_msgbox(frontend, msg, NULL);

    if (f->cfg.close_on_exit == FORCE_ON)
        f->closeTerminal();
    f->setSessionTitle(f->getSessionTitle() + " (inactive)");
}