*/
bool Console::sql_cmd(const char *query, QStringList &results)
{
+ if (!is_connectedGui())
+ return false;
int stat;
POOL_MEM cmd(PM_MESSAGE);
{
name_returned = m_dir->name();
}
+
+bool Console::is_connectedGui()
+{
+ if (is_connected()) {
+ return true;
+ } else {
+ 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;
+ }
+}
bool sql_cmd(QString &cmd, QStringList &results);
bool authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons);
bool is_connected() { return m_sock != NULL; };
+ bool is_connectedGui();
const QFont get_font();
void writeSettings();
void readSettings();
/* let the next page BE the console */
nextPage = nextConsole;
} else {
- printf("Should never get here\n");
+ /* Should never get here */
nextPage = NULL;
nextConsole = NULL;
}
}
}
- /* now process the next item */
+ /* process the current (next) item */
if ((nextPage) || (nextConsole)) {
if (nextConsole != previousConsole) {
*/
void Pages::consoleCommand(QString &command)
{
+ if (!m_console->is_connectedGui())
+ return;
m_console->display_text("Context sensitive command :\n\n");
m_console->display_text("**** ");
m_console->display_text(command + " ****\n");