Difference between revisions of "Dialog Manager"
Jump to navigation
Jump to search
(Created page with " A page to discuss what a dialog manager should do (motivated by 2020 GSoC dialog work). = Functions of Dialog Manager (or equivalent) = # Keep a list of open dialogs (those...") |
(comments) |
||
Line 22: | Line 22: | ||
# The main code is in "ui/dialog/dialog-manager.h" and ...cpp. | # The main code is in "ui/dialog/dialog-manager.h" and ...cpp. | ||
# Dialogs, once created are not deleted (just hidden). (Verify) | # Dialogs, once created are not deleted (just hidden). (Verify) | ||
:: ''They are deleted when the window closes (since [https://gitlab.com/inkscape/inkscape/-/merge_requests/1325 !1325]) --[[User:Speleo3|Speleo3]] ([[User talk:Speleo3|talk]])'' | |||
# "Behavior" | # "Behavior" | ||
## Floating dialogs are those that cannot be docked. The Preference dialog is currently always floating. | ## Floating dialogs are those that cannot be docked. The Preference dialog is currently always floating. | ||
Line 29: | Line 30: | ||
# The use of GQuark identify dialogs should be unnecessary. Use a std::map<std::string> where the string is the dialog name. (GQuark can be used for efficient look-ups but thats not needed for dialogs.) | # The use of GQuark identify dialogs should be unnecessary. Use a std::map<std::string> where the string is the dialog name. (GQuark can be used for efficient look-ups but thats not needed for dialogs.) | ||
# In desktop.cpp there are two variables "_dlg_mgr" and "_dlg_mgr_owned". It's not clear why. I could not get "Inkscape::UI::Dialog::DialogManager::getInstance() to return an instance. | # In desktop.cpp there are two variables "_dlg_mgr" and "_dlg_mgr_owned". It's not clear why. I could not get "Inkscape::UI::Dialog::DialogManager::getInstance() to return an instance. | ||
:: ''I introduced <code>_dlg_mgr_owned</code> to distinguish between floating dialogs which are shared between multiple windows (like the Preferences Dialog) and those which are owned by a main window and should be destroyed along with it. --[[User:Speleo3|Speleo3]] ([[User talk:Speleo3|talk]])'' | |||
# The "PanelDialog" class handles linking dialogs to documents. It shouldn't be necessary, as we have a new (simpler) method of doing that. | # The "PanelDialog" class handles linking dialogs to documents. It shouldn't be necessary, as we have a new (simpler) method of doing that. |
Latest revision as of 18:20, 30 June 2020
A page to discuss what a dialog manager should do (motivated by 2020 GSoC dialog work).
Functions of Dialog Manager (or equivalent)
- Keep a list of open dialogs (those attached to a notebook).
- Hide/show dialogs (notebooks).
- Update
- Floating dialogs when active window changes.
- Dialogs when document swapped.
- Dialogs when document changes(?).
- Delete (or hide) dialogs
- When closed directly.
- When notebook removed.
- When window is closed.
- When Inkscape closes (also save configuration).
- Track dialog meta-preferences. (Are there any?)
Observations/Questions
- The main code is in "ui/dialog/dialog-manager.h" and ...cpp.
- Dialogs, once created are not deleted (just hidden). (Verify)
- "Behavior"
- Floating dialogs are those that cannot be docked. The Preference dialog is currently always floating.
- Docking dialogs are those that can be docked, either in an Inkscape Window or in a floating Dialog Window.
- There is a preference to set which to use.
- Using Gtk::Notebooks, we should support only "dock" dialogs. (And remove an unnecessary layer of abstraction.)
- The use of GQuark identify dialogs should be unnecessary. Use a std::map<std::string> where the string is the dialog name. (GQuark can be used for efficient look-ups but thats not needed for dialogs.)
- In desktop.cpp there are two variables "_dlg_mgr" and "_dlg_mgr_owned". It's not clear why. I could not get "Inkscape::UI::Dialog::DialogManager::getInstance() to return an instance.
- The "PanelDialog" class handles linking dialogs to documents. It shouldn't be necessary, as we have a new (simpler) method of doing that.