summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorHeiko Tietze <tietze.heiko@gmail.com>2019-09-06 10:34:54 +0200
committerHeiko Tietze <heiko.tietze@documentfoundation.org>2019-09-23 07:51:01 +0200
commit97bcd0e416b1fb725b5aaade811e80d46fdaf1e2 (patch)
tree9d841bf31e56faf32c83e6f2518919af4c6b212d /sfx2/source
parentc8e2675ebde04ab814fe0bc8f800a502280f4689 (diff)
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@documentfoundation.org>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/appl/appserv.cxx9
-rw-r--r--sfx2/source/view/viewfrm.cxx10
2 files changed, 12 insertions, 7 deletions
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();