summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorheiko tietze <tietze.heiko@gmail.com>2019-05-13 10:59:18 +0200
committerHeiko Tietze <tietze.heiko@gmail.com>2019-05-17 10:43:57 +0200
commit5187d3ae495a07373a12fd5980c9269bc8ce3f8f (patch)
treed529b9a31620015ecab6e69c607a37de2fb8018b
parenthandle CG state save/restore in ContextHolder class (diff)
downloadcore-5187d3ae495a07373a12fd5980c9269bc8ce3f8f.tar.gz
core-5187d3ae495a07373a12fd5980c9269bc8ce3f8f.zip
Resolves: tdf#69042 - Add a "What's New" infobar
Shows an infobar with a link to the respective wiki page Adds a button to the About dialog Replaces If6eb1542d2ad310226f76850f480f2f99070b803 Change-Id: I1eeb504994a6364feb90cfa447029875e0ec1969 Reviewed-on: https://gerrit.libreoffice.org/72218 Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com> Tested-by: Heiko Tietze <tietze.heiko@gmail.com>
-rw-r--r--cui/source/dialogs/about.cxx9
-rw-r--r--cui/source/inc/about.hxx1
-rw-r--r--cui/uiconfig/ui/aboutdialog.ui22
-rw-r--r--include/sfx2/sfxsids.hrc2
-rw-r--r--include/sfx2/strings.hrc6
-rw-r--r--include/sfx2/viewfrm.hxx3
-rw-r--r--include/unotools/configmgr.hxx2
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Common.xcu3
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs5
-rw-r--r--officecfg/registry/schema/org/openoffice/Setup.xcs7
-rw-r--r--sfx2/sdi/appslots.sdi4
-rw-r--r--sfx2/sdi/sfx.sdi14
-rw-r--r--sfx2/source/appl/appserv.cxx9
-rw-r--r--sfx2/source/view/viewfrm.cxx48
-rw-r--r--test/user-template/registry/modifications.xcd3
-rw-r--r--unotools/source/config/configmgr.cxx6
16 files changed, 129 insertions, 15 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 0943c163b42e..7d5266682144 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -76,6 +76,7 @@ AboutDialog::AboutDialog(vcl::Window* pParent)
m_aCopyrightTextStr = m_pCopyrightText->GetText();
get(m_pWebsiteButton, "website");
get(m_pCreditsButton, "credits");
+ get(m_pReleaseNotesButton, "btnReleaseNotes");
m_aCreditsLinkStr = get<FixedText>("link")->GetText();
m_sBuildStr = get<FixedText>("buildid")->GetText();
m_aVendorTextStr = get<FixedText>("vendor")->GetText();
@@ -100,6 +101,7 @@ AboutDialog::AboutDialog(vcl::Window* pParent)
// Connect all handlers
m_pCreditsButton->SetClickHdl( LINK( this, AboutDialog, HandleClick ) );
m_pWebsiteButton->SetClickHdl( LINK( this, AboutDialog, HandleClick ) );
+ m_pReleaseNotesButton->SetClickHdl( LINK( this, AboutDialog, HandleClick ) );
get<PushButton>("close")->GrabFocus();
}
@@ -119,6 +121,7 @@ void AboutDialog::dispose()
m_pCreditsButton.clear();
m_pWebsiteButton.clear();
m_pBuildIdLink.clear();
+ m_pReleaseNotesButton.clear();
SfxModalDialog::dispose();
}
@@ -134,6 +137,12 @@ IMPL_LINK( AboutDialog, HandleClick, Button*, pButton, void )
sURL = officecfg::Office::Common::Help::StartCenter::InfoURL::get();
localizeWebserviceURI(sURL);
}
+ else if (pButton == m_pReleaseNotesButton)
+ {
+ sURL = officecfg::Office::Common::Menus::ReleaseNotesURL::get() +
+ "?LOvers=" + utl::ConfigManager::getProductVersion() +
+ "&LOlocale=" + LanguageTag(utl::ConfigManager::getUILocale()).getLanguage();
+ }
// If the URL is empty, don't do anything
if ( sURL.isEmpty() )
diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx
index 9885cdec7d47..d191343f941a 100644
--- a/cui/source/inc/about.hxx
+++ b/cui/source/inc/about.hxx
@@ -43,6 +43,7 @@ private:
VclPtr<FixedText> m_pLogoReplacement;
VclPtr<PushButton> m_pCreditsButton;
VclPtr<PushButton> m_pWebsiteButton;
+ VclPtr<PushButton> m_pReleaseNotesButton;
OUString m_aVersionTextStr;
OUString m_aVendorTextStr;
diff --git a/cui/uiconfig/ui/aboutdialog.ui b/cui/uiconfig/ui/aboutdialog.ui
index 552fd1570185..2fc67d43913b 100644
--- a/cui/uiconfig/ui/aboutdialog.ui
+++ b/cui/uiconfig/ui/aboutdialog.ui
@@ -21,6 +21,21 @@
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
+ <object class="GtkButton" id="btnReleaseNotes">
+ <property name="label" translatable="yes" context="aboutdialog|releasenotes">_Release Notes</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkButton" id="credits">
<property name="label" translatable="yes" context="aboutdialog|credits">Cre_dits</property>
<property name="visible">True</property>
@@ -31,7 +46,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">0</property>
+ <property name="position">1</property>
<property name="secondary">True</property>
</packing>
</child>
@@ -46,7 +61,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
<property name="secondary">True</property>
</packing>
</child>
@@ -63,7 +78,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
@@ -311,6 +326,7 @@
</object>
</child>
<action-widgets>
+ <action-widget response="0">btnReleaseNotes</action-widget>
<action-widget response="0">credits</action-widget>
<action-widget response="0">website</action-widget>
<action-widget response="-7">close</action-widget>
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 7c0508b75415..ca2349b0196c 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -94,6 +94,8 @@ class SvxSearchItem;
#define SID_DOCUMENTATION (SID_SFX_START + 423)
#define SID_DONATION (SID_SFX_START + 424)
#define SID_GETINVOLVED (SID_SFX_START + 425)
+#define SID_WHATSNEW (SID_SFX_START + 426)
+
#define SID_SHOW_LICENSE (SID_SFX_START + 1683)
#define SID_SHOW_CREDITS (SID_SFX_START + 1711)
diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index ca5f86f7d738..bb6606a7c620 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -246,8 +246,10 @@
#define STR_NONCHECKEDOUT_DOCUMENT NC_("STR_NONCHECKEDOUT_DOCUMENT", "This document is not checked out on the server.")
#define STR_GET_INVOLVED_TEXT NC_("STR_GET_INVOLVED_TEXT", "Help us make %PRODUCTNAME even better!")
#define STR_GET_INVOLVED_BUTTON NC_("STR_GET_INVOLVED_BUTTON", "Get involved")
-#define STR_GET_DONATE_TEXT NC_("STR_GET_DONATE_TEXT", "Your donations support our worldwide community.")
-#define STR_GET_DONATE_BUTTON NC_("STR_GET_DONATE_BUTTON", "Donate")
+#define STR_DONATE_TEXT NC_("STR_DONATE_TEXT", "Your donations support our worldwide community.")
+#define STR_DONATE_BUTTON NC_("STR_DONATE_BUTTON", "Donate")
+#define STR_WHATSNEW_TEXT NC_("STR_WHATSNEW", "You are running version %PRODUCTVERSION of %PRODUCTNAME for the first time. Do you want to learn what's new?")
+#define STR_WHATSNEW_BUTTON NC_("STR_WHATSNEW_BUTTON", "Release Notes")
#define STR_READONLY_DOCUMENT NC_("STR_READONLY_DOCUMENT", "This document is open in read-only mode.")
#define STR_READONLY_PDF NC_("STR_READONLY_PDF", "This PDF is open in read-only mode to allow signing the existing file.")
#define STR_CLASSIFIED_DOCUMENT NC_("STR_CLASSIFIED_DOCUMENT", "The classification label of this document is %1.")
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index de7bcaafafaf..502f1fe4480d 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -57,7 +57,8 @@ protected:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
DECL_LINK(GetInvolvedHandler, Button*, void);
- DECL_LINK(GetDonateHandler, Button*, void);
+ DECL_LINK(DonationHandler, Button*, void);
+ DECL_LINK(WhatsNewHandler, Button*, void);
DECL_LINK(SwitchReadOnlyHandler, Button*, void);
DECL_LINK(SignDocumentHandler, Button*, void);
SAL_DLLPRIVATE void KillDispatcher_Impl();
diff --git a/include/unotools/configmgr.hxx b/include/unotools/configmgr.hxx
index e79629834db4..e5b9f9c2f358 100644
--- a/include/unotools/configmgr.hxx
+++ b/include/unotools/configmgr.hxx
@@ -53,6 +53,8 @@ public:
static OUString getProductVersion();
+ static OUString getLastProductVersion();
+
static OUString getVendor();
static void storeConfigItems();
diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index 3e3223a14562..5f99ddc036bd 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -394,6 +394,9 @@
<prop oor:name="DonationURL" oor:type="xs:string">
<value>https://hub.libreoffice.org/donation/</value>
</prop>
+ <prop oor:name="ReleaseNotesURL" oor:type="xs:string">
+ <value>https://hub.libreoffice.org/ReleaseNotes/</value>
+ </prop>
</node>
<node oor:name="Forms">
<node oor:name="ControlLayout">
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index cbee0983ea4b..6d54c8159706 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2075,6 +2075,11 @@
<desc>Specifies the URL used with the UNO command Donation (SID_DONATION).</desc>
</info>
</prop>
+ <prop oor:name="ReleaseNotesURL" oor:type="xs:string" oor:nillable="false">
+ <info>
+ <desc>Specifies the URL used with the UNO command WhatsNew (SID_WHATSNEW).</desc>
+ </info>
+ </prop>
</group>
<group oor:name="History">
<!-- OldLocation: soffice.ini -->
diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs
index 1525b24a908b..34bca3e15c5e 100644
--- a/officecfg/registry/schema/org/openoffice/Setup.xcs
+++ b/officecfg/registry/schema/org/openoffice/Setup.xcs
@@ -260,6 +260,13 @@
<!-- JB: Empty default inserted into empty property node. Remove if NIL
was intended -->
</prop>
+ <prop oor:name="ooSetupLastVersion" oor:type="xs:string" oor:nillable="true">
+ <info>
+ <desc>Specifies the version number of the previously used product for
+ whats-new comparison.</desc>
+ </info>
+ <value/>
+ </prop>
<prop oor:name="ooSetupVersionAboutBox" oor:type="xs:string" oor:nillable="false">
<info>
<desc>Specifies the complete (major.minor.micro) version number of the
diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi
index e46e29741243..c1444d478a68 100644
--- a/sfx2/sdi/appslots.sdi
+++ b/sfx2/sdi/appslots.sdi
@@ -136,6 +136,10 @@ interface Application
[
ExecMethod = MiscExec_Impl ;
]
+ SID_WHATSNEW
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
SID_SHOW_LICENSE
[
ExecMethod = MiscExec_Impl ;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 1794527ef78d..d3e1157d96e2 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -4945,7 +4945,21 @@ SfxVoidItem GetInvolved SID_GETINVOLVED
MenuConfig = TRUE,
GroupId = SfxGroupId::Application;
]
+SfxVoidItem WhatsNew SID_WHATSNEW
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ GroupId = SfxGroupId::Application;
+]
SfxVoidItem ShowLicense SID_SHOW_LICENSE
()
[
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 8de0d32cbf21..c5f09027700c 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -585,6 +585,15 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
sfx2::openUriExternally(sURL, false);
break;
}
+ case SID_WHATSNEW:
+ {
+ // Open release notes depending on version and locale
+ OUString sURL(officecfg::Office::Common::Menus::ReleaseNotesURL::get() + //https://hub.libreoffice.org/ReleaseNotes/
+ "?LOvers=" + utl::ConfigManager::getProductVersion() +
+ "&LOlocale=" + LanguageTag(utl::ConfigManager::getUILocale()).getLanguage() );
+ sfx2::openUriExternally(sURL, false);
+ break;
+ }
case SID_SHOW_LICENSE:
{
LicenseDialog aDialog(rReq.GetFrameWeld());
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 897bd9f5b180..18d71c170ea9 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1221,14 +1221,39 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
const auto t0 = std::chrono::system_clock::now().time_since_epoch();
- // show tip-of-the-day dialog
- const bool bShowTipOfTheDay = officecfg::Office::Common::Misc::ShowTipOfTheDay::get();
bool bIsUITest = false; //uitest.uicheck fails when the dialog is open
for( sal_uInt16 i = 0; i < Application::GetCommandLineParamCount(); i++ )
{
if( Application::GetCommandLineParam(i) == "--nologo" )
bIsUITest = true;
}
+
+ //what's new infobar
+ if (!officecfg::Setup::Product::ooSetupLastVersion::isReadOnly()) //don't show/update when readonly
+ {
+ OUString sSetupVersion = utl::ConfigManager::getProductVersion();
+ sal_Int32 iCurrent = sSetupVersion.getToken(0,'.').toInt32() * 10 + sSetupVersion.getToken(1,'.').toInt32();
+ OUString sLastVersion = utl::ConfigManager::getLastProductVersion();
+ if (sLastVersion.isEmpty()) sLastVersion="0.0";
+ sal_Int32 iLast = sLastVersion.getToken(0,'.').toInt32() * 10 + sLastVersion.getToken(1,'.').toInt32();
+ if ((iCurrent > iLast) && !Application::IsHeadlessModeEnabled() && !bIsUITest)
+ {
+ VclPtr<SfxInfoBarWindow> pInfoBar = AppendInfoBar("whatsnew", SfxResId(STR_WHATSNEW_TEXT), InfoBarType::Info);
+ VclPtrInstance<PushButton> xWhatsNewButton(&GetWindow());
+ xWhatsNewButton->SetText(SfxResId(STR_WHATSNEW_BUTTON));
+ xWhatsNewButton->SetSizePixel(xWhatsNewButton->GetOptimalSize());
+ xWhatsNewButton->SetClickHdl(LINK(this, SfxViewFrame, WhatsNewHandler));
+ pInfoBar->addButton(xWhatsNewButton);
+
+ //update lastversion
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+ officecfg::Setup::Product::ooSetupLastVersion::set(sSetupVersion, batch);
+ batch->commit();
+ }
+ }
+
+ // show tip-of-the-day dialog
+ const bool bShowTipOfTheDay = officecfg::Office::Common::Misc::ShowTipOfTheDay::get();
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
@@ -1279,13 +1304,13 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
bUpdateLastTimeDonateShown = true;
- VclPtr<SfxInfoBarWindow> pInfoBar = AppendInfoBar("getdonate", SfxResId(STR_GET_DONATE_TEXT), InfoBarType::Info);
+ VclPtr<SfxInfoBarWindow> pInfoBar = AppendInfoBar("donate", SfxResId(STR_DONATE_TEXT), InfoBarType::Info);
- VclPtrInstance<PushButton> xGetDonateButton(&GetWindow());
- xGetDonateButton->SetText(SfxResId(STR_GET_DONATE_BUTTON));
- xGetDonateButton->SetSizePixel(xGetDonateButton->GetOptimalSize());
- xGetDonateButton->SetClickHdl(LINK(this, SfxViewFrame, GetDonateHandler));
- pInfoBar->addButton(xGetDonateButton);
+ VclPtrInstance<PushButton> xDonateButton(&GetWindow());
+ xDonateButton->SetText(SfxResId(STR_DONATE_BUTTON));
+ xDonateButton->SetSizePixel(xDonateButton->GetOptimalSize());
+ xDonateButton->SetClickHdl(LINK(this, SfxViewFrame, DonationHandler));
+ pInfoBar->addButton(xDonateButton);
}
if (bUpdateLastTimeDonateShown
@@ -1419,12 +1444,17 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
}
}
+IMPL_LINK_NOARG(SfxViewFrame, WhatsNewHandler, Button*, void)
+{
+ GetDispatcher()->Execute(SID_WHATSNEW);
+}
+
IMPL_LINK_NOARG(SfxViewFrame, GetInvolvedHandler, Button*, void)
{
GetDispatcher()->Execute(SID_GETINVOLVED);
}
-IMPL_LINK_NOARG(SfxViewFrame, GetDonateHandler, Button*, void)
+IMPL_LINK_NOARG(SfxViewFrame, DonationHandler, Button*, void)
{
GetDispatcher()->Execute(SID_DONATION);
}
diff --git a/test/user-template/registry/modifications.xcd b/test/user-template/registry/modifications.xcd
index d8483c6f33ed..20895dbaf80a 100644
--- a/test/user-template/registry/modifications.xcd
+++ b/test/user-template/registry/modifications.xcd
@@ -22,6 +22,9 @@
<prop oor:name="ShowTipOfTheDay">
<value>false</value>
</prop>
+ <prop oor:name="LastTipOfTheDayShown">
+ <value>"32767"</value> <!-- some arbitray high value (sal_Int32) -->
+ </prop>
</node>
<node oor:name="Filter">
<node oor:name="Graphic">
diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx
index 05b1e5874643..859fd1c50498 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -135,6 +135,12 @@ OUString utl::ConfigManager::getProductVersion() {
"Product/ooSetupVersion");
}
+OUString utl::ConfigManager::getLastProductVersion() {
+ return getConfigurationString(
+ "/org.openoffice.Setup",
+ "Product/ooSetupLastVersion");
+}
+
OUString utl::ConfigManager::getVendor() {
return getConfigurationString(
"/org.openoffice.Setup",