Skip to content

Commit

Permalink
<home_mode> does not make sense in COOL config
Browse files Browse the repository at this point in the history
- We got a query from a customer wrt. <home_mode> in coolwsd.xml.
  It is the best not to include this setting in COOL builds, because
  it is for CODE users. The condition in configure.ac is whether we
  define welcome URL. We define welcome URL for CODE builds only.
  (But it's a legacy that may be cleaned up in the future, because
  we do not use that welcome URL actually, not even in CODE. We
  replaced the remote welcome screen to internal welcome dialog
  long ago. We may find a better way to make disctinction in configure.ac
  between CODE and COOL builds.)
- The description of the setting was vague, probably it's not a secret,
  what it does.
- The feedback.show setting was unnecessary. It was never in coolwsd.xml.
  In COOL we don't have feedback URL, so feedback dialog is never
  displayed and there is no visible Send Feedback button (or menu item).
  In CODE home mode we suppress the feedback popup. By default we
  enable the feedback popup in CODE.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I158aede7c64f88ac3add843ff7ae9cca8b38aa94
  • Loading branch information
timar committed Nov 22, 2024
1 parent a644712 commit 2ee637e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -973,11 +973,15 @@ fi
AC_DEFINE_UNQUOTED([INFOBAR_URL],["$INFOBAR_URL"],[Infobar URL.])

WELCOME_CONFIG_FRAGMENT=
HOME_MODE_CONFIGURATION=
ENABLE_WELCOME_MESSAGE=0
WELCOME_URL=
if test -n "$with_welcome_url"; then
WELCOME_URL=$with_welcome_url
ENABLE_WELCOME_MESSAGE=1
HOME_MODE_CONFIGURATION="<home_mode>
<enable desc=\"Home users can enable this setting, which in turn disables welcome screen and user feedback popups, but also limits concurrent open connections to 20 and concurrent open documents to 10. The default means that number of concurrent open connections and concurrent open documents are unlimited, but welcome screen and user feedback cannot be switched off.\" type=\"bool\" default=\"false\">false</enable>
</home_mode>"
else
WELCOME_CONFIG_FRAGMENT="<welcome>
<enable type=\"bool\" desc=\"Controls whether the welcome screen should be shown to the users on new install and updates. When enabled, your custom welcome screen must be created at /usr/share/coolwsd/browser/dist/welcome/welcome.html.\" default=\"false\">false</enable>
Expand All @@ -986,6 +990,8 @@ fi

AC_SUBST([WELCOME_CONFIG_FRAGMENT])
AM_SUBST_NOTMAKE(WELCOME_CONFIG_FRAGMENT)
AC_SUBST([HOME_MODE_CONFIGURATION])
AM_SUBST_NOTMAKE(HOME_MODE_CONFIGURATION)
AC_DEFINE_UNQUOTED([ENABLE_WELCOME_MESSAGE],$ENABLE_WELCOME_MESSAGE,[Should the Release notes message be shown on upgrade])
AM_CONDITIONAL([ENABLE_WELCOME_MESSAGE], [test "$ENABLE_WELCOME_MESSAGE" = "1"])
AC_DEFINE_UNQUOTED([WELCOME_URL],["$WELCOME_URL"],[The welcome url of the build.])
Expand Down
6 changes: 2 additions & 4 deletions coolwsd.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,6 @@
<url desc="URL of optional JSON file that lists fonts to be included in Online" type="string" default=""></url>
</remote_font_config>

<home_mode>
<enable desc="Enable more configuration options for home users" type="bool" default="false">false</enable>
</home_mode>

<fonts_missing>
<handling desc="How to handle fonts missing in a document: 'report', 'log', 'both', or 'ignore'" type="string" default="log">log</handling>
</fonts_missing>
Expand All @@ -341,6 +337,8 @@
<server_name desc="server name to show in cluster overview admin panel" type="string" default=""></server_name>
</indirection_endpoint>

@HOME_MODE_CONFIGURATION@

@LOCK_CONFIGURATION@

@FEATURE_RESTRICTION_CONFIGURATION@
Expand Down
2 changes: 0 additions & 2 deletions wsd/COOLWSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,6 @@ void COOLWSD::innerInitialize(Poco::Util::Application& self)
{ "trace[@enable]", "false" },
{ "welcome.enable", "false" },
{ "home_mode.enable", "false" },
{ "feedback.show", "true" },
{ "overwrite_mode.enable", "false" },
#if ENABLE_FEATURE_LOCK
{ "feature_lock.locked_hosts[@allow]", "false" },
Expand Down Expand Up @@ -1943,7 +1942,6 @@ void COOLWSD::innerInitialize(Poco::Util::Application& self)
}
else
{
conf.setString("feedback.show", "true");
conf.setString("welcome.enable", "true");
COOLWSD::MaxConnections = MAX_CONNECTIONS;
COOLWSD::MaxDocuments = MAX_DOCUMENTS;
Expand Down
2 changes: 1 addition & 1 deletion wsd/FileServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,7 @@ FileServerRequestHandler::ResourceAccessDetails FileServerRequestHandler::prepro
Poco::replaceInPlace(preprocess, std::string("%ENABLE_MACROS_EXECUTION%"), enableMacrosExecution);


if (!config.getBool("feedback.show", true) && config.getBool("home_mode.enable", false))
if (config.getBool("home_mode.enable", false))
{
Poco::replaceInPlace(preprocess, std::string("%AUTO_SHOW_FEEDBACK%"), (std::string)"false");
}
Expand Down

0 comments on commit 2ee637e

Please sign in to comment.