Kaydet (Commit) 81947986 authored tarafından Gergo Mocsi's avatar Gergo Mocsi

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
üst c149c96c
......@@ -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: */
......@@ -41,6 +41,9 @@ private:
DECL_LINK(OkHdl, void*);
DECL_LINK(CancelHdl, void*);
void LoadConfig();
void SaveConfig();
public:
CodeCompleteOptionsDlg( Window* pWindow );
~CodeCompleteOptionsDlg();
......
......@@ -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 \
......
......@@ -13,6 +13,7 @@ officecfg_XCSFILES := \
LDAP \
Office/Accelerators \
Office/Addons \
Office/BasicIDE \
Office/Calc \
Office/CalcAddIns \
Office/Canvas \
......
<?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>
<?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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment