Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index


I've converted our Info/Query/Warning/Error message boxes to the scheme
I demoed at the last LibreOffice conference and FOSDEM that makes it
possible to have our dialogs be native gtk3 dialogs when our backend is
gtk3. When the backend is not gtk3 they remain as the vcl widgetery.

changes of use look like, from...

ScopedVclPtrInstance<QueryBox> xBox(
  pWindow, MessBoxStyle::OkCancel, "Message");
xBox->Execute();

to...

std::unique_ptr<weld::MessageDialog> xBox(
  Application::CreateMessageDialog(pParent,
  VclMessageType::Question, VclButtonsType::OkCancel,
  "Message");
xBox->run();

The old pParent argument was a vcl::Window, the new pParent argument is
now a weld::Window. You get a weld::Window from a vcl::Window with
Window::GetFrameWeld()

Where the message dialogs were loaded from .ui files, the loader in the
gtk3 case is gtk's builtin gtkbuilder and the translations are sucked
out of our .mo gettext format translations by the native gtk3 gettext
support. In the non-gtk3 case its "as it was", i.e. our own .ui loader
backed by vcl widgets and translations coming from our boost::gettext
based translation infrastructure.

FWIW: a weld::Widget is approximately equivalent to a
vcl::Window/GtkWidget, while a weld::Window is equivalent to
vcl::SystemWindow/GtkWindow.

Numbers:
89 message dialog are loaded from .ui files
474 message dialogs are directly instantiated

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.