[Libreoffice-commits] core.git: Branch 'feature/gsoc-basic-ide-completion-and-other-bits' - basctl/Library_basctl.mk basctl/sdi basctl/source basctl/uiconfig basctl/UIConfig_basicide.mk cui/Library_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk officecfg/registry sfx2/sdi

Gergo Mocsi gmocsi91 at gmail.com
Mon Aug 12 05:01:41 PDT 2013


 basctl/Library_basctl.mk                                              |    1 
 basctl/UIConfig_basicide.mk                                           |    1 
 basctl/sdi/baside.sdi                                                 |    6 
 basctl/source/basicide/basicideoptionsdlg.cxx                         |  111 ---
 basctl/source/basicide/basicideoptionsdlg.hxx                         |   59 --
 basctl/source/basicide/baside2.cxx                                    |   16 
 basctl/uiconfig/basicide/menubar/menubar.xml                          |    1 
 basctl/uiconfig/basicide/ui/basicideoptionsdialog.ui                  |  279 ----------
 cui/Library_cui.mk                                                    |    1 
 cui/UIConfig_cui.mk                                                   |    1 
 cui/source/inc/cuires.hrc                                             |    1 
 cui/source/options/optbasic.cxx                                       |  158 +++++
 cui/source/options/optbasic.hxx                                       |   52 +
 cui/source/options/treeopt.cxx                                        |    3 
 cui/source/options/treeopt.src                                        |    1 
 cui/uiconfig/ui/optbasicidepage.ui                                    |  220 +++++++
 officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu |    5 
 sfx2/sdi/sfx.sdi                                                      |   24 
 18 files changed, 437 insertions(+), 503 deletions(-)

New commits:
commit 12de061bcbc4af45403099dd0a0c855c20cba1d8
Author: Gergo Mocsi <gmocsi91 at gmail.com>
Date:   Mon Aug 12 13:53:09 2013 +0200

    GSOC work, Tool/Options/Basic IDE Options created
    
    Created a new tab in Tools/Options/Basic IDE options instead of the ModalDialog.
    The original dialog under Basic IDE/View/IDE Options was removed.
    Tab page is disabled when experimetal flag is off, entry node in the treebox is visible.
    
    Change-Id: Iaad1ea5fadc3f05ca81f2240dceb513f25be35b9

