Presenter Console: simplify Help string handling

No need to store these in the configuration

Change-Id: I1790f544e337854d1e921bc4fc98aa37952ad067
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197052
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
This commit is contained in:
Gabor Kelemen
2026-01-18 17:49:35 +01:00
parent c8cc15d483
commit d1d399ab50
4 changed files with 55 additions and 234 deletions
@@ -969,210 +969,6 @@
</node>
</node>
</node>
<node oor:name="HelpView">
<node oor:name="HelpStrings">
<node oor:name="a" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">Left click, right or down arrow, spacebar, page down, enter, return</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Next slide, or next effect</value>
</prop>
</node>
<node oor:name="b" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">Right click, left or up arrow, page up, backspace</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Previous slide, or previous effect</value>
</prop>
</node>
<node oor:name="c" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">'P'</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Use mouse pointer as pen</value>
</prop>
</node>
<node oor:name="d" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">Home</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">First slide</value>
</prop>
</node>
<node oor:name="e" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">End</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Last slide</value>
</prop>
</node>
<node oor:name="f" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">'E'</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Erase all ink on slide</value>
</prop>
</node>
<node oor:name="g" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">Alt-Page Up</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Previous slide without effects</value>
</prop>
</node>
<node oor:name="h" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">Alt-Page Down</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Next slide without effects</value>
</prop>
</node>
<node oor:name="i" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="x-no-translate"> </value>
</prop>
<prop oor:name="Right">
<value xml:lang="x-no-translate"> </value>
</prop>
</node>
<node oor:name="j" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">'B', '.'</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Blacks/Unblacks the screen</value>
</prop>
</node>
<node oor:name="k" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">'W', ','</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Whites/Unwhites the screen</value>
</prop>
</node>
<node oor:name="l" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="x-no-translate"> </value>
</prop>
<prop oor:name="Right">
<value xml:lang="x-no-translate"> </value>
</prop>
</node>
<node oor:name="m" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">Esc, '-'</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">End slide show</value>
</prop>
</node>
<node oor:name="n" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="x-no-translate"> </value>
</prop>
<prop oor:name="Right">
<value xml:lang="x-no-translate"> </value>
</prop>
</node>
<node oor:name="o" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">Number followed by Enter</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Go to that slide</value>
</prop>
</node>
<node oor:name="p" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="x-no-translate"> </value>
</prop>
<prop oor:name="Right">
<value xml:lang="x-no-translate"> </value>
</prop>
</node>
<node oor:name="q" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">'G', 'S'</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Grow/Shrink size of notes font</value>
</prop>
</node>
<node oor:name="r" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">'A', 'Z'</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Scroll notes up/down</value>
</prop>
</node>
<node oor:name="s" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">'H', 'L'</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Move caret in notes view backward/forward</value>
</prop>
</node>
<node oor:name="t" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="x-no-translate"> </value>
</prop>
<prop oor:name="Right">
<value xml:lang="x-no-translate"> </value>
</prop>
</node>
<node oor:name="u" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">Ctrl-'1'</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Shows the Presenter Console</value>
</prop>
</node>
<node oor:name="v" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">Ctrl-'2'</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Shows the Presentation Notes</value>
</prop>
</node>
<node oor:name="w" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">Ctrl-'3'</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Shows the Slides Overview</value>
</prop>
</node>
<node oor:name="x" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">Ctrl-'4'</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Switches monitors</value>
</prop>
</node>
<node oor:name="z" oor:op="replace">
<prop oor:name="Left">
<value xml:lang="en-US">Ctrl-'A'</value>
</prop>
<prop oor:name="Right">
<value xml:lang="en-US">Turn off pointer as pen mode</value>
</prop>
</node>
</node>
</node>
</node>
<node oor:name="Presenter">
<node oor:name="Themes">
+49
View File
@@ -0,0 +1,49 @@
/* -*- 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 .
*/
#pragma once
#include <unotools/resmgr.hxx>
#include <utility>
#define NC_(Context, String) TranslateId(Context, u8##String)
const std::pair<TranslateId, TranslateId> HelpStrings[] =
{
{ NC_("STR_PRESCONHTEXT_A_KEY", "Left click, right or down arrow, spacebar, page down, enter, return"), NC_("STR_PRESCONHTEXT_A_DESC", "Next slide, or next effect") },
{ NC_("STR_PRESCONHTEXT_B_KEY", "Right click, left or up arrow, page up, backspace"), NC_("STR_PRESCONHTEXT_B_DESC", "Previous slide, or previous effect") },
{ NC_("STR_PRESCONHTEXT_C_KEY", "'P'"), NC_("STR_PRESCONHTEXT_C_DESC", "Use mouse pointer as pen") },
{ NC_("STR_PRESCONHTEXT_D_KEY", "Home"), NC_("STR_PRESCONHTEXT_D_DESC", "First slide") },
{ NC_("STR_PRESCONHTEXT_E_KEY", "End"), NC_("STR_PRESCONHTEXT_E_DESC", "Last slide") },
{ NC_("STR_PRESCONHTEXT_F_KEY", "'E'"), NC_("STR_PRESCONHTEXT_F_DESC", "Erase all ink on slide") },
{ NC_("STR_PRESCONHTEXT_G_KEY", "Alt-Page Up"), NC_("STR_PRESCONHTEXT_G_DESC", "Previous slide without effects") },
{ NC_("STR_PRESCONHTEXT_H_KEY", "Alt-Page Down"), NC_("STR_PRESCONHTEXT_H_DESC", "Next slide without effects") },
{ NC_("STR_PRESCONHTEXT_J_KEY", "'B', '.'"), NC_("STR_PRESCONHTEXT_J_DESC", "Blacks/Unblacks the screen") },
{ NC_("STR_PRESCONHTEXT_K_KEY", "'W', ','"), NC_("STR_PRESCONHTEXT_K_DESC", "Whites/Unwhites the screen") },
{ NC_("STR_PRESCONHTEXT_M_KEY", "Esc, '-'"), NC_("STR_PRESCONHTEXT_M_DESC", "End slide show") },
{ NC_("STR_PRESCONHTEXT_O_KEY", "Number followed by Enter"), NC_("STR_PRESCONHTEXT_O_DESC", "Go to that slide") },
{ NC_("STR_PRESCONHTEXT_Q_KEY", "'G', 'S'"), NC_("STR_PRESCONHTEXT_Q_DESC", "Grow/Shrink size of notes font") },
{ NC_("STR_PRESCONHTEXT_R_KEY", "'A', 'Z'"), NC_("STR_PRESCONHTEXT_R_DESC", "Scroll notes up/down") },
{ NC_("STR_PRESCONHTEXT_S_KEY", "'H', 'L'"), NC_("STR_PRESCONHTEXT_S_DESC", "Move caret in notes view backward/forward") },
{ NC_("STR_PRESCONHTEXT_U_KEY", "Ctrl-'1'"), NC_("STR_PRESCONHTEXT_U_DESC", "Shows the Presenter Console") },
{ NC_("STR_PRESCONHTEXT_V_KEY", "Ctrl-'2'"), NC_("STR_PRESCONHTEXT_V_DESC", "Shows the Presentation Notes") },
{ NC_("STR_PRESCONHTEXT_W_KEY", "Ctrl-'3'"), NC_("STR_PRESCONHTEXT_W_DESC", "Shows the Slides Overview") },
{ NC_("STR_PRESCONHTEXT_X_KEY", "Ctrl-'4'"), NC_("STR_PRESCONHTEXT_X_DESC", "Switches monitors") },
{ NC_("STR_PRESCONHTEXT_Z_KEY", "Ctrl-'A'"), NC_("STR_PRESCONHTEXT_Z_DESC", "Turn off pointer as pen mode") }
};
+6 -28
View File
@@ -25,8 +25,9 @@
#include "PresenterGeometryHelper.hxx"
#include <DrawController.hxx>
#include <framework/ConfigurationController.hxx>
#include <sdresid.hxx>
#include <pchelp.hrc>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/rendering/CompositeOperation.hpp>
#include <com/sun/star/rendering/TextDirection.hpp>
#include <com/sun/star/util/Color.hpp>
@@ -342,35 +343,12 @@ void PresenterHelpView::Paint (const awt::Rectangle& rUpdateBox)
void PresenterHelpView::ReadHelpStrings()
{
// Read help strings stored in pchelp.hrc
mpTextContainer.reset(new TextContainer);
PresenterConfigurationAccess aConfiguration (
mxComponentContext,
u"/org.openoffice.Office.PresenterScreen/"_ustr,
PresenterConfigurationAccess::READ_ONLY);
Reference<container::XNameAccess> xStrings (
aConfiguration.GetConfigurationNode(u"PresenterScreenSettings/HelpView/HelpStrings"_ustr),
UNO_QUERY);
PresenterConfigurationAccess::ForAll(
xStrings,
[this](OUString const&, uno::Reference<beans::XPropertySet> const& xProps)
{
return this->ProcessString(xProps);
});
}
void PresenterHelpView::ProcessString (
const Reference<beans::XPropertySet>& rsProperties)
{
if ( ! rsProperties.is())
return;
OUString sLeftText;
PresenterConfigurationAccess::GetProperty(rsProperties, u"Left"_ustr) >>= sLeftText;
OUString sRightText;
PresenterConfigurationAccess::GetProperty(rsProperties, u"Right"_ustr) >>= sRightText;
mpTextContainer->push_back(
for (const auto& pair: HelpStrings)
mpTextContainer->push_back(
std::make_shared<Block>(
sLeftText, sRightText, mpFont->mxFont, mnMaximalWidth));
SdResId(pair.first), SdResId(pair.second), mpFont->mxFont, mnMaximalWidth));
}
void PresenterHelpView::CheckFontSize()
-2
View File
@@ -99,8 +99,6 @@ private:
void Resize();
void Paint (const css::awt::Rectangle& rRedrawArea);
void ReadHelpStrings();
void ProcessString (
const css::uno::Reference<css::beans::XPropertySet>& rsProperties);
/** Find a font size, so that all text can be displayed at the same
time.