diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-26 20:44:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-27 12:51:24 +0200 |
commit | e171aec015212aa295e5e1831474b8af636e477b (patch) | |
tree | 589ec6c499f845749920a5bda5d67916c965e761 /cui | |
parent | f9fee27333e97e2251fc9b9b56072abc77a227fd (diff) |
weld SvxOpenCLTabPage
Change-Id: I8cc47aa63daa76794f1ec2e4fc7b64a1a0a18564
Reviewed-on: https://gerrit.libreoffice.org/76457
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/optopencl.cxx | 46 | ||||
-rw-r--r-- | cui/source/options/optopencl.hxx | 12 |
2 files changed, 20 insertions, 38 deletions
diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx index ba1ea2de7294..5131714e18c8 100644 --- a/cui/source/options/optopencl.cxx +++ b/cui/source/options/optopencl.cxx @@ -17,9 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <vcl/fixed.hxx> #include <vcl/svapp.hxx> -#include <vcl/window.hxx> #include <vcl/settings.hxx> #include <vcl/weld.hxx> #include <svl/zforlist.hxx> @@ -27,7 +25,6 @@ #include <opencl/openclwrapper.hxx> #include <officecfg/Office/Common.hxx> #include <svtools/restartdialog.hxx> -#include <svtools/simptabl.hxx> #include "optHeaderTabListbox.hxx" #include <com/sun/star/configuration/theDefaultProvider.hpp> @@ -40,39 +37,28 @@ #include <dialmgr.hxx> #include "optopencl.hxx" -SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet) : - SfxTabPage(pParent, "OptOpenCLPage", "cui/ui/optopenclpage.ui", &rSet), - maConfig(OpenCLConfig::get()) +SvxOpenCLTabPage::SvxOpenCLTabPage(TabPageParent pParent, const SfxItemSet& rSet) + : SfxTabPage(pParent, "cui/ui/optopenclpage.ui", "OptOpenCLPage", &rSet) + , maConfig(OpenCLConfig::get()) + , mxUseOpenCL(m_xBuilder->weld_check_button("useopencl")) + , mxOclUsed(m_xBuilder->weld_label("openclused")) + , mxOclNotUsed(m_xBuilder->weld_label("openclnotused")) { - get(mpUseOpenCL, "useopencl"); - get(mpOclUsed,"openclused"); - get(mpOclNotUsed,"openclnotused"); - - mpUseOpenCL->Check(maConfig.mbUseOpenCL); - mpUseOpenCL->Enable(!officecfg::Office::Common::Misc::UseOpenCL::isReadOnly()); + mxUseOpenCL->set_active(maConfig.mbUseOpenCL); + mxUseOpenCL->set_sensitive(!officecfg::Office::Common::Misc::UseOpenCL::isReadOnly()); bool bCLUsed = openclwrapper::GPUEnv::isOpenCLEnabled(); - mpOclUsed->Show(bCLUsed); - mpOclNotUsed->Show(!bCLUsed); + mxOclUsed->set_visible(bCLUsed); + mxOclNotUsed->set_visible(!bCLUsed); } SvxOpenCLTabPage::~SvxOpenCLTabPage() { - disposeOnce(); -} - -void SvxOpenCLTabPage::dispose() -{ - mpUseOpenCL.clear(); - mpOclUsed.clear(); - mpOclNotUsed.clear(); - - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxOpenCLTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +VclPtr<SfxTabPage> SvxOpenCLTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxOpenCLTabPage>::Create(pParent.pParent, *rAttrSet); + return VclPtr<SvxOpenCLTabPage>::Create(pParent, *rAttrSet); } bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* ) @@ -80,8 +66,8 @@ bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* ) bool bModified = false; std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); - if (mpUseOpenCL->IsValueChangedFromSaved()) - maConfig.mbUseOpenCL = mpUseOpenCL->IsChecked(); + if (mxUseOpenCL->get_state_changed_from_saved()) + maConfig.mbUseOpenCL = mxUseOpenCL->get_active(); if (maConfig != OpenCLConfig::get()) { @@ -105,8 +91,8 @@ void SvxOpenCLTabPage::Reset( const SfxItemSet* ) { maConfig = OpenCLConfig::get(); - mpUseOpenCL->Check(maConfig.mbUseOpenCL); - mpUseOpenCL->SaveValue(); + mxUseOpenCL->set_active(maConfig.mbUseOpenCL); + mxUseOpenCL->save_state(); } diff --git a/cui/source/options/optopencl.hxx b/cui/source/options/optopencl.hxx index cc07698e50ca..ddb74e07643a 100644 --- a/cui/source/options/optopencl.hxx +++ b/cui/source/options/optopencl.hxx @@ -22,23 +22,19 @@ #include <opencl/openclconfig.hxx> #include <sfx2/tabdlg.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> class SvxOpenCLTabPage : public SfxTabPage { private: OpenCLConfig maConfig; - VclPtr<CheckBox> mpUseOpenCL; - - VclPtr<FixedText> mpOclUsed; - VclPtr<FixedText> mpOclNotUsed; + std::unique_ptr<weld::CheckButton> mxUseOpenCL; + std::unique_ptr<weld::Label> mxOclUsed; + std::unique_ptr<weld::Label> mxOclNotUsed; public: - SvxOpenCLTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); + SvxOpenCLTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxOpenCLTabPage() override; - virtual void dispose() override; static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); |