diff --git a/basctl/Library_basctl.mk b/basctl/Library_basctl.mk
index 47fcefb..c008ad6 100644
--- a/basctl/Library_basctl.mk
+++ b/basctl/Library_basctl.mk
@@ -99,7 +99,6 @@ $(eval $(call gb_Library_add_exception_objects,basctl,\
 	basctl/source/basicide/linenumberwindow \
 	basctl/source/basicide/localizationmgr \
 	basctl/source/basicide/macrodlg \
-	basctl/source/basicide/basicideoptionsdlg \
 	basctl/source/basicide/moduldl2 \
 	basctl/source/basicide/moduldlg \
 	basctl/source/basicide/objdlg \
diff --git a/basctl/UIConfig_basicide.mk b/basctl/UIConfig_basicide.mk
index 4be0d4d..013df6e 100644
--- a/basctl/UIConfig_basicide.mk
+++ b/basctl/UIConfig_basicide.mk
@@ -30,7 +30,6 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/BasicIDE,\
 
 $(eval $(call gb_UIConfig_add_uifiles,modules/BasicIDE,\
 	basctl/uiconfig/basicide/ui/basicmacrodialog \
-	basctl/uiconfig/basicide/ui/basicideoptionsdialog \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/basctl/sdi/baside.sdi b/basctl/sdi/baside.sdi
index b00b65e..271441c 100644
--- a/basctl/sdi/baside.sdi
+++ b/basctl/sdi/baside.sdi
@@ -36,12 +36,6 @@ shell basctl_Shell
         ExecMethod  = ExecuteCurrent;
     ]
 
-    SID_BASICIDE_IDEOPTIONS
-    [
-        StateMethod = GetState;
-        ExecMethod  = ExecuteCurrent;
-    ]
-
     SID_BASICIDE_HIDECURPAGE
     [
         ExecMethod  = ExecuteCurrent;
diff --git a/basctl/source/basicide/basicideoptionsdlg.cxx b/basctl/source/basicide/basicideoptionsdlg.cxx
deleted file mode 100644
index 765cffa..0000000
--- a/basctl/source/basicide/basicideoptionsdlg.cxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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 .
- */
-
-#include "basicideoptionsdlg.hxx"
-#include <basic/codecompletecache.hxx>
-#include <svtools/miscopt.hxx>
-#include <basidesh.hrc>
-#include <iostream>
-#include <officecfg/Office/BasicIDE.hxx>
-#include <boost/shared_ptr.hpp>
-
-namespace basctl
-{
-
-BasicIDEOptionsDlg::BasicIDEOptionsDlg( Window* pWindow )
-: ModalDialog(pWindow, "BasicIDEOptionsDlg", "modules/BasicIDE/ui/basicideoptionsdialog.ui")
-{
-    get(pCancelBtn, "cancel");
-    get(pOkBtn, "ok");
-
-    get(pCodeCompleteChk, "codecomplete_enable");
-    get(pAutocloseProcChk, "autoclose_proc");
-    get(pAutocloseParenChk, "autoclose_paren");
-    get(pAutocloseQuotesChk, "autoclose_quotes");
-    get(pAutoCorrectKeywordsChk, "autocorrect_keywords");
-    get(pUseExtendedTypesChk, "extendedtypes_enable");
-
-    pOkBtn->SetClickHdl( LINK( this, BasicIDEOptionsDlg, OkHdl ) );
-    pCancelBtn->SetClickHdl( LINK( this, BasicIDEOptionsDlg, CancelHdl ) );
-
-    LoadConfig();
-
-}
-
-BasicIDEOptionsDlg::~BasicIDEOptionsDlg()
-{
-}
-
-IMPL_LINK_NOARG(BasicIDEOptionsDlg, OkHdl)
-{
-    CodeCompleteOptions::SetCodeCompleteOn( pCodeCompleteChk->IsChecked() );
-    CodeCompleteOptions::SetProcedureAutoCompleteOn( pAutocloseProcChk->IsChecked() );
-    CodeCompleteOptions::SetAutoCloseQuotesOn( pAutocloseQuotesChk->IsChecked() );
-    CodeCompleteOptions::SetAutoCloseParenthesisOn( pAutocloseParenChk->IsChecked() );
-    CodeCompleteOptions::SetAutoCorrectKeywordsOn( pAutoCorrectKeywordsChk->IsChecked() );
-    CodeCompleteOptions::SetExtendedTypeDeclaration( pUseExtendedTypesChk->IsChecked() );
-
-    SaveConfig();
-    Close();
-    return 0;
-}
-
-IMPL_LINK_NOARG(BasicIDEOptionsDlg, CancelHdl)
-{
-    Close();
-    return 0;
-}
-
-short BasicIDEOptionsDlg::Execute()
-{
-    return ModalDialog::Execute();
-}
-
-void BasicIDEOptionsDlg::LoadConfig()
-{
-    bool bProcClose = officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::get();
-    bool bExtended = officecfg::Office::BasicIDE::Autocomplete::UseExtended::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::AutoCorrectKeywords::get();
-
-    pCodeCompleteChk->Check( bCodeCompleteOn );
-    pAutocloseProcChk->Check( bProcClose );
-    pAutocloseQuotesChk->Check( bQuoteClose );
-    pAutocloseParenChk->Check( bParenClose );
-    pAutoCorrectKeywordsChk->Check( bCorrect );
-    pUseExtendedTypesChk->Check( bExtended );
-}
-
-void BasicIDEOptionsDlg::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::UseExtended::set( pUseExtendedTypesChk->IsChecked(), batch );
-    officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::set( pAutocloseParenChk->IsChecked(), batch );
-    officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::set( pAutocloseQuotesChk->IsChecked(), batch );
-    officecfg::Office::BasicIDE::Autocomplete::AutoCorrectKeywords::set( pAutoCorrectKeywordsChk->IsChecked(), batch );
-    batch->commit();
-}
-
-} // namespace basctl
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index a21cdb9..22bbb42 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -54,7 +54,6 @@
 #include <cassert>
 #include <basic/codecompletecache.hxx>
 #include <svtools/miscopt.hxx>
-#include "basicideoptionsdlg.hxx"
 
 namespace basctl
 {
@@ -1012,12 +1011,6 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
             rLayout.BasicRemoveWatch();
         }
         break;
-        case SID_BASICIDE_IDEOPTIONS:
-        {
-            boost::scoped_ptr< BasicIDEOptionsDlg > pDlg( new BasicIDEOptionsDlg( this ) );
-            pDlg->Execute();
-        }
-        break;
         case SID_CUT:
         {
             if ( !IsReadOnly() )
@@ -1164,15 +1157,6 @@ void ModulWindow::GetState( SfxItemSet &rSet )
                 rSet.Put(SfxBoolItem(nWh, bSourceLinesEnabled));
                 break;
             }
-            case SID_BASICIDE_IDEOPTIONS:
-            {
-                SvtMiscOptions aMiscOptions;
-                if( !aMiscOptions.IsExperimentalMode() )
-                {
-                    rSet.Put( SfxVisibilityItem(nWh, false) );
-                }
-            }
-            break;
         }
     }
 }
