summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2011-12-07 21:58:26 -0500
committerAugust Sodora <augsod@gmail.com>2011-12-07 21:59:28 -0500
commitbd7f8380113b0cbe706d131b33e7551b2c484205 (patch)
tree60ff450396806f72bf2945eae0a86af9461b3746 /cui/source
parent855115d2f5845502e8619b35666512023584e012 (diff)
Remove oooimprovement
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/factory/dlgfact.cxx9
-rw-r--r--cui/source/inc/optimprove.hxx120
-rw-r--r--cui/source/options/optimprove.cxx197
-rw-r--r--cui/source/options/optimprove.hrc50
-rw-r--r--cui/source/options/optimprove.src124
-rw-r--r--cui/source/options/optimprove2.cxx267
-rw-r--r--cui/source/options/treeopt.cxx43
-rw-r--r--cui/source/options/treeopt.src1
8 files changed, 0 insertions, 811 deletions
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 2a6340dd5ee9..dc7c368203c1 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -36,7 +36,6 @@
#include <cuires.hrc>
#include <svx/dialogs.hrc>
#include "numfmt.hxx"
-#include "optimprove.hxx"
#include "splitcelldlg.hxx"
#include "gallery.hrc"
#include "dstribut.hxx"
@@ -1667,14 +1666,6 @@ SfxAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( Window* pParent,
case RID_SFXPAGE_DBREGISTER :
pDlg = new DatabaseRegistrationDialog( pParent, rAttr );
break;
- case RID_SVXPAGE_IMPROVEMENT :
- {
- String help_url;
- SFX_ITEMSET_ARG( &rAttr, pItem, SfxStringItem, SID_CURRENT_URL, sal_False );
- if ( pItem )
- help_url = pItem->GetValue();
- pDlg = new SvxImprovementDialog( pParent, help_url);
- }
default:
break;
}
diff --git a/cui/source/inc/optimprove.hxx b/cui/source/inc/optimprove.hxx
deleted file mode 100644
index 0666c78df0bd..000000000000
--- a/cui/source/inc/optimprove.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTIMPROVE_HXX
-#define _SVX_OPTIMPROVE_HXX
-
-// include ---------------------------------------------------------------
-
-#include <vcl/tabpage.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
-#include <svtools/fixedhyper.hxx>
-#include <sfx2/basedlgs.hxx>
-#include <sfx2/tabdlg.hxx>
-
-// class SvxImprovementPage ----------------------------------------------
-
-class SvxImprovementPage : public TabPage
-{
-private:
- FixedLine m_aImproveFL;
- FixedText m_aInvitationFT;
- RadioButton m_aYesRB;
- RadioButton m_aNoRB;
- FixedLine m_aDataFL;
- FixedText m_aNumberOfReportsFT;
- FixedText m_aNumberOfReportsValueFT;
- FixedText m_aNumberOfActionsFT;
- FixedText m_aNumberOfActionsValueFT;
- PushButton m_aShowDataPB;
-
- String m_sInfo;
- String m_sMoreInfo;
-
-public:
- SvxImprovementPage( Window* pParent );
- ~SvxImprovementPage();
-
- inline bool IsYesChecked() const { return m_aYesRB.IsChecked() != sal_False; }
-
- inline String GetPageText() const { return GetText(); }
- inline String GetInvitationText() const { return m_aInvitationFT.GetText(); }
- inline String GetYesButtonText() const { return m_aYesRB.GetText(); }
- inline String GetNoButtonText() const { return m_aNoRB.GetText(); }
- inline String GetInfoText() const { return m_sInfo; }
- inline String GetTitleText() const { return m_aImproveFL.GetText(); }
-};
-
-class SvxImprovementOptionsPage : public SfxTabPage
-{
-private:
- FixedLine m_aImproveFL;
- FixedText m_aInvitationFT;
- RadioButton m_aYesRB;
- RadioButton m_aNoRB;
- svt::FixedHyperlinkImage m_aInfoFI;
- FixedLine m_aDataFL;
- FixedText m_aNumberOfReportsFT;
- FixedText m_aNumberOfReportsValueFT;
- FixedText m_aNumberOfActionsFT;
- FixedText m_aNumberOfActionsValueFT;
- PushButton m_aShowDataPB;
-
- String m_sInfo;
- String m_sMoreInfo;
- ::rtl::OUString m_sLogPath;
-
- SvxImprovementOptionsPage( Window* pParent, const SfxItemSet& rSet );
-
- DECL_LINK( HandleHyperlink, svt::FixedHyperlinkImage * );
- DECL_LINK( HandleShowData, PushButton * );
-
-public:
- virtual ~SvxImprovementOptionsPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
-
- virtual sal_Bool FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-class SvxImprovementDialog : public SfxSingleTabDialog
-{
-private:
- SvxImprovementPage* m_pPage;
-
- DECL_LINK( HandleOK, OKButton * );
- DECL_LINK( HandleHyperlink, svt::FixedHyperlinkImage * );
-
-public:
- SvxImprovementDialog( Window* pParent, const String& rInfoURL );
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optimprove.cxx b/cui/source/options/optimprove.cxx
deleted file mode 100644
index 27d5e9fe68d2..000000000000
--- a/cui/source/options/optimprove.cxx
+++ /dev/null
@@ -1,197 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// include ---------------------------------------------------------------
-
-#define _SVX_OPTIMPROVE_CXX
-
-#include <optimprove.hxx>
-#include <dialmgr.hxx>
-#include <vcl/msgbox.hxx>
-#include <svx/dialogs.hrc>
-#include "optimprove.hrc"
-#include "helpid.hrc"
-#include <cuires.hrc>
-
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/system/XSystemShellExecute.hpp>
-#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
-#include <com/sun/star/oooimprovement/XCoreController.hpp>
-#include <comphelper/configurationhelper.hxx>
-#include <comphelper/processfactory.hxx>
-#include <comphelper/uieventslogger.hxx>
-
-namespace lang = ::com::sun::star::lang;
-namespace uno = ::com::sun::star::uno;
-using namespace com::sun::star::system;
-
-// class SvxImprovementPage ----------------------------------------------
-
-SvxImprovementPage::SvxImprovementPage( Window* pParent ) :
-
- TabPage( pParent, CUI_RES( RID_SVXPAGE_IMPROVEMENT ) ),
-
- m_aImproveFL ( this, CUI_RES( FL_IMPROVE ) ),
- m_aInvitationFT ( this, CUI_RES( FT_INVITATION ) ),
- m_aYesRB ( this, CUI_RES( RB_YES ) ),
- m_aNoRB ( this, CUI_RES( RB_NO ) ),
- m_aDataFL ( this, CUI_RES( FL_DATA ) ),
- m_aNumberOfReportsFT ( this, CUI_RES( FT_NR_REPORTS ) ),
- m_aNumberOfReportsValueFT ( this, CUI_RES( FT_NR_REPORTS_VALUE ) ),
- m_aNumberOfActionsFT ( this, CUI_RES( FT_NR_ACTIONS ) ),
- m_aNumberOfActionsValueFT ( this, CUI_RES( FT_NR_ACTIONS_VALUE ) ),
- m_aShowDataPB ( this, CUI_RES( PB_SHOWDATA ) ),
-
- m_sInfo ( CUI_RES( STR_INFO ) ),
- m_sMoreInfo ( CUI_RES( STR_MOREINFO ) )
-
-{
- FreeResource();
-
- m_aInvitationFT.Show();
- m_aDataFL.Hide();
- m_aNumberOfReportsFT.Hide();
- m_aNumberOfReportsValueFT.Hide();
- m_aNumberOfActionsFT.Hide();
- m_aNumberOfActionsValueFT.Hide();
- m_aShowDataPB.Hide();
-
- Size aNewSize = m_aInvitationFT.GetSizePixel();
- const long nMinWidth = m_aYesRB.CalcMinimumSize().Width();
- const long nNewWidth = std::max( aNewSize.Width() * 4 / 5, nMinWidth );
- const long nWDelta = aNewSize.Width() - nNewWidth;
- aNewSize.Width() = nNewWidth;
- const Size aCalcSize = m_aInvitationFT.CalcMinimumSize( nNewWidth );
- const long nHDelta = aCalcSize.Height() - aNewSize.Height();
- aNewSize.Height() = aCalcSize.Height();
- m_aInvitationFT.SetSizePixel( aNewSize );
-
- aNewSize = m_aYesRB.GetSizePixel();
- aNewSize.Width() = nNewWidth;
- Point aNewPos = m_aYesRB.GetPosPixel();
- aNewPos.Y() += nHDelta;
- m_aYesRB.SetPosSizePixel( aNewPos, aNewSize );
- aNewSize = m_aNoRB.GetSizePixel();
- aNewSize.Width() = nNewWidth;
- aNewPos = m_aNoRB.GetPosPixel();
- aNewPos.Y() += nHDelta;
- m_aNoRB.SetPosSizePixel( aNewPos, aNewSize );
- aNewSize = m_aImproveFL.GetSizePixel();
- aNewSize.Width() -= nWDelta;
- m_aImproveFL.SetSizePixel( aNewSize );
-
- Size aSize = GetOutputSizePixel();
- aSize.Width() -= nWDelta;
- aSize.Height() = m_aDataFL.GetPosPixel().Y();
- aSize.Height() += nHDelta;
- SetSizePixel( aSize );
-}
-
-// -----------------------------------------------------------------------
-
-SvxImprovementPage::~SvxImprovementPage()
-{
-}
-
-// class SvxImprovementDialog --------------------------------------------
-
-SvxImprovementDialog::SvxImprovementDialog( Window* pParent, const String& rInfoURL ) :
-
- SfxSingleTabDialog( pParent, RID_SVXPAGE_IMPROVEMENT, rInfoURL ),
-
- m_pPage( NULL )
-
-{
- m_pPage = new SvxImprovementPage( this );
- SetInfoLink( LINK( this, SvxImprovementDialog, HandleHyperlink ) );
- SetPage( m_pPage );
- if ( GetOKButton() )
- GetOKButton()->SetClickHdl( LINK( this, SvxImprovementDialog, HandleOK ) );
-}
-
-IMPL_LINK( SvxImprovementDialog, HandleHyperlink, svt::FixedHyperlinkImage*, pHyperlinkImage )
-{
- ::rtl::OUString sURL( pHyperlinkImage->GetURL() );
-
- if ( sURL.getLength() > 0 )
- {
- try
- {
- uno::Reference< lang::XMultiServiceFactory > xSMGR =
- ::comphelper::getProcessServiceFactory();
- uno::Reference< XSystemShellExecute > xSystemShell(
- xSMGR->createInstance( ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ),
- uno::UNO_QUERY_THROW );
- if ( xSystemShell.is() )
- {
- xSystemShell->execute(
- sURL, ::rtl::OUString(), SystemShellExecuteFlags::DEFAULTS );
- }
- }
- catch( const uno::Exception& e )
- {
- OSL_TRACE( "Caught exception: %s\n thread terminated.\n",
- rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
- }
- }
-
- return 0;
-}
-
-IMPL_LINK( SvxImprovementDialog, HandleOK, OKButton*, EMPTYARG )
-{
- uno::Reference< lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- uno::Reference< com::sun::star::oooimprovement::XCoreController > core_c(
- xSMGR->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.oooimprovement.CoreController") ) ),
- uno::UNO_QUERY);
- if(core_c.is())
- {
- ::comphelper::ConfigurationHelper::writeDirectKey(
- xSMGR,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.OOoImprovement.Settings") ),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Participation") ),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowedInvitation") ),
- uno::makeAny( true ),
- ::comphelper::ConfigurationHelper::E_STANDARD );
- ::comphelper::ConfigurationHelper::writeDirectKey(
- xSMGR,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.OOoImprovement.Settings") ),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Participation") ),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InvitationAccepted") ),
- uno::makeAny( m_pPage->IsYesChecked() ),
- ::comphelper::ConfigurationHelper::E_STANDARD );
- // TODO: refactor
- ::comphelper::UiEventsLogger::reinit();
- }
- EndDialog( RET_OK );
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optimprove.hrc b/cui/source/options/optimprove.hrc
deleted file mode 100644
index 024e5d5aae4a..000000000000
--- a/cui/source/options/optimprove.hrc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTIMPROVE_HRC
-#define _SVX_OPTIMPROVE_HRC
-
-// defines ---------------------------------------------------------------
-
-#define FL_IMPROVE 10
-#define FT_INVITATION 11
-#define RB_YES 12
-#define RB_NO 13
-#define FL_DATA 14
-#define FT_NR_REPORTS 15
-#define FT_NR_REPORTS_VALUE 16
-#define FT_NR_ACTIONS 17
-#define FT_NR_ACTIONS_VALUE 18
-#define PB_SHOWDATA 19
-#define FI_INFO 20
-#define WIN_INFO 21
-#define BTN_OK 22
-
-#define STR_INFO 10
-#define STR_MOREINFO 11
-
-#endif
-
diff --git a/cui/source/options/optimprove.src b/cui/source/options/optimprove.src
deleted file mode 100644
index 523dc8545ca9..000000000000
--- a/cui/source/options/optimprove.src
+++ /dev/null
@@ -1,124 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// include --------------------------------------------------------------
-
-#include "optimprove.hrc"
-#include <cuires.hrc>
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-
-TabPage RID_SVXPAGE_IMPROVEMENT
-{
- HelpId = "cui:TabPage:RID_SVXPAGE_IMPROVEMENT" ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "%PRODUCTNAME Improvement Program" ;
- FixedLine FL_IMPROVE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Improvement Program" ;
- };
- FixedText FT_INVITATION
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 242 , 72 ) ;
- WordBreak = TRUE ;
- Text [ en-US ] = "We invite you to join our %PRODUCTNAME Improvement Program to help optimize the quality of %PRODUCTNAME.\n\nIf you are willing to participate, we will collect anonymous statistics about how you use %PRODUCTNAME. The data is used to identify usage patterns.\n\nThe %PRODUCTNAME Improvement Program will not collect any personal data, or document content." ;
- };
- RadioButton RB_YES
- {
- HelpID = "cui:RadioButton:RID_SVXPAGE_IMPROVEMENT:RB_YES";
- Pos = MAP_APPFONT ( 12 , 92 ) ;
- Size = MAP_APPFONT ( 215 , 10 ) ;
- Check = TRUE ;
- Text [ en-US ] = "~Yes, I am willing to participate in the %PRODUCTNAME Improvement Program" ;
- };
- RadioButton RB_NO
- {
- HelpID = "cui:RadioButton:RID_SVXPAGE_IMPROVEMENT:RB_NO";
- Pos = MAP_APPFONT ( 12 , 105 ) ;
- Size = MAP_APPFONT ( 215 , 10 ) ;
- Text [ en-US ] = "~No, I do not wish to participate" ;
- };
- FixedImage FI_INFO
- {
- Pos = MAP_APPFONT ( 230 , 91 ) ;
- Size = MAP_APPFONT ( 24 , 24 ) ;
- Fixed = Image
- {
- ImageBitmap = Bitmap { File = "info.png"; };
- };
- };
- FixedLine FL_DATA
- {
- Pos = MAP_APPFONT ( 6 , 121 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Tracked Data" ;
- };
- FixedText FT_NR_REPORTS
- {
- Pos = MAP_APPFONT ( 12 , 132 ) ;
- Size = MAP_APPFONT ( 96 , 8 ) ;
- Text [ en-US ] = "Number of reports sent:" ;
- };
- FixedText FT_NR_REPORTS_VALUE
- {
- Pos = MAP_APPFONT ( 111 , 132 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- };
- FixedText FT_NR_ACTIONS
- {
- Pos = MAP_APPFONT ( 12 , 145 ) ;
- Size = MAP_APPFONT ( 96 , 8 ) ;
- Text [ en-US ] = "Number of tracked actions:" ;
- };
- FixedText FT_NR_ACTIONS_VALUE
- {
- Pos = MAP_APPFONT ( 111 , 145 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- };
- PushButton PB_SHOWDATA
- {
- HelpID = "cui:PushButton:RID_SVXPAGE_IMPROVEMENT:PB_SHOWDATA";
- Pos = MAP_APPFONT ( 12 , 161 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "~Show Data" ;
- };
- String STR_INFO
- {
- Text [ en-US ] = "Help Optimize the Quality of %PRODUCTNAME" ;
- };
- String STR_MOREINFO
- {
- Text [ en-US ] = "More Information" ;
- };
-};
-
diff --git a/cui/source/options/optimprove2.cxx b/cui/source/options/optimprove2.cxx
deleted file mode 100644
index 4d6f23836a0f..000000000000
--- a/cui/source/options/optimprove2.cxx
+++ /dev/null
@@ -1,267 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define _SVX_OPTIMPROVE_CXX
-
-#include <optimprove.hxx>
-#include <dialmgr.hxx>
-#include <vcl/msgbox.hxx>
-
-#include "optimprove.hrc"
-#include "helpid.hrc"
-#include <cuires.hrc>
-#include <svx/dialogs.hrc>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/oooimprovement/XCore.hpp>
-#include <com/sun/star/oooimprovement/XCoreController.hpp>
-#include <com/sun/star/system/XSystemShellExecute.hpp>
-#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
-#include <com/sun/star/util/XStringSubstitution.hpp>
-#include <comphelper/configurationhelper.hxx>
-#include <comphelper/processfactory.hxx>
-#include <comphelper/synchronousdispatch.hxx>
-#include <comphelper/uieventslogger.hxx>
-#include <osl/file.hxx>
-
-#define C2S(s) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
-
-namespace beans = ::com::sun::star::beans;
-namespace lang = ::com::sun::star::lang;
-namespace uno = ::com::sun::star::uno;
-namespace util = ::com::sun::star::util;
-using namespace com::sun::star::system;
-
-
-namespace
-{
- bool lcl_doesLogfileExist(const ::rtl::OUString& sLogPath)
- {
- ::rtl::OUString sLogFile( sLogPath );
- sLogFile += C2S("/Current.csv");
- ::osl::File aLogFile(sLogFile);
- return aLogFile.open(osl_File_OpenFlag_Read) == ::osl::FileBase::E_None;
- }
-}
-
-// class SvxImprovementOptionsPage ---------------------------------------
-
-SvxImprovementOptionsPage::SvxImprovementOptionsPage( Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_IMPROVEMENT ), rSet ),
-
- m_aImproveFL ( this, CUI_RES( FL_IMPROVE ) ),
- m_aInvitationFT ( this, CUI_RES( FT_INVITATION ) ),
- m_aYesRB ( this, CUI_RES( RB_YES ) ),
- m_aNoRB ( this, CUI_RES( RB_NO ) ),
- m_aInfoFI ( this, CUI_RES( FI_INFO ) ),
- m_aDataFL ( this, CUI_RES( FL_DATA ) ),
- m_aNumberOfReportsFT ( this, CUI_RES( FT_NR_REPORTS ) ),
- m_aNumberOfReportsValueFT ( this, CUI_RES( FT_NR_REPORTS_VALUE ) ),
- m_aNumberOfActionsFT ( this, CUI_RES( FT_NR_ACTIONS ) ),
- m_aNumberOfActionsValueFT ( this, CUI_RES( FT_NR_ACTIONS_VALUE ) ),
- m_aShowDataPB ( this, CUI_RES( PB_SHOWDATA ) ),
-
- m_sInfo ( CUI_RES( STR_INFO ) ),
- m_sMoreInfo ( CUI_RES( STR_MOREINFO ) )
-
-{
- FreeResource();
-
- m_aInfoFI.SetURL( C2S( "www.sun.com/privacy/" ) );
- m_aInfoFI.SetClickHdl( LINK( this, SvxImprovementOptionsPage, HandleHyperlink ) );
- m_aShowDataPB.SetClickHdl( LINK( this, SvxImprovementOptionsPage, HandleShowData ) );
-}
-
-SvxImprovementOptionsPage::~SvxImprovementOptionsPage()
-{
-}
-
-IMPL_LINK( SvxImprovementOptionsPage, HandleHyperlink, svt::FixedHyperlinkImage*, EMPTYARG )
-{
- ::rtl::OUString sURL( m_aInfoFI.GetURL() );
-
- if ( sURL.getLength() > 0 )
- {
- try
- {
- uno::Reference< lang::XMultiServiceFactory > xSMGR =
- ::comphelper::getProcessServiceFactory();
- uno::Reference< XSystemShellExecute > xSystemShell(
- xSMGR->createInstance( ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ),
- uno::UNO_QUERY_THROW );
- if ( xSystemShell.is() )
- {
- xSystemShell->execute(
- sURL, ::rtl::OUString(), SystemShellExecuteFlags::DEFAULTS );
- }
- }
- catch( const uno::Exception& e )
- {
- OSL_TRACE( "Caught exception: %s\n thread terminated.\n",
- rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
- }
- }
-
- return 0;
-}
-
-IMPL_LINK( SvxImprovementOptionsPage, HandleShowData, PushButton*, EMPTYARG )
-{
- uno::Reference < uno::XInterface > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(
- C2S("com.sun.star.frame.Desktop") ), uno::UNO_QUERY );
- if ( xDesktop.is() )
- {
- ::rtl::OUString sLogFile( m_sLogPath );
- sLogFile += C2S("/Current.csv");
- uno::Sequence< beans::PropertyValue > aArgs(3);
- aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName") );
- aArgs[0].Value = uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text - txt - csv (StarCalc)") ) );
- aArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterOptions") );
- aArgs[1].Value = uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("44,34,12,1,") ) );
- aArgs[2].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly") );
- aArgs[2].Value = uno::makeAny(true);
-
- uno::Reference< lang::XComponent > xDoc = ::comphelper::SynchronousDispatch::dispatch(
- xDesktop, sLogFile, C2S("_default"), 0, aArgs );
- if ( xDoc.is() )
- {
- dynamic_cast<Dialog*>(GetParent())->EndDialog( RET_CANCEL );
- return 1;
- }
- }
-
- return 0;
-}
-
-SfxTabPage* SvxImprovementOptionsPage::Create( Window* pParent, const SfxItemSet& rSet )
-{
- return new SvxImprovementOptionsPage( pParent, rSet );
-}
-
-sal_Bool SvxImprovementOptionsPage::FillItemSet( SfxItemSet& /*rSet*/ )
-{
- uno::Reference< lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- uno::Reference< uno::XInterface > xConfig;
-
- try
- {
- xConfig = ::comphelper::ConfigurationHelper::openConfig(
- xSMGR, C2S("/org.openoffice.Office.OOoImprovement.Settings"),
- ::comphelper::ConfigurationHelper::E_STANDARD );
- ::comphelper::ConfigurationHelper::writeRelativeKey(
- xConfig, C2S("Participation"), C2S("ShowedInvitation"), uno::makeAny( true ) );
- ::comphelper::ConfigurationHelper::writeRelativeKey(
- xConfig, C2S("Participation"), C2S("InvitationAccepted"), uno::makeAny( m_aYesRB.IsChecked() != sal_False ) );
- ::comphelper::ConfigurationHelper::flush( xConfig );
- // TODO: refactor
- ::comphelper::UiEventsLogger::reinit();
- }
- catch( uno::Exception& )
- {
- }
-
- return sal_False;
-}
-
-void SvxImprovementOptionsPage::Reset( const SfxItemSet& /*rSet*/ )
-{
- uno::Reference< lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- uno::Reference< com::sun::star::oooimprovement::XCore > xCore(
- xSMGR->createInstance( C2S("com.sun.star.oooimprovement.Core") ),
- uno::UNO_QUERY );
- uno::Reference< uno::XInterface > xConfig;
-
- try
- {
- m_aNoRB.Check();
- xConfig = ::comphelper::ConfigurationHelper::openConfig(
- xSMGR, C2S("/org.openoffice.Office.OOoImprovement.Settings"),
- ::comphelper::ConfigurationHelper::E_READONLY );
- if ( xConfig.is() )
- {
- bool bYesChecked = false;
- uno::Any aAny = ::comphelper::ConfigurationHelper::
- readRelativeKey( xConfig, C2S("Participation"), C2S("ShowedInvitation") );
- if ( ( aAny >>= bYesChecked ) && bYesChecked )
- {
- bool bTemp = false;
- aAny = ::comphelper::ConfigurationHelper::
- readRelativeKey( xConfig, C2S("Participation"), C2S("InvitationAccepted") );
- if ( aAny >>= bTemp )
- {
- bYesChecked &= bTemp;
- if ( bYesChecked )
- m_aYesRB.Check();
- }
- }
-
- ::rtl::OUString sURL;
- aAny = ::comphelper::ConfigurationHelper::
- readRelativeKey( xConfig, C2S("Participation"), C2S("HelpUrl") );
- if ( aAny >>= sURL )
- m_aInfoFI.SetURL( sURL );
-
- sal_Int32 nCount = 0;
- aAny = ::comphelper::ConfigurationHelper::
- readRelativeKey( xConfig, C2S("Counters"), C2S("UploadedReports") );
- if ( aAny >>= nCount )
- m_aNumberOfReportsValueFT.SetText( String::CreateFromInt32( nCount ) );
- aAny = ::comphelper::ConfigurationHelper::
- readRelativeKey( xConfig, C2S("Counters"), C2S("LoggedEvents") );
- if ( aAny >>= nCount )
- {
- if ( xCore.is() )
- nCount += xCore->getSessionLogEventCount();
- m_aNumberOfActionsValueFT.SetText( String::CreateFromInt32( nCount ) );
- }
-
- ::rtl::OUString sPath;
- aAny = ::comphelper::ConfigurationHelper::readDirectKey(
- xSMGR, C2S("/org.openoffice.Office.Logging"), C2S("OOoImprovement"),
- C2S("LogPath"), ::comphelper::ConfigurationHelper::E_READONLY );
- if ( aAny >>= sPath )
- {
- uno::Reference< util::XStringSubstitution > xSubst(
- xSMGR->createInstance( C2S("com.sun.star.util.PathSubstitution") ),
- uno::UNO_QUERY );
- if ( xSubst.is() )
- sPath = xSubst->substituteVariables( sPath, sal_False );
- m_sLogPath = sPath;
- m_aShowDataPB.Enable(lcl_doesLogfileExist(m_sLogPath));
- }
- }
- }
- catch( uno::Exception& )
- {
- m_aShowDataPB.Enable(false);
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index d5f48812e779..66210b70b1bf 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -45,7 +45,6 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/oooimprovement/XCoreController.hpp>
#include <comphelper/configurationhelper.hxx>
#include <com/sun/star/awt/XDialogProvider.hpp>
#include <com/sun/star/awt/XDialogProvider2.hpp>
@@ -99,7 +98,6 @@
#include "optjsearch.hxx"
#include "connpooloptions.hxx"
#include "optupdt.hxx"
-#include <optimprove.hxx>
#include "optchart.hxx"
#include "optgdlg.hxx"
#include "optmemory.hxx"
@@ -361,7 +359,6 @@ SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, Window* pParent, const SfxItem
case RID_SVXPAGE_OPTIONS_JAVA: fnCreate = &SvxJavaOptionsPage::Create ; break;
case RID_SVXPAGE_ONLINEUPDATE: fnCreate = &SvxOnlineUpdateTabPage::Create; break;
case RID_OPTPAGE_CHART_DEFCOLORS: fnCreate = &SvxDefaultColorOptPage::Create; break;
- case RID_SVXPAGE_IMPROVEMENT: fnCreate = &SvxImprovementOptionsPage::Create; break;
}
SfxTabPage* pRet = fnCreate ? (*fnCreate)( pParent, rSet ) : NULL;
@@ -394,7 +391,6 @@ static OptionsMapping_Impl const OptionsMap_Impl[] =
{ "ProductName", "Java", RID_SVXPAGE_OPTIONS_JAVA },
{ "ProductName", "NetworkIdentity", RID_SVXPAGE_SSO },
{ "ProductName", "OnlineUpdate", RID_SVXPAGE_ONLINEUPDATE },
- { "ProductName", "ImprovementProgram", RID_SVXPAGE_IMPROVEMENT },
{ "LanguageSettings", NULL, SID_LANGUAGE_OPTIONS },
{ "LanguageSettings", "Languages", OFA_TP_LANGUAGES },
{ "LanguageSettings", "WritingAids", RID_SFXPAGE_LINGU },
@@ -1823,50 +1819,11 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
continue;
}
}
- // Disable OOoImprovement page if not enabled
- if( RID_SVXPAGE_IMPROVEMENT == nPageId )
- {
- continue;
- }
- if ( nPageId != RID_SVXPAGE_SSO || isSSOEnabled )
- {
- AddTabPage( nPageId, sNewTitle, nGroup );
- }
- }
- do
- {
- String sNewTitle = C2U("Improvement Program");
- {
- SvxImprovementPage aTempTabPage(this);
- sNewTitle = aTempTabPage.GetTitleText();
- }
- nPageId = RID_SVXPAGE_IMPROVEMENT;
- if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- continue;
- // Disable OOoImprovement page if not enabled
- {
- const ::rtl::OUString sService = C2U("com.sun.star.oooimprovement.CoreController");
- try
- {
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- Reference < ::com::sun::star::oooimprovement::XCoreController > xService( xFactory->createInstance( sService ), UNO_QUERY );
-
- if( ! xService.is() )
- continue;
- if( ! xService->showBuiltinOptionsPage(1))
- continue;
- }
- catch ( ::com::sun::star::loader::CannotActivateFactoryException& )
- {
- continue;
- }
- }
if ( nPageId != RID_SVXPAGE_SSO || isSSOEnabled )
{
AddTabPage( nPageId, sNewTitle, nGroup );
}
}
- while (0);
}
// Load and Save options
diff --git a/cui/source/options/treeopt.src b/cui/source/options/treeopt.src
index 62be8ce22c40..acfc312426ba 100644
--- a/cui/source/options/treeopt.src
+++ b/cui/source/options/treeopt.src
@@ -162,7 +162,6 @@ Resource RID_OFADLG_OPTIONS_TREE_PAGES
< "Java" ; RID_SVXPAGE_OPTIONS_JAVA ; > ;
< "Network Identity" ; RID_SVXPAGE_SSO ; > ;
< "Online Update" ; RID_SVXPAGE_ONLINEUPDATE ; > ;
- < "" ; RID_SVXPAGE_IMPROVEMENT ; > ;
};
};
StringArray SID_LANGUAGE_OPTIONS