return true; /* ***FIXME*** return any command error */
}
+/*
+ * OverLoads for sql_cmd
+ */
+bool Console::sql_cmd(int &conn, QString &query, QStringList &results)
+{
+ return sql_cmd(conn, query.toUtf8().data(), results, false);
+}
+
bool Console::sql_cmd(QString &query, QStringList &results)
{
- return sql_cmd(query.toUtf8().data(), results);
+ int conn;
+ if (!availableDirComm(conn))
+ return false;
+ return sql_cmd(conn, query.toUtf8().data(), results, true);
}
-/*
- * Send an sql query to the Director, and return the
- * results in a QStringList.
- */
bool Console::sql_cmd(const char *query, QStringList &results)
{
int conn;
if (!availableDirComm(conn))
return false;
+ return sql_cmd(conn, query, results, true);
+}
+/*
+ * Send an sql query to the Director, and return the
+ * results in a QStringList.
+ */
+bool Console::sql_cmd(int &conn, const char *query, QStringList &results, bool donotify)
+{
DirComm *dircomm = m_dircommHash.value(conn);
int stat;
POOL_MEM cmd(PM_MESSAGE);
if (mainWin->m_connDebug)
Pmsg2(000, "sql_cmd conn %i %s\n", conn, query);
- notify(conn, false);
+ if (donotify)
+ dircomm->notify(false);
pm_strcpy(cmd, ".sql query=\"");
pm_strcat(cmd, query);
results << dircomm->msg();
first = false;
}
- notify(conn, true);
+ if (donotify)
+ dircomm->notify(true);
discardToPrompt(conn);
return true; /* ***FIXME*** return any command error */
}
}
}
+/*
+ * get_job_defaults overload
+ */
+bool Console::get_job_defaults(struct job_defaults &job_defs)
+{
+ int conn;
+ return get_job_defaults(conn, job_defs, true);
+}
+
+bool Console::get_job_defaults(int &conn, struct job_defaults &job_defs)
+{
+ return get_job_defaults(conn, job_defs, false);
+}
+
/*
* Send a job name to the director, and read all the resulting
* defaults.
*/
-bool Console::get_job_defaults(struct job_defaults &job_defs)
+bool Console::get_job_defaults(int &conn, struct job_defaults &job_defs, bool donotify)
{
QString scmd;
int stat;
char *def;
- int conn = notifyOff();
+ if (donotify)
+ conn = notifyOff();
beginNewCommand(conn);
DirComm *dircomm = m_dircommHash.value(conn);
if (mainWin->m_connDebug)
}
}
- notify(conn, true);
+ if (donotify)
+ notify(conn, true);
return true;
bail_out:
- notify(conn, true);
+ if (donotify)
+ notify(conn, true);
return false;
}
bool dir_cmd(QString &cmd, QStringList &results);
bool sql_cmd(const char *cmd, QStringList &results);
bool sql_cmd(QString &cmd, QStringList &results);
+ bool sql_cmd(int &conn, QString &cmd, QStringList &results);
+ bool sql_cmd(int &conn, const char *cmd, QStringList &results, bool donotify);
int write_dir(const char *buf);
void write_dir(int conn, const char *buf);
void getDirResName(QString &);
void display_textf(const char *fmt, ...);
void display_html(const QString buf);
bool get_job_defaults(struct job_defaults &);
+ bool get_job_defaults(int &conn, struct job_defaults &);
const QFont get_font();
void beginNewCommand(int conn);
void getVolumeList(QStringList &);
void getStatusList(QStringList &);
private:
+ bool get_job_defaults(int &conn, struct job_defaults &, bool donotify);
void update_cursor(void);
void stopTimer();
bool is_connectedGui();