diff --git a/basctl/uiconfig/basicide/menubar/menubar.xml b/basctl/uiconfig/basicide/menubar/menubar.xml
index 34288e2..2c12262 100644
--- a/basctl/uiconfig/basicide/menubar/menubar.xml
+++ b/basctl/uiconfig/basicide/menubar/menubar.xml
@@ -61,7 +61,6 @@
             <menu:menuitem menu:id=".uno:StatusBarVisible"/>
             <menu:menuitem menu:id=".uno:ShowImeStatusWindow"/>
             <menu:menuitem menu:id=".uno:ShowLines"/>
-            <menu:menuitem menu:id=".uno:BasicIDEOptionsDialog"/>
             <menu:menuitem menu:id=".uno:GotoLine"/>
             <menu:menuseparator/>
             <menu:menuitem menu:id=".uno:FullScreen"/>
diff --git a/basctl/uiconfig/basicide/ui/basicideoptionsdialog.ui b/basctl/uiconfig/basicide/ui/basicideoptionsdialog.ui
deleted file mode 100644
index e293ccd..0000000
--- a/basctl/uiconfig/basicide/ui/basicideoptionsdialog.ui
+++ /dev/null
@@ -1,279 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
-  <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkDialog" id="BasicIDEOptionsDlg">
-    <property name="can_focus">False</property>
-    <property name="border_width">5</property>
-    <property name="title" translatable="yes">IDE Options</property>
-    <property name="resizable">False</property>
-    <property name="modal">True</property>
-    <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <object class="GtkBox" id="dialog-vbox1">
-        <property name="can_focus">False</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child>
-          <object class="GtkFrame" id="frame3">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label_xalign">0</property>
-            <property name="shadow_type">none</property>
-            <child>
-              <object class="GtkAlignment" id="alignment3">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="left_padding">12</property>
-                <child>
-                  <object class="GtkBox" id="box2">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="orientation">vertical</property>
-                    <child>
-                      <object class="GtkCheckButton" id="extendedtypes_enable">
-                        <property name="label" translatable="yes">Use extended types</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="xalign">0</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
-              </object>
-            </child>
-            <child type="label">
-              <object class="GtkLabel" id="label3">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Language Features</property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area1">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="cancel">
-                <property name="label">gtk-cancel</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="ok">
-                <property name="label">gtk-ok</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-                <property name="image_position">right</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkBox" id="box1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="orientation">vertical</property>
-            <child>
-              <object class="GtkFrame" id="frame1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">none</property>
-                <child>
-                  <object class="GtkAlignment" id="alignment1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="left_padding">12</property>
-                    <child>
-                      <object class="GtkBox" id="box3">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="orientation">vertical</property>
-                        <child>
-                          <object class="GtkCheckButton" id="codecomplete_enable">
-                            <property name="label" translatable="yes">Enable Code Completition</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="xalign">0</property>
-                            <property name="draw_indicator">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-                <child type="label">
-                  <object class="GtkLabel" id="label1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">Code Completition</property>
-                    <attributes>
-                      <attribute name="weight" value="bold"/>
-                    </attributes>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkFrame" id="frame2">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">none</property>
-                <child>
-                  <object class="GtkAlignment" id="alignment2">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="left_padding">12</property>
-                    <child>
-                      <object class="GtkBox" id="box4">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="orientation">vertical</property>
-                        <child>
-                          <object class="GtkCheckButton" id="autoclose_proc">
-                            <property name="label" translatable="yes">Autoclose Procedures</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="xalign">0</property>
-                            <property name="draw_indicator">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkCheckButton" id="autoclose_paren">
-                            <property name="label" translatable="yes">Autoclose Parenthesis</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="xalign">0</property>
-                            <property name="draw_indicator">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkCheckButton" id="autoclose_quotes">
-                            <property name="label" translatable="yes">Autoclose Quotes</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="xalign">0</property>
-                            <property name="draw_indicator">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkCheckButton" id="autocorrect_keywords">
-                            <property name="label" translatable="yes">Autocorrect Keywords</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="xalign">0</property>
-                            <property name="draw_indicator">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">3</property>
-                          </packing>
-                        </child>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-                <child type="label">
-                  <object class="GtkLabel" id="label2">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">Code Suggestion</property>
-                    <attributes>
-                      <attribute name="weight" value="bold"/>
-                    </attributes>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-1">cancel</action-widget>
-      <action-widget response="0">ok</action-widget>
-    </action-widgets>
-  </object>
-</interface>
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk
index f7d9f7c..c26cfce 100644
--- a/cui/Library_cui.mk
+++ b/cui/Library_cui.mk
@@ -136,6 +136,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
     cui/source/options/internationaloptions \
     cui/source/options/optaccessibility \
     cui/source/options/optasian \
