![]() |
NDEVR
API Documentation
|
Manages all windows and logic surrounding dialogs and views for displaying and managing any environment within the application. More...
Public Member Functions | |
| WindowManager (QTModelManager *manager) | |
| Constructs a WindowManager with the given model manager. | |
| virtual DockWidget< AboutDialog > * | aboutDialog () |
| Returns the about dialog, which details information about the application, and instruction manuals, if available. | |
| virtual void | addCustomDockWidget (DockInit *widget) |
| Adds a widget to be docked in the default location when a project has been loaded. | |
| virtual void | addInitialSetupSettingsMenu (WidgetInit *menu, bool always_show=false) |
| Adds a menu to the initial setup dialog shown on first launch. | |
| virtual void | addSettingsMenu (WidgetInit *menu, std::function< void()> reset_to_defaults) |
| Adds a dialog to the logic such that, should a settings dialog be created, the dialog will be added to the menu. | |
| virtual DockWidget< AsciiModelFileDialog > * | asciiExporterWindow (Buffer< UUID > model, const Buffer< FileRequest > &file) |
| Returns the ASCII exporter dialog configured for the given model and file requests. | |
| virtual DockWidget< AsciiModelFileDialog > * | asciiImporterWindow () |
| Returns the dialog adjusting used for adjust the import settings of a given ascii file request. | |
| virtual DockWidget< AsciiModelFileDialog > * | asciiImporterWindow (const Buffer< FileRequest > &requests) |
| Returns the ASCII importer dialog configured for the given file requests. | |
| virtual void | clearAll ()=0 |
| Resets the entire display to original initial state, before a project was loaded. | |
| virtual void | closeAll (const PopupInfo &popup_origin=PopupInfo()) |
| Prompts the user to save changes, if required, then closes everything returning to application initial state with no project loaded. | |
| void | createNewProject (bool show_settings, const PopupInfo &popup_origin=PopupInfo()) |
| Creates a new project and shows any relevant information based on show_settings parameter. | |
| virtual void | createNewProjectNow (bool show_settings, const PopupInfo &popup_origin=PopupInfo()) |
| Creates a new project immediately without prompting to save. | |
| virtual void | exit (bool relaunch=false, const StringView &relaunch_options="--relaunch") |
| Saves user settings and exits the application, relaunching if requested. | |
| virtual DockWidget< AutoModelFileDialog > * | exporterWindow (Buffer< UUID > model, const Buffer< FileRequest > &file) |
| Returns the dialog adjusting the export settings of a given file request. | |
| virtual void | exportFile (ExportRequest request) |
| Called when the user exports. | |
| virtual void | exportFiles (Buffer< UUID > model, const Buffer< FileRequest > &files, const PopupInfo &popup_origin) |
| Called when the user has selected a file format and default data to export. | |
| virtual FileChooserDialog * | fileChooser () |
| Returns the default file chooser dialog used for user selection of files for import or export. | |
| virtual DockWidget< AutoModelFileDialog > * | importerWindow () |
| Returns the dialog adjusting used for adjust the import settings of a given file request. | |
| virtual DockWidget< AutoModelFileDialog > * | importerWindow (const Buffer< FileRequest > &requests) |
| Returns the dialog adjusting the import settings of a given file request. | |
| virtual void | importUserFiles (const Buffer< FileRequest > &files, PopupInfo popup_origin=PopupInfo()) |
| Called when the user has requested to import and has selected a file. | |
| void | initialSetupFinishedSignal () |
| Signal emitted when the initial setup process has completed. | |
| void | initKeypad () |
| Initializes the on-screen keypad for touch input. | |
| virtual DockWidget< LogManagerDialog > * | logView () |
| Returns the dialog for viewing all application logs related to the session and project. | |
| virtual QWidget * | mainWindow () const =0 |
| Returns the primary window for the application. | |
| virtual void | onNewProjectSelected (bool show_settings, const PopupInfo &popup_origin=PopupInfo()) |
| Creates a new project and shows any relevant information based on show_settings parameter. | |
| virtual void | onNewProjectSelected (const PopupInfo &popup_origin=PopupInfo()) |
| Creates a new project and shows any relevant information based on WindowOptions. | |
| void | onNewProjectSignal () |
| Signal emitted when a new project is created. | |
| virtual void | openUserFiles (const Buffer< FileRequest > &files, PopupInfo popup_origin=PopupInfo()) |
| Opens user-selected files as new projects or adds them to the current project. | |
| virtual void | recoverLastData () |
| Attempts to recover data from the last session if it was not properly saved. | |
| virtual void | removeCustomDockWidget (DockInit *widget) |
| Removes a widget that was added with addCustomDockWidget. | |
| virtual void | removeInitialSetupSettingsMenu (WidgetInit *menu) |
| Removes a previously added initial setup settings menu. | |
| virtual void | removeSettingsMenu (WidgetInit *menu) |
| Removes a previously added settings menu from the settings dialog. | |
| virtual void | requestExit (const PopupInfo &popup_origin=PopupInfo()) |
| Prompts the user to confirm an exit and save changes if required. | |
| virtual void | requestExit (QCloseEvent *event, const PopupInfo &popup_origin=PopupInfo()) |
| Prompts the user to confirm an exit and save changes if required. | |
| virtual void | requestExitWithFunction (std::function< void()> exit_function, const PopupInfo &popup_origin=PopupInfo()) |
| Prompts the user to confirm an exit and save changes if required. | |
| virtual void | saveImage (const StringView &image_id, const File &default_file, PopupInfo info) |
| Prompts the user to save an image to a file location. | |
| virtual void | saveProjectAs (const PopupInfo &popup_origin=PopupInfo()) |
| Called when the user has selected the project to save and we want to allow them to rename the file Will prompt the user for any additional export settings, if required, then export data. | |
| virtual void | setMainWindowCallback (const std::function< void(QWidget *)> &main_window_callback) |
| Sets a callback invoked when the main window is created or changed. | |
| virtual DockWidget< SettingsDialog > * | settingsDialog () |
| Returns the settings dialog for allowing the user to adjust application specific objects. | |
| virtual void | showImportDialogIfNeeded (const Buffer< FileRequest > &file, PopupInfo popup_origin=PopupInfo()) |
| Shows the import settings dialog if additional configuration is needed for the file requests. | |
| virtual void | showMainScreen () |
| Shows the main screen and puts it in front of any windows. | |
| virtual void | showModelProperties (const ShowPropertiesSettings &settings) |
| Called when we want to show the dialog for editing a specific object using application default editing dialogs. | |
| void | simulateKeyPress (int key) |
| Simulates a key press event as if the user pressed a key on the keyboard. | |
| virtual void | updateModified ()=0 |
| Called when application should check to see if the project has been modified since last save. | |
| void | userDataAdded (Buffer< UUID > object) |
| Signal emitted when user data has been added to the project. | |
| virtual void | userDeleteObjects (const Buffer< UUID > &ids, PopupInfo info) |
| Called when the user deletes objects. | |
| virtual void | userImportFile (PopupInfo popup_origin, const Buffer< FileFormat > &formats) |
| Called when the user has requested to import a file. | |
| virtual void | userImportFile (PopupInfo popup_origin=PopupInfo()) |
| Called when the user has requested to import a file. | |
| virtual void | userOpenProject (PopupInfo popup_origin=PopupInfo()) |
| Called when the user has requested to choose a project file to open. | |
| Public Member Functions inherited from PopupManager | |
| PopupManager () | |
| Constructs a PopupManager. | |
| virtual ContainerWidgetBase * | container () const |
| Returns the primary container widget for adding new docks. | |
| virtual RibbonArea | defaultRibbonArea (const QCustomDockWidget *) |
| Returns the default ribbon area for a dock widget. | |
| virtual void | hideWidget (QWidget *widget, const PopupInfo &popup_origin) |
| Hides a widget that was previously shown as a popup. | |
| void | setupAsPopupHandler () |
| Registers this manager as the application's popup handler service. | |
| virtual bool | showWidget (QWidget *widget, PopupInfo popup_origin, PopupInfo popup_end) |
| Shows a widget as a popup with animation from origin to destination. | |
Protected Member Functions | |
| virtual void | addProjectFolderToRecents () |
| Adds the current project folder to the recent directories list. | |
| FactoryParameterBuffer | convertRequest (const Buffer< FileRequest > &requests) |
| Converts file requests into a FactoryParameterBuffer for IO processing. | |
| virtual AboutDialog * | createAboutDialog () |
| Creates and returns a new AboutDialog instance. | |
| virtual AsciiModelFileDialog * | createAsciiModelFileDialog (bool is_import) |
| Creates and returns a new AsciiModelFileDialog for import or export. | |
| virtual AutoModelFileDialog * | createAutoModelFileDialog (bool is_import) |
| Creates and returns a new AutoModelFileDialog for import or export. | |
| virtual FileChooserDialog * | createFileChooserDialog () |
| Creates and returns a new FileChooserDialog instance. | |
| virtual LogManagerDialog * | createLogView () |
| Creates and returns a new LogManagerDialog instance. | |
| virtual SettingsDialog * | createSettingsDialog () |
| Creates and returns a new SettingsDialog instance. | |
| virtual DropArea | defaultDropArea (const QCustomDockWidget *dock_widget) const |
| Returns the default drop area for a given dock widget. | |
| virtual SectionWidget * | defaultDropReference (const QCustomDockWidget *dock_widget=nullptr) const |
| Returns the default section widget to drop relative to. | |
| virtual void | hideSplashScreen (const TimeSpan &delay_time, const TimeSpan &fade_time) |
| Hides the splash screen with the specified delay and fade animation. | |
| virtual InitialSetupDialog * | initialSetupDialog () |
| Returns or creates the initial setup dialog. | |
| void | initialSetupFinishedSlot () |
| Slot invoked when the initial setup process has completed. | |
| virtual void | layoutAll () |
| Performs a full layout pass, arranging all dock widgets and panels. | |
| void | lockScreenToWindowSize () |
| Locks the screen resolution to match the current window size. | |
| virtual void | setupExporterWindow (AutoModelFileDialog *window, Buffer< UUID > model, const Buffer< FileRequest > &file) |
| Configures an exporter window with the given model objects and file requests. | |
| void | updateFileDialog (const Buffer< UUID > &model, const Buffer< FileFormat > &formats, StringView extension, bool show_recents, bool save_dialog) |
| Updates the file chooser dialog with format filters and options. | |
| void | updateFileDialogToProject () |
| Updates the file dialog to default to the current project directory. | |
| virtual void | updateFromWindowOptions () |
| Updates the window layout and behavior based on the current WindowOptions. | |
Protected Attributes | |
| DockWidget< AboutDialog > * | m_about_dock = nullptr |
| The about dialog dock. | |
| DockWidget< AsciiModelFileDialog > * | m_ascii_export_dock = nullptr |
| The ASCII export file dialog dock. | |
| DockWidget< AsciiModelFileDialog > * | m_ascii_import_dock = nullptr |
| The ASCII import file dialog dock. | |
| Buffer< DockInit * > | m_custom_dock_widgets |
| Custom dock widgets registered by modules. | |
| DesignObjectDialogLookup * | m_dialog_lookup |
| Lookup table for design object editing dialogs. | |
| Dictionary< UUID, QPointer< DockWidget< DesignObjectDialog > > > | m_editor_docks |
| Map of object UUIDs to their editor dock widgets. | |
| DockWidget< AutoModelFileDialog > * | m_export_dock = nullptr |
| The export file dialog dock. | |
| String | m_export_image_id |
| The identifier of the image being exported. | |
| FileChooserDialog * | m_file_chooser = nullptr |
| The main file chooser dialog. | |
| bool | m_has_setup_keypad = false |
| Whether the on-screen keypad has been initialized. | |
| FileChooserDialog * | m_image_export = nullptr |
| File chooser dialog for image export. | |
| DockWidget< AutoModelFileDialog > * | m_import_dock = nullptr |
| The import file dialog dock. | |
| Buffer< std::tuple< WidgetInit *, bool > > | m_initial_settings_dialogs |
| Registered initial setup menus and their always-show flags. | |
| InitialSetupDialog * | m_initial_setup_dialog = nullptr |
| The initial setup dialog instance. | |
| bool | m_is_exiting = false |
| Whether the application is in the process of exiting. | |
| QPointer< DockWidget< Keypad > > | m_key_pad_dock = nullptr |
| The docked keypad widget for touch input. | |
| DockWidget< LogManagerDialog > * | m_log_dock = nullptr |
| The log manager dialog dock. | |
| std::function< void(QWidget *)> | m_main_window_callback |
| Callback invoked when the main window is created. | |
| QTModelManager * | m_model_manager = nullptr |
| The model manager providing project data. | |
| Buffer< std::tuple< WidgetInit *, std::function< void()> > > | m_settings_dialogs |
| Registered settings menus and their reset callbacks. | |
| DockWidget< SettingsDialog > * | m_settings_dock = nullptr |
| The settings dialog dock. | |
| Protected Attributes inherited from PopupManager | |
| Dictionary< QObject *, QPointer< QCustomDockWidget > > | m_docks |
| Mapping of objects to their associated dock widgets. | |
| PopupWidget * | m_popup_widget = nullptr |
| The popup widget used for displaying popup content. | |
Manages all windows and logic surrounding dialogs and views for displaying and managing any environment within the application.
class: WindowManager
Author: Tyler Parke
Definition at line 68 of file WindowManager.h.
| WindowManager::WindowManager | ( | QTModelManager * | manager | ) |
Constructs a WindowManager with the given model manager.
| [in] | manager | The model manager providing project and design data. |
References WindowManager().
Referenced by WindowManager().
|
virtual |
Returns the about dialog, which details information about the application, and instruction manuals, if available.
|
virtual |
Adds a widget to be docked in the default location when a project has been loaded.
If a project is loaded, dialog will be added and docked immediately
| [in] | widget | - The widget to be docked |
Reimplemented in QTWindowManager.
|
virtual |
Adds a menu to the initial setup dialog shown on first launch.
| [in] | menu | The menu to add. |
| [in] | always_show | Whether to always show this menu, even on subsequent launches. |
|
virtual |
Adds a dialog to the logic such that, should a settings dialog be created, the dialog will be added to the menu.
Provided function will be called if the user decides to reset the settings to default
| [in] | menu | - The menu to be added to the settings dialog |
| [in] | reset_to_defaults | - The function to be called if the user decides to reset the settings to default |
|
virtual |
Returns the ASCII exporter dialog configured for the given model and file requests.
| [in] | model | The UUIDs of the model objects to export. |
| [in] | file | The file requests to configure for export. |
|
virtual |
Returns the dialog adjusting used for adjust the import settings of a given ascii file request.
|
virtual |
Returns the ASCII importer dialog configured for the given file requests.
| [in] | requests | The file requests to configure for import. |
|
pure virtual |
Resets the entire display to original initial state, before a project was loaded.
Author: Tyler Parke
Date: 2023-01-16
Implemented in FormSheetWindowManager, and QTWindowManager.
Prompts the user to save changes, if required, then closes everything returning to application initial state with no project loaded.
| [in] | popup_origin | - The origin where any animations should occur |
|
protected |
Converts file requests into a FactoryParameterBuffer for IO processing.
| [in] | requests | The file requests to convert. |
|
protectedvirtual |
Creates and returns a new AboutDialog instance.
|
protectedvirtual |
Creates and returns a new AsciiModelFileDialog for import or export.
| [in] | is_import | Whether the dialog is for importing (true) or exporting (false). |
|
protectedvirtual |
Creates and returns a new AutoModelFileDialog for import or export.
| [in] | is_import | Whether the dialog is for importing (true) or exporting (false). |
|
protectedvirtual |
Creates and returns a new FileChooserDialog instance.
|
protectedvirtual |
Creates and returns a new LogManagerDialog instance.
Reimplemented in QTWindowManager.
| void WindowManager::createNewProject | ( | bool | show_settings, |
| const PopupInfo & | popup_origin = PopupInfo() ) |
Creates a new project and shows any relevant information based on show_settings parameter.
| [in] | show_settings | - if true, properties dialog for the project will be shown to user after creation |
| [in] | popup_origin | - The origin where any animations should occur |
|
virtual |
Creates a new project immediately without prompting to save.
| [in] | show_settings | Whether to show the project properties dialog after creation. |
| [in] | popup_origin | The origin where any animations should occur. |
|
protectedvirtual |
Creates and returns a new SettingsDialog instance.
|
protectedvirtual |
Returns the default drop area for a given dock widget.
| [in] | dock_widget | The dock widget to query. |
Reimplemented from PopupManager.
Reimplemented in QTWindowManager.
|
protectedvirtual |
Returns the default section widget to drop relative to.
| [in] | dock_widget | The dock widget to query. |
Reimplemented from PopupManager.
Reimplemented in QTWindowManager.
|
virtual |
Saves user settings and exits the application, relaunching if requested.
| [in] | relaunch | - Whether or not to re-open the application after closing it |
Reimplemented in FormSheetWindowManager, and QTWindowManager.
|
virtual |
Returns the dialog adjusting the export settings of a given file request.
File requests will be completed once dialog is accepted or cancelled
Author: Tyler Parke
Date: 2023-01-16 Parameters:
| [in] | requests | - The objects to be exported |
|
virtual |
Called when the user exports.
Will prompt user to select a location and format to save the file, then prompt the user for any additional export settings, if required
Author: Tyler Parke
Date: 2023-01-16
| [in] | request | - The settings for deletion |
| [in] | show_recents | - Whether or not export should show recent settings |
|
virtual |
Called when the user has selected a file format and default data to export.
Will prompt the user for any additional export settings, if required, then export data
Author: Tyler Parke
Date: 2023-01-16
| [in] | model | - The ids of the default model objects to export |
| [in] | files | - The requested exports |
| [in] | popup_origin | - The origin where any animations should occur |
|
virtual |
Returns the default file chooser dialog used for user selection of files for import or export.
|
protectedvirtual |
Hides the splash screen with the specified delay and fade animation.
| [in] | delay_time | Time to wait before beginning the fade. |
| [in] | fade_time | Duration of the fade-out animation. |
|
virtual |
Returns the dialog adjusting used for adjust the import settings of a given file request.
|
virtual |
Returns the dialog adjusting the import settings of a given file request.
File requests will be completed once dialog is accepted or cancelled
| [in] | requests | - The objects to be imported |
|
virtual |
Called when the user has requested to import and has selected a file.
Will prompt the user for any additional import settings, if required, then import data
| [in] | files | - The file requests used to define what data to import |
| [in] | popup_origin | - The origin where any animations should occur |
|
protectedvirtual |
Returns or creates the initial setup dialog.
|
virtual |
Returns the dialog for viewing all application logs related to the session and project.
|
virtual |
Creates a new project and shows any relevant information based on show_settings parameter.
Author: Tyler Parke
Date: 2023-01-17
| [in] | show_settings | - if true, properties dialog for the project will be shown to user after creation |
| [in] | popup_origin | - The origin where any animations should occur |
|
virtual |
Creates a new project and shows any relevant information based on WindowOptions.
Author: Tyler Parke
Date: 2023-01-17
| [in] | popup_origin | - The origin where any animations should occur |
|
virtual |
Opens user-selected files as new projects or adds them to the current project.
| [in] | files | The file requests describing what to open. |
| [in] | popup_origin | The origin where any animations should occur. |
|
virtual |
Removes a widget that was added with addCustomDockWidget.
If widget is not present, function does nothing
| [in] | widget | - The widget to be removed |
|
virtual |
Removes a previously added initial setup settings menu.
| [in] | menu | The menu to remove. |
|
virtual |
Removes a previously added settings menu from the settings dialog.
| [in] | menu | The menu to remove. |
Prompts the user to confirm an exit and save changes if required.
If confirmed, exit() will be called
| [in] | exit_function | - The function to be called should the user elect to exit |
| [in] | popup_origin | - The origin where any animations should occur |
|
virtual |
Prompts the user to confirm an exit and save changes if required.
If confirmed, exit() will be called
| [in] | event | - The exit event |
| [in] | popup_origin | - The origin where any animations should occur |
Reimplemented in FormSheetWindowManager.
|
virtual |
Prompts the user to confirm an exit and save changes if required.
If confirmed, exit_function will be called and should contain the actual exit routine, typically including the call to exit()
Author: Tyler Parke
Date: 2023-01-16
| [in] | exit_function | - The function to be called should the user elect to exit |
| [in] | popup_origin | - The origin where any animations should occur |
Reimplemented in QTWindowManager.
|
virtual |
Prompts the user to save an image to a file location.
| [in] | image_id | The identifier of the image to save. |
| [in] | default_file | The default file path for saving. |
| [in] | info | The popup configuration for the save dialog. |
Called when the user has selected the project to save and we want to allow them to rename the file Will prompt the user for any additional export settings, if required, then export data.
Author: Tyler Parke
Date: 2023-01-16
| [in] | popup_origin | - The origin where any animations should occur |
|
virtual |
Sets a callback invoked when the main window is created or changed.
| [in] | main_window_callback | The callback receiving the main window widget. |
|
virtual |
Returns the settings dialog for allowing the user to adjust application specific objects.
|
protectedvirtual |
Configures an exporter window with the given model objects and file requests.
| [in] | window | The exporter dialog to configure. |
| [in] | model | The UUIDs of model objects to export. |
| [in] | file | The file requests defining the export. |
|
virtual |
Shows the import settings dialog if additional configuration is needed for the file requests.
| [in] | file | The file requests to check. |
| [in] | popup_origin | The origin where any animations should occur. |
|
virtual |
Called when we want to show the dialog for editing a specific object using application default editing dialogs.
This can be called for creating new objects, editing existing objects, etc based on the provided settings
| [in] | settings | - The information used to generate the editing dialog |
Reimplemented in QTWindowManager.
| void WindowManager::simulateKeyPress | ( | int | key | ) |
Simulates a key press event as if the user pressed a key on the keyboard.
| [in] | key | The Qt key code to simulate. |
|
protected |
Updates the file chooser dialog with format filters and options.
| [in] | model | The UUIDs of model objects to filter for. |
| [in] | formats | The available file formats. |
| [in] | extension | The default file extension. |
| [in] | show_recents | Whether to show recent file locations. |
| [in] | save_dialog | Whether the dialog is for saving (true) or opening (false). |
|
pure virtual |
Called when application should check to see if the project has been modified since last save.
Author: Tyler Parke
Date: 2023-01-16
Implemented in FormSheetWindowManager, and QTWindowManager.
Signal emitted when user data has been added to the project.
| [in] | object | The UUIDs of the added objects. |
|
virtual |
Called when the user deletes objects.
If specified, will prompt if user is sure, and then deletes all objects
Author: Tyler Parke
Date: 2023-01-16
| [in] | ids | - The ids of objects the user is deleting |
|
virtual |
Called when the user has requested to import a file.
Will prompt user to select import a file, then prompt the user for any additional import settings, if required, then import data
| [in] | popup_origin | - The origin where any animations should occur |
| [in] | formats | - The available import formats. If empty, all supported formats will be used |
Called when the user has requested to import a file.
Will prompt user to select import a file, then prompt the user for any additional import settings, if required, then import data
| [in] | popup_origin | - The origin where any animations should occur |
Called when the user has requested to choose a project file to open.
Will prompt user to select project file, then open it
Author: Tyler Parke
Date: 2023-01-16
| [in] | popup_origin | - The origin where any animations should occur |