[Libreoffice-commits] core.git: basctl/uiconfig chart2/uiconfig cui/inc cui/source dbaccess/uiconfig extensions/uiconfig framework/uiconfig include/sfx2 officecfg/registry reportdesign/uiconfig sc/uiconfig sd/uiconfig sfx2/sdi sfx2/source starmath/uiconfig sw/uiconfig

Heiko Tietze (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 23 05:51:50 UTC 2019


 basctl/uiconfig/basicide/menubar/menubar.xml                         |    1 
 chart2/uiconfig/menubar/menubar.xml                                  |    1 
 cui/inc/tipoftheday.hrc                                              |    1 
 cui/source/dialogs/tipofthedaydlg.cxx                                |   31 +++++-----
 cui/source/inc/tipofthedaydlg.hxx                                    |    6 -
 dbaccess/uiconfig/dbapp/menubar/menubar.xml                          |    1 
 dbaccess/uiconfig/dbquery/menubar/menubar.xml                        |    1 
 dbaccess/uiconfig/dbrelation/menubar/menubar.xml                     |    1 
 dbaccess/uiconfig/dbtable/menubar/menubar.xml                        |    1 
 dbaccess/uiconfig/dbtdata/menubar/menubar.xml                        |    1 
 extensions/uiconfig/sbibliography/menubar/menubar.xml                |    1 
 framework/uiconfig/startmodule/menubar/menubar.xml                   |    1 
 include/sfx2/sfxsids.hrc                                             |    2 
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |   14 ++++
 officecfg/registry/schema/org/openoffice/Office/Common.xcs           |    6 +
 reportdesign/uiconfig/dbreport/menubar/menubar.xml                   |    1 
 sc/uiconfig/scalc/menubar/menubar.xml                                |    1 
 sd/uiconfig/sdraw/menubar/menubar.xml                                |    1 
 sd/uiconfig/simpress/menubar/menubar.xml                             |    1 
 sfx2/sdi/appslots.sdi                                                |    4 +
 sfx2/sdi/sfx.sdi                                                     |   17 +++++
 sfx2/source/appl/appserv.cxx                                         |    9 ++
 sfx2/source/view/viewfrm.cxx                                         |   10 ---
 starmath/uiconfig/smath/menubar/menubar.xml                          |    1 
 sw/uiconfig/sglobal/menubar/menubar.xml                              |    1 
 sw/uiconfig/sweb/menubar/menubar.xml                                 |    1 
 sw/uiconfig/swform/menubar/menubar.xml                               |    1 
 sw/uiconfig/swreport/menubar/menubar.xml                             |    1 
 sw/uiconfig/swriter/menubar/menubar.xml                              |    1 
 sw/uiconfig/swxform/menubar/menubar.xml                              |    1 
 30 files changed, 95 insertions(+), 25 deletions(-)

New commits:
commit 97bcd0e416b1fb725b5aaade811e80d46fdaf1e2
Author:     Heiko Tietze <tietze.heiko at gmail.com>
AuthorDate: Fri Sep 6 10:34:54 2019 +0200
Commit:     Heiko Tietze <heiko.tietze at documentfoundation.org>
CommitDate: Mon Sep 23 07:51:01 2019 +0200

    Resolves tdf#127400 - Allow to show tip of the day again
    
    * UNO command TipOfTheDay and slot SID_TIPOFTHEDAY
      introduced and added to help menus
    * Tip ID introduced to keep the current tip over the day
    * Tip ID updates after 24h
    * Randomization of tips replaced by sequential order
    * Tip ID added to the dialog title
    
    Change-Id: I69b72b80d6d6afa25a1c4f01fa05bc60b5741db8
    Reviewed-on: https://gerrit.libreoffice.org/78693
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tietze at documentfoundation.org>

diff --git a/basctl/uiconfig/basicide/menubar/menubar.xml b/basctl/uiconfig/basicide/menubar/menubar.xml
index 290bb6a7de36..ac59065c9daf 100644
--- a/basctl/uiconfig/basicide/menubar/menubar.xml
+++ b/basctl/uiconfig/basicide/menubar/menubar.xml
@@ -159,6 +159,7 @@
             <menu:menuitem menu:id=".uno:HelpIndex"/>
             <menu:menuitem menu:id=".uno:ExtendedHelp"/>
             <menu:menuitem menu:id=".uno:Documentation"/>
+            <menu:menuitem menu:id=".uno:TipOfTheDay"/>
             <menu:menuseparator/>
             <menu:menuitem menu:id=".uno:QuestionAnswers"/>
             <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/chart2/uiconfig/menubar/menubar.xml b/chart2/uiconfig/menubar/menubar.xml
index d3dbf57b54a5..354ebbc1903a 100644
--- a/chart2/uiconfig/menubar/menubar.xml
+++ b/chart2/uiconfig/menubar/menubar.xml
@@ -160,6 +160,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/cui/inc/tipoftheday.hrc b/cui/inc/tipoftheday.hrc
index 16f79af26497..8977f718f945 100644
--- a/cui/inc/tipoftheday.hrc
+++ b/cui/inc/tipoftheday.hrc
@@ -263,6 +263,7 @@ const std::tuple<const char*, OUString, OUString> TIPOFTHEDAY_STRINGARRAY[] =
 
 #define STR_HELP_LINK                   NC_("STR_HELP_LINK", "%PRODUCTNAME Help")
 #define STR_MORE_LINK                   NC_("STR_MORE_LINK", "More info")
+#define STR_TITLE                       NC_("STR_TITLE", "Tip of the Day")
 
 #endif //INCLUDED_CUI_INC_TIPOFTHEDAY_HRC
 
diff --git a/cui/source/dialogs/tipofthedaydlg.cxx b/cui/source/dialogs/tipofthedaydlg.cxx
index 2ee5518c5274..55e9b51b9003 100644
--- a/cui/source/dialogs/tipofthedaydlg.cxx
+++ b/cui/source/dialogs/tipofthedaydlg.cxx
@@ -28,7 +28,6 @@
 #include <vcl/help.hxx>
 #include <vcl/virdev.hxx>
 #include <vcl/svapp.hxx>
-#include <comphelper/random.hxx>
 
 TipOfTheDayDialog::TipOfTheDayDialog(weld::Window* pParent)
     : GenericDialogController(pParent, "cui/ui/tipofthedaydialog.ui", "TipOfTheDayDialog")
@@ -38,11 +37,17 @@ TipOfTheDayDialog::TipOfTheDayDialog(weld::Window* pParent)
     , m_pNext(m_xBuilder->weld_button("btnNext"))
     , m_pLink(m_xBuilder->weld_link_button("btnLink"))
 {
-    m_pShowTip->connect_toggled(LINK(this, TipOfTheDayDialog, OnShowTipToggled));
+    m_pShowTip->set_active(officecfg::Office::Common::Misc::ShowTipOfTheDay::get());
     m_pNext->connect_clicked(LINK(this, TipOfTheDayDialog, OnNextClick));
 
     nNumberOfTips = SAL_N_ELEMENTS(TIPOFTHEDAY_STRINGARRAY);
-    nCurrentTip = comphelper::rng::uniform_int_distribution(0, nNumberOfTips - 1);
+    nCurrentTip = officecfg::Office::Common::Misc::LastTipOfTheDayID::get();
+
+    const auto t0 = std::chrono::system_clock::now().time_since_epoch();
+    nDay = std::chrono::duration_cast<std::chrono::hours>(t0).count() / 24; //days since 1970-01-01
+    if (nDay > officecfg::Office::Common::Misc::LastTipOfTheDayShown::get())
+        nCurrentTip++;
+
     UpdateTip();
 }
 
@@ -50,10 +55,9 @@ TipOfTheDayDialog::~TipOfTheDayDialog()
 {
     std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
         comphelper::ConfigurationChanges::create());
-    const auto t0 = std::chrono::system_clock::now().time_since_epoch();
-    const sal_Int32 nDay
-        = std::chrono::duration_cast<std::chrono::hours>(t0).count() / 24; // days since 1970-01-01
     officecfg::Office::Common::Misc::LastTipOfTheDayShown::set(nDay, xChanges);
+    officecfg::Office::Common::Misc::LastTipOfTheDayID::set(nCurrentTip, xChanges);
+    officecfg::Office::Common::Misc::ShowTipOfTheDay::set(m_pShowTip->get_active(), xChanges);
     xChanges->commit();
 }
 
