diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-11-30 09:44:19 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-12-01 16:40:44 +0100 |
commit | bd8a89f208c71e51921d5f090179b99b45cc0a5f (patch) | |
tree | 76884fe22a5167ae48cd8a94b7e7d75b08ddcaa7 /cui | |
parent | 9ae2d9ff4be259ad60bbb10a7488e38ca4eefc11 (diff) |
sc interpreter: Don't hide S/W Interpreter behind an environment variable.
Instead provide a user setting that can be enabled so that the S/W Interpreter
is used on a subset of the operations. The operations for which it is used
are controlled by a whitelist in ScCalcConfig::setOpenCLConfigToDefault().
Change-Id: I7d3f3a864fcb1231e5484ec23961f14fca1466c5
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optopencl.cxx | 19 | ||||
-rw-r--r-- | cui/source/options/optopencl.hxx | 1 | ||||
-rw-r--r-- | cui/uiconfig/ui/optopenclpage.ui | 18 |
3 files changed, 36 insertions, 2 deletions
diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx index 71cd281480dc..db1470e290c7 100644 --- a/cui/source/options/optopencl.cxx +++ b/cui/source/options/optopencl.cxx @@ -35,7 +35,8 @@ #include <com/sun/star/util/XChangesBatch.hpp> #include <com/sun/star/setup/UpdateCheckConfig.hpp> -#include "cuires.hrc" +#include <cuires.hrc> +#include <dialmgr.hxx> #include "optopencl.hxx" #include <svtools/treelistentry.hxx> @@ -43,6 +44,7 @@ SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet) SfxTabPage(pParent, "OptOpenCLPage", "cui/ui/optopenclpage.ui", &rSet), maConfig(OpenCLConfig::get()) { + get(mpUseSwInterpreter, "useswinterpreter"); get(mpUseOpenCL, "useopencl"); get(mpBlackListTable, "blacklist"); get(mpBlackListFrame,"blacklistframe"); @@ -60,6 +62,8 @@ SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet) get(mpVendor,"vendor"); get(mpDrvVersion,"driverversion"); + mpUseSwInterpreter->Check(officecfg::Office::Common::Misc::UseSwInterpreter::get()); + mpUseOpenCL->Check(maConfig.mbUseOpenCL); mpUseOpenCL->SetClickHdl(LINK(this, SvxOpenCLTabPage, EnableOpenCLHdl)); @@ -116,6 +120,7 @@ void SvxOpenCLTabPage::dispose() mpBlackList.disposeAndClear(); mpWhiteList.disposeAndClear(); + mpUseSwInterpreter.clear(); mpUseOpenCL.clear(); mpBlackListFrame.clear(); mpBlackListTable.clear(); @@ -146,6 +151,15 @@ bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* ) bool bModified = false; std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); + if (mpUseSwInterpreter->IsValueChangedFromSaved()) + { + officecfg::Office::Common::Misc::UseSwInterpreter::set(mpUseSwInterpreter->IsChecked(), batch); + bModified = true; + + ScopedVclPtrInstance<MessageDialog> aWarnBox(this, CUI_RES(RID_SVXSTR_OPTIONS_RESTART), VCL_MESSAGE_INFO); + aWarnBox->Execute(); + } + if (mpUseOpenCL->IsValueChangedFromSaved()) maConfig.mbUseOpenCL = mpUseOpenCL->IsChecked(); @@ -195,6 +209,9 @@ void SvxOpenCLTabPage::Reset( const SfxItemSet* ) { maConfig = OpenCLConfig::get(); + mpUseSwInterpreter->Check(officecfg::Office::Common::Misc::UseSwInterpreter::get()); + mpUseSwInterpreter->SaveValue(); + mpUseOpenCL->Check(maConfig.mbUseOpenCL); mpUseOpenCL->SaveValue(); diff --git a/cui/source/options/optopencl.hxx b/cui/source/options/optopencl.hxx index fe91fe1f440f..10dc30b5ce2b 100644 --- a/cui/source/options/optopencl.hxx +++ b/cui/source/options/optopencl.hxx @@ -31,6 +31,7 @@ class SvxOpenCLTabPage : public SfxTabPage private: OpenCLConfig maConfig; + VclPtr<CheckBox> mpUseSwInterpreter; VclPtr<CheckBox> mpUseOpenCL; VclPtr<VclFrame> mpBlackListFrame; diff --git a/cui/uiconfig/ui/optopenclpage.ui b/cui/uiconfig/ui/optopenclpage.ui index 89ac882818a0..2cad763361ca 100644 --- a/cui/uiconfig/ui/optopenclpage.ui +++ b/cui/uiconfig/ui/optopenclpage.ui @@ -26,6 +26,22 @@ <property name="orientation">vertical</property> <property name="spacing">12</property> <child> + <object class="GtkCheckButton" id="useswinterpreter"> + <property name="label" translatable="yes">Allow use of Software Interpreter (even when OpenCL is not available)</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> <object class="GtkCheckButton" id="useopencl"> <property name="label" translatable="yes">Allow use of OpenCL</property> <property name="visible">True</property> @@ -38,7 +54,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">0</property> + <property name="position">1</property> </packing> </child> <child> |