Class Avogadro::MoleQueue::MoleQueueDialog#

class MoleQueueDialog : public QDialog#

The MoleQueueDialog class provides a thin wrapper around MoleQueueWidget for standalone use.

<avogadro/molequeue/molequeuedialog.h>

Unnamed Group

MoleQueueWidget &widget()#
Returns:

A reference to the internal MoleQueueWidget instance.

const MoleQueueWidget &widget() const#
Returns:

A reference to the internal MoleQueueWidget instance.

Public Types

enum SubmitOption#

Options controlling job submission behavior in the submitJob method.

Values:

enumerator WaitForSubmissionResponse#

Keep the dialog open until MoleQueue replies to the submission request. If a submission error occurs, the user will have to opportunity to fix it.

enumerator SelectProgramFromTemplate#

Use the program in the template job to initialize the queue/program view. All queues containing a matching program will be expanded, and the first match will be selected. To match, an existing program must contain the template program string, and comparisons are case insensitive.

enum SubmitStatus#

Return values from submitJob indicating result.

Values:

enumerator SubmissionSuccessful#

The job was accepted by MoleQueue. This can only be returned when WaitForSubmissionResponse IS set as an option.

enumerator SubmissionFailed#

The job was not submitted to MoleQueue, likely due to a disconnected server. This can only be returned when WaitForSubmissionResponse IS NOT set as an option.

enumerator SubmissionAttempted#

The job was submitted to MoleQueue. This can only be returned when WaitForSubmissionResponse is NOT set as an option.

enumerator SubmissionAborted#

The user canceled the submission.

enumerator JobFailed#

The user requested that the job output be opened when finished, but the job did not finish successfully (the job was either canceled or failed).

enumerator JobFinished#

The user requested that the job output be opened when finished, and the job completed without error. The jobTemplate argument of submitJob will be overwritten with the current job details, fetched from the server after the job enters the “Finished” state.

Public Functions

explicit MoleQueueDialog(QWidget *parent_ = nullptr)#
~MoleQueueDialog() override#

Public Slots

void done(int r) override#

Public Static Functions

static SubmitStatus submitJob(QWidget *parent_, const QString &caption, JobObject &jobTemplate, SubmitOptions options, unsigned int *moleQueueId = nullptr, int *submissionRequestId = nullptr)#

Show a job configuration dialog and let the user submit the job to MoleQueue.

Parameters:
  • parent_ – The parent widget for parenting/layout purposes.

  • caption – The dialog title.

  • jobTemplate – A template job, used to initialize GUI options. If the user requests that the job output is opened and the job finishes successfully, this will be overwritten with the current job details, and JobFinished is returned.

  • options – Bitwise combination of flags that control dialog behavior.

  • moleQueueId – If not nullptr, the variable referenced by this pointer will be overwritten by the MoleQueue Id of the submitted job when the option WaitForSubmissionResponse is set. If an error occurs or the required option is not set, this value will be set to MoleQueueWidget::InvalidMoleQueueId.

  • submissionRequestId – If not nullptr, the variable referenced by this pointer will be overwritten by the submitJob JSON-RPC 2.0 request id. If an error occurs, this value will be set to -1.

Returns:

A SubmitStatus enum value indicating the result of the submission.

static bool promptForJobOptions(QWidget *windowParent, const QString &caption, JobObject &jobTemplate)#

Show a job configuration dialog and collect the user’s selected options.

Parameters:
  • windowParent – The parent of the dialog window.

  • caption – Title of the dialog window.

  • jobTemplate – JobObject with initial options. Will be overwritten with the configured job options.

Returns:

True on success, false otherwise.