+    cui/source/options/optbasic \
     cui/source/options/optchart \
     cui/source/options/optcolor \
     cui/source/options/optctl \
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index b21a582..52e9e8d 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
 	cui/uiconfig/ui/optaccessibilitypage \
 	cui/uiconfig/ui/optadvancedpage \
 	cui/uiconfig/ui/optappearancepage \
+	cui/uiconfig/ui/optbasicidepage \
 	cui/uiconfig/ui/optbrowserpage \
 	cui/uiconfig/ui/optctlpage \
 	cui/uiconfig/ui/optemailpage \
diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc
index bdb022d..e7dd664 100644
--- a/cui/source/inc/cuires.hrc
+++ b/cui/source/inc/cuires.hrc
@@ -180,6 +180,7 @@
 #define RID_SVXBMP_LOCK                     (RID_SVX_START + 118)
 #define RID_SVXSTR_READONLY_CONFIG_TIP      (RID_SVX_START + 1026)
 #define RID_SVXERR_OPT_DOUBLEPATHS          (RID_SVX_START + 208)       //?
+#define RID_SVXPAGE_BASICIDE_OPTIONS        (RID_SVX_START + 209)
 #define RID_SVXSTR_KEY_AUTOCORRECT_DIR      (RID_SVX_START + 1004)  //?
 #define RID_SVXSTR_KEY_DICTIONARY_PATH      (RID_SVX_START + 1010)//?
 #define RID_SVXSTR_KEY_LINGUISTIC_DIR       (RID_SVX_START + 1016)//?
