diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-29 16:54:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-30 09:53:59 +0200 |
commit | 5a6a718d0e99bbd3311fdcd87648420fcec9f5b2 (patch) | |
tree | 48ee1b6cb0db9751ab92083a11af0b8268866d52 /cui/source | |
parent | 0871c62fab7effd915d54caf953fd6b7e8de2372 (diff) |
weld SvxEMailTabPage
Change-Id: I039564a53fe4b9c20f34efcb9e59f57528a1f5da
Reviewed-on: https://gerrit.libreoffice.org/76561
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/options/optinet2.cxx | 73 | ||||
-rw-r--r-- | cui/source/options/optinet2.hxx | 23 |
2 files changed, 41 insertions, 55 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index e4a16a298cf6..af3c497d44e8 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -965,46 +965,33 @@ struct SvxEMailTabPage_Impl bool bROHideContent; }; -SvxEMailTabPage::SvxEMailTabPage(vcl::Window* pParent, const SfxItemSet& rSet) - : SfxTabPage( pParent, "OptEmailPage", "cui/ui/optemailpage.ui", &rSet) +SvxEMailTabPage::SvxEMailTabPage(TabPageParent pParent, const SfxItemSet& rSet) + : SfxTabPage( pParent, "cui/ui/optemailpage.ui", "OptEmailPage", &rSet) , pImpl(new SvxEMailTabPage_Impl) + , m_xMailContainer(m_xBuilder->weld_container("program")) + , m_xMailerURLFI(m_xBuilder->weld_image("lockemail")) + , m_xMailerURLED(m_xBuilder->weld_entry("url")) + , m_xMailerURLPB(m_xBuilder->weld_button("browse")) + , m_xSuppressHiddenContainer(m_xBuilder->weld_container("suppressHiddenCont")) + , m_xSuppressHiddenFI(m_xBuilder->weld_image("lockSuppressHidden")) + , m_xSuppressHidden(m_xBuilder->weld_check_button("suppressHidden")) + , m_xDefaultFilterFT(m_xBuilder->weld_label("browsetitle")) { - get(m_pMailContainer, "program"); - get(m_pMailerURLFI, "lockemail"); - get(m_pMailerURLED, "url"); - get(m_pMailerURLPB, "browse"); - get(m_pSuppressHiddenContainer, "suppressHiddenCont"); - get(m_pSuppressHiddenFI, "lockSuppressHidden"); - get(m_pSuppressHidden, "suppressHidden"); - m_sDefaultFilterName = get<FixedText>("browsetitle")->GetText(); - m_pMailerURLPB->SetClickHdl( LINK( this, SvxEMailTabPage, FileDialogHdl_Impl ) ); + m_sDefaultFilterName = m_xDefaultFilterFT->get_label(); + m_xMailerURLPB->connect_clicked( LINK( this, SvxEMailTabPage, FileDialogHdl_Impl ) ); } /* -------------------------------------------------------------------------*/ SvxEMailTabPage::~SvxEMailTabPage() { - disposeOnce(); -} - -void SvxEMailTabPage::dispose() -{ - pImpl.reset(); - m_pMailContainer.clear(); - m_pMailerURLFI.clear(); - m_pMailerURLED.clear(); - m_pMailerURLPB.clear(); - m_pSuppressHiddenContainer.clear(); - m_pSuppressHiddenFI.clear(); - m_pSuppressHidden.clear(); - SfxTabPage::dispose(); } /* -------------------------------------------------------------------------*/ VclPtr<SfxTabPage> SvxEMailTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxEMailTabPage>::Create(pParent.pParent, *rAttrSet); + return VclPtr<SvxEMailTabPage>::Create(pParent, *rAttrSet); } /* -------------------------------------------------------------------------*/ @@ -1013,16 +1000,16 @@ bool SvxEMailTabPage::FillItemSet( SfxItemSet* ) { std::shared_ptr<comphelper::ConfigurationChanges> batch( comphelper::ConfigurationChanges::create()); - if (!pImpl->bROProgram && m_pMailerURLED->IsValueChangedFromSaved()) + if (!pImpl->bROProgram && m_xMailerURLED->get_value_changed_from_saved()) { - pImpl->sProgram = m_pMailerURLED->GetText(); + pImpl->sProgram = m_xMailerURLED->get_text(); officecfg::Office::Common::ExternalMailer::Program::set( pImpl->sProgram, batch); } if (!pImpl->bROHideContent - && pImpl->bHideContent != m_pSuppressHidden->IsChecked()) + && pImpl->bHideContent != m_xSuppressHidden->get_active()) { - pImpl->bHideContent = m_pSuppressHidden->IsChecked(); + pImpl->bHideContent = m_xSuppressHidden->get_active(); officecfg::Office::Security::HiddenContent::RemoveHiddenContent::set( pImpl->bHideContent, batch); } @@ -1034,33 +1021,33 @@ bool SvxEMailTabPage::FillItemSet( SfxItemSet* ) void SvxEMailTabPage::Reset( const SfxItemSet* ) { - m_pMailerURLED->Enable(); - m_pMailerURLPB->Enable(); + m_xMailerURLED->set_sensitive(true); + m_xMailerURLPB->set_sensitive(true); if (pImpl->bROProgram) - m_pMailerURLFI->Show(); + m_xMailerURLFI->show(); - m_pMailerURLED->SetText(pImpl->sProgram); - m_pMailerURLED->SaveValue(); + m_xMailerURLED->set_text(pImpl->sProgram); + m_xMailerURLED->save_value(); - m_pMailContainer->Enable(!pImpl->bROProgram); + m_xMailContainer->set_sensitive(!pImpl->bROProgram); if (pImpl->bROHideContent) - m_pSuppressHiddenFI->Show(); + m_xSuppressHiddenFI->show(); - m_pSuppressHidden->Check(pImpl->bHideContent); + m_xSuppressHidden->set_active(pImpl->bHideContent); - m_pSuppressHiddenContainer->Enable(!pImpl->bROHideContent); + m_xSuppressHiddenContainer->set_sensitive(!pImpl->bROHideContent); } /* -------------------------------------------------------------------------*/ -IMPL_LINK( SvxEMailTabPage, FileDialogHdl_Impl, Button*, pButton, void ) +IMPL_LINK_NOARG(SvxEMailTabPage, FileDialogHdl_Impl, weld::Button&, void) { - if (m_pMailerURLPB == pButton && !pImpl->bROProgram) + if (!pImpl->bROProgram) { FileDialogHelper aHelper(css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, GetFrameWeld()); - OUString sPath = m_pMailerURLED->GetText(); + OUString sPath = m_xMailerURLED->get_text(); if ( sPath.isEmpty() ) sPath = "/usr/bin"; @@ -1077,7 +1064,7 @@ IMPL_LINK( SvxEMailTabPage, FileDialogHdl_Impl, Button*, pButton, void ) { sPath.clear(); } - m_pMailerURLED->SetText(sPath); + m_xMailerURLED->set_text(sPath); } } } diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx index 9d7c3596c90e..dd75a3920ad0 100644 --- a/cui/source/options/optinet2.hxx +++ b/cui/source/options/optinet2.hxx @@ -155,24 +155,24 @@ public: struct SvxEMailTabPage_Impl; class SvxEMailTabPage : public SfxTabPage { - VclPtr<VclContainer> m_pMailContainer; - VclPtr<FixedImage> m_pMailerURLFI; - VclPtr<Edit> m_pMailerURLED; - VclPtr<PushButton> m_pMailerURLPB; - VclPtr<VclContainer> m_pSuppressHiddenContainer; - VclPtr<FixedImage> m_pSuppressHiddenFI; - VclPtr<CheckBox> m_pSuppressHidden; - OUString m_sDefaultFilterName; std::unique_ptr<SvxEMailTabPage_Impl> pImpl; - DECL_LINK( FileDialogHdl_Impl, Button*, void ); + std::unique_ptr<weld::Container> m_xMailContainer; + std::unique_ptr<weld::Image> m_xMailerURLFI; + std::unique_ptr<weld::Entry> m_xMailerURLED; + std::unique_ptr<weld::Button> m_xMailerURLPB; + std::unique_ptr<weld::Container> m_xSuppressHiddenContainer; + std::unique_ptr<weld::Image> m_xSuppressHiddenFI; + std::unique_ptr<weld::CheckButton> m_xSuppressHidden; + std::unique_ptr<weld::Label> m_xDefaultFilterFT; + + DECL_LINK(FileDialogHdl_Impl, weld::Button&, void); public: - SvxEMailTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); + SvxEMailTabPage(TabPageParent pParent, const SfxItemSet& rSet ); virtual ~SvxEMailTabPage() override; - virtual void dispose() override; static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); @@ -182,5 +182,4 @@ public: #endif // INCLUDED_CUI_SOURCE_OPTIONS_OPTINET2_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |