Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3761

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/61/3761/1

fdo56995 Created global option to disable presenter console

Changes made are as Follows
1./officecfg/registry/schema/org/openoffice/Office/Impress.xcs
        To add the new global checkbox to Libreoffice Impress>General
        A new xml block for EnablePresenterScreen was added
        <prop oor:name="EnablePresenterScreen" oor:type="xs:boolean"
2./sd/source/ui/app/optsitem.cxx
        To add the setter/getter for the new checkbox button, namely
                a.SetEnablePresenterScreen
                b.IsEnablePresenterScreen
        EnablePresenterScreen added to index number 26 of
                GetPropNameArray()
3./sd/source/ui/dlg/tpoption.cxx
        SdTpOptionsMisc() editted to attach EnablePresenterScreen to
        aCbxEnablePresenterScreen  ( this, SdResId( CBX_ENABLE_PRESEN
        Added to FillItemSet() and Reset() functions
4./sd/source/ui/dlg/tpoption.src b/sd/source/ui/dlg/tpoption.src
        enableSdRemote size changed to
        Size = MAP_APPFONT ( 116 , 10 ) ;
        To allow enableSdRemote(CBX_ENABLE_SDREMOTE) and enablePresen
        enablePresenterScreen checkbox CBX_ENABLE_PRESENTER_SCREEN ad
5./sd/source/ui/inc/optsitem.hxx
        Set default value for enablePresenterScreen as 1 or TRUE
        sal_Bool    bEnablePresenterScreen : 1;
        Added getter/setter named same as above for interface definit
6./sd/source/ui/inc/tpoption.hrc
        Defined CBX_ENABLE_PRESENTER_SCREEN as 42nd checkbox
        #define CBX_ENABLE_PRESENTER_SCREEN 42
7./sd/source/ui/inc/tpoption.hxx
        Added interface declaration of aCbxEnablePresenterScreen whic
8./sdext/source/presenter/PresenterScreen.hxx
        Added interface declaration of
        bool isPresenterScreenEnabled
        to PresenterScreen class to allow presenterscreen to get the
9./sdext/source/presenter/PresenterScreen.cxx
        Added definition of
        isPresenterScreenEnabled(const css::uno::Reference<css::uno::
        Input : Current Process Context
        Output : The 0/1 value of EnablePresenterScreen from /org.ope

        In
        PresenterScreenListener::notifyEvent( const css::document::Ev
        Added
        if(mpPresenterScreen->isPresenterScreenEnabled(mxComponentCon
            mpPresenterScreen->InitializePresenterScreen();
        To initialize PresenterScreen only when enabled

Change-Id: I61e8ea96383b6486caac6651134d1e40731f50b7
---
M officecfg/registry/schema/org/openoffice/Office/Impress.xcs
M sd/source/ui/app/optsitem.cxx
M sd/source/ui/dlg/tpoption.cxx
M sd/source/ui/dlg/tpoption.src
M sd/source/ui/inc/optsitem.hxx
M sd/source/ui/inc/tpoption.hrc
M sd/source/ui/inc/tpoption.hxx
M sdext/source/presenter/PresenterScreen.cxx
M sdext/source/presenter/PresenterScreen.hxx
9 files changed, 61 insertions(+), 6 deletions(-)



diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index c6df659..6e10c99 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -570,7 +570,7 @@
           </info>
           <value>false</value>
         </prop>
-        <prop oor:name="Layout" oor:type="xs:boolean" oor:nillable="false">
+       <prop oor:name="Layout" oor:type="xs:boolean" oor:nillable="false">
           <!-- OldPath: Impress/Other/New_Doc -->
           <!-- OldLocation: Soffice.cfg -->
           <!-- UIHints: Tools - Options - Presentation  Other  [Section] New document -->
@@ -602,6 +602,15 @@
           </info>
           <value>true</value>
         </prop>
+       <prop oor:name="EnablePresenterScreen" oor:type="xs:boolean" oor:nillable="false">
+         <!-- OldPath: NA, New Option -->
+          <!-- OldLocation: NA, New Option -->
+           <info>
+            <desc>Indicates whether to show Presenter Screen Console which shows next slide, notes 
etc.</desc>
+            <label>Presenter Screen</label>
+          </info>
+          <value>true</value>
+        </prop>
       </group>
       <group oor:name="Compatibility">
         <info>
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index 9fe08cc..e960588 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -489,6 +489,7 @@
     bClickChangeRotation( sal_False ),
     bStartWithActualPage( sal_False ),
     bEnableSdremote( sal_False ),
+    bEnablePresenterScreen( sal_True),
     bSolidDragging( sal_True ),
     bSummationOfParagraphs( sal_False ),
     bShowUndoDeleteWarning( sal_True ),
@@ -524,6 +525,7 @@
             IsClickChangeRotation() == rOpt.IsClickChangeRotation() &&
             IsStartWithActualPage() == rOpt.IsStartWithActualPage() &&
             IsEnableSdremote() == rOpt.IsEnableSdremote() &&
+            IsEnablePresenterScreen() == rOpt.IsEnablePresenterScreen()&&
             IsSummationOfParagraphs() == rOpt.IsSummationOfParagraphs() &&
             IsSolidDragging() == rOpt.IsSolidDragging() &&
             IsShowUndoDeleteWarning() == rOpt.IsShowUndoDeleteWarning() &&
@@ -580,10 +582,11 @@
 
         "PenColor",
         "PenWidth",
-        "Start/EnableSdremote"
+        "Start/EnableSdremote",
+        "Start/EnablePresenterScreen"
     };
 
-    rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 26 : 14 );
+    rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 27 : 14 );
     ppNames = aPropNames;
 }
 
@@ -642,6 +645,9 @@
 
         if( pValues[25].hasValue() )
             SetEnableSdremote( *(sal_Bool*) pValues[ 25 ].getValue() );
+
+        if( pValues[26].hasValue() )
+            SetEnablePresenterScreen( *(sal_Bool*) pValues[ 26 ].getValue() );
     }
 
     return sal_True;
@@ -685,6 +691,7 @@
         pValues[ 23 ] <<= GetPresentationPenColor();
         pValues[ 24 ] <<= GetPresentationPenWidth();
         pValues[ 25 ] <<= IsEnableSdremote();
+        pValues[ 26 ] <<= IsEnablePresenterScreen();
     }
 
     return sal_True;
@@ -713,6 +720,7 @@
         maOptionsMisc.SetStartWithTemplate( pOpts->IsStartWithTemplate() );
         maOptionsMisc.SetStartWithActualPage( pOpts->IsStartWithActualPage() );
         maOptionsMisc.SetEnableSdremote( pOpts->IsEnableSdremote() );
+        maOptionsMisc.SetEnablePresenterScreen( pOpts->IsEnablePresenterScreen() );
         maOptionsMisc.SetSummationOfParagraphs( pOpts->IsSummationOfParagraphs() );
         maOptionsMisc.SetShowUndoDeleteWarning( pOpts->IsShowUndoDeleteWarning() );
         maOptionsMisc.SetPrinterIndependentLayout( pOpts->GetPrinterIndependentLayout() );
@@ -796,6 +804,7 @@
         pOpts->SetClickChangeRotation( maOptionsMisc.IsClickChangeRotation() );
         pOpts->SetStartWithActualPage( maOptionsMisc.IsStartWithActualPage() );
         pOpts->SetEnableSdremote( maOptionsMisc.IsEnableSdremote() );
+        pOpts->SetEnablePresenterScreen( maOptionsMisc.IsEnablePresenterScreen() );
         pOpts->SetSummationOfParagraphs( maOptionsMisc.IsSummationOfParagraphs() );
         pOpts->SetSolidDragging( maOptionsMisc.IsSolidDragging() );
         pOpts->SetShowUndoDeleteWarning( maOptionsMisc.IsShowUndoDeleteWarning() );
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index e87baa8..9a79272 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -235,7 +235,10 @@
 
     aCbxStartWithActualPage     ( this, SdResId( CBX_START_WITH_ACTUAL_PAGE ) ),
     aGrpStartWithActualPage     ( this, SdResId( GRP_START_WITH_ACTUAL_PAGE ) ),
