Class sh::ui::OpenWithDialog

class sh::ui::OpenWithDialog : public sh::ui::Dialog

The ‘Open With’ dialog.

Subclassed by sh::ui::qt::QtOpenWithDialog, sh::ui::web::WebOpenWithDialog

Public Functions

OpenWithDialog(std::shared_ptr<sh::filesystem::FilesystemNode> node, QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> openMethods)

Parameters
  • node: The file which is later to be opened.

  • openMethods: The open-methods (programs for opening the file) to present for choice.

std::shared_ptr<sh::tools::filetypes::OpenMethod> chosenMethod() = 0

Returns the chosen open-method (program for opening the file).

bool rememberForMimetype() = 0

Returns if the chosen method is checked to be remembered for the same mime-type in the future.

std::shared_ptr<const sh::filesystem::Eurl> rememberForDirectory() = 0

If it’s checked for the chosen method to be remembered for some subdirectory in the future, it returns the Eurl of this subdirectory, otherwise nullptr.

bool rememberForFile() = 0

Returns if the chosen method is checked to be remembered for the same file in the future.

std::shared_ptr<sh::filesystem::FilesystemNode> node()

Returns the file node which is later to be opened.

QList<std::shared_ptr<tools::filetypes::OpenMethod>> openMethods()

Returns the open-methods (programs for opening the file) to present for choice.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Members

std::shared_ptr<sh::filesystem::FilesystemNode> _node
QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> _openMethods