diff options
author | Gergo Mocsi <gmocsi91@gmail.com> | 2013-07-30 13:01:43 +0200 |
---|---|---|
committer | Gergo Mocsi <gmocsi91@gmail.com> | 2013-09-02 18:16:52 +0200 |
commit | 8194798645517e7c54296ba47ded09a67cf71805 (patch) | |
tree | 15077e36d8726e7a451f74c083bd80c0cc15bdc0 /basctl | |
parent | GSOC work, "autocomplete procedures" fix + new feature (diff) | |
download | core-8194798645517e7c54296ba47ded09a67cf71805.tar.gz core-8194798645517e7c54296ba47ded09a67cf71805.zip |
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')
-rw-r--r-- | basctl/source/basicide/codecompleteoptionsdlg.cxx | 32 | ||||
-rw-r--r-- | basctl/source/basicide/codecompleteoptionsdlg.hxx | 3 |
2 files changed, 35 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: */ diff --git a/basctl/source/basicide/codecompleteoptionsdlg.hxx b/basctl/source/basicide/codecompleteoptionsdlg.hxx index 4c8b177615d5..6314841daaed 100644 --- a/basctl/source/basicide/codecompleteoptionsdlg.hxx +++ b/basctl/source/basicide/codecompleteoptionsdlg.hxx @@ -41,6 +41,9 @@ private: DECL_LINK(OkHdl, void*); DECL_LINK(CancelHdl, void*); + void LoadConfig(); + void SaveConfig(); + public: CodeCompleteOptionsDlg( Window* pWindow ); ~CodeCompleteOptionsDlg(); |