From 8194798645517e7c54296ba47ded09a67cf71805 Mon Sep 17 00:00:00 2001 From: Gergo Mocsi Date: Tue, 30 Jul 2013 13:01:43 +0200 Subject: 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 --- basctl/source/basicide/codecompleteoptionsdlg.cxx | 32 ++++++++++++ basctl/source/basicide/codecompleteoptionsdlg.hxx | 3 ++ officecfg/Configuration_officecfg.mk | 1 + officecfg/files.mk | 1 + .../data/org/openoffice/Office/BasicIDE.xcu | 38 ++++++++++++++ .../schema/org/openoffice/Office/BasicIDE.xcs | 61 ++++++++++++++++++++++ 6 files changed, 136 insertions(+) create mode 100644 officecfg/registry/data/org/openoffice/Office/BasicIDE.xcu create mode 100644 officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs 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 #include #include +#include +#include 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(); diff --git a/officecfg/Configuration_officecfg.mk b/officecfg/Configuration_officecfg.mk index 89579778b959..cb27ffcc0a52 100644 --- a/officecfg/Configuration_officecfg.mk +++ b/officecfg/Configuration_officecfg.mk @@ -32,6 +32,7 @@ $(eval $(call gb_Configuration_add_datas,registry,officecfg/registry/data,\ org/openoffice/FirstStartWizard.xcu \ org/openoffice/Interaction.xcu \ org/openoffice/Office/Calc.xcu \ + org/openoffice/Office/BasicIDE.xcu \ org/openoffice/Office/Canvas.xcu \ org/openoffice/Office/Compatibility.xcu \ org/openoffice/Office/ExtensionDependencies.xcu \ diff --git a/officecfg/files.mk b/officecfg/files.mk index 3fbbfa0f0887..3110805deeab 100644 --- a/officecfg/files.mk +++ b/officecfg/files.mk @@ -13,6 +13,7 @@ officecfg_XCSFILES := \ LDAP \ Office/Accelerators \ Office/Addons \ + Office/BasicIDE \ Office/Calc \ Office/CalcAddIns \ Office/Canvas \ diff --git a/officecfg/registry/data/org/openoffice/Office/BasicIDE.xcu b/officecfg/registry/data/org/openoffice/Office/BasicIDE.xcu new file mode 100644 index 000000000000..283d8043da90 --- /dev/null +++ b/officecfg/registry/data/org/openoffice/Office/BasicIDE.xcu @@ -0,0 +1,38 @@ + + + + + + + false + + + false + + + false + + + false + + + false + + + diff --git a/officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs b/officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs new file mode 100644 index 000000000000..1cce64415e26 --- /dev/null +++ b/officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs @@ -0,0 +1,61 @@ + + + + + + Contains configuration for the BASIC IDE. + + + + + Autocomplete function configuration. + + + + Sets the code completition on/off. Default is false. + + false + + + + Sets the autoclose parenthesis on/off. Default is false. + + false + + + + Sets the autoclose double quotes on/off. Default is false. + + false + + + + Sets the autoclose procedures on/off. Default is false. + + false + + + + Sets the auto correct spelling on/off. Default is false. + + false + + + + -- cgit