diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-25 17:26:42 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-26 22:14:43 +0100 |
commit | 28488c94d697f169baaf4c67bf2c71287b503c43 (patch) | |
tree | 124245dfe4d87a722fe441ddee97ec8dbfb5bc06 /sc/source/ui/docshell/docsh.cxx | |
parent | 94fa259e769b44f2c2ea7f1667b28f2c07489668 (diff) |
convert corner case warningboxes with checkboxes
Change-Id: Ic8b58b792236a733b6687148eac5c06bbf734acf
Reviewed-on: https://gerrit.libreoffice.org/50325
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/docshell/docsh.cxx')
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 767d5a502827..c8bbd5c93dd3 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -724,12 +724,28 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) ScAppOptions aAppOptions = SC_MOD()->GetAppOptions(); if ( aAppOptions.GetShowSharedDocumentWarning() ) { - ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), MessBoxStyle::Ok, - ScGlobal::GetRscString( STR_SHARED_DOC_WARNING ) ); - aBox->SetDefaultCheckBoxText(); - aBox->Execute(); - bool bChecked = aBox->GetCheckBoxState(); - if ( bChecked ) + vcl::Window* pWin = ScDocShell::GetActiveDialogParent(); + + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWin ? pWin->GetFrameWeld() : nullptr, + "modules/scalc/ui/sharedwarningdialog.ui")); + std::unique_ptr<weld::MessageDialog> xWarningBox(xBuilder->weld_message_dialog("SharedWarningDialog")); + std::unique_ptr<weld::CheckButton> xWarningOnBox(xBuilder->weld_check_button("ask")); + + //fdo#75121, a bit tricky because the widgets we want to align with + //don't actually exist in the ui description, they're implied + std::unique_ptr<weld::Container> xOrigParent(xWarningOnBox->weld_parent()); + std::unique_ptr<weld::Container> xContentArea(xWarningBox->weld_message_area()); + xOrigParent->remove(xWarningOnBox.get()); + xContentArea->add(xWarningOnBox.get()); + + xWarningBox->run(); + + //put them back as they were + xContentArea->remove(xWarningOnBox.get()); + xOrigParent->add(xWarningOnBox.get()); + + bool bChecked = xWarningOnBox->get_active(); + if (bChecked) { aAppOptions.SetShowSharedDocumentWarning( !bChecked ); SC_MOD()->SetAppOptions( aAppOptions ); |