[Libreoffice-commits] core.git: Branch 'feature/sidebaropt' - 2 commits - cui/source cui/uiconfig include/svtools officecfg/registry sd/source svtools/source

Michael Meeks michael.meeks at suse.com
Fri May 17 04:24:58 PDT 2013


 cui/source/options/optjava.cxx                             |   12 +++-
 cui/source/options/optjava.hxx                             |    1 
 cui/uiconfig/ui/optadvancedpage.ui                         |   19 ++++++
 include/svtools/miscopt.hxx                                |    3 +
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |    8 ++
 sd/source/ui/app/sddll1.cxx                                |    6 ++
 sd/source/ui/app/sddll2.cxx                                |    1 
 sd/source/ui/dlg/PaneShells.cxx                            |   23 ++++++++
 sd/source/ui/framework/factories/BasicPaneFactory.cxx      |   14 ++++-
 sd/source/ui/framework/factories/BasicPaneFactory.hxx      |    1 
 sd/source/ui/framework/factories/BasicViewFactory.cxx      |   13 ++++
 sd/source/ui/framework/module/ImpressModule.cxx            |   18 ++++++
 sd/source/ui/framework/module/ToolPanelModule.cxx          |    5 +
 sd/source/ui/framework/module/ToolPanelModule.hxx          |    2 
 svtools/source/config/miscopt.cxx                          |   36 ++++++++++++-
 15 files changed, 151 insertions(+), 11 deletions(-)

New commits:
commit 3e82c25284eb368f8ed971044842fe919f24c672
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri May 17 12:25:23 2013 +0100

    more reverts, first cut at making sidebar optional.

diff --git a/sd/source/ui/app/sddll1.cxx b/sd/source/ui/app/sddll1.cxx
index 09a7346..100f527 100644
--- a/sd/source/ui/app/sddll1.cxx
+++ b/sd/source/ui/app/sddll1.cxx
@@ -37,6 +37,7 @@
 #include "DrawDocShell.hxx"
 #include "GraphicDocShell.hxx"
 #include "SlideSorterViewShell.hxx"
+#include "taskpane/ToolPanelViewShell.hxx"
 #include "FactoryIds.hxx"
 #include "sdmod.hxx"
 #include "app.hrc"
@@ -114,6 +115,11 @@ void SdDLL::RegisterInterfaces()
 
     // View shells for the side panes.
     ::sd::slidesorter::SlideSorterViewShell::RegisterInterface (pMod);
+
+    ::sd::toolpanel::ToolPanelViewShell::RegisterInterface(pMod);
+    // Tell the tool panel view shell to register the interfaces of its
+    // controls.
+    ::sd::toolpanel::ToolPanelViewShell::RegisterControls();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/app/sddll2.cxx b/sd/source/ui/app/sddll2.cxx
index 3088415..d28257d 100644
--- a/sd/source/ui/app/sddll2.cxx
+++ b/sd/source/ui/app/sddll2.cxx
@@ -126,6 +126,7 @@ void SdDLL::RegisterControllers()
     ::avmedia::MediaPlayer::RegisterChildWindow(0, pMod);
     ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(0, pMod);
     ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(0, pMod);
+    ::sd::ToolPanelChildWindow::RegisterChildWindow(0, pMod);
     ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(0, pMod);
 
     SvxFillToolBoxControl::RegisterControl(0, pMod);
diff --git a/sd/source/ui/dlg/PaneShells.cxx b/sd/source/ui/dlg/PaneShells.cxx
index 023dbcc..d3338ab 100644
--- a/sd/source/ui/dlg/PaneShells.cxx
+++ b/sd/source/ui/dlg/PaneShells.cxx
@@ -92,6 +92,29 @@ LeftDrawPaneShell::~LeftDrawPaneShell (void)
 {
 }
 
+//===== ToolPanelPaneShell ========================================================
+
+SFX_SLOTMAP( ToolPanelPaneShell )
+{
+    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+SFX_IMPL_INTERFACE( ToolPanelPaneShell, SfxShell, SdResId( STR_TOOL_PANEL_SHELL ) )
+{
+    SFX_CHILDWINDOW_REGISTRATION( ::sd::ToolPanelChildWindow::GetChildWindowId() );
+}
+
+TYPEINIT1( ToolPanelPaneShell, SfxShell );
+
+ToolPanelPaneShell::ToolPanelPaneShell()
+    :SfxShell()
+{
+    SetName(OUString("ToolPanel"));
+}
+
+ToolPanelPaneShell::~ToolPanelPaneShell(void)
+{
+}
 
 } // end of namespace ::sd
 
diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
index 5c5a043..c91265f 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
@@ -45,7 +45,8 @@ namespace {
         CenterPaneId,
         FullScreenPaneId,
         LeftImpressPaneId,
-        LeftDrawPaneId
+        LeftDrawPaneId,
+        RightPaneId
     };
 
     static const sal_Int32 gnConfigurationUpdateStartEvent(0);
@@ -219,6 +220,11 @@ void SAL_CALL BasicPaneFactory::initialize (const Sequence<Any>& aArguments)
                 aDescriptor.mePaneId = LeftDrawPaneId;
                 mpPaneContainer->push_back(aDescriptor);
                 xCC->addResourceFactory(aDescriptor.msPaneURL, this);
+
+                aDescriptor.msPaneURL = FrameworkHelper::msRightPaneURL;
+                aDescriptor.mePaneId = RightPaneId;
+                mpPaneContainer->push_back(aDescriptor);
+                xCC->addResourceFactory(aDescriptor.msPaneURL, this);
             }
 
             // Register as configuration change listener.
@@ -287,6 +293,7 @@ Reference<XResource> SAL_CALL BasicPaneFactory::createResource (
 
                 case LeftImpressPaneId:
                 case LeftDrawPaneId:
+                case RightPaneId:
                     xPane = CreateChildWindowPane(
                         rxPaneId,
                         *iDescriptor);
@@ -472,6 +479,11 @@ Reference<XResource> BasicPaneFactory::CreateChildWindowPane (
                 nChildWindowId = ::sd::LeftPaneDrawChildWindow::GetChildWindowId();
                 break;
 
+            case RightPaneId:
+                pShell.reset(new ToolPanelPaneShell());
+                nChildWindowId = ::sd::ToolPanelChildWindow::GetChildWindowId();
+                break;
+
             default:
                 break;
         }
diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.hxx b/sd/source/ui/framework/factories/BasicPaneFactory.hxx
index de9c81b..472609a 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.hxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.hxx
@@ -59,6 +59,7 @@ namespace sd { namespace framework {
         private:resource/pane/FullScreenPane
         private:resource/pane/LeftImpressPane
         private:resource/pane/LeftDrawPane
+        private:resource/pane/RightPane
     There are two left panes because this is (seems to be) the only way to
     show different titles for the left pane in Draw and Impress.
 */
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 78d7988..08b903b 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -33,6 +33,7 @@
 #include "DrawViewShell.hxx"
 #include "GraphicViewShell.hxx"
 #include "OutlineViewShell.hxx"
+#include "taskpane/ToolPanelViewShell.hxx"
 #include "PresentationViewShell.hxx"
 #include "SlideSorterViewShell.hxx"
 #include "FrameView.hxx"
@@ -318,6 +319,7 @@ void SAL_CALL BasicViewFactory::initialize (const Sequence<Any>& aArguments)
             mxConfigurationController->addResourceFactory(FrameworkHelper::msNotesViewURL, this);
             mxConfigurationController->addResourceFactory(FrameworkHelper::msHandoutViewURL, this);
             mxConfigurationController->addResourceFactory(FrameworkHelper::msPresentationViewURL, this);
+            mxConfigurationController->addResourceFactory(FrameworkHelper::msTaskPaneURL, this);
             mxConfigurationController->addResourceFactory(FrameworkHelper::msSlideSorterURL, this);
         }
         catch (RuntimeException&)
@@ -456,6 +458,15 @@ void SAL_CALL BasicViewFactory::initialize (const Sequence<Any>& aArguments)
             pFrameView,
             bIsCenterPane);
     }
+    else if (rsViewURL.equals(FrameworkHelper::msTaskPaneURL))
+    {
+        pViewShell.reset(
+            new ::sd::toolpanel::ToolPanelViewShell(
+                &rFrame,
+                *mpBase,
+                &rWindow,
+                pFrameView));
+    }
 
     return pViewShell;
 }
@@ -522,6 +533,8 @@ bool BasicViewFactory::IsCacheable (const ::boost::shared_ptr<ViewDescriptor>& r
                 FrameworkHelper::msSlideSorterURL, FrameworkHelper::msLeftDrawPaneURL));
             maCacheableResources.push_back(pHelper->CreateResourceId(
                 FrameworkHelper::msSlideSorterURL, FrameworkHelper::msLeftImpressPaneURL));
