[Libreoffice-commits] core.git: Branch 'feature/gsoc-basic-ide-completion-and-other-bits' - basctl/source officecfg/Configuration_officecfg.mk officecfg/files.mk officecfg/registry

Gergo Mocsi gmocsi91 at gmail.com
Tue Jul 30 04:09:36 PDT 2013


 basctl/source/basicide/codecompleteoptionsdlg.cxx            |   32 +++++
 basctl/source/basicide/codecompleteoptionsdlg.hxx            |    3 
 officecfg/Configuration_officecfg.mk                         |    1 
 officecfg/files.mk                                           |    1 
 officecfg/registry/data/org/openoffice/Office/BasicIDE.xcu   |   38 ++++++
 officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs |   61 +++++++++++
 6 files changed, 136 insertions(+)

New commits:
commit 0fb3bff4e44f9df12214f008761218f4a1afdd44
Author: Gergo Mocsi <gmocsi91 at gmail.com>
Date:   Tue Jul 30 13:01:43 2013 +0200

    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

diff --git a/basctl/source/basicide/codecompleteoptionsdlg.cxx b/basctl/source/basicide/codecompleteoptionsdlg.cxx
index e79190c..aa887a2 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 4c8b177..6314841 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 70cc15b..0f90f0a 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 20237c1..c12dfa6 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 0000000..283d804
--- /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 0000000..1cce644
--- /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>


More information about the Libreoffice-commits mailing list