weld ImpPDFTabOpnFtrPage

Change-Id: Icafd88d41f2f0757fcf788882196e7ac07d7c745
Reviewed-on: https://gerrit.libreoffice.org/56024
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara 2018-06-18 12:20:10 +01:00
parent 62106963a0
commit 9b19f99430
3 changed files with 92 additions and 128 deletions

View File

@ -880,105 +880,76 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportPDFAHdl, CheckBox&, void)
} }
} }
/// The option features tab page /// The option features tab page
ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage(vcl::Window* pParent, const SfxItemSet& rCoreSet) ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage(TabPageParent pParent, const SfxItemSet& rCoreSet)
: SfxTabPage(pParent, "PdfViewPage","filter/ui/pdfviewpage.ui", &rCoreSet) : SfxTabPage(pParent, "filter/ui/pdfviewpage.ui", "PdfViewPage", &rCoreSet)
, mbUseCTLFont(false) , mbUseCTLFont(false)
, mxRbOpnPageOnly(m_xBuilder->weld_radio_button("pageonly"))
, mxRbOpnOutline(m_xBuilder->weld_radio_button("outline"))
, mxRbOpnThumbs(m_xBuilder->weld_radio_button("thumbs"))
, mxNumInitialPage(m_xBuilder->weld_spin_button("page"))
, mxRbMagnDefault(m_xBuilder->weld_radio_button("fitdefault"))
, mxRbMagnFitWin(m_xBuilder->weld_radio_button("fitwin"))
, mxRbMagnFitWidth(m_xBuilder->weld_radio_button("fitwidth"))
, mxRbMagnFitVisible(m_xBuilder->weld_radio_button("fitvis"))
, mxRbMagnZoom(m_xBuilder->weld_radio_button("fitzoom"))
, mxNumZoom(m_xBuilder->weld_spin_button("zoom"))
, mxRbPgLyDefault(m_xBuilder->weld_radio_button("defaultlayout"))
, mxRbPgLySinglePage(m_xBuilder->weld_radio_button("singlelayout"))
, mxRbPgLyContinue(m_xBuilder->weld_radio_button("contlayout"))
, mxRbPgLyContinueFacing(m_xBuilder->weld_radio_button("contfacinglayout"))
, mxCbPgLyFirstOnLeft(m_xBuilder->weld_check_button("firstonleft"))
{ {
get(mpRbOpnPageOnly, "pageonly"); mxRbMagnDefault->connect_toggled( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
get(mpRbOpnOutline, "outline"); mxRbMagnFitWin->connect_toggled( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
get(mpRbOpnThumbs, "thumbs"); mxRbMagnFitWidth->connect_toggled( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
get(mpNumInitialPage, "page"); mxRbMagnFitVisible->connect_toggled( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
get(mpRbMagnDefault, "fitdefault"); mxRbMagnZoom->connect_toggled( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
get(mpRbMagnFitWin, "fitwin");
get(mpRbMagnFitWidth, "fitwidth");
get(mpRbMagnFitVisible, "fitvis");
get(mpRbMagnZoom, "fitzoom");
get(mpNumZoom, "zoom");
get(mpRbPgLyDefault, "defaultlayout");
get(mpRbPgLySinglePage, "singlelayout");
get(mpRbPgLyContinue, "contlayout");
get(mpRbPgLyContinueFacing, "contfacinglayout");
get(mpCbPgLyFirstOnLeft, "firstonleft");
mpRbMagnDefault->SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
mpRbMagnFitWin->SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
mpRbMagnFitWidth->SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
mpRbMagnFitVisible->SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
mpRbMagnZoom->SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
} }
ImpPDFTabOpnFtrPage::~ImpPDFTabOpnFtrPage() ImpPDFTabOpnFtrPage::~ImpPDFTabOpnFtrPage()
{ {
disposeOnce();
} }
VclPtr<SfxTabPage> ImpPDFTabOpnFtrPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
void ImpPDFTabOpnFtrPage::dispose()
{ {
mpRbOpnPageOnly.clear(); return VclPtr<ImpPDFTabOpnFtrPage>::Create(pParent, *rAttrSet);
mpRbOpnOutline.clear();
mpRbOpnThumbs.clear();
mpNumInitialPage.clear();
mpRbMagnDefault.clear();
mpRbMagnFitWin.clear();
mpRbMagnFitWidth.clear();
mpRbMagnFitVisible.clear();
mpRbMagnZoom.clear();
mpNumZoom.clear();
mpRbPgLyDefault.clear();
mpRbPgLySinglePage.clear();
mpRbPgLyContinue.clear();
mpRbPgLyContinueFacing.clear();
mpCbPgLyFirstOnLeft.clear();
SfxTabPage::dispose();
} }
VclPtr<SfxTabPage> ImpPDFTabOpnFtrPage::Create( TabPageParent pParent,
const SfxItemSet* rAttrSet)
{
return VclPtr<ImpPDFTabOpnFtrPage>::Create( pParent.pParent, *rAttrSet );
}
void ImpPDFTabOpnFtrPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) void ImpPDFTabOpnFtrPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
{ {
paParent->mnInitialView = 0; paParent->mnInitialView = 0;
if( mpRbOpnOutline->IsChecked() ) if( mxRbOpnOutline->get_active() )
paParent->mnInitialView = 1; paParent->mnInitialView = 1;
else if( mpRbOpnThumbs->IsChecked() ) else if( mxRbOpnThumbs->get_active() )
paParent->mnInitialView = 2; paParent->mnInitialView = 2;
paParent->mnMagnification = 0; paParent->mnMagnification = 0;
if( mpRbMagnFitWin->IsChecked() ) if( mxRbMagnFitWin->get_active() )
paParent->mnMagnification = 1; paParent->mnMagnification = 1;
else if( mpRbMagnFitWidth->IsChecked() ) else if( mxRbMagnFitWidth->get_active() )
paParent->mnMagnification = 2; paParent->mnMagnification = 2;
else if( mpRbMagnFitVisible->IsChecked() ) else if( mxRbMagnFitVisible->get_active() )
paParent->mnMagnification = 3; paParent->mnMagnification = 3;
else if( mpRbMagnZoom->IsChecked() ) else if( mxRbMagnZoom->get_active() )
{ {
paParent->mnMagnification = 4; paParent->mnMagnification = 4;
paParent->mnZoom = static_cast<sal_Int32>(mpNumZoom->GetValue()); paParent->mnZoom = mxNumZoom->get_value();
} }
paParent->mnInitialPage = static_cast<sal_Int32>(mpNumInitialPage->GetValue()); paParent->mnInitialPage = mxNumInitialPage->get_value();
paParent->mnPageLayout = 0; paParent->mnPageLayout = 0;
if( mpRbPgLySinglePage->IsChecked() ) if( mxRbPgLySinglePage->get_active() )
paParent->mnPageLayout = 1; paParent->mnPageLayout = 1;
else if( mpRbPgLyContinue->IsChecked() ) else if( mxRbPgLyContinue->get_active() )
paParent->mnPageLayout = 2; paParent->mnPageLayout = 2;
else if( mpRbPgLyContinueFacing->IsChecked() ) else if( mxRbPgLyContinueFacing->get_active() )
paParent->mnPageLayout = 3; paParent->mnPageLayout = 3;
paParent->mbFirstPageLeft = mbUseCTLFont && mpCbPgLyFirstOnLeft->IsChecked(); paParent->mbFirstPageLeft = mbUseCTLFont && mxCbPgLyFirstOnLeft->get_active();
} }
void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent )
{ {
mbUseCTLFont = paParent->mbUseCTLFont; mbUseCTLFont = paParent->mbUseCTLFont;
@ -986,16 +957,16 @@ void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
{ {
default: default:
case 0: case 0:
mpRbPgLyDefault->Check(); mxRbPgLyDefault->set_active(true);
break; break;
case 1: case 1:
mpRbPgLySinglePage->Check(); mxRbPgLySinglePage->set_active(true);
break; break;
case 2: case 2:
mpRbPgLyContinue->Check(); mxRbPgLyContinue->set_active(true);
break; break;
case 3: case 3:
mpRbPgLyContinueFacing->Check(); mxRbPgLyContinueFacing->set_active(true);
break; break;
} }
@ -1003,13 +974,13 @@ void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
{ {
default: default:
case 0: case 0:
mpRbOpnPageOnly->Check(); mxRbOpnPageOnly->set_active(true);
break; break;
case 1: case 1:
mpRbOpnOutline->Check(); mxRbOpnOutline->set_active(true);
break; break;
case 2: case 2:
mpRbOpnThumbs->Check(); mxRbOpnThumbs->set_active(true);
break; break;
} }
@ -1017,56 +988,53 @@ void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
{ {
default: default:
case 0: case 0:
mpRbMagnDefault->Check(); mxRbMagnDefault->set_active(true);
mpNumZoom->Enable( false ); mxNumZoom->set_sensitive(false);
break; break;
case 1: case 1:
mpRbMagnFitWin->Check(); mxRbMagnFitWin->set_active(true);
mpNumZoom->Enable( false ); mxNumZoom->set_sensitive(false);
break; break;
case 2: case 2:
mpRbMagnFitWidth->Check(); mxRbMagnFitWidth->set_active(true);
mpNumZoom->Enable( false ); mxNumZoom->set_sensitive(false);
break; break;
case 3: case 3:
mpRbMagnFitVisible->Check(); mxRbMagnFitVisible->set_active(true);
mpNumZoom->Enable( false ); mxNumZoom->set_sensitive(false);
break; break;
case 4: case 4:
mpRbMagnZoom->Check(); mxRbMagnZoom->set_active(true);
mpNumZoom->Enable(); mxNumZoom->set_sensitive(true);
break; break;
} }
mpNumZoom->SetValue( paParent->mnZoom ); mxNumZoom->set_value(paParent->mnZoom);
mpNumInitialPage->SetValue( paParent->mnInitialPage ); mxNumInitialPage->set_value(paParent->mnInitialPage);
if( !mbUseCTLFont ) if (!mbUseCTLFont)
mpCbPgLyFirstOnLeft->Hide( ); mxCbPgLyFirstOnLeft->hide();
else else
{ {
mpRbPgLyContinueFacing->SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbPgLyContinueFacingHdl ) ); mxRbPgLyContinueFacing->connect_toggled(LINK(this, ImpPDFTabOpnFtrPage, ToggleRbPgLyContinueFacingHdl));
mpCbPgLyFirstOnLeft->Check( paParent->mbFirstPageLeft ); mxCbPgLyFirstOnLeft->set_active(paParent->mbFirstPageLeft);
ToggleRbPgLyContinueFacingHdl(); ToggleRbPgLyContinueFacingHdl();
} }
} }
IMPL_LINK_NOARG(ImpPDFTabOpnFtrPage, ToggleRbPgLyContinueFacingHdl, weld::ToggleButton&, void)
IMPL_LINK_NOARG(ImpPDFTabOpnFtrPage, ToggleRbPgLyContinueFacingHdl, RadioButton&, void)
{ {
ToggleRbPgLyContinueFacingHdl(); ToggleRbPgLyContinueFacingHdl();
} }
void ImpPDFTabOpnFtrPage::ToggleRbPgLyContinueFacingHdl() void ImpPDFTabOpnFtrPage::ToggleRbPgLyContinueFacingHdl()
{ {
mpCbPgLyFirstOnLeft->Enable( mpRbPgLyContinueFacing->IsChecked() ); mxCbPgLyFirstOnLeft->set_sensitive(mxRbPgLyContinueFacing->get_active());
} }
IMPL_LINK_NOARG( ImpPDFTabOpnFtrPage, ToggleRbMagnHdl, weld::ToggleButton&, void )
IMPL_LINK_NOARG( ImpPDFTabOpnFtrPage, ToggleRbMagnHdl, RadioButton&, void )
{ {
mpNumZoom->Enable( mpRbMagnZoom->IsChecked() ); mxNumZoom->set_sensitive(mxRbMagnZoom->get_active());
} }
/// The Viewer preferences tab page /// The Viewer preferences tab page

View File

@ -257,36 +257,33 @@ public:
/// Class tab page viewer /// Class tab page viewer
class ImpPDFTabOpnFtrPage : public SfxTabPage class ImpPDFTabOpnFtrPage : public SfxTabPage
{ {
VclPtr<RadioButton> mpRbOpnPageOnly;
VclPtr<RadioButton> mpRbOpnOutline;
VclPtr<RadioButton> mpRbOpnThumbs;
VclPtr<NumericField> mpNumInitialPage;
VclPtr<RadioButton> mpRbMagnDefault;
VclPtr<RadioButton> mpRbMagnFitWin;
VclPtr<RadioButton> mpRbMagnFitWidth;
VclPtr<RadioButton> mpRbMagnFitVisible;
VclPtr<RadioButton> mpRbMagnZoom;
VclPtr<NumericField> mpNumZoom;
VclPtr<RadioButton> mpRbPgLyDefault;
VclPtr<RadioButton> mpRbPgLySinglePage;
VclPtr<RadioButton> mpRbPgLyContinue;
VclPtr<RadioButton> mpRbPgLyContinueFacing;
VclPtr<CheckBox> mpCbPgLyFirstOnLeft;
bool mbUseCTLFont; bool mbUseCTLFont;
DECL_LINK( ToggleRbPgLyContinueFacingHdl, RadioButton&, void ); std::unique_ptr<weld::RadioButton> mxRbOpnPageOnly;
DECL_LINK( ToggleRbMagnHdl, RadioButton&, void ); std::unique_ptr<weld::RadioButton> mxRbOpnOutline;
std::unique_ptr<weld::RadioButton> mxRbOpnThumbs;
std::unique_ptr<weld::SpinButton> mxNumInitialPage;
std::unique_ptr<weld::RadioButton> mxRbMagnDefault;
std::unique_ptr<weld::RadioButton> mxRbMagnFitWin;
std::unique_ptr<weld::RadioButton> mxRbMagnFitWidth;
std::unique_ptr<weld::RadioButton> mxRbMagnFitVisible;
std::unique_ptr<weld::RadioButton> mxRbMagnZoom;
std::unique_ptr<weld::SpinButton> mxNumZoom;
std::unique_ptr<weld::RadioButton> mxRbPgLyDefault;
std::unique_ptr<weld::RadioButton> mxRbPgLySinglePage;
std::unique_ptr<weld::RadioButton> mxRbPgLyContinue;
std::unique_ptr<weld::RadioButton> mxRbPgLyContinueFacing;
std::unique_ptr<weld::CheckButton> mxCbPgLyFirstOnLeft;
DECL_LINK(ToggleRbPgLyContinueFacingHdl, weld::ToggleButton&, void);
DECL_LINK(ToggleRbMagnHdl, weld::ToggleButton&, void);
void ToggleRbPgLyContinueFacingHdl(); void ToggleRbPgLyContinueFacingHdl();
public: public:
ImpPDFTabOpnFtrPage( vcl::Window* pParent, const SfxItemSet& rSet ); ImpPDFTabOpnFtrPage(TabPageParent pParent, const SfxItemSet& rSet);
virtual ~ImpPDFTabOpnFtrPage() override; virtual ~ImpPDFTabOpnFtrPage() override;
virtual void dispose() override;
static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
void GetFilterConfigItem( ImpPDFTabDialog* paParent); void GetFilterConfigItem( ImpPDFTabDialog* paParent);

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 --> <!-- Generated with glade 3.22.1 -->
<interface domain="flt"> <interface domain="flt">
<requires lib="gtk+" version="3.18"/> <requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustment1"> <object class="GtkAdjustment" id="adjustment1">
@ -54,7 +54,6 @@
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="active">True</property> <property name="active">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">outline</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -70,7 +69,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">thumbs</property> <property name="group">pageonly</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -102,10 +101,10 @@
<object class="GtkLabel" id="label4"> <object class="GtkLabel" id="label4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="pdfviewpage|label4">Open on pa_ge:</property> <property name="label" translatable="yes" context="pdfviewpage|label4">Open on pa_ge:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">page</property> <property name="mnemonic_widget">page</property>
<property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -116,6 +115,7 @@
<object class="GtkSpinButton" id="page"> <object class="GtkSpinButton" id="page">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment1</property> <property name="adjustment">adjustment1</property>
</object> </object>
<packing> <packing>
@ -177,7 +177,6 @@
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="active">True</property> <property name="active">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">fitwin</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -193,7 +192,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">fitwidth</property> <property name="group">fitdefault</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -209,7 +208,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">fitvis</property> <property name="group">fitdefault</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -225,7 +224,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">fitzoom</property> <property name="group">fitdefault</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -260,6 +259,7 @@
<object class="GtkSpinButton" id="zoom"> <object class="GtkSpinButton" id="zoom">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment2</property> <property name="adjustment">adjustment2</property>
<accessibility> <accessibility>
<relation type="labelled-by" target="fitzoom"/> <relation type="labelled-by" target="fitzoom"/>
@ -331,7 +331,6 @@
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="active">True</property> <property name="active">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">singlelayout</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -347,7 +346,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">contlayout</property> <property name="group">defaultlayout</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -363,7 +362,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">contfacinglayout</property> <property name="group">defaultlayout</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>