Dialog Manager

From Inkscape Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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.