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 + + diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 09a9b1867e54..9e72795692eb 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -5600,6 +5600,14 @@ false + + + Determines whether the usage information (like what actions + the user has performed) can be collected, and potentially sent for + examination. + + false + Determines if the limited, and awkward code producing diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 752a2f75d4e4..b371e7a88d44 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -644,6 +645,9 @@ void UsageInfo::load() void UsageInfo::save() { + if (!officecfg::Office::Common::Misc::CollectUsageInformation::get()) + return; + // TODO - do a real saving here, not only dump to the screen std::cerr << "Usage information:" << std::endl; for (UsageMap::const_iterator it = maUsage.begin(); it != maUsage.end(); ++it) @@ -658,7 +662,7 @@ class theUsageInfo : public rtl::Static {}; /// Extracts information about the command + args, and stores that. void collectUsageInformation(const util::URL& rURL, const uno::Sequence& rArgs) { - if (/*TODO disabled now, bind this to a config option instead*/true) + if (!officecfg::Office::Common::Misc::CollectUsageInformation::get()) return; OUStringBuffer aBuffer;