summaryrefslogtreecommitdiff
path: root/cui/source/options/optimprove2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/options/optimprove2.cxx')
-rw-r--r--cui/source/options/optimprove2.cxx27
1 files changed, 15 insertions, 12 deletions
diff --git a/cui/source/options/optimprove2.cxx b/cui/source/options/optimprove2.cxx
index 5bb7c1592061..132247d6f81d 100644
--- a/cui/source/options/optimprove2.cxx
+++ b/cui/source/options/optimprove2.cxx
@@ -50,6 +50,7 @@
#include <comphelper/synchronousdispatch.hxx>
#include <comphelper/uieventslogger.hxx>
#include <tools/testtoolloader.hxx>
+#include <osl/file.hxx>
#define C2S(s) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
@@ -59,14 +60,16 @@ namespace uno = ::com::sun::star::uno;
namespace util = ::com::sun::star::util;
using namespace com::sun::star::system;
-// class SvxEmptyPage ----------------------------------------------------
-
-SvxEmptyPage::SvxEmptyPage( Window* pParent ) :
-
- TabPage( pParent, CUI_RES( RID_SVXPAGE_IMPROVEMENT ) )
+namespace
{
- FreeResource();
+ 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 ---------------------------------------
@@ -151,7 +154,10 @@ IMPL_LINK( SvxImprovementOptionsPage, HandleShowData, PushButton*, EMPTYARG )
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;
@@ -162,11 +168,6 @@ SfxTabPage* SvxImprovementOptionsPage::Create( Window* pParent, const SfxItemSet
return new SvxImprovementOptionsPage( pParent, rSet );
}
-sal_uInt16* SvxImprovementOptionsPage::GetRanges()
-{
- return NULL;
-}
-
sal_Bool SvxImprovementOptionsPage::FillItemSet( SfxItemSet& /*rSet*/ )
{
uno::Reference< lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
@@ -180,7 +181,7 @@ sal_Bool SvxImprovementOptionsPage::FillItemSet( SfxItemSet& /*rSet*/ )
::comphelper::ConfigurationHelper::writeRelativeKey(
xConfig, C2S("Participation"), C2S("ShowedInvitation"), uno::makeAny( true ) );
::comphelper::ConfigurationHelper::writeRelativeKey(
- xConfig, C2S("Participation"), C2S("InvitationAccepted"), uno::makeAny( m_aYesRB.IsChecked() != FALSE ) );
+ xConfig, C2S("Participation"), C2S("InvitationAccepted"), uno::makeAny( m_aYesRB.IsChecked() != sal_False ) );
::comphelper::ConfigurationHelper::flush( xConfig );
// TODO: refactor
::comphelper::UiEventsLogger::reinit();
@@ -257,11 +258,13 @@ void SvxImprovementOptionsPage::Reset( const SfxItemSet& /*rSet*/ )
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);
}
}