summaryrefslogtreecommitdiff
path: root/basctl/source/basicide/codecompleteoptionsdlg.cxx
diff options
context:
space:
mode:
authorGergo Mocsi <gmocsi91@gmail.com>2013-07-30 13:01:43 +0200
committerGergo Mocsi <gmocsi91@gmail.com>2013-07-30 13:01:43 +0200
commit0fb3bff4e44f9df12214f008761218f4a1afdd44 (patch)
treee2b9f9f8693d70257743f436242fc2ee260c6f11 /basctl/source/basicide/codecompleteoptionsdlg.cxx
parent5b26a68284d6f3e79b1d63a2ebd5b60be6cdfa46 (diff)
GSOC work, config entry to store options
Created a config file to store configuration for the feature. NOTE: it gives a runtime error, so it is temporary disabled. Change-Id: I7103bdfad43bb5760165430a57d93a90a7e5dc7e
Diffstat (limited to 'basctl/source/basicide/codecompleteoptionsdlg.cxx')
-rw-r--r--basctl/source/basicide/codecompleteoptionsdlg.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/basctl/source/basicide/codecompleteoptionsdlg.cxx b/basctl/source/basicide/codecompleteoptionsdlg.cxx
index e79190c29088..aa887a235440 100644
--- a/basctl/source/basicide/codecompleteoptionsdlg.cxx
+++ b/basctl/source/basicide/codecompleteoptionsdlg.cxx
@@ -22,6 +22,8 @@
#include <svtools/miscopt.hxx>
#include <basidesh.hrc>
#include <iostream>
+#include <officecfg/Office/BasicIDE.hxx>
+#include <boost/shared_ptr.hpp>
namespace basctl
{
@@ -40,12 +42,14 @@ CodeCompleteOptionsDlg::CodeCompleteOptionsDlg( Window* pWindow )
pOkBtn->SetClickHdl( LINK( this, CodeCompleteOptionsDlg, OkHdl ) );
pCancelBtn->SetClickHdl( LINK( this, CodeCompleteOptionsDlg, CancelHdl ) );
+ //LoadConfig();
pCodeCompleteChk->Check( CodeCompleteOptions::IsCodeCompleteOn() );
pAutocloseProcChk->Check( CodeCompleteOptions::IsProcedureAutoCompleteOn() );
pAutocloseQuotesChk->Check( CodeCompleteOptions::IsAutoCloseQuotesOn() );
pAutocloseParenChk->Check( CodeCompleteOptions::IsAutoCloseParenthesisOn() );
pAutoCorrectSpellingChk->Check( CodeCompleteOptions::IsAutoCorrectSpellingOn() );
+
}
CodeCompleteOptionsDlg::~CodeCompleteOptionsDlg()
@@ -59,6 +63,8 @@ IMPL_LINK_NOARG(CodeCompleteOptionsDlg, OkHdl)
CodeCompleteOptions::SetAutoCloseQuotesOn( pAutocloseQuotesChk->IsChecked() );
CodeCompleteOptions::SetAutoCloseParenthesisOn( pAutocloseParenChk->IsChecked() );
CodeCompleteOptions::SetAutoCorrectSpellingOn( pAutoCorrectSpellingChk->IsChecked() );
+
+ //SaveConfig();
Close();
return 0;
}
@@ -74,6 +80,32 @@ short CodeCompleteOptionsDlg::Execute()
return ModalDialog::Execute();
}
+void CodeCompleteOptionsDlg::LoadConfig()
+{
+ bool bProcClose = officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::get();
+ bool bCodeCompleteOn = officecfg::Office::BasicIDE::Autocomplete::CodeComplete::get();
+ bool bParenClose = officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::get();
+ bool bQuoteClose = officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::get();
+ bool bCorrect = officecfg::Office::BasicIDE::Autocomplete::AutoCorrectSpelling::get();
+
+ pCodeCompleteChk->Check( bCodeCompleteOn );
+ pAutocloseProcChk->Check( bProcClose );
+ pAutocloseQuotesChk->Check( bQuoteClose );
+ pAutocloseParenChk->Check( bParenClose );
+ pAutoCorrectSpellingChk->Check( bCorrect );
+}
+
+void CodeCompleteOptionsDlg::SaveConfig()
+{
+ boost::shared_ptr< comphelper::ConfigurationChanges > batch(comphelper::ConfigurationChanges::create());
+ officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::set( pAutocloseProcChk->IsChecked(), batch );
+ officecfg::Office::BasicIDE::Autocomplete::CodeComplete::set( pCodeCompleteChk->IsChecked(), batch );
+ officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::set( pAutocloseParenChk->IsChecked(), batch );
+ officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::set( pAutocloseQuotesChk->IsChecked(), batch );
+ officecfg::Office::BasicIDE::Autocomplete::AutoCorrectSpelling::set( pAutoCorrectSpellingChk->IsChecked(), batch );
+ batch->commit();
+}
+
} // namespace basctl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */