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

weld MoreOptionsDialog

Change-Id: I2fd6ffcbd03e1b797634bdb4646f1951cd665a1c
Reviewed-on: https://gerrit.libreoffice.org/67810
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 56082703
......@@ -40,20 +40,19 @@ namespace vcl {
namespace vcl
{
class MoreOptionsDialog : public ModalDialog
class MoreOptionsDialog : public weld::GenericDialogController
{
VclPtr<PrintDialog> mpParent;
VclPtr<OKButton> mpOKButton;
VclPtr<CancelButton> mpCancelButton;
VclPtr<CheckBox> mpSingleJobsBox;
std::unique_ptr<weld::Button> mxOKButton;
std::unique_ptr<weld::Button> mxCancelButton;
std::unique_ptr<weld::CheckButton> mxSingleJobsBox;
DECL_LINK( ClickHdl, Button*, void );
DECL_LINK( ClickHdl, weld::Button&, void );
public:
MoreOptionsDialog( VclPtr<PrintDialog> i_pParent );
virtual ~MoreOptionsDialog() override;
virtual void dispose() override;
};
class PrintDialog : public ModalDialog
......@@ -134,7 +133,7 @@ namespace vcl
std::shared_ptr<PrinterController> maPController;
VclPtr< MoreOptionsDialog > mpMoreOptionsDlg;
std::unique_ptr<MoreOptionsDialog> mxMoreOptionsDlg;
VclPtr<TabControl> mpTabCtrl;
VclPtr<VclFrame> mpPageLayoutFrame;
......
......@@ -80,48 +80,36 @@ namespace {
}
}
MoreOptionsDialog::MoreOptionsDialog( VclPtr<PrintDialog> i_pParent )
: ModalDialog(i_pParent, "MoreOptionsDialog", "vcl/ui/moreoptionsdialog.ui")
MoreOptionsDialog::MoreOptionsDialog(VclPtr<PrintDialog> i_pParent)
: GenericDialogController(i_pParent->GetFrameWeld(), "vcl/ui/moreoptionsdialog.ui", "MoreOptionsDialog")
, mpParent( i_pParent )
, mxOKButton(m_xBuilder->weld_button("ok"))
, mxCancelButton(m_xBuilder->weld_button("cancel"))
, mxSingleJobsBox(m_xBuilder->weld_check_button("singlejobs"))
{
get(mpOKButton, "ok");
get(mpCancelButton, "cancel");
get(mpSingleJobsBox, "singlejobs");
mpSingleJobsBox->Check( mpParent->isSingleJobs() );
mxSingleJobsBox->set_active( mpParent->isSingleJobs() );
mpOKButton->SetClickHdl( LINK( this, MoreOptionsDialog, ClickHdl ) );
mpCancelButton->SetClickHdl( LINK( this, MoreOptionsDialog, ClickHdl ) );
mxOKButton->connect_clicked( LINK( this, MoreOptionsDialog, ClickHdl ) );
mxCancelButton->connect_clicked( LINK( this, MoreOptionsDialog, ClickHdl ) );
}
MoreOptionsDialog::~MoreOptionsDialog()
{
disposeOnce();
}
void MoreOptionsDialog::dispose()
IMPL_LINK (MoreOptionsDialog, ClickHdl, weld::Button&, rButton, void)
{
mpOKButton.clear();
mpCancelButton.clear();
mpSingleJobsBox.clear();
mpParent.clear();
ModalDialog::dispose();
}
IMPL_LINK ( MoreOptionsDialog, ClickHdl, Button*, pButton, void )
{
if ( pButton == mpOKButton )
if (&rButton == mxOKButton.get())
{
mpParent->mbSingleJobs = mpSingleJobsBox->IsChecked();
EndDialog( RET_OK );
mpParent->mbSingleJobs = mxSingleJobsBox->get_active();
m_xDialog->response(RET_OK);
}
else if ( pButton == mpCancelButton )
else if (&rButton == mxCancelButton.get())
{
EndDialog( RET_CANCEL );
m_xDialog->response(RET_CANCEL);
}
}
PrintDialog::PrintPreviewWindow::PrintPreviewWindow( vcl::Window* i_pParent )
: Window( i_pParent, 0 )
, maMtf()
......@@ -754,7 +742,7 @@ void PrintDialog::dispose()
mpNupOrderWin.clear();
mpNupOrderTxt.clear();
mpBorderCB.clear();
mpMoreOptionsDlg.disposeAndClear();
mxMoreOptionsDlg.reset();
ModalDialog::dispose();
}
......@@ -1890,8 +1878,8 @@ IMPL_LINK ( PrintDialog, ClickHdl, Button*, pButton, void )
}
else if ( pButton == mpMoreOptionsBtn )
{
mpMoreOptionsDlg = VclPtr< MoreOptionsDialog >::Create( this );
mpMoreOptionsDlg->Execute();
mxMoreOptionsDlg.reset(new MoreOptionsDialog(this));
mxMoreOptionsDlg->run();
}
else
{
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.4 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="vcl">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="MoreOptionsDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="moreoptionsdialog|moreprintingoptions">More Printing Options</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="box">
<property name="can_focus">False</property>
......@@ -21,6 +27,7 @@
<property name="label" context="moreoptionsdialog|ok">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
......@@ -35,6 +42,8 @@
<property name="label" context="moreoptionsdialog|cancel">gtk-cancel</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_stock">True</property>
</object>
......@@ -81,8 +90,5 @@
</child>
</object>
</child>
<child>
<placeholder/>
</child>
</object>
</interface>
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