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/3762

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/62/3762/1

fdo#56995 Created global option to disable presenter console in Impress

Changes made are as Follows
/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
        To add the new global checkbox to Libreoffice Impress>General>Start
        A new xml block for EnablePresenterScreen was added
                <prop oor:name="EnablePresenterScreen" oor:type="xs:boolean" >
                /sd/source/ui/app/optsitem.cxx
                To add the setter/getter for the new checkbox button, namely:
                        SetEnablePresenterScreen
                        IsEnablePresenterScreen
                EnablePresenterScreen added to index number 26 of:
                        GetPropNameArray()
/sd/source/ui/dlg/tpoption.cxx
        SdTpOptionsMisc() editted to attach EnablePresenterScreen to CBX_ENABLE_PRESENTER_SCREEN
                aCbxEnablePresenterScreen  ( this, SdResId( CBX_ENABLE_PRESENTER_SCREEN))
        Also Added to FillItemSet() and Reset() functions
/sd/source/ui/dlg/tpoption.src b/sd/source/ui/dlg/tpoption.src
        enableSdRemote size changed to
                Size = MAP_APPFONT ( 116 , 10 ) ;
                Pos = MAP_APPFONT ( 12 , 158  ) ;
                This is also correct, tested!
                To allow enableSdRemote(CBX_ENABLE_SDREMOTE) and enablePresenterScreen( 
CBX_ENABLE_PRESENTER_SCREEN) to be drawn adjacent.
                enablePresenterScreen checkbox CBX_ENABLE_PRESENTER_SCREEN added
/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 definition
sd/source/ui/inc/tpoption.hrc
        Defined CBX_ENABLE_PRESENTER_SCREEN as 42nd checkbox
                #define CBX_ENABLE_PRESENTER_SCREEN 42
/sd/source/ui/inc/tpoption.hxx
         Added interface declaration of aCbxEnablePresenterScreen which was attached to  
CBX_ENABLE_PRESENTER_SCREEN
/sdext/source/presenter/PresenterScreen.hxx
         Added interface declaration of
                bool isPresenterScreenEnabled()
                 to PresenterScreen class to allow presenterscreen to get if the option is checked
/sdext/source/presenter/PresenterScreen.cxx
         Added definition of
                 isPresenterScreenEnabled(const css::uno::Reference<css::uno::XComponentContext>& 
rxContext)
                        Input : Current Process Context
                        Output : The 0/1 value of EnablePresenterScreen from presenterconfig
        In PresenterScreenListener::notifyEvent( )
                Added
                         if(mpPresenterScreen->isPresenterScreenEnabled(mxComponentContext)
                                mpPresenterScreen->InitializePresenterScreen()
                To initialize PresenterScreen only when enabled

Change-Id: If8242e607323df57d8e78d08cf2129d03c0c9e4f
---
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, 56 insertions(+), 5 deletions(-)



diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index c6df659..f3cd164 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -602,6 +602,13 @@
           </info>
           <value>true</value>
         </prop>
+       <prop oor:name="EnablePresenterScreen" oor:type="xs:boolean" oor:nillable="false">
+           <info>
+            <desc>Indicates whether to show Presenter Screen Console which shows next slide, notes 
etc.</desc>
+            <label>Enable 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..603cd60 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -236,6 +236,7 @@
     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 +403,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 +418,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 +477,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 +489,7 @@
     aCbxMasterPageCache.SaveValue();
     aCbxCopy.SaveValue();
     aCbxEnableSdremote.SaveValue();
+    aCbxEnablePresenterScreen.SaveValue();
     aCbxCompatibility.SaveValue();
     aCbxUsePrinterMetrics.SaveValue();
 
@@ -611,6 +616,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 +635,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..1112e86 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 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/3762
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8242e607323df57d8e78d08cf2129d03c0c9e4f
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.