summaryrefslogtreecommitdiff
path: root/sfx2
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
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')
-rw-r--r--sfx2/sdi/appslots.sdi4
-rw-r--r--sfx2/sdi/sfx.sdi17
-rw-r--r--sfx2/source/appl/appserv.cxx9
-rw-r--r--sfx2/source/view/viewfrm.cxx10
4 files changed, 33 insertions, 7 deletions
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();