sd/source/ui/dlg/ins_paste.cxx | 21 +++++-------------- sd/source/ui/inc/ins_paste.hxx | 13 ++++------- sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 7 +++--- sd/uiconfig/simpress/ui/insertslides.ui | 16 +++++++++----- 4 files changed, 26 insertions(+), 31 deletions(-)
New commits: commit 36a688255ff2ebddafa3a8d7011167f437967b6a Author: Caolán McNamara <caol...@redhat.com> Date: Thu May 10 21:30:06 2018 +0100 weld SdInsertPasteDlg Change-Id: I999e7ff88afd7dd82b368ede83d004e309e7dd3e Reviewed-on: https://gerrit.libreoffice.org/54102 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sd/source/ui/dlg/ins_paste.cxx b/sd/source/ui/dlg/ins_paste.cxx index 2689f4211bb3..a0b6f305d404 100644 --- a/sd/source/ui/dlg/ins_paste.cxx +++ b/sd/source/ui/dlg/ins_paste.cxx @@ -19,30 +19,21 @@ #include <ins_paste.hxx> -SdInsertPasteDlg::SdInsertPasteDlg(vcl::Window* pWindow) - : ModalDialog( pWindow, "InsertSlidesDialog", - "modules/simpress/ui/insertslides.ui") +SdInsertPasteDlg::SdInsertPasteDlg(weld::Window* pWindow) + : GenericDialogController(pWindow, "modules/simpress/ui/insertslides.ui", "InsertSlidesDialog") + , m_xRbBefore(m_xBuilder->weld_radio_button("before")) + , m_xRbAfter(m_xBuilder->weld_radio_button("after")) { - get(m_pRbBefore, "before"); - get(m_pRbAfter, "after"); - m_pRbAfter->Check(); + m_xRbAfter->set_active(true); } SdInsertPasteDlg::~SdInsertPasteDlg() { - disposeOnce(); -} - -void SdInsertPasteDlg::dispose() -{ - m_pRbBefore.clear(); - m_pRbAfter.clear(); - ModalDialog::dispose(); } bool SdInsertPasteDlg::IsInsertBefore() const { - return m_pRbBefore->IsChecked(); + return m_xRbBefore->get_active(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/ins_paste.hxx b/sd/source/ui/inc/ins_paste.hxx index 2ea57eee2e05..70a946271ed8 100644 --- a/sd/source/ui/inc/ins_paste.hxx +++ b/sd/source/ui/inc/ins_paste.hxx @@ -22,21 +22,18 @@ #include <sddllapi.h> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/dialog.hxx> +#include <vcl/weld.hxx> // SdInsertPasteDlg -class SD_DLLPUBLIC SdInsertPasteDlg : public ModalDialog +class SD_DLLPUBLIC SdInsertPasteDlg : public weld::GenericDialogController { private: - VclPtr<RadioButton> m_pRbBefore; - VclPtr<RadioButton> m_pRbAfter; + std::unique_ptr<weld::RadioButton> m_xRbBefore; + std::unique_ptr<weld::RadioButton> m_xRbAfter; public: - SdInsertPasteDlg( vcl::Window* pWindow ); + SdInsertPasteDlg(weld::Window* pWindow); virtual ~SdInsertPasteDlg() override; - virtual void dispose() override; bool IsInsertBefore() const; }; diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index fb12640c8b1e..7ac3ed0e4eda 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -281,11 +281,12 @@ sal_Int32 Clipboard::GetInsertionPosition () else if (mrController.GetFocusManager().IsFocusShowing()) { // Use the focus to determine the insertion position. - ScopedVclPtrInstance< SdInsertPasteDlg > aDialog(nullptr); - if (aDialog->Execute() == RET_OK) + vcl::Window* pWin = mrSlideSorter.GetContentWindow(); + SdInsertPasteDlg aDialog(pWin ? pWin->GetFrameWeld() : nullptr); + if (aDialog.run() == RET_OK) { nInsertPosition = mrController.GetFocusManager().GetFocusedPageIndex(); - if ( ! aDialog->IsInsertBefore()) + if (!aDialog.IsInsertBefore()) nInsertPosition ++; } } diff --git a/sd/uiconfig/simpress/ui/insertslides.ui b/sd/uiconfig/simpress/ui/insertslides.ui index 5a7e92fa430d..1e26155abf03 100644 --- a/sd/uiconfig/simpress/ui/insertslides.ui +++ b/sd/uiconfig/simpress/ui/insertslides.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.20.4 --> <interface domain="sd"> <requires lib="gtk+" version="3.18"/> <object class="GtkDialog" id="InsertSlidesDialog"> @@ -7,16 +7,19 @@ <property name="border_width">6</property> <property name="title" translatable="yes" context="insertslides|InsertSlidesDialog">Insert Slides</property> <property name="resizable">False</property> + <property name="modal">True</property> + <property name="default_width">0</property> + <property name="default_height">0</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> + <property name="orientation">vertical</property> <property name="spacing">12</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="layout_style">start</property> + <property name="layout_style">end</property> <child> <object class="GtkButton" id="ok"> <property name="label">gtk-ok</property> @@ -59,6 +62,7 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="position">2</property> + <property name="secondary">True</property> </packing> </child> </object> @@ -98,7 +102,6 @@ <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">after</property> </object> <packing> <property name="expand">False</property> @@ -132,10 +135,10 @@ <object class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="yalign">0.55000001192092896</property> <property name="xpad">1</property> <property name="label" translatable="yes" context="insertslides|label1">Position</property> <property name="justify">center</property> + <property name="yalign">0.55000001192092896</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -155,5 +158,8 @@ <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> </action-widgets> + <child> + <placeholder/> + </child> </object> </interface> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits