diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-19 16:33:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-22 22:07:38 +0100 |
commit | 6a4c464b49dbfa2801818ead1b50bc9580824d00 (patch) | |
tree | 3d6381b6b13576bc536670992b36784436486e95 /avmedia | |
parent | f7733528e88a6619f82b54b59e92a9bca72c0a89 (diff) |
weld native message dialogs
just the straight-forward MessageDialog cases first
a) remove border_width from message dialog .ui so as to take
the default border width
b) retain 12 as default message dialog border for vcl widget case
c) remove layour_style from message dialog button boxes so as to
take the default mode (a no-op for vcl widget case)
d) use gtk response ids (vcl builder will converts to vcl ones)
Change-Id: I7de281093a1b64f92f71ca11e7cbba42bb658154
Reviewed-on: https://gerrit.libreoffice.org/50143
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/framework/mediacontrol.cxx | 3 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow.cxx | 14 |
2 files changed, 8 insertions, 9 deletions
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx index 59f6c3cce90e..23cf4944e11c 100644 --- a/avmedia/source/framework/mediacontrol.cxx +++ b/avmedia/source/framework/mediacontrol.cxx @@ -28,6 +28,7 @@ #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <vcl/lstbox.hxx> +#include <vcl/weld.hxx> #include <unotools/syslocale.hxx> #include <sfx2/viewfrm.hxx> #include <math.h> @@ -299,7 +300,7 @@ IMPL_LINK( MediaControl, implSelectHdl, ToolBox*, p, void ) if (MediaWindow::executeMediaURLDialog(this, aURL, nullptr)) { if( !MediaWindow::isMediaURL( aURL, ""/*TODO?*/, true ) ) - MediaWindow::executeFormatErrorBox( this ); + MediaWindow::executeFormatErrorBox(GetFrameWeld()); else { aExecItem.setURL( aURL, "", ""/*TODO?*/ ); diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx index df416bb96db7..4d8ad4edec5c 100644 --- a/avmedia/source/viewer/mediawindow.cxx +++ b/avmedia/source/viewer/mediawindow.cxx @@ -23,7 +23,8 @@ #include <bitmaps.hlst> #include <strings.hrc> #include <tools/urlobj.hxx> -#include <vcl/layout.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <unotools/pathoptions.hxx> #include <sfx2/filedlghelper.hxx> #include <comphelper/processfactory.hxx> @@ -295,16 +296,13 @@ bool MediaWindow::executeMediaURLDialog(const vcl::Window* pParent, OUString& rU return !rURL.isEmpty(); } - -void MediaWindow::executeFormatErrorBox( vcl::Window* pParent ) +void MediaWindow::executeFormatErrorBox(weld::Widget* pParent) { - ScopedVclPtrInstance< MessageDialog > aErrBox( pParent, AvmResId( AVMEDIA_STR_ERR_URL ) ); - - aErrBox->Execute(); - aErrBox.disposeAndClear(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, + VclMessageType::Warning, VclButtonsType::Ok, AvmResId(AVMEDIA_STR_ERR_URL))); + xBox->run(); } - bool MediaWindow::isMediaURL( const OUString& rURL, const OUString& rReferer, bool bDeep, Size* pPreferredSizePixel ) { const INetURLObject aURL( rURL ); |