@@ -65,6 +69,11 @@ static bool file_exists(const OUString& fileName)
 
 void TipOfTheDayDialog::UpdateTip()
 {
+    if ((nCurrentTip + 1 > nNumberOfTips) || (nCurrentTip < 0))
+        nCurrentTip = 0;
+    m_xDialog->set_title(CuiResId(STR_TITLE) + ": " + OUString::number(nCurrentTip + 1) + "/"
+                         + OUString::number(nNumberOfTips));
+
     // text
     OUString aText = CuiResId(std::get<0>(TIPOFTHEDAY_STRINGARRAY[nCurrentTip]));
     m_pText->set_label(aText);
@@ -110,14 +119,6 @@ void TipOfTheDayDialog::UpdateTip()
     }
 }
 
-IMPL_STATIC_LINK(TipOfTheDayDialog, OnShowTipToggled, weld::ToggleButton&, rButton, void)
-{
-    std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
-        comphelper::ConfigurationChanges::create());
-    officecfg::Office::Common::Misc::ShowTipOfTheDay::set(rButton.get_active(), xChanges);
-    xChanges->commit();
-}
-
 IMPL_LINK_NOARG(TipOfTheDayDialog, OnLinkClick, weld::LinkButton&, void)
 {
     Application::GetHelp()->Start(aLink, static_cast<weld::Widget*>(nullptr));
@@ -125,7 +126,7 @@ IMPL_LINK_NOARG(TipOfTheDayDialog, OnLinkClick, weld::LinkButton&, void)
 
 IMPL_LINK_NOARG(TipOfTheDayDialog, OnNextClick, weld::Button&, void)
 {
-    nCurrentTip = (nCurrentTip + 1) % nNumberOfTips;
+    nCurrentTip++; //zeroed at updatetip when out of range
     UpdateTip();
 }
 
diff --git a/cui/source/inc/tipofthedaydlg.hxx b/cui/source/inc/tipofthedaydlg.hxx
index 1f55df1156da..d013665a4055 100644
--- a/cui/source/inc/tipofthedaydlg.hxx
+++ b/cui/source/inc/tipofthedaydlg.hxx
@@ -30,11 +30,11 @@ private:
     std::unique_ptr<weld::Button> m_pNext;
     std::unique_ptr<weld::LinkButton> m_pLink;
 
-    sal_uInt32 nCurrentTip;
-    sal_uInt32 nNumberOfTips;
+    sal_Int32 nCurrentTip;
+    sal_Int32 nNumberOfTips;
+    sal_Int32 nDay;
     OUString aLink;
     void UpdateTip();
-    DECL_STATIC_LINK(TipOfTheDayDialog, OnShowTipToggled, weld::ToggleButton&, void);
     DECL_LINK(OnNextClick, weld::Button&, void);
     DECL_LINK(OnLinkClick, weld::LinkButton&, void);
 
diff --git a/dbaccess/uiconfig/dbapp/menubar/menubar.xml b/dbaccess/uiconfig/dbapp/menubar/menubar.xml
index 2949b57e7740..7038a63608a7 100644
--- a/dbaccess/uiconfig/dbapp/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbapp/menubar/menubar.xml
@@ -147,6 +147,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/dbaccess/uiconfig/dbquery/menubar/menubar.xml b/dbaccess/uiconfig/dbquery/menubar/menubar.xml
index a7c26ead641f..8227446b4b89 100644
--- a/dbaccess/uiconfig/dbquery/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbquery/menubar/menubar.xml
@@ -102,6 +102,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/dbaccess/uiconfig/dbrelation/menubar/menubar.xml b/dbaccess/uiconfig/dbrelation/menubar/menubar.xml
index 31c3f1c06d44..6e3df781eca9 100644
--- a/dbaccess/uiconfig/dbrelation/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbrelation/menubar/menubar.xml
@@ -86,6 +86,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/dbaccess/uiconfig/dbtable/menubar/menubar.xml b/dbaccess/uiconfig/dbtable/menubar/menubar.xml
index 7a255d12214b..bbd4a7428f74 100644
--- a/dbaccess/uiconfig/dbtable/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbtable/menubar/menubar.xml
@@ -86,6 +86,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/dbaccess/uiconfig/dbtdata/menubar/menubar.xml b/dbaccess/uiconfig/dbtdata/menubar/menubar.xml
index cdd892b5baa5..bbf379953e85 100644
--- a/dbaccess/uiconfig/dbtdata/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbtdata/menubar/menubar.xml
@@ -111,6 +111,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/extensions/uiconfig/sbibliography/menubar/menubar.xml b/extensions/uiconfig/sbibliography/menubar/menubar.xml
index e3b241e1131d..3604c1b760a1 100644
--- a/extensions/uiconfig/sbibliography/menubar/menubar.xml
+++ b/extensions/uiconfig/sbibliography/menubar/menubar.xml
@@ -60,6 +60,7 @@
             <menu:menuitem menu:id=".uno:HelpIndex"/>
             <menu:menuitem menu:id=".uno:ExtendedHelp"/>
             <menu:menuitem menu:id=".uno:Documentation"/>
+            <menu:menuitem menu:id=".uno:TipOfTheDay"/>
             <menu:menuseparator/>
             <menu:menuitem menu:id=".uno:QuestionAnswers"/>
             <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/framework/uiconfig/startmodule/menubar/menubar.xml b/framework/uiconfig/startmodule/menubar/menubar.xml
index 96ac15d10f81..eb0532080155 100644
--- a/framework/uiconfig/startmodule/menubar/menubar.xml
+++ b/framework/uiconfig/startmodule/menubar/menubar.xml
@@ -61,6 +61,7 @@
             <menu:menuitem menu:id=".uno:HelpIndex"/>
             <menu:menuitem menu:id=".uno:ExtendedHelp"/>
             <menu:menuitem menu:id=".uno:Documentation"/>
+            <menu:menuitem menu:id=".uno:TipOfTheDay"/>
             <menu:menuseparator/>
             <menu:menuitem menu:id=".uno:QuestionAnswers"/>
             <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 80c92e1cdc2a..d77279cb44d3 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -88,6 +88,8 @@ class SvxSearchItem;
 #define SID_HELPTIPS                        (SID_SFX_START + 404)
 #define SID_EMOJI_CONTROL                   (SID_SFX_START + 405)
 #define SID_CHARMAP_CONTROL                 (SID_SFX_START + 406)
+#define SID_TIPOFTHEDAY                     (SID_SFX_START + 407)
+
 // free                                     (SID_SFX_START + 410)
 #define SID_SEND_FEEDBACK                   (SID_SFX_START + 421)
 #define SID_Q_AND_A                         (SID_SFX_START + 422)
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index e4e241771c94..0d4cf4e199ae 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -4985,6 +4985,20 @@
           <value>1</value>
         </prop>
       </node>
+      <node oor:name=".uno:TipOfTheDay" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">~Tip of the day</value>
+        </prop>
+        <prop oor:name="ContextLabel" oor:type="xs:string">
+          <value xml:lang="en-US">Show Tip-Of-The-Day</value>
+        </prop>
+        <prop oor:name="TooltipLabel" oor:type="xs:string">
+          <value xml:lang="en-US">Show the Tip-Of-The-Day dialog</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
       <node oor:name=".uno:ViewDataSourceBrowser" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">~Data Sources</value>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 543fd8c564a0..4dce5f44acd2 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5513,6 +5513,12 @@
           <info>
               <desc>The last time when the Tip-of-the-day dialog was shown.</desc>
           </info>
+          <value>-1</value> <!-- +1 every 24h -->
+      </prop>
+      <prop oor:name="LastTipOfTheDayID" oor:type="xs:int" oor:nillable="false">
+          <info>
+              <desc>The last shown Tip-of-the-day.</desc>
+          </info>
           <value>0</value>
       </prop>
       <prop oor:name="UseOpenCL" oor:type="xs:boolean" oor:nillable="false">
diff --git a/reportdesign/uiconfig/dbreport/menubar/menubar.xml b/reportdesign/uiconfig/dbreport/menubar/menubar.xml
index 28e2847610ba..cf9bb4543450 100644
--- a/reportdesign/uiconfig/dbreport/menubar/menubar.xml
+++ b/reportdesign/uiconfig/dbreport/menubar/menubar.xml
@@ -277,6 +277,7 @@
             <menu:menuitem menu:id=".uno:HelpIndex"/>
             <menu:menuitem menu:id=".uno:ExtendedHelp"/>
             <menu:menuitem menu:id=".uno:Documentation"/>
+            <menu:menuitem menu:id=".uno:TipOfTheDay"/>
             <menu:menuseparator/>
             <menu:menuitem menu:id=".uno:QuestionAnswers"/>
             <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index 35fb4a20075f..f360aa06397f 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -774,6 +774,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
index 6c0388a043c3..0e48502ec360 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -631,6 +631,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index cbe0950d5291..42b7d435c56a 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -671,6 +671,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi
index 1d8ac05b697d..ee5a731d2063 100644
--- a/sfx2/sdi/appslots.sdi
+++ b/sfx2/sdi/appslots.sdi
@@ -56,6 +56,10 @@ interface Application
         ExecMethod = MiscExec_Impl ;
         StateMethod = MiscState_Impl ;
     ]
