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 | |
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')
-rw-r--r-- | cui/source/options/optinet2.cxx | 73 | ||||
-rw-r--r-- | cui/source/options/optinet2.hxx | 23 | ||||
-rw-r--r-- | cui/uiconfig/ui/optemailpage.ui | 41 |
3 files changed, 64 insertions, 73 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: */ diff --git a/cui/uiconfig/ui/optemailpage.ui b/cui/uiconfig/ui/optemailpage.ui index 497e99a99d92..f2fba43ae7dc 100644 --- a/cui/uiconfig/ui/optemailpage.ui +++ b/cui/uiconfig/ui/optemailpage.ui @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.1 --> <interface domain="cui"> <requires lib="gtk+" version="3.18"/> <object class="GtkFrame" id="OptEmailPage"> @@ -30,8 +31,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -40,13 +39,12 @@ <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <property name="width_chars">32</property> </object> <packing> <property name="left_attach">2</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -60,8 +58,6 @@ <packing> <property name="left_attach">3</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -70,13 +66,11 @@ <property name="no_show_all">True</property> <property name="halign">center</property> <property name="valign">center</property> - <property name="pixbuf">res/lock.png</property> + <property name="icon_name">res/lock.png</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -89,7 +83,6 @@ <property name="left_attach">0</property> <property name="top_attach">1</property> <property name="width">4</property> - <property name="height">1</property> </packing> </child> </object> @@ -109,15 +102,13 @@ <object class="GtkLabel" id="suppress"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="optemailpage|suppress">Suppress hidden elements of documents</property> <property name="use_underline">True</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">2</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -132,8 +123,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -142,15 +131,31 @@ <property name="no_show_all">True</property> <property name="halign">center</property> <property name="valign">center</property> - <property name="pixbuf">res/lock.png</property> + <property name="icon_name">res/lock.png</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="expand">False</property> |