Difference between revisions of "Dialog Manager"

From Inkscape Wiki
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)

  1. Keep a list of open dialogs (those attached to a notebook).
  2. Hide/show dialogs (notebooks).
  3. Update
    1. Floating dialogs when active window changes.
    2. Dialogs when document swapped.
    3. Dialogs when document changes(?).
  4. Delete (or hide) dialogs
    1. When closed directly.
    2. When notebook removed.
    3. When window is closed.
    4. When Inkscape closes (also save configuration).
  5. Track dialog meta-preferences. (Are there any?)


Observations/Questions

  1. The main code is in "ui/dialog/dialog-manager.h" and ...cpp.
  2. Dialogs, once created are not deleted (just hidden). (Verify)
They are deleted when the window closes (since !1325) --Speleo3 (talk)
  1. "Behavior"
    1. Floating dialogs are those that cannot be docked. The Preference dialog is currently always floating.
    2. Docking dialogs are those that can be docked, either in an Inkscape Window or in a floating Dialog Window.
    3. There is a preference to set which to use.
    4. Using Gtk::Notebooks, we should support only "dock" dialogs. (And remove an unnecessary layer of abstraction.)
  2. 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.)
  3. 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 _dlg_mgr_owned 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. --Speleo3 (talk)
  1. The "PanelDialog" class handles linking dialogs to documents. It shouldn't be necessary, as we have a new (simpler) method of doing that.