|
|
static const char * | GetOwnVersionString () |
| |
|
static bool | IsHeadless () |
| | True if the application doesn't show any window and only works in the background.
|
| |
|
static void | SetHeadless (bool bHeadless) |
| | Set to true if the application doesn't show any window and only works in the background.
|
| |
|
static bool | IsUnattended () |
| | True if no user is present to interact with the application. Always true in headless mode.
|
| |
| static void | SetUnattended () |
| |
| static void | ReportSuppressedDialog (ezStringView sDescription) |
| |
| static bool | SuppressModalWindow (ezStringView sDescription) |
| |
| static void | ReportFailedAssert (ezStringView sReport) |
| |
|
static ezArrayPtr< const ezString > | GetFailedAsserts () |
| |
|
static void | ClearFailedAsserts () |
| |
| static ezArrayPtr< const ezString > | GetSuppressedDialogs () |
| |
|
static void | ClearSuppressedDialogs () |
| |
| static void | MessageBoxStatus (const ezStatus &s, const char *szFailureMsg, const char *szSuccessMsg="", bool bOnlySuccessMsgIfDetails=true) |
| |
|
static void | MessageBoxInformation (const ezFormatString &msg, ezStringView sDontShowAgainID={}) |
| | Shows an information message box.
|
| |
|
static void | MessageBoxWarning (const ezFormatString &msg) |
| | Shows an warning message box.
|
| |
| static QMessageBox::StandardButton | MessageBoxQuestion (const ezFormatString &msg, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton, QMessageBox::StandardButton unattendedButton) |
| |
| static void | ShowAllDocumentsTemporaryStatusBarMessage (const ezFormatString &msg, ezTime timeOut) |
| |
|
static void | ShowAllDocumentsPermanentStatusBarMessage (const ezFormatString &msg, Event::TextType type) |
| |
|
static void | ShowGlobalStatusBarMessage (const ezFormatString &msg) |
| | Shows a 'critical' message in all container windows (in red), which does not disappear, until it is replaced with another (empty) string.
|
| |
|
static ezResult | OpenFileInDefaultProgram (ezStringView sPath) |
| | Opens the given file in the program that is registered in the OS to handle that file type.
|
| |
|
static ezResult | OpenInVisualStudio (ezStringView sPath) |
| | Open the given file in Visual Studio.
|
| |
|
static ezResult | OpenInRider (ezStringView sPath) |
| | Open the given file in Jetbrains Rider.
|
| |
|
static void | OpenInExplorer (ezStringView sPath, bool bIsFile) |
| | Opens the given file or folder in the Explorer.
|
| |
|
static void | OpenWith (ezStringView sPath) |
| | Shows the "Open With" dialog.
|
| |
|
static ezStatus | OpenInVsCode (const QStringList &arguments) |
| | Attempts to launch Visual Studio Code with the given command line.
|
| |
| static const QIcon & | GetCachedIconResource (ezStringView sIdentifier, ezColor svgTintColor=ezColor::MakeZero()) |
| |
| static const QImage & | GetCachedImageResource (const char *szIdentifier) |
| |
| static const QPixmap & | GetCachedPixmapResource (const char *szIdentifier) |
| |
| static ezResult | AddToGitIgnore (const char *szGitIgnoreFile, const char *szPattern) |
| |
|
static void | CheckForUpdates () |
| | Raises the 'CheckForUpdates' event.
|
| |
| static void | GotoLinkTarget (ezStringView sLinkTarget) |
| |
Returns a cached QIcon that was created from an internal Qt resource (e.g. 'QIcon(":QtNamespace/MyIcon.png")' ). Prevents creating the object over and over.
If svgTintColor is a non-zero color, and sIdentifier points to an .SVG file, then the first time the icon is requested with that color, a copy is made, and the SVG content is modified such that white ("#FFFFFF") gets replaced by the requested color. Thus multiple tints of the same icon can be created for different use cases. Usually this is used to get different shades of the same icon, such that it looks good on the target background.
| void ezQtUiServices::GotoLinkTarget |
( |
ezStringView |
sLinkTarget | ) |
|
|
static |
For opening internal links to documents, object references, etc.
Used for instance by log windows to support embedded links. Can be links to assets, document or even objects inside scenes. Could also be external URLs. What's supported is determined by whoever handles the request. The link target should look like this: "scheme:string". The "scheme:" allows handlers to distinguish the format of the rest of the string and whether it supports it.
| void ezQtUiServices::ReportFailedAssert |
( |
ezStringView |
sReport | ) |
|
|
static |
Records a failed assert instead of letting it open its dialog, and returns whether it was handled.
Installed as the global assert handler by Init(). While a user is present nothing changes - the assert goes to the previous handler, which breaks into the debugger or shows the usual dialog. It is only unattended that an assert has nowhere to go: the dialog blocks the main thread, so the application stops answering entirely and whoever triggered the assert never learns that it fired.
The failed condition is logged and collected like a suppressed dialog, and execution continues past an assert that was meant to stop it. That is a deliberate trade: continuing is not safe, but the caller does get told, whereas a hung process tells nobody anything. Anything reporting these should say that the application's state is now questionable and that it should be restarted.
| void ezQtUiServices::ReportSuppressedDialog |
( |
ezStringView |
sDescription | ) |
|
|
static |
Records that a dialog or message box was not shown, because IsUnattended() is set.
Whoever triggered the operation would otherwise have no way to tell a suppressed dialog apart from the operation simply doing nothing. sDescription should identify what was suppressed well enough to act on it, i.e. the dialog's class name or the text of the message box.
Called by ezQtDialog and the MessageBox* functions; call it manually when suppressing a modal window that goes through neither.
| void ezQtUiServices::SetUnattended |
( |
| ) |
|
|
static |
Set if the application runs without a user present, e.g. driven by a script or an AI agent.
The UI is still shown, but everything that would block waiting for input must not be displayed. The message box functions below therefore only log their message and return their unattended answer, and ezQtDialog::exec() returns without showing anything. Code that opens a modal window in some other way (QFileDialog, QInputDialog, ...) has to check this itself, otherwise it stalls the application indefinitely.
This is one-way, for a process that is unattended for its entire runtime (the '-unattended' command line option). To make only part of a normal editor session unattended, use ezQtScopedUnattended.
| bool ezQtUiServices::SuppressModalWindow |
( |
ezStringView |
sDescription | ) |
|
|
static |
Checks whether a modal window may be opened at all, and records its suppression when it may not.
For modal windows that do not go through ezQtDialog and therefore have to check for themselves: QFileDialog, QInputDialog, QMessageBox used directly, and anything else that enters a nested event loop. Returns true when the window must NOT be shown - the caller then continues as if the user had cancelled it, which for a file picker means an empty selection.
Only worth adding where an automated caller can actually reach the window, i.e. in code triggered by a global ezAction. A picker that only opens from a button inside another dialog is already covered, because that dialog never opens.