+    SID_TIPOFTHEDAY // ole(no) api(final/play/rec)
+    [
+        ExecMethod = MiscExec_Impl ;
+    ]
     SID_CONFIG // ole(no) api(final/play/rec)
     [
         ExecMethod = MiscExec_Impl ;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 87a478d99275..624abe196661 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -1889,6 +1889,23 @@ SfxBoolItem HelpTip SID_HELPTIPS
     GroupId = SfxGroupId::Application;
 ]
 
+SfxVoidItem TipOfTheDay SID_TIPOFTHEDAY
+
+[
+    AutoUpdate = FALSE,
+    FastCall = FALSE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+
+
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    ToolBoxConfig = TRUE,
+    GroupId = SfxGroupId::Application;
+]
 
 SfxVoidItem EmojiControl SID_EMOJI_CONTROL
 
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 9b5351e5aab9..3fb832faaa0f 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -665,6 +665,15 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
                 rReq.AppendItem( SfxBoolItem( SID_HELPBALLOONS, bOn) );
             break;
         }
+        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+        case SID_TIPOFTHEDAY:
+        {
+            VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
+            ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateTipOfTheDayDialog(rReq.GetFrameWeld()));
+            pDlg->Execute();
+            bDone = true;
+            break;
+        }
 
         // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
         case SID_ABOUT:
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 5214f17ee980..490bd3519831 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1315,13 +1315,9 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
                 if (bShowTipOfTheDay && !Application::IsHeadlessModeEnabled() && !bIsUITest) {
                     const sal_Int32 nLastTipOfTheDay = officecfg::Office::Common::Misc::LastTipOfTheDayShown::get();
                     const sal_Int32 nDay = std::chrono::duration_cast<std::chrono::hours>(t0).count()/24; // days since 1970-01-01
-                    if (nDay-nLastTipOfTheDay > 0) { //only once per day
-                        VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
-                        ScopedVclPtr<VclAbstractDialog> pDlg(
-                            pFact->CreateTipOfTheDayDialog(GetWindow().GetFrameWeld()));
-                        pDlg->Execute();
-                    }
-                }
+                    if (nDay-nLastTipOfTheDay > 0) //only once per day
+                        GetDispatcher()->Execute(SID_TIPOFTHEDAY);
+                } //bShowTipOfTheDay
 
                 // inform about the community involvement
                 const sal_Int64 nLastGetInvolvedShown = officecfg::Setup::Product::LastTimeGetInvolvedShown::get();
