From 9c9831f79cf0413c0cd947449bf8253fe09a224f Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Thu, 16 Oct 2014 10:53:52 +0200 Subject: usage info: Checkbox to turn it on and off (Tools -> Options... -> General). Change-Id: I67143e604314f5553026c369bbed3fdd683c39a6 --- cui/source/options/optgdlg.cxx | 14 ++++++++++ cui/source/options/optgdlg.hxx | 2 ++ cui/uiconfig/ui/optgeneralpage.ui | 57 ++++++++++++++++++++++++++++++++++----- 3 files changed, 66 insertions(+), 7 deletions(-) (limited to 'cui') diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 79688ccd2bb3..ef1ae9661187 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -67,6 +67,7 @@ #include #include #include +#include #include #include @@ -206,6 +207,7 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet) get(m_pYearFrame, "yearframe"); get(m_pYearValueField, "year"); get(m_pToYearFT, "toyear"); + get(m_pCollectUsageInfo, "collectusageinfo"); if (m_pFileDlgCB->IsVisible() && SvtMiscOptions().IsUseSystemFileDialogReadOnly()) { @@ -246,6 +248,7 @@ SfxTabPage* OfaMiscTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAtt bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet ) { bool bModified = false; + boost::shared_ptr batch(comphelper::ConfigurationChanges::create()); SvtHelpOptions aHelpOptions; if ( m_pToolTipsCB->IsValueChangedFromSaved() ) @@ -291,6 +294,14 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet ) rSet->Put( SfxUInt16Item( SID_ATTR_YEAR2000, nNum ) ); } + if (m_pCollectUsageInfo->IsValueChangedFromSaved()) + { + officecfg::Office::Common::Misc::CollectUsageInformation::set(m_pCollectUsageInfo->IsChecked(), batch); + bModified = true; + } + + batch->commit(); + return bModified; } @@ -327,6 +338,9 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet ) { m_pYearFrame->Enable(false); } + + m_pCollectUsageInfo->Check(officecfg::Office::Common::Misc::CollectUsageInformation::get()); + m_pCollectUsageInfo->SaveValue(); } diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx index f559a0c00a03..33534573502d 100644 --- a/cui/source/options/optgdlg.hxx +++ b/cui/source/options/optgdlg.hxx @@ -55,6 +55,8 @@ private: OUString m_aStrDateInfo; + CheckBox* m_pCollectUsageInfo; + DECL_LINK( TwoFigureHdl, NumericField* ); DECL_LINK( TwoFigureConfigHdl, NumericField* ); DECL_LINK(HelpCheckHdl_Impl, void *); diff --git a/cui/uiconfig/ui/optgeneralpage.ui b/cui/uiconfig/ui/optgeneralpage.ui index 83bc11437255..943c36602cfb 100644 --- a/cui/uiconfig/ui/optgeneralpage.ui +++ b/cui/uiconfig/ui/optgeneralpage.ui @@ -1,6 +1,13 @@ + + 1583 + 9857 + 1930 + 1 + 10 + True False @@ -351,12 +358,48 @@ 1 - - - 1583 - 9857 - 1930 - 1 - 10 + + + True + False + 0 + none + + + True + False + 6 + 12 + + + Allow collecting usage information, and sending it to TDF servers + True + True + False + True + 0 + True + + + + + + + True + False + Privacy + + + + + + + + 0 + 5 + 1 + 1 + + -- cgit v1.2.3