Kaydet (Commit) 0e257f8c authored tarafından Caolán McNamara's avatar Caolán McNamara

weld ImpSWFDialog

Change-Id: I0650ab2b95eddde0337b1d65e957a58083d993bf
Reviewed-on: https://gerrit.libreoffice.org/61477Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b8633c58
......@@ -28,7 +28,6 @@ $(eval $(call gb_Library_use_libraries,flash,\
vcl \
utl \
tl \
tk \
i18nlangtag \
comphelper \
basegfx \
......
......@@ -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: */
......@@ -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();
};
......
......@@ -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;
......
......@@ -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>
......
......@@ -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>
......
<?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>
......
......@@ -19,7 +19,6 @@
#ifndef INCLUDED_FORMS_SOURCE_RICHTEXT_RICHTEXTVCLCONTROL_HXX
#define INCLUDED_FORMS_SOURCE_RICHTEXT_RICHTEXTVCLCONTROL_HXX
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
#include <vcl/toolbox.hxx>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment