Kaydet (Commit) 3880bf65 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld HeaderFooterDialog

Change-Id: I6a5068106d0f243646cf12ec676dff60a04922ee
Reviewed-on: https://gerrit.libreoffice.org/73596
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 36ed48a4
......@@ -188,9 +188,6 @@
<glade-widget-class title="NUP Preview" name="vcllo-ShowNupOrderWindow"
generic-name="NUP Preview" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Presentation Preview" name="sduilo-PresLayoutPreview"
generic-name="Presentation Preview" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Address Preview" name="swlo-SwAddressPreview"
generic-name="Address Preview" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
......
......@@ -196,10 +196,10 @@ public:
virtual VclPtr<VclAbstractDialog> CreateMasterLayoutDialog(weld::Window* pParent, SdDrawDocument* pDoc, SdPage*) = 0;
virtual VclPtr<AbstractHeaderFooterDialog> CreateHeaderFooterDialog( sd::ViewShell* pViewShell,
vcl::Window* pParent,
SdDrawDocument* pDoc,
SdPage* pCurrentPage ) = 0;
virtual VclPtr<AbstractHeaderFooterDialog> CreateHeaderFooterDialog(sd::ViewShell* pViewShell,
weld::Window* pParent,
SdDrawDocument* pDoc,
SdPage* pCurrentPage) = 0;
virtual CreateTabPage GetSdOptionsContentsTabPageCreatorFunc() = 0;
virtual CreateTabPage GetSdPrintOptionsTabPageCreatorFunc() = 0;
......
......@@ -578,7 +578,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
}
case 22:
{
// CreateHeaderFooterDialog(sd::ViewShell* pViewShell, vcl::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage) override;
// CreateHeaderFooterDialog(sd::ViewShell* pViewShell, weld::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage) override;
// This is a hard case, for two reasons:
// - It uses BaseClass TabPage which has a very sparse interface,
// need to add 'Screenshot interface' there and implement
......@@ -589,9 +589,10 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
CPPUNIT_ASSERT(pDrawDoc);
SdPage* pSdPage = pDrawDoc->GetSdPage(0, PageKind::Standard);
CPPUNIT_ASSERT(pSdPage);
auto const parent = Application::GetDefDialogParent();
pRetval = getSdAbstractDialogFactory()->CreateHeaderFooterDialog(
getViewShell(),
Application::GetDefDialogParent(),
parent == nullptr ? nullptr : parent->GetFrameWeld(),
pDrawDoc,
pSdPage);
break;
......
......@@ -137,7 +137,16 @@ short AbstractSdVectorizeDlg_Impl::Execute()
}
IMPL_ABSTDLG_BASE(AbstractSdPublishingDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractHeaderFooterDialog_Impl);
short AbstractHeaderFooterDialog_Impl::Execute()
{
return m_xDlg->run();
}
bool AbstractHeaderFooterDialog_Impl::StartExecuteAsync(AsyncContext &rCtx)
{
return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
}
short AbstractBulletDialog_Impl::Execute()
{
......@@ -521,10 +530,10 @@ VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateMasterLayoutDialog
return VclPtr<AbstractMasterLayoutDialog_Impl>::Create(std::make_unique<::sd::MasterLayoutDialog>(pParent, pDoc, pCurrentPage));
}
VclPtr<AbstractHeaderFooterDialog> SdAbstractDialogFactory_Impl::CreateHeaderFooterDialog( sd::ViewShell* pViewShell,
vcl::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage )
VclPtr<AbstractHeaderFooterDialog> SdAbstractDialogFactory_Impl::CreateHeaderFooterDialog(sd::ViewShell* pViewShell,
weld::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage)
{
return VclPtr<AbstractHeaderFooterDialog_Impl>::Create( VclPtr<::sd::HeaderFooterDialog>::Create( pViewShell, pParent, pDoc, pCurrentPage ));
return VclPtr<AbstractHeaderFooterDialog_Impl>::Create(std::make_unique<::sd::HeaderFooterDialog>(pViewShell, pParent, pDoc, pCurrentPage));
}
VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateSdPhotoAlbumDialog(weld::Window* pParent, SdDrawDocument* pDoc)
......
......@@ -353,7 +353,15 @@ class AbstractSdPublishingDlg_Impl :public AbstractSdPublishingDlg
class AbstractHeaderFooterDialog_Impl :public AbstractHeaderFooterDialog
{
DECL_ABSTDLG_BASE(AbstractHeaderFooterDialog_Impl,::sd::HeaderFooterDialog)
private:
std::shared_ptr<::sd::HeaderFooterDialog> m_xDlg;
public:
AbstractHeaderFooterDialog_Impl(std::unique_ptr<::sd::HeaderFooterDialog> pDlg)
: m_xDlg(std::move(pDlg))
{
}
virtual short Execute() override;
virtual bool StartExecuteAsync(AsyncContext &rCtx) override;
};
//AbstractDialogFactory_Impl implementations
......@@ -390,10 +398,10 @@ public:
virtual VclPtr<VclAbstractDialog> CreateMasterLayoutDialog(weld::Window* pParent, SdDrawDocument* pDoc, SdPage*) override;
virtual VclPtr<AbstractHeaderFooterDialog> CreateHeaderFooterDialog( sd::ViewShell* pViewShell,
vcl::Window* pParent,
SdDrawDocument* pDoc,
SdPage* pCurrentPage ) override;
virtual VclPtr<AbstractHeaderFooterDialog> CreateHeaderFooterDialog(sd::ViewShell* pViewShell,
weld::Window* pParent,
SdDrawDocument* pDoc,
SdPage* pCurrentPage) override;
// For TabPage
virtual CreateTabPage GetSdOptionsContentsTabPageCreatorFunc() override;
......
......@@ -19,9 +19,7 @@
#ifndef INCLUDED_SD_SOURCE_UI_INC_HEADERFOOTERDLG_HXX
#define INCLUDED_SD_SOURCE_UI_INC_HEADERFOOTERDLG_HXX
#include <vcl/tabdlg.hxx>
#include <vcl/button.hxx>
#include <vcl/tabctrl.hxx>
#include <vcl/weld.hxx>
#include <sdpage.hxx>
......@@ -33,24 +31,13 @@ class ViewShell;
class HeaderFooterTabPage;
class HeaderFooterDialog : public TabDialog
class HeaderFooterDialog : public weld::GenericDialogController
{
private:
DECL_LINK( ActivatePageHdl, TabControl*, void );
DECL_LINK( ClickApplyToAllHdl, Button*, void );
DECL_LINK( ClickApplyHdl, Button*, void );
DECL_LINK( ClickCancelHdl, Button*, void );
VclPtr<TabControl> mpTabCtrl;
VclPtr<HeaderFooterTabPage> mpSlideTabPage;
VclPtr<HeaderFooterTabPage> mpNotesHandoutsTabPage;
sal_uInt16 mnSlidesId;
VclPtr<PushButton> maPBApplyToAll;
VclPtr<PushButton> maPBApply;
VclPtr<CancelButton> maPBCancel;
DECL_LINK( ActivatePageHdl, const OString&, void );
DECL_LINK( ClickApplyToAllHdl, weld::Button&, void );
DECL_LINK( ClickApplyHdl, weld::Button&, void );
DECL_LINK( ClickCancelHdl, weld::Button&, void );
HeaderFooterSettings maSlideSettings;
HeaderFooterSettings maNotesHandoutSettings;
......@@ -59,18 +46,24 @@ private:
SdPage* mpCurrentPage;
ViewShell* mpViewShell;
std::unique_ptr<weld::Notebook> mxTabCtrl;
std::unique_ptr<weld::Button> mxPBApplyToAll;
std::unique_ptr<weld::Button> mxPBApply;
std::unique_ptr<weld::Button> mxPBCancel;
std::unique_ptr<HeaderFooterTabPage> mxSlideTabPage;
std::unique_ptr<HeaderFooterTabPage> mxNotesHandoutsTabPage;
void apply( bool bToAll, bool bForceSlides );
void change( SdUndoGroup* pUndoGroup, SdPage* pPage, const HeaderFooterSettings& rNewSettings );
public:
HeaderFooterDialog( ViewShell* pViewShell, vcl::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage );
HeaderFooterDialog(ViewShell* pViewShell, weld::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage);
virtual ~HeaderFooterDialog() override;
virtual void dispose() override;
void ApplyToAll();
void Apply();
virtual short Execute() override;
virtual short run() override;
};
}
......
......@@ -301,15 +301,18 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
case SID_INSERT_DATE_TIME:
{
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
VclPtr<AbstractHeaderFooterDialog> pDlg(pFact->CreateHeaderFooterDialog( this, GetActiveWindow(), GetDoc(), mpActualPage ));
vcl::Window* pWin = GetActiveWindow();
VclPtr<AbstractHeaderFooterDialog> pDlg(pFact->CreateHeaderFooterDialog(this, pWin ? pWin->GetFrameWeld() : nullptr, GetDoc(), mpActualPage));
std::shared_ptr<SfxRequest> xRequest(new SfxRequest(rReq));
rReq.Ignore(); // the 'old' request is not relevant any more
pDlg->StartExecuteAsync([this, xRequest](sal_Int32 /*nResult*/){
pDlg->StartExecuteAsync([this, pDlg, xRequest](sal_Int32 /*nResult*/){
GetActiveWindow()->Invalidate();
UpdatePreview( mpActualPage );
Invalidate();
xRequest->Done();
pDlg->disposeOnce();
});
break;
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="sd">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="HeaderFooterDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="headerfooterdialog|HeaderFooterDialog">Header and Footer</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>
......@@ -21,6 +27,7 @@
<property name="label" translatable="yes" context="headerfooterdialog|apply_all">Appl_y to All</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
......@@ -99,6 +106,30 @@
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="tab">
......@@ -118,6 +149,30 @@
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">1</property>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="sd">
<requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkBox" id="HeaderFooterTab">
<property name="visible">True</property>
<property name="can_focus">False</property>
......@@ -78,6 +77,7 @@
<object class="GtkEntry" id="header_text">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -136,7 +136,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">rb_auto</property>
<accessibility>
<relation type="label-for" target="datetime_value"/>
</accessibility>
......@@ -151,6 +150,7 @@
<object class="GtkEntry" id="datetime_value">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<accessibility>
<relation type="labelled-by" target="rb_fixed"/>
</accessibility>
......@@ -204,7 +204,7 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="svxcorelo-SvxLanguageBox" id="language_list">
<object class="GtkComboBoxText" id="language_list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
......@@ -228,7 +228,7 @@
</packing>
</child>
<child>
<object class="GtkComboBox" id="datetime_format_list">
<object class="GtkComboBoxText" id="datetime_format_list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
......@@ -328,6 +328,7 @@
<object class="GtkEntry" id="footer_text">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -409,9 +410,9 @@
<object class="GtkLabel" id="replacement_a">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="headerfootertab|replacement_a">_Page Number</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -423,8 +424,8 @@
<object class="GtkLabel" id="replacement_b">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="headerfootertab|replacement_b">Include on page</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -440,7 +441,7 @@
</packing>
</child>
<child>
<object class="sduilo-PresLayoutPreview" id="preview">
<object class="GtkDrawingArea" id="preview">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
......
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