diff --git a/cui/source/options/optbasic.cxx b/cui/source/options/optbasic.cxx
new file mode 100644
index 0000000..93d8fc5
--- /dev/null
+++ b/cui/source/options/optbasic.cxx
@@ -0,0 +1,158 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 .
+ */
+
+#include "optbasic.hxx"
+#include <basic/codecompletecache.hxx>
+#include <svtools/miscopt.hxx>
+#include <iostream>
+#include <officecfg/Office/BasicIDE.hxx>
+#include <boost/shared_ptr.hpp>
+#include <cuires.hrc>
+#include <svtools/miscopt.hxx>
+
+SvxBasicIDEOptionsPage::SvxBasicIDEOptionsPage( Window* pParent, const SfxItemSet& rSet )
+: SfxTabPage(pParent, "OptBasicIDEPage", "cui/ui/optbasicidepage.ui", rSet)
+{
+    SvtMiscOptions aMiscOpt;
+    if( ! aMiscOpt.IsExperimentalMode() )
+    {
+        Disable();
+    }
+
+    get(pCodeCompleteChk, "codecomplete_enable");
+    get(pAutocloseProcChk, "autoclose_proc");
+    get(pAutocloseParenChk, "autoclose_paren");
+    get(pAutocloseQuotesChk, "autoclose_quotes");
+    get(pAutoCorrectKeywordsChk, "autocorrect_keywords");
+    get(pUseExtendedTypesChk, "extendedtypes_enable");
+
+    LoadConfig();
+
+}
+
+SvxBasicIDEOptionsPage::~SvxBasicIDEOptionsPage()
+{
+}
+
+void SvxBasicIDEOptionsPage::LoadConfig()
+{
+    bool bProcClose = officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::get();
+    bool bExtended = officecfg::Office::BasicIDE::Autocomplete::UseExtended::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::AutoCorrectKeywords::get();
+
+    pCodeCompleteChk->Check( bCodeCompleteOn );
+    pAutocloseProcChk->Check( bProcClose );
+    pAutocloseQuotesChk->Check( bQuoteClose );
+    pAutocloseParenChk->Check( bParenClose );
+    pAutoCorrectKeywordsChk->Check( bCorrect );
+    pUseExtendedTypesChk->Check( bExtended );
+}
+
+void SvxBasicIDEOptionsPage::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::UseExtended::set( pUseExtendedTypesChk->IsChecked(), batch );
+    officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::set( pAutocloseParenChk->IsChecked(), batch );
+    officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::set( pAutocloseQuotesChk->IsChecked(), batch );
+    officecfg::Office::BasicIDE::Autocomplete::AutoCorrectKeywords::set( pAutoCorrectKeywordsChk->IsChecked(), batch );
+    batch->commit();
+}
+
+sal_Bool SvxBasicIDEOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ )
+{
+    sal_Bool bModified = sal_False;
+
+    if( pAutocloseProcChk->IsChecked() != pAutocloseProcChk->GetSavedValue() )
+    {
+        boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
+        officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::set( pAutocloseProcChk->IsChecked(), batch );
+        batch->commit();
+        bModified = sal_True;
+    }
+
+    if( pCodeCompleteChk->IsChecked() != pCodeCompleteChk->GetSavedValue() )
+    {
+        boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
+        officecfg::Office::BasicIDE::Autocomplete::CodeComplete::set( pCodeCompleteChk->IsChecked(), batch );
+        batch->commit();
+        bModified = sal_True;
+    }
+
+    if( pUseExtendedTypesChk->IsChecked() != pUseExtendedTypesChk->GetSavedValue() )
+    {
+        boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
+        officecfg::Office::BasicIDE::Autocomplete::UseExtended::set( pUseExtendedTypesChk->IsChecked(), batch );
+        batch->commit();
+        bModified = sal_True;
+    }
+
+    if( pAutocloseParenChk->IsChecked() != pAutocloseParenChk->GetSavedValue() )
+    {
+        boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
+        officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::set( pAutocloseParenChk->IsChecked(), batch );
+        batch->commit();
+        bModified = sal_True;
+    }
+
+    if( pAutocloseQuotesChk->IsChecked() != pAutocloseQuotesChk->GetSavedValue() )
+    {
+        boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
+        officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::set( pAutocloseQuotesChk->IsChecked(), batch );
+        batch->commit();
+        bModified = sal_True;
+    }
+
+    if( pAutoCorrectKeywordsChk->IsChecked() != pAutoCorrectKeywordsChk->GetSavedValue() )
+    {
+        boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
+        officecfg::Office::BasicIDE::Autocomplete::AutoCorrectKeywords::set( pAutoCorrectKeywordsChk->IsChecked(), batch );
+        batch->commit();
+        bModified = sal_True;
+    }
+
+    return bModified;
+}
+
+void SvxBasicIDEOptionsPage::Reset( const SfxItemSet& /*rSet*/ )
+{
+    LoadConfig();
+    pCodeCompleteChk->SaveValue();
+
+    pAutocloseProcChk->SaveValue();
+
+    pAutocloseQuotesChk->SaveValue();
+
+    pAutocloseParenChk->SaveValue();
+
+    pAutoCorrectKeywordsChk->SaveValue();
+
+    pUseExtendedTypesChk->SaveValue();
+}
+
+SfxTabPage* SvxBasicIDEOptionsPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
+{
+    return ( new SvxBasicIDEOptionsPage( pParent, rAttrSet ) );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/basicideoptionsdlg.hxx b/cui/source/options/optbasic.hxx
similarity index 74%
rename from basctl/source/basicide/basicideoptionsdlg.hxx
rename to cui/source/options/optbasic.hxx
index 1d3970d..4265f57 100644
--- a/basctl/source/basicide/basicideoptionsdlg.hxx
+++ b/cui/source/options/optbasic.hxx
@@ -17,21 +17,16 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef BASCTL_BASICIDEOPTIONSDLG_HXX
-#define BASCTL_BASICIDEOPTIONSDLG_HXX
+#ifndef _SVX_OPTBASIC_HXX
+#define _SVX_OPTBASIC_HXX
 
 #include <vcl/button.hxx>
 #include <vcl/dialog.hxx>
+#include <sfx2/tabdlg.hxx>
 
-namespace basctl
-{
-
-class BasicIDEOptionsDlg: public ModalDialog
+class SvxBasicIDEOptionsPage: public SfxTabPage
 {
 private:
-    CancelButton* pCancelBtn;
-    OKButton* pOkBtn;
-
     CheckBox* pCodeCompleteChk;
     CheckBox* pAutocloseProcChk;
     CheckBox* pAutocloseParenChk;
@@ -39,21 +34,19 @@ private:
     CheckBox* pAutoCorrectKeywordsChk;
     CheckBox* pUseExtendedTypesChk;
 
-    DECL_LINK(OkHdl, void*);
-    DECL_LINK(CancelHdl, void*);
-
     void LoadConfig();
     void SaveConfig();
 
 public:
-    BasicIDEOptionsDlg( Window* pWindow );
-    ~BasicIDEOptionsDlg();
+    SvxBasicIDEOptionsPage( Window* pParent, const SfxItemSet& rSet );
+    ~SvxBasicIDEOptionsPage();
 
-    virtual short Execute();
+    static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
+    virtual sal_Bool FillItemSet( SfxItemSet& rSet );
+    virtual void Reset( const SfxItemSet& rSet );
 };
 
-} // namespace basctl
 
-#endif //BASCTL_BASICIDEOPTIONSDLG_HXX
+#endif //_SVX_OPTBASIC_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 33f2b79..7a25d09 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -50,6 +50,7 @@
 #include "optupdt.hxx"
 #include "personalization.hxx"
 #include "treeopt.hxx"
+#include "optbasic.hxx"
 
 #include <com/sun/star/awt/XContainerWindowEventHandler.hpp>
 #include <com/sun/star/awt/ContainerWindowProvider.hpp>
@@ -317,6 +318,7 @@ SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, Window* pParent, const SfxItem
         case RID_SVXPAGE_OPTIONS_JAVA:              fnCreate = &SvxJavaOptionsPage::Create ; break;
         case RID_SVXPAGE_ONLINEUPDATE:              fnCreate = &SvxOnlineUpdateTabPage::Create; break;
         case RID_OPTPAGE_CHART_DEFCOLORS:           fnCreate = &SvxDefaultColorOptPage::Create; break;
+        case RID_SVXPAGE_BASICIDE_OPTIONS:          fnCreate = &SvxBasicIDEOptionsPage::Create; break;
     }
 
     SfxTabPage* pRet = fnCreate ? (*fnCreate)( pParent, rSet ) : NULL;