+
     aCbxEnableSdremote          ( this, SdResId( CBX_ENABLE_SDREMOTE ) ),
+    aCbxEnablePresenterScreen  ( this, SdResId( CBX_ENABLE_PRESENTER_SCREEN ) ),
+
     aTxtCompatibility           ( this, SdResId( FT_COMPATIBILITY ) ),
     aCbxUsePrinterMetrics       ( this, SdResId( CB_USE_PRINTER_METRICS ) ),
     aCbxCompatibility           ( this, SdResId( CB_MERGE_PARA_DIST ) ),
@@ -402,6 +405,7 @@
         aCbxCopy.GetSavedValue()                != aCbxCopy.IsChecked() ||
         aCbxStartWithActualPage.GetSavedValue() != aCbxStartWithActualPage.IsChecked() ||
         aCbxEnableSdremote.GetSavedValue()      != aCbxEnableSdremote.IsChecked() ||
+        aCbxEnablePresenterScreen.GetSavedValue()!= aCbxEnablePresenterScreen.IsChecked() ||
         aCbxCompatibility.GetSavedValue()       != aCbxCompatibility.IsChecked() ||
         aCbxUsePrinterMetrics.GetSavedValue()   != aCbxUsePrinterMetrics.IsChecked() )
     {
@@ -416,6 +420,7 @@
         aOptsItem.GetOptionsMisc().SetDragWithCopy( aCbxCopy.IsChecked() );
         aOptsItem.GetOptionsMisc().SetStartWithActualPage( aCbxStartWithActualPage.IsChecked() );
         aOptsItem.GetOptionsMisc().SetEnableSdremote( aCbxEnableSdremote.IsChecked() );
+        aOptsItem.GetOptionsMisc().SetEnablePresenterScreen( aCbxEnablePresenterScreen.IsChecked() 
);
         aOptsItem.GetOptionsMisc().SetSummationOfParagraphs( aCbxCompatibility.IsChecked() );
         aOptsItem.GetOptionsMisc().SetPrinterIndependentLayout (
             aCbxUsePrinterMetrics.IsChecked()
@@ -474,6 +479,7 @@
     aCbxCopy.Check( aOptsItem.GetOptionsMisc().IsDragWithCopy() );
     aCbxStartWithActualPage.Check( aOptsItem.GetOptionsMisc().IsStartWithActualPage() );
     aCbxEnableSdremote.Check( aOptsItem.GetOptionsMisc().IsEnableSdremote() );
+    aCbxEnablePresenterScreen.Check( aOptsItem.GetOptionsMisc().IsEnablePresenterScreen() );
     aCbxCompatibility.Check( aOptsItem.GetOptionsMisc().IsSummationOfParagraphs() );
     aCbxUsePrinterMetrics.Check( aOptsItem.GetOptionsMisc().GetPrinterIndependentLayout()==1 );
     aCbxStartWithTemplate.SaveValue();
@@ -485,6 +491,7 @@
     aCbxMasterPageCache.SaveValue();
     aCbxCopy.SaveValue();
     aCbxEnableSdremote.SaveValue();
+    aCbxEnablePresenterScreen.SaveValue();
     aCbxCompatibility.SaveValue();
     aCbxUsePrinterMetrics.SaveValue();
 
@@ -611,6 +618,9 @@
     lcl_MoveWin (aGrpStartWithActualPage, -nLineHeight);
     lcl_MoveWin (aCbxStartWithActualPage, -nLineHeight);
     lcl_MoveWin (aCbxEnableSdremote, -nLineHeight);
+    lcl_MoveWin (aCbxEnablePresenterScreen,
+        nDialogWidth/2 - aCbxEnablePresenterScreen.GetPosPixel().X(),
+        -nLineHeight);
     lcl_MoveWin (aTxtCompatibility, -nLineHeight);
 
     // Move the printer-independent-metrics check box up two lines to change
@@ -627,6 +637,7 @@
     aGrpProgramStart.Hide();
     aCbxStartWithActualPage.Hide();
     aCbxEnableSdremote.Hide();
+    aCbxEnablePresenterScreen.Hide();
     aCbxCompatibility.Hide();
     aGrpStartWithActualPage.Hide();
     aCbxCrookNoContortion.Show();
diff --git a/sd/source/ui/dlg/tpoption.src b/sd/source/ui/dlg/tpoption.src
index c1374f3..fbeff3a 100644
--- a/sd/source/ui/dlg/tpoption.src
+++ b/sd/source/ui/dlg/tpoption.src
@@ -210,10 +210,18 @@
     {
         HelpID = "sd:CheckBox:TP_OPTIONS_MISC:CBX_ENABLE_SDREMOTE";
         Pos = MAP_APPFONT ( 12 , 158  ) ;
-        Size = MAP_APPFONT ( 242 , 10 ) ;
+        Size = MAP_APPFONT ( 116 , 10 ) ;
         TabStop = TRUE ;
         Text [ en-US ] = "Enable remote control" ;
     };
+    CheckBox CBX_ENABLE_PRESENTER_SCREEN
+    {
+        HelpID = "sd:CheckBox:TP_OPTIONS_MISC:CBX_ENABLE_PRESENTER_SCREEN";
+        Pos = MAP_APPFONT ( 12 , 158  ) ;
+        Size = MAP_APPFONT ( 116 , 10 ) ;
+        TabStop = TRUE ;
+        Text [ en-US ] = "Enable Presenter Screen Console" ;
+    };
     FixedLine FT_COMPATIBILITY
     {
         Pos = MAP_APPFONT ( 6 , 173 ) ;
diff --git a/sd/source/ui/inc/optsitem.hxx b/sd/source/ui/inc/optsitem.hxx
index 99e6bf3..9fa4b23 100644
--- a/sd/source/ui/inc/optsitem.hxx
+++ b/sd/source/ui/inc/optsitem.hxx
@@ -224,6 +224,7 @@
     sal_Bool    bClickChangeRotation    : 1;    // Misc/RotateClick
     sal_Bool    bStartWithActualPage    : 1;    // Misc/Start/CurrentPage
     sal_Bool    bEnableSdremote         : 1;    // Misc/Start/EnableSdremote
+    sal_Bool    bEnablePresenterScreen : 1;    // Misc/Start/EnablePresenterDisplay
     sal_Bool    bSolidDragging          : 1;    // Misc/ModifyWithAttributes
     sal_Bool    bSummationOfParagraphs  : 1;    // misc/SummationOfParagraphs
     sal_Bool    bShowUndoDeleteWarning  : 1;    // Misc/ShowUndoDeleteWarning
@@ -273,6 +274,7 @@
     sal_Bool    IsClickChangeRotation() const { Init(); return (sal_Bool) bClickChangeRotation; }
     sal_Bool    IsStartWithActualPage() const { Init(); return (sal_Bool) bStartWithActualPage; }
     sal_Bool    IsEnableSdremote() const { Init(); return (sal_Bool) bEnableSdremote; }
+    sal_Bool    IsEnablePresenterScreen() const { Init(); return (sal_Bool) 
bEnablePresenterScreen; }
     sal_Bool    IsSolidDragging() const { Init(); return (sal_Bool) bSolidDragging; }
     sal_Bool    IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs != 0; };
 
@@ -312,6 +314,7 @@
     void    SetClickChangeRotation( sal_Bool bOn = sal_True ) { if( bClickChangeRotation != bOn ) 
{ OptionsChanged(); bClickChangeRotation = bOn; } }
     void    SetStartWithActualPage( sal_Bool bOn = sal_True ) { if( bStartWithActualPage != bOn ) 
{ OptionsChanged(); bStartWithActualPage = bOn; } }
     void    SetEnableSdremote( sal_Bool bOn = sal_True ) { if( bEnableSdremote != bOn ) { 
OptionsChanged(); bEnableSdremote = bOn; } }
+    void    SetEnablePresenterScreen( sal_Bool bOn = sal_True ) { if( bEnablePresenterScreen != 
bOn ) { OptionsChanged(); bEnablePresenterScreen = bOn; } }
     void    SetSummationOfParagraphs( sal_Bool bOn = sal_True ){ if ( bOn != 
bSummationOfParagraphs ) { OptionsChanged(); bSummationOfParagraphs = bOn; } }
     /** Set the printer independent layout mode.
         @param nOn
diff --git a/sd/source/ui/inc/tpoption.hrc b/sd/source/ui/inc/tpoption.hrc
index 59915ab..7ff6656 100644
--- a/sd/source/ui/inc/tpoption.hrc
+++ b/sd/source/ui/inc/tpoption.hrc
@@ -74,5 +74,5 @@
 
 #define CB_USE_PRINTER_METRICS 40
 #define CBX_ENABLE_SDREMOTE 41
-
+#define CBX_ENABLE_PRESENTER_SCREEN 42
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx
index 9d04085..e64e621 100644
--- a/sd/source/ui/inc/tpoption.hxx
+++ b/sd/source/ui/inc/tpoption.hxx
@@ -97,6 +97,7 @@
     CheckBox    aCbxStartWithActualPage;
     FixedLine   aGrpStartWithActualPage;
     CheckBox    aCbxEnableSdremote;
+    CheckBox    aCbxEnablePresenterScreen;
     FixedLine   aTxtCompatibility;
     CheckBox    aCbxUsePrinterMetrics;
     CheckBox    aCbxCompatibility;
diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx
index 8fe7fce..f361912 100644
--- a/sdext/source/presenter/PresenterScreen.cxx
+++ b/sdext/source/presenter/PresenterScreen.cxx
@@ -220,7 +220,8 @@
     if ( Event.EventName == "OnStartPresentation" )
     {
         mpPresenterScreen = new PresenterScreen(mxComponentContext, mxModel);
-        mpPresenterScreen->InitializePresenterScreen();
+        if(mpPresenterScreen->isPresenterScreenEnabled(mxComponentContext))
+            mpPresenterScreen->InitializePresenterScreen();
     }
     else if ( Event.EventName == "OnEndPresentation" )
     {
@@ -286,6 +287,17 @@
 {
 }
 
+bool PresenterScreen::isPresenterScreenEnabled(const 
css::uno::Reference<css::uno::XComponentContext>& rxContext)
+{
+        bool dEnablePresenterScreen=true;
+        PresenterConfigurationAccess aConfiguration (
+            rxContext,
+            OUString("/org.openoffice.Office.Impress/"),
+            PresenterConfigurationAccess::READ_ONLY);
+        aConfiguration.GetConfigurationNode("Misc/Start/EnablePresenterScreen")
+            >>= dEnablePresenterScreen;
+        return dEnablePresenterScreen;
+}
 void SAL_CALL PresenterScreen::disposing (void)
 {
     Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
diff --git a/sdext/source/presenter/PresenterScreen.hxx b/sdext/source/presenter/PresenterScreen.hxx
index 1647f84..c97447d 100644
--- a/sdext/source/presenter/PresenterScreen.hxx
+++ b/sdext/source/presenter/PresenterScreen.hxx
@@ -109,6 +109,8 @@
 
     virtual void SAL_CALL disposing (void);
 
+    bool isPresenterScreenEnabled(
+        const css::uno::Reference<css::uno::XComponentContext>& rxContext);
     /** Make the presenter screen visible.
     */
     void InitializePresenterScreen (void);

-- 
To view, visit https://gerrit.libreoffice.org/3761
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61e8ea96383b6486caac6651134d1e40731f50b7
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Manik Malhotra <manik10044@iiitd.ac.in>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.