summaryrefslogtreecommitdiff
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
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
-rw-r--r--basctl/source/basicide/codecompleteoptionsdlg.cxx32
-rw-r--r--basctl/source/basicide/codecompleteoptionsdlg.hxx3
-rw-r--r--officecfg/Configuration_officecfg.mk1
-rw-r--r--officecfg/files.mk1
-rw-r--r--officecfg/registry/data/org/openoffice/Office/BasicIDE.xcu38
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs61
6 files changed, 136 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();
diff --git a/officecfg/Configuration_officecfg.mk b/officecfg/Configuration_officecfg.mk
index 70cc15b9de46..0f90f0a8e2b0 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/ExtendedColorScheme.xcu \
diff --git a/officecfg/files.mk b/officecfg/files.mk
index 20237c123e1d..c12dfa61306a 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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ -->
+ <!DOCTYPE oor:component-data SYSTEM "../../../../component-update.dtd">
+<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:install="http://openoffice.org/2004/installation" oor:name="BasicIDE" oor:package="org.openoffice.Office">
+ <node oor:name="Autocomplete" oor:op="replace">
+ <prop oor:name="CodeComplete">
+ <value>false</value>
+ </prop>
+ <prop oor:name="AutocloseParenthesis">
+ <value>false</value>
+ </prop>
+ <prop oor:name="AutocloseDoubleQuotes">
+ <value>false</value>
+ </prop>
+ <prop oor:name="AutocloseProc">
+ <value>false</value>
+ </prop>
+ <prop oor:name="AutoCorrectSpelling">
+ <value>false</value>
+ </prop>
+ </node>
+</oor:component-data>
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ -->
+ <!DOCTYPE oor:component-data SYSTEM "../../../../component-update.dtd">
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="BasicIDE" oor:package="org.openoffice.Office" xml:lang="en-US">
+ <info>
+ <desc>Contains configuration for the BASIC IDE.</desc>
+ </info>
+ <component>
+ <group oor:name="Autocomplete">
+ <info>
+ <desc>Autocomplete function configuration.</desc>
+ </info>
+ <prop oor:name="CodeComplete" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Sets the code completition on/off. Default is false.</desc>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="AutocloseParenthesis" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Sets the autoclose parenthesis on/off. Default is false.</desc>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="AutocloseDoubleQuotes" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Sets the autoclose double quotes on/off. Default is false.</desc>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="AutocloseProc" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Sets the autoclose procedures on/off. Default is false.</desc>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="AutoCorrectSpelling" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Sets the auto correct spelling on/off. Default is false.</desc>
+ </info>
+ <value>false</value>
+ </prop>
+ </group>
+ </component>
+</oor:component-schema>