@@ -347,6 +349,7 @@ static OptionsMapping_Impl const OptionsMap_Impl[] =
     { "ProductName",        "Appearance",           RID_SVXPAGE_COLORCONFIG },
     { "ProductName",        "Accessibility",        RID_SVXPAGE_ACCESSIBILITYCONFIG },
     { "ProductName",        "Java",                 RID_SVXPAGE_OPTIONS_JAVA },
+    { "ProductName",        "BasicIDEOptions",      RID_SVXPAGE_BASICIDE_OPTIONS },
     { "ProductName",        "OnlineUpdate",         RID_SVXPAGE_ONLINEUPDATE },
     { "LanguageSettings",   NULL,                   SID_LANGUAGE_OPTIONS },
     { "LanguageSettings",   "Languages",            OFA_TP_LANGUAGES  },
diff --git a/cui/source/options/treeopt.src b/cui/source/options/treeopt.src
index af8e332..f2defbb 100644
--- a/cui/source/options/treeopt.src
+++ b/cui/source/options/treeopt.src
@@ -100,6 +100,7 @@ Resource RID_OFADLG_OPTIONS_TREE_PAGES
             < "Appearance" ;        RID_SVXPAGE_COLORCONFIG        ; > ;
             < "Accessibility" ; RID_SVXPAGE_ACCESSIBILITYCONFIG ; > ;
             < "Advanced" ; RID_SVXPAGE_OPTIONS_JAVA ; > ;