+            maCacheableResources.push_back(pHelper->CreateResourceId(
+                FrameworkHelper::msTaskPaneURL, FrameworkHelper::msRightPaneURL));
         }
 
         ::std::vector<Reference<XResourceId> >::const_iterator iId;
diff --git a/sd/source/ui/framework/module/ImpressModule.cxx b/sd/source/ui/framework/module/ImpressModule.cxx
index 240a94a..2c2ac43 100644
--- a/sd/source/ui/framework/module/ImpressModule.cxx
+++ b/sd/source/ui/framework/module/ImpressModule.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <comphelper/processfactory.hxx>
+#include <comphelper/configuration.hxx>
+#include "officecfg/Office/Common.hxx"
 
 #include "framework/ImpressModule.hxx"
 
@@ -45,9 +48,22 @@ void ImpressModule::Initialize (Reference<frame::XController>& rxController)
     new SlideSorterModule(
         rxController,
         FrameworkHelper::msLeftImpressPaneURL);
+
+    // MMeeks ...
+    bool bSidebar = false;
+    try {
+        bSidebar = officecfg::Office::Common::Misc::ExperimentalSidebar::get(
+                        comphelper::getProcessComponentContext());
+    } catch (const uno::Exception &e) {
+        SAL_WARN("sd", "don't have experimental sidebar option installed");
+    }
     new ToolPanelModule(
         rxController,
-        FrameworkHelper::msSidebarViewURL);
+        bSidebar ? FrameworkHelper::msSidebarViewURL :
+                   FrameworkHelper::msTaskPaneURL,
+        bSidebar ? FrameworkHelper::msSidebarPaneURL :
+                   FrameworkHelper::msRightPaneURL
+        );
     new ToolBarModule(rxController);
     new ShellStackGuard(rxController);
 }
diff --git a/sd/source/ui/framework/module/ToolPanelModule.cxx b/sd/source/ui/framework/module/ToolPanelModule.cxx
index c607fbd..273a22a 100644
--- a/sd/source/ui/framework/module/ToolPanelModule.cxx
+++ b/sd/source/ui/framework/module/ToolPanelModule.cxx
@@ -42,9 +42,10 @@ namespace sd { namespace framework {
 
 ToolPanelModule::ToolPanelModule (
     const Reference<frame::XController>& rxController,
-    const OUString& rsSidebarPaneURL)
+    const OUString& rsViewURL,
+    const OUString& rsPaneURL)
     : ResourceManager(rxController,
-        FrameworkHelper::CreateResourceId(FrameworkHelper::msSidebarViewURL, rsSidebarPaneURL)),
+        FrameworkHelper::CreateResourceId(rsViewURL, rsPaneURL)),
       mxControllerManager(rxController,UNO_QUERY)
 {
     if (mxConfigurationController.is())
diff --git a/sd/source/ui/framework/module/ToolPanelModule.hxx b/sd/source/ui/framework/module/ToolPanelModule.hxx
index ce28ef8..112ffbf 100644
--- a/sd/source/ui/framework/module/ToolPanelModule.hxx
+++ b/sd/source/ui/framework/module/ToolPanelModule.hxx
@@ -35,7 +35,7 @@ class ToolPanelModule
 public:
     ToolPanelModule (
         const css::uno::Reference<css::frame::XController>& rxController,
-        const OUString& rsRightPaneURL);
+        const OUString& rsViewURL, const OUString& rsPaneURL);
     virtual ~ToolPanelModule (void);
 
     virtual void SaveResourceState (void);
commit 1db0b004de7ff73adbd136483e86e700028a75d3
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri May 17 11:51:41 2013 +0100

    add experimental option for sidebar to 'Advanced' pane.

diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 8f7adca..1c03981 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -144,6 +144,7 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet
     get(m_pParameterBtn, "parameters");
     get(m_pClassPathBtn, "classpath");
     get(m_pExperimentalCB, "experimental");
+    get(m_pExpSidebarCB, "exp_sidebar");
     get(m_pMacroCB, "macrorecording");
     m_sAccessibilityText = get<FixedText>("a11y")->GetText();
     m_sAddDialogText = get<FixedText>("selectruntime")->GetText();
