diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-06 19:53:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-06 21:58:26 +0200 |
commit | 0e257f8c07de253c0a1d4e63dfdf0383bd658fab (patch) | |
tree | 4171476771e2539a2de89c03cb3f2e8e3a1488ca /filter | |
parent | b8633c58dc7fa43076abeeb7e53a931d92119f26 (diff) |
weld ImpSWFDialog
Change-Id: I0650ab2b95eddde0337b1d65e957a58083d993bf
Reviewed-on: https://gerrit.libreoffice.org/61477
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/Library_flash.mk | 1 | ||||
-rw-r--r-- | filter/source/flash/impswfdialog.cxx | 87 | ||||
-rw-r--r-- | filter/source/flash/impswfdialog.hxx | 38 | ||||
-rw-r--r-- | filter/source/flash/swfdialog.cxx | 19 | ||||
-rw-r--r-- | filter/source/pdf/impdialog.hxx | 8 | ||||
-rw-r--r-- | filter/source/pdf/pdfdialog.cxx | 1 | ||||
-rw-r--r-- | filter/uiconfig/ui/impswfdialog.ui | 35 |
7 files changed, 59 insertions, 130 deletions
diff --git a/filter/Library_flash.mk b/filter/Library_flash.mk index ccf161b011e0..7abba3682a56 100644 --- a/filter/Library_flash.mk +++ b/filter/Library_flash.mk @@ -28,7 +28,6 @@ $(eval $(call gb_Library_use_libraries,flash,\ vcl \ utl \ tl \ - tk \ i18nlangtag \ comphelper \ basegfx \ diff --git a/filter/source/flash/impswfdialog.cxx b/filter/source/flash/impswfdialog.cxx index ea920709901a..b12febde0cb5 100644 --- a/filter/source/flash/impswfdialog.cxx +++ b/filter/source/flash/impswfdialog.cxx @@ -24,83 +24,58 @@ using namespace com::sun::star::uno; using namespace com::sun::star::beans; -ImpSWFDialog::ImpSWFDialog( vcl::Window* pParent, Sequence< PropertyValue >& rFilterData ) : - ModalDialog( pParent, "ImpSWFDialog", "filter/ui/impswfdialog.ui" ), - - maConfigItem( "Office.Common/Filter/Flash/Export/", &rFilterData ) +ImpSWFDialog::ImpSWFDialog(weld::Window* pParent, Sequence< PropertyValue >& rFilterData) + : GenericDialogController(pParent, "filter/ui/impswfdialog.ui", "ImpSWFDialog") + , maConfigItem("Office.Common/Filter/Flash/Export/", &rFilterData) + , mxNumFldQuality(m_xBuilder->weld_spin_button("quality")) + , mxCheckExportAll(m_xBuilder->weld_check_button("exportall")) + , mxCheckExportBackgrounds(m_xBuilder->weld_check_button("exportbackgrounds")) + , mxCheckExportBackgroundObjects(m_xBuilder->weld_check_button("exportbackgroundobjects")) + , mxCheckExportSlideContents(m_xBuilder->weld_check_button("exportslidecontents")) + , mxCheckExportSound(m_xBuilder->weld_check_button("exportsound")) + , mxCheckExportOLEAsJPEG(m_xBuilder->weld_check_button("exportoleasjpeg")) + , mxCheckExportMultipleFiles(m_xBuilder->weld_check_button("exportmultiplefiles")) { - get(mpNumFldQuality,"quality"); - get(mpCheckExportAll,"exportall"); - get(mpCheckExportMultipleFiles,"exportmultiplefiles"); - get(mpCheckExportBackgrounds,"exportbackgrounds"); - get(mpCheckExportBackgroundObjects,"exportbackgroundobjects"); - get(mpCheckExportSlideContents,"exportslidecontents"); - get(mpCheckExportSound,"exportsound"); - get(mpCheckExportOLEAsJPEG,"exportoleasjpeg"); - const sal_uLong nCompressMode = maConfigItem.ReadInt32( "CompressMode", 75 ); - mpNumFldQuality->SetValue( nCompressMode ); + mxNumFldQuality->set_value(nCompressMode); - mpCheckExportAll->Check(); - mpCheckExportSlideContents->Check(); - mpCheckExportSound->Check(); + mxCheckExportAll->set_active(true); + mxCheckExportSlideContents->set_active(true); + mxCheckExportSound->set_active(true); - mpCheckExportAll->SetToggleHdl( LINK( this, ImpSWFDialog, OnToggleCheckbox ) ); + mxCheckExportAll->connect_toggled(LINK(this, ImpSWFDialog, OnToggleCheckbox)); - mpCheckExportBackgrounds->Disable(); - mpCheckExportBackgroundObjects->Disable(); - mpCheckExportSlideContents->Disable(); + mxCheckExportBackgrounds->set_sensitive(false); + mxCheckExportBackgroundObjects->set_sensitive(false); + mxCheckExportSlideContents->set_sensitive(false); } - ImpSWFDialog::~ImpSWFDialog() { - disposeOnce(); } - -void ImpSWFDialog::dispose() -{ - mpNumFldQuality.clear(); - mpCheckExportAll.clear(); - mpCheckExportBackgrounds.clear(); - mpCheckExportBackgroundObjects.clear(); - mpCheckExportSlideContents.clear(); - mpCheckExportSound.clear(); - mpCheckExportOLEAsJPEG.clear(); - mpCheckExportMultipleFiles.clear(); - maConfigItem.WriteModifiedConfig(); - ModalDialog::dispose(); -} - - Sequence< PropertyValue > ImpSWFDialog::GetFilterData() { - sal_Int32 nCompressMode = static_cast<sal_Int32>(mpNumFldQuality->GetValue()); + sal_Int32 nCompressMode = static_cast<sal_Int32>(mxNumFldQuality->get_value()); maConfigItem.WriteInt32( "CompressMode" , nCompressMode ); - maConfigItem.WriteBool( "ExportAll", mpCheckExportAll->IsChecked() ); - maConfigItem.WriteBool( "ExportBackgrounds", mpCheckExportBackgrounds->IsChecked() ); - maConfigItem.WriteBool( "ExportBackgroundObjects", mpCheckExportBackgroundObjects->IsChecked() ); - maConfigItem.WriteBool( "ExportSlideContents", mpCheckExportSlideContents->IsChecked() ); - maConfigItem.WriteBool( "ExportSound", mpCheckExportSound->IsChecked() ); - maConfigItem.WriteBool( "ExportOLEAsJPEG", mpCheckExportOLEAsJPEG->IsChecked() ); - maConfigItem.WriteBool( "ExportMultipleFiles", mpCheckExportMultipleFiles->IsChecked() ); + maConfigItem.WriteBool( "ExportAll", mxCheckExportAll->get_active() ); + maConfigItem.WriteBool( "ExportBackgrounds", mxCheckExportBackgrounds->get_active() ); + maConfigItem.WriteBool( "ExportBackgroundObjects", mxCheckExportBackgroundObjects->get_active() ); + maConfigItem.WriteBool( "ExportSlideContents", mxCheckExportSlideContents->get_active() ); + maConfigItem.WriteBool( "ExportSound", mxCheckExportSound->get_active() ); + maConfigItem.WriteBool( "ExportOLEAsJPEG", mxCheckExportOLEAsJPEG->get_active() ); + maConfigItem.WriteBool( "ExportMultipleFiles", mxCheckExportMultipleFiles->get_active() ); Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() ); return aRet; } - -/// This is called whenever the user toggles one of the checkboxes -IMPL_LINK( ImpSWFDialog, OnToggleCheckbox, CheckBox&, rBox, void ) +IMPL_LINK_NOARG(ImpSWFDialog, OnToggleCheckbox, weld::ToggleButton&, void) { - if (&rBox == mpCheckExportAll) - { - mpCheckExportBackgrounds->Enable(!mpCheckExportBackgrounds->IsEnabled()); - mpCheckExportBackgroundObjects->Enable(!mpCheckExportBackgroundObjects->IsEnabled()); - mpCheckExportSlideContents->Enable(!mpCheckExportSlideContents->IsEnabled()); - } + mxCheckExportBackgrounds->set_sensitive(!mxCheckExportBackgrounds->get_sensitive()); + mxCheckExportBackgroundObjects->set_sensitive(!mxCheckExportBackgroundObjects->get_sensitive()); + mxCheckExportSlideContents->set_sensitive(!mxCheckExportSlideContents->get_sensitive()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/flash/impswfdialog.hxx b/filter/source/flash/impswfdialog.hxx index 5dfe84de0d13..d299c4924a51 100644 --- a/filter/source/flash/impswfdialog.hxx +++ b/filter/source/flash/impswfdialog.hxx @@ -22,39 +22,29 @@ #include <com/sun/star/uno/Sequence.h> #include <com/sun/star/beans/PropertyValue.hpp> - -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> - #include <vcl/FilterConfigItem.hxx> +#include <vcl/weld.hxx> - -namespace vcl { class Window; } - - -class ImpSWFDialog : public ModalDialog +class ImpSWFDialog : public weld::GenericDialogController { private: - VclPtr<NumericField> mpNumFldQuality; - VclPtr<CheckBox> mpCheckExportAll; - VclPtr<CheckBox> mpCheckExportBackgrounds; - VclPtr<CheckBox> mpCheckExportBackgroundObjects; - VclPtr<CheckBox> mpCheckExportSlideContents; - VclPtr<CheckBox> mpCheckExportSound; - VclPtr<CheckBox> mpCheckExportOLEAsJPEG; - VclPtr<CheckBox> mpCheckExportMultipleFiles; - FilterConfigItem maConfigItem; - DECL_LINK( OnToggleCheckbox, CheckBox&, void ); + std::unique_ptr<weld::SpinButton> mxNumFldQuality; + std::unique_ptr<weld::CheckButton> mxCheckExportAll; + std::unique_ptr<weld::CheckButton> mxCheckExportBackgrounds; + std::unique_ptr<weld::CheckButton> mxCheckExportBackgroundObjects; + std::unique_ptr<weld::CheckButton> mxCheckExportSlideContents; + std::unique_ptr<weld::CheckButton> mxCheckExportSound; + std::unique_ptr<weld::CheckButton> mxCheckExportOLEAsJPEG; + std::unique_ptr<weld::CheckButton> mxCheckExportMultipleFiles; + + DECL_LINK(OnToggleCheckbox, weld::ToggleButton&, void); public: - ImpSWFDialog( vcl::Window* pParent, - css::uno::Sequence< css::beans::PropertyValue >& rFilterData ); + ImpSWFDialog(weld::Window* pParent, + css::uno::Sequence< css::beans::PropertyValue >& rFilterData ); virtual ~ImpSWFDialog() override; - virtual void dispose() override; css::uno::Sequence< css::beans::PropertyValue > GetFilterData(); }; diff --git a/filter/source/flash/swfdialog.cxx b/filter/source/flash/swfdialog.cxx index 92940f111f00..a04aede0add8 100644 --- a/filter/source/flash/swfdialog.cxx +++ b/filter/source/flash/swfdialog.cxx @@ -21,15 +21,13 @@ #include "swfdialog.hxx" #include "swfuno.hxx" #include "impswfdialog.hxx" -#include <vcl/svapp.hxx> -#include <vcl/dialog.hxx> #include <svl/solar.hrc> #include <comphelper/processfactory.hxx> #include <cppuhelper/queryinterface.hxx> #include <com/sun/star/view/XRenderable.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> -#include <toolkit/helper/vclunohelper.hxx> +#include <vcl/svapp.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -111,16 +109,14 @@ OUString SAL_CALL SWFDialog::getImplementationName() return SWFDialog_getImplementationName(); } - Sequence< OUString > SAL_CALL SWFDialog::getSupportedServiceNames() { return SWFDialog_getSupportedServiceNames(); } - svt::OGenericUnoDialog::Dialog SWFDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) { - VclPtr<::Dialog> pRet; + std::unique_ptr<weld::DialogController> xRet; if (mxSrcDoc.is()) { @@ -144,35 +140,31 @@ svt::OGenericUnoDialog::Dialog SWFDialog::createDialog(const css::uno::Reference { } */ - pRet.reset(VclPtr<ImpSWFDialog>::Create(VCLUnoHelper::GetWindow(rParent), maFilterData)); + xRet.reset(new ImpSWFDialog(Application::GetFrameWeld(rParent), maFilterData)); } - return svt::OGenericUnoDialog::Dialog(pRet); + return svt::OGenericUnoDialog::Dialog(std::move(xRet)); } - void SWFDialog::executedDialog( sal_Int16 nExecutionResult ) { if (nExecutionResult && m_aDialog) - maFilterData = static_cast< ImpSWFDialog* >(m_aDialog.m_xVclDialog.get())->GetFilterData(); + maFilterData = static_cast<ImpSWFDialog*>(m_aDialog.m_xWeldDialog.get())->GetFilterData(); destroyDialog(); } - Reference< XPropertySetInfo > SAL_CALL SWFDialog::getPropertySetInfo() { Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } - ::cppu::IPropertyArrayHelper& SWFDialog::getInfoHelper() { return *getArrayHelper(); } - ::cppu::IPropertyArrayHelper* SWFDialog::createArrayHelper() const { Sequence< Property > aProps; @@ -180,7 +172,6 @@ Reference< XPropertySetInfo > SAL_CALL SWFDialog::getPropertySetInfo() return new ::cppu::OPropertyArrayHelper( aProps ); } - Sequence< PropertyValue > SAL_CALL SWFDialog::getPropertyValues() { sal_Int32 i, nCount; diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 32ce705a0ca7..f54d7147b07a 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -22,14 +22,6 @@ #include <sfx2/tabdlg.hxx> -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <vcl/edit.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/combobox.hxx> -#include <vcl/group.hxx> #include <vcl/pdfwriter.hxx> #include <vcl/FilterConfigItem.hxx> #include <vcl/weld.hxx> diff --git a/filter/source/pdf/pdfdialog.cxx b/filter/source/pdf/pdfdialog.cxx index b6219e5be777..f48ab54da588 100644 --- a/filter/source/pdf/pdfdialog.cxx +++ b/filter/source/pdf/pdfdialog.cxx @@ -21,7 +21,6 @@ #include "pdfdialog.hxx" #include "impdialog.hxx" #include <vcl/svapp.hxx> -#include <vcl/dialog.hxx> #include <svl/solar.hrc> #include <com/sun/star/view/XRenderable.hpp> diff --git a/filter/uiconfig/ui/impswfdialog.ui b/filter/uiconfig/ui/impswfdialog.ui index f5878605a1d7..6617cd7128f2 100644 --- a/filter/uiconfig/ui/impswfdialog.ui +++ b/filter/uiconfig/ui/impswfdialog.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> +<!-- Generated with glade 3.22.1 --> <interface domain="flt"> <requires lib="gtk+" version="3.18"/> <object class="GtkAdjustment" id="adjustmentquality"> @@ -13,7 +13,13 @@ <property name="border_width">6</property> <property name="title" translatable="yes" context="impswfdialog|ImpSWFDialog">Flash (SWF) Options</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> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -91,18 +97,16 @@ <object class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="impswfdialog|label1">1: min. quality 100: max. quality</property> <property name="use_underline">True</property> <property name="justify">fill</property> <property name="mnemonic_widget">quality</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -110,6 +114,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="valign">center</property> + <property name="activates_default">True</property> <property name="xalign">0.5</property> <property name="input_purpose">digits</property> <property name="adjustment">adjustmentquality</property> @@ -118,16 +123,12 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -143,8 +144,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -165,8 +164,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -188,8 +185,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -205,8 +200,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -222,24 +215,18 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -255,8 +242,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -272,8 +257,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">4</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> |