diff --git a/starmath/uiconfig/smath/menubar/menubar.xml b/starmath/uiconfig/smath/menubar/menubar.xml
index e787ef388104..04ca77df844b 100644
--- a/starmath/uiconfig/smath/menubar/menubar.xml
+++ b/starmath/uiconfig/smath/menubar/menubar.xml
@@ -153,6 +153,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index 007d1fce099b..1b6ae10caa1e 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -780,6 +780,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml
index b7e77d4413ef..aeeb4f2547ac 100644
--- a/sw/uiconfig/sweb/menubar/menubar.xml
+++ b/sw/uiconfig/sweb/menubar/menubar.xml
@@ -651,6 +651,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml
index b2295ffd955e..eee985a05a12 100644
--- a/sw/uiconfig/swform/menubar/menubar.xml
+++ b/sw/uiconfig/swform/menubar/menubar.xml
@@ -732,6 +732,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml
index 611551fe0139..6e6773e08c82 100644
--- a/sw/uiconfig/swreport/menubar/menubar.xml
+++ b/sw/uiconfig/swreport/menubar/menubar.xml
@@ -691,6 +691,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index 4815aad22ae3..772ea5ee85a5 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -786,6 +786,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index bf6e54657788..7c6f020fc0ab 100644
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -779,6 +779,7 @@
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
+      <menu:menuitem menu:id=".uno:TipOfTheDay"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:QuestionAnswers"/>
       <menu:menuitem menu:id=".uno:SendFeedback"/>


More information about the Libreoffice-commits mailing list