@@ -622,6 +623,13 @@ sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ )
         bModified = sal_True;
     }
 
+    if ( m_pExpSidebarCB->IsChecked() != m_pExpSidebarCB->GetSavedValue() )
+    {
+        SvtMiscOptions aMiscOpt;
+        aMiscOpt.SetExperimentalSidebar( m_pExpSidebarCB->IsChecked() );
+        bModified = sal_True;
+    }
+
     if ( m_pMacroCB->IsChecked() != m_pMacroCB->GetSavedValue() )
     {
         SvtMiscOptions aMiscOpt;
@@ -629,8 +637,6 @@ sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ )
         bModified = sal_True;
     }
 
-
-
     if ( m_pPathDlg )
     {
         OUString sPath( m_pPathDlg->GetClassPath() );
@@ -716,6 +722,8 @@ void SvxJavaOptionsPage::Reset( const SfxItemSet& /*rSet*/ )
 
     m_pExperimentalCB->Check( aMiscOpt.IsExperimentalMode() );
     m_pExperimentalCB->SaveValue();
+    m_pExpSidebarCB->Check( aMiscOpt.IsExperimentalSidebar() );
+    m_pExpSidebarCB->SaveValue();
     m_pMacroCB->Check( aMiscOpt.IsMacroRecorderMode() );
     m_pMacroCB->SaveValue();
 
diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx
index 07fa6be..b3e9c8e 100644
--- a/cui/source/options/optjava.hxx
+++ b/cui/source/options/optjava.hxx
@@ -65,6 +65,7 @@ private:
     Timer                   m_aResetTimer;
 
     CheckBox*               m_pExperimentalCB;
+    CheckBox*               m_pExpSidebarCB;
     CheckBox*               m_pMacroCB;
 
     ::std::vector< JavaInfo* >
diff --git a/cui/uiconfig/ui/optadvancedpage.ui b/cui/uiconfig/ui/optadvancedpage.ui
index ddfce7e..8fac290 100644
--- a/cui/uiconfig/ui/optadvancedpage.ui
+++ b/cui/uiconfig/ui/optadvancedpage.ui
@@ -340,6 +340,23 @@
                   </packing>
                 </child>
                 <child>
+                  <object class="GtkCheckButton" id="exp_sidebar">
+                    <property name="label" translatable="yes">Enable experimental sidebar</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</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="macrorecording">
                     <property name="label" translatable="yes">Enable macro recording</property>
                     <property name="visible">True</property>
@@ -350,7 +367,7 @@
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
-                    <property name="top_attach">1</property>
+                    <property name="top_attach">2</property>
                     <property name="width">1</property>
                     <property name="height">1</property>
                   </packing>
diff --git a/include/svtools/miscopt.hxx b/include/svtools/miscopt.hxx
index 85c5b604..ca0b569 100644
--- a/include/svtools/miscopt.hxx
+++ b/include/svtools/miscopt.hxx
@@ -109,6 +109,9 @@ class SVT_DLLPUBLIC SvtMiscOptions: public utl::detail::Options
         void        SetExperimentalMode( sal_Bool bSet );
         sal_Bool    IsExperimentalMode() const;
 
+        void        SetExperimentalSidebar( sal_Bool bSet );
+        sal_Bool    IsExperimentalSidebar() const;
+
         void        SetMacroRecorderMode( sal_Bool bSet );
         sal_Bool    IsMacroRecorderMode() const;
 
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index d514c10..2666c98 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5521,11 +5521,17 @@
       </prop>
       <prop oor:name="ExperimentalMode" oor:type="xs:boolean" oor:nillable="false">
         <info>
-          <desc>Determins if various experimental, and potentially unstable
+          <desc>Determines if various experimental, and potentially unstable
           features should be enabled in the user interface.</desc>
         </info>
         <value>false</value>
       </prop>
+      <prop oor:name="ExperimentalSidebar" oor:type="xs:boolean" oor:nillable="false">
+        <info>
+          <desc>Determines if the experimental sidebar UI change should be enabled.</desc>
+        </info>
+        <value>false</value>
+      </prop>
       <prop oor:name="MacroRecorderMode" oor:type="xs:boolean" oor:nillable="false">
         <info>
           <desc>Determins if the limited, and awkward code producing
diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx
index ed509e0..4ac2f9f 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -63,8 +63,10 @@ using namespace ::com::sun::star;
 #define PROPERTYHANDLE_ALWAYSALLOWSAVE          8
 #define PROPERTYNAME_EXPERIMENTALMODE       "ExperimentalMode"
 #define PROPERTYHANDLE_EXPERIMENTALMODE         9
-#define PROPERTYNAME_MACRORECORDERMODE       "MacroRecorderMode"
+#define PROPERTYNAME_MACRORECORDERMODE      "MacroRecorderMode"
 #define PROPERTYHANDLE_MACRORECORDERMODE        10
+#define PROPERTYNAME_EXPERIMENTALSIDEBAR    "ExperimentalSidebar"
+#define PROPERTYHANDLE_EXPERIMENTALSIDEBAR      11
 
 #define VCL_TOOLBOX_STYLE_FLAT              ((sal_uInt16)0x0004) // from <vcl/toolbox.hxx>
 
@@ -88,6 +90,7 @@ class SvtMiscOptions_Impl : public ConfigItem
     sal_Bool    m_bDisableUICustomization;
     sal_Bool    m_bAlwaysAllowSave;
     sal_Bool    m_bExperimentalMode;
+    sal_Bool    m_bExperimentalSidebar;
     sal_Bool    m_bMacroRecorderMode;
 
     public:
@@ -160,6 +163,12 @@ class SvtMiscOptions_Impl : public ConfigItem
         inline sal_Bool IsExperimentalMode() const
         { return m_bExperimentalMode; }
 
+        inline void SetExperimentalSidebar( sal_Bool bSet )
+        { m_bExperimentalSidebar = bSet; SetModified(); }
+
+        inline sal_Bool IsExperimentalSidebar() const
+        { return m_bExperimentalSidebar; }
+
         inline void SetMacroRecorderMode( sal_Bool bSet )
         { m_bMacroRecorderMode = bSet; SetModified(); }
 
@@ -272,6 +281,7 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
     , m_bIsShowLinkWarningDialogRO( sal_False )
     , m_bAlwaysAllowSave( sal_False )
     , m_bExperimentalMode( sal_False )
+    , m_bExperimentalSidebar( sal_False )
     , m_bMacroRecorderMode( sal_False )
 
 {
@@ -391,6 +401,12 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
                     OSL_FAIL("Wrong type of \"Misc\\MacroRecorderMode\"!" );
                 break;
             }
+            case PROPERTYHANDLE_EXPERIMENTALSIDEBAR :
+            {
+                if( !(seqValues[nProperty] >>= m_bExperimentalSidebar) )
+                    OSL_FAIL("Wrong type of \"Misc\\ExperimentalSidebar\"!" );
+                break;
+            }
         }
     }
 