+            < "Basic IDE Options" ; RID_SVXPAGE_BASICIDE_OPTIONS ; > ;
             < "Online Update" ; RID_SVXPAGE_ONLINEUPDATE ; > ;
         };
     };
diff --git a/cui/uiconfig/ui/optbasicidepage.ui b/cui/uiconfig/ui/optbasicidepage.ui
new file mode 100644
index 0000000..3dde65f
--- /dev/null
+++ b/cui/uiconfig/ui/optbasicidepage.ui
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkBox" id="OptBasicIDEPage">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="orientation">vertical</property>
+    <property name="spacing">12</property>
+    <child>
+      <object class="GtkFrame" id="frame1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="top_padding">6</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkGrid" id="grid1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkCheckButton" id="codecomplete_enable">
+                    <property name="label" translatable="yes">Enable Code Completition</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="label1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Code Completition</property>
+            <attributes>
+              <attribute name="weight" value="bold"/>
+            </attributes>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkFrame" id="frame2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="top_padding">6</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkGrid" id="grid3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="row_spacing">6</property>
+                <child>
+                  <object class="GtkCheckButton" id="autoclose_proc">
+                    <property name="label" translatable="yes">Autoclose Procedures</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">3</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="autoclose_paren">
+                    <property name="label" translatable="yes">Autoclose Parenthesis</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">2</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="autoclose_quotes">
+                    <property name="label" translatable="yes">Autoclose Quotes</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="autocorrect_keywords">
+                    <property name="label" translatable="yes">Autocorrect Keywords</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="label2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Code Suggestion</property>
+            <attributes>
+              <attribute name="weight" value="bold"/>
+            </attributes>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkFrame" id="frame3">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="top_padding">6</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkGrid" id="grid2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="row_spacing">6</property>
+                <child>
+                  <object class="GtkCheckButton" id="extendedtypes_enable">
+                    <property name="label" translatable="yes">Use extended types</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="label3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Language Features</property>
+            <attributes>
+              <attribute name="weight" value="bold"/>
+            </attributes>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">2</property>
+      </packing>
+    </child>
+  </object>
+</interface>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu
index a796ce1..be70ad7 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu
@@ -8,11 +8,6 @@
           <value xml:lang="en-US">Goto Line Number...</value>
         </prop>
       </node>
-      <node oor:name=".uno:BasicIDEOptionsDialog" oor:op="replace">
-        <prop oor:name="Label" oor:type="xs:string">
-          <value xml:lang="en-US">IDE options</value>
-        </prop>
-      </node>
       <node oor:name=".uno:ShowLines" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Line Numbers</value>
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index da368fd..b34e2a2 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -3874,30 +3874,6 @@ SfxVoidItem MatchGroup SID_BASICIDE_MATCHGROUP
     GroupId = GID_MACRO;
 ]
 
-SfxVoidItem BasicIDEOptionsDialog SID_BASICIDE_IDEOPTIONS
-
-[
-    /* flags: */
-    AutoUpdate = TRUE,
-    Cachable = Cachable,
-    FastCall = FALSE,
-    HasCoreId = FALSE,
-    HasDialog = FALSE,
-    ReadOnlyDoc = TRUE,
-    Toggle = FALSE,
-    Container = FALSE,
-    RecordAbsolute = FALSE,
-    RecordPerSet;
-    Synchron;
-
-    /* config: */
-    AccelConfig = TRUE,
-    MenuConfig = TRUE,
-    StatusBarConfig = FALSE,
-    ToolBoxConfig = TRUE,
-    GroupId = GID_MACRO;
-]
-
 //--------------------------------------------------------------------------
 SfxBoolItem MenuBarVisible SID_TOGGLE_MENUBAR
 


More information about the Libreoffice-commits mailing list