cui/source/dialogs/welcomedlg.cxx                  |    1 +
 officecfg/registry/schema/org/openoffice/Setup.xcs |    8 +++++---
 sfx2/source/view/viewfrm.cxx                       |   13 +++++++++----
 3 files changed, 15 insertions(+), 7 deletions(-)

New commits:
commit 3cfa257452dd04da0dcd6e9a8e61dcd98bdcb687
Author:     Heiko Tietze <tietze.he...@gmail.com>
AuthorDate: Tue May 27 13:49:12 2025 +0200
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Wed May 28 14:13:19 2025 +0200

    Resolves tdf#166733 - Show Welcome dialog only once
    
    WhatsNewDialog made nilable with default=nil; on the very first
    start this variable is set to true (and potentially toggled to
    false by the user later)
    
    Change-Id: I8653c9de2ae58233a614acba5ee3a35fd97c8154
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185905
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>
    Tested-by: Jenkins

diff --git a/cui/source/dialogs/welcomedlg.cxx 
b/cui/source/dialogs/welcomedlg.cxx
index c3d402e16e49..631a8d7a84f3 100644
--- a/cui/source/dialogs/welcomedlg.cxx
+++ b/cui/source/dialogs/welcomedlg.cxx
@@ -61,6 +61,7 @@ WelcomeDialog::WelcomeDialog(weld::Window* pParent, const 
bool bIsFirstStart)
 
 WelcomeDialog::~WelcomeDialog()
 {
+    m_xTabCtrl->set_current_page(sNewsTab); // ensure next start with the 
first page
     if (!m_xShowAgain->get_active())
     {
         std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs 
b/officecfg/registry/schema/org/openoffice/Setup.xcs
index de6740bdbf2f..4bbaa1c1ea56 100644
--- a/officecfg/registry/schema/org/openoffice/Setup.xcs
+++ b/officecfg/registry/schema/org/openoffice/Setup.xcs
@@ -307,11 +307,13 @@
         </info>
         <value>true</value>
       </prop>
-      <prop oor:name="WhatsNewDialog" oor:type="xs:boolean" 
oor:nillable="false">
+      <prop oor:name="WhatsNewDialog" oor:type="xs:boolean">
         <info>
-            <desc>Set to false to not show the WhatsNew dialog but the 
infobar.</desc>
+            <desc>Set to false to not show the WhatsNew dialog but the infobar.
+            Initial nil value is evaluated at the first start to show the
+            welcome dialog, and set to true in order to show the Whatsnew
+            information as a dialog rather than the simple infobar in case of 
false.</desc>
         </info>
-        <value>true</value>
       </prop>
     </group>
     <group oor:name="Office">
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 0c41e379c806..588b5fb3a7e2 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1648,24 +1648,29 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, 
const SfxHint& rHint )
                     bool bIsWhatsNewShown = false; //suppress tipoftheday if 
whatsnew was shown
 
                     static const bool bRunningUnitTest = 
o3tl::IsRunningUnitTest() || o3tl::IsRunningUITest();
-                    static const bool bIsFirstStart = 
officecfg::Office::Common::Misc::FirstRun::get();
-                    if (bIsFirstStart && !IsInModalMode() && !bRunningUnitTest)
+                    std::optional<bool> bShowWelcome = 
officecfg::Setup::Product::WhatsNewDialog::get(); // nil at first start = 
welcome dialog
+                    if (!bShowWelcome.has_value() && !IsInModalMode() && 
!bRunningUnitTest)
                     {
                         SfxAbstractDialogFactory* pFact = 
SfxAbstractDialogFactory::Create();
                         ScopedVclPtr<SfxAbstractTabDialog> pDlg(
                             
pFact->CreateWelcomeDialog(GetWindow().GetFrameWeld(), true));
                         pDlg->Execute();
+
+                        std::shared_ptr<comphelper::ConfigurationChanges> 
batch(comphelper::ConfigurationChanges::create());
+                        officecfg::Setup::Product::WhatsNewDialog::set(true, 
batch); // true after first start = whatsnew dialog
+                        batch->commit();
+
                         bIsWhatsNewShown = true;
                     }
 
                     //what's new dialog
-                    static bool wantsWhatsNew = 
utl::isProductVersionUpgraded() && !IsInModalMode() && !bIsFirstStart;
+                    static bool wantsWhatsNew = 
utl::isProductVersionUpgraded() && !IsInModalMode() && bShowWelcome.has_value();
                     if (wantsWhatsNew)
                     {
                         wantsWhatsNew = false;
                         if (officecfg::Setup::Product::WhatsNew::get())
                         {
-                            if 
(officecfg::Setup::Product::WhatsNewDialog::get())
+                            if (bShowWelcome)
                             {
                                 SfxAbstractDialogFactory* pFact = 
SfxAbstractDialogFactory::Create();
                                 ScopedVclPtr<SfxAbstractTabDialog> pDlg(

Reply via email to