@@ -673,6 +689,11 @@ void SvtMiscOptions_Impl::Commit()
                 seqValues[nProperty] <<= m_bMacroRecorderMode;
                 break;
             }
+            case PROPERTYHANDLE_EXPERIMENTALSIDEBAR :
+            {
+                seqValues[nProperty] <<= m_bExperimentalSidebar;
+                break;
+            }
         }
     }
     // Set properties in configuration.
@@ -697,7 +718,8 @@ Sequence< OUString > SvtMiscOptions_Impl::GetPropertyNames()
         OUString(PROPERTYNAME_DISABLEUICUSTOMIZATION),
         OUString(PROPERTYNAME_ALWAYSALLOWSAVE),
         OUString(PROPERTYNAME_EXPERIMENTALMODE),
-        OUString(PROPERTYNAME_MACRORECORDERMODE)
+        OUString(PROPERTYNAME_MACRORECORDERMODE),
+        OUString(PROPERTYNAME_EXPERIMENTALSIDEBAR)
     };
 
     // Initialize return sequence with these list ...
@@ -878,6 +900,16 @@ sal_Bool SvtMiscOptions::IsExperimentalMode() const
     return m_pDataContainer->IsExperimentalMode();
 }
 
+void SvtMiscOptions::SetExperimentalSidebar( sal_Bool bSet )
+{
+    m_pDataContainer->SetExperimentalSidebar( bSet );
+}
+
+sal_Bool SvtMiscOptions::IsExperimentalSidebar() const
+{
+    return m_pDataContainer->IsExperimentalSidebar();
+}
+
 void SvtMiscOptions::SetMacroRecorderMode( sal_Bool bSet )
 {
     m_pDataContainer->SetMacroRecorderMode( bSet );


More information about the Libreoffice-commits mailing list