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

weld SwCaptionOptDlg

Change-Id: Iac2cb2ab3239e23a64dbc528f0d07d4071c4815c
Reviewed-on: https://gerrit.libreoffice.org/65055
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 322d5b23
......@@ -393,12 +393,13 @@ IMPL_LINK_NOARG(SwLoadOptPage, MetricHdl, ListBox&, void)
}
}
SwCaptionOptDlg::SwCaptionOptDlg(vcl::Window* pParent, const SfxItemSet& rSet)
: SfxSingleTabDialog(pParent, rSet, "CaptionDialog",
"modules/swriter/ui/captiondialog.ui")
SwCaptionOptDlg::SwCaptionOptDlg(weld::Window* pParent, const SfxItemSet& rSet)
: SfxSingleTabDialogController(pParent, rSet, "modules/swriter/ui/captiondialog.ui",
"CaptionDialog")
{
// create TabPage
SetTabPage(SwCaptionOptPage::Create(get_content_area(), &rSet));
TabPageParent aParent(get_content_area(), this);
SetTabPage(SwCaptionOptPage::Create(aParent, &rSet));
}
SwCaptionPreview::SwCaptionPreview(vcl::Window* pParent, WinBits nStyle)
......@@ -889,10 +890,8 @@ void SwCaptionOptPage::ModifyHdl()
{
const OUString sFieldTypeName = m_xCategoryBox->get_active_text();
SfxSingleTabDialog *pDlg = dynamic_cast<SfxSingleTabDialog*>(GetTabDialog());
PushButton *pBtn = pDlg ? pDlg->GetOKButton() : nullptr;
if (pBtn)
pBtn->Enable(!sFieldTypeName.isEmpty());
if (SfxSingleTabDialogController* pDlg = dynamic_cast<SfxSingleTabDialogController*>(GetDialogController()))
pDlg->GetOKButton().set_sensitive(!sFieldTypeName.isEmpty());
bool bEnable = m_xCategoryBox->get_sensitive() && sFieldTypeName != m_sNone;
m_xFormatText->set_sensitive(bEnable);
......
......@@ -352,8 +352,8 @@ IMPL_LINK_NOARG(SwCaptionDialog, ModifyHdl, Edit&, void)
IMPL_LINK_NOARG(SwCaptionDialog, CaptionHdl, Button*, void)
{
SfxItemSet aSet( rView.GetDocShell()->GetDoc()->GetAttrPool() );
ScopedVclPtrInstance< SwCaptionOptDlg > aDlg( this, aSet );
aDlg->Execute();
SwCaptionOptDlg aDlg(GetFrameWeld(), aSet);
aDlg.run();
}
void SwCaptionDialog::DrawSample()
......
......@@ -95,10 +95,10 @@ public:
virtual void Reset( const SfxItemSet* rSet ) override;
};
class SwCaptionOptDlg : public SfxSingleTabDialog
class SwCaptionOptDlg : public SfxSingleTabDialogController
{
public:
SwCaptionOptDlg(vcl::Window* pParent, const SfxItemSet& rSet);
SwCaptionOptDlg(weld::Window* pParent, const SfxItemSet& rSet);
};
class SwCaptionPreview : public vcl::Window
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="sw">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="CaptionDialog">
......@@ -7,7 +7,13 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="captiondialog|CaptionDialog">Caption</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>
......
......@@ -441,7 +441,6 @@
<property name="alignment">0.5</property>
<child>
<object class="GtkCellRendererToggle" id="cellrenderer2">
<property name="radio">True</property>
</object>
<attributes>
<attribute name="active">0</attribute>
......
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