sfx2/source/appl/appserv.cxx | 27 ------------- sfx2/source/view/viewfrm.cxx | 87 ------------------------------------------- 2 files changed, 114 deletions(-)
New commits: commit 36d5cff5ec4ccfe3cdcab3c4f1c7f1de2ec3ee92 Author: Balazs Varga <[email protected]> AuthorDate: Fri Sep 8 12:05:17 2023 +0200 Commit: Thorsten Behrens <[email protected]> CommitDate: Sat Sep 9 23:43:01 2023 +0200 Also remove donate/involvement info bar code Cherry-pick from commit: 0a8737c61abe41740b390661971f27926f1f7ccb Change-Id: I1426c7eb15cc4613304dc2acf7795d4ca4c0079c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156706 Reviewed-by: Gabor Kelemen <[email protected]> Tested-by: Thorsten Behrens <[email protected]> diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index ee603ab5e097..a894708e52a1 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -505,33 +505,6 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) break; } #if !ENABLE_WASM_STRIP_PINGUSER - case SID_GETINVOLVED: - { - // Open get involved/join us page based on locales - OUString sURL(officecfg::Office::Common::Menus::GetInvolvedURL::get() + //https://hub.libreoffice.org/joinus/ - "?LOlocale=" + utl::ConfigManager::getUILocale()); - sfx2::openUriExternally(sURL, false, rReq.GetFrameWeld()); - break; - } - case SID_DONATION: - { - // Open donation page based on language + script (BCP47) with language as fall back. - OUString aLang = LanguageTag(utl::ConfigManager::getUILocale()).getLanguage(); - OUString aBcp47 = LanguageTag(utl::ConfigManager::getUILocale()).getBcp47(); - OUString sURL(officecfg::Office::Common::Menus::DonationURL::get() + //https://hub.libreoffice.org/donation/ - "?BCP47=" + aBcp47 + "&LOlang=" + aLang ); - sfx2::openUriExternally(sURL, false, rReq.GetFrameWeld()); - 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()).getBcp47() ); - sfx2::openUriExternally(sURL, false, rReq.GetFrameWeld()); - break; - } case SID_HYPHENATIONMISSING: { // Open wiki page about hyphenation diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index da5477928f51..86dbcf954ef8 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1376,18 +1376,6 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) #if !ENABLE_WASM_STRIP_PINGUSER bool bIsHeadlessOrUITest = SfxApplication::IsHeadlessOrUITest(); //uitest.uicheck fails when the dialog is open - //what's new infobar - if (utl::isProductVersionUpgraded(true) && !bIsHeadlessOrUITest) - { - VclPtr<SfxInfoBarWindow> pInfoBar = AppendInfoBar("whatsnew", "", SfxResId(STR_WHATSNEW_TEXT), InfobarType::INFO); - if (pInfoBar) - { - weld::Button& rWhatsNewButton = pInfoBar->addButton(); - rWhatsNewButton.set_label(SfxResId(STR_WHATSNEW_BUTTON)); - rWhatsNewButton.connect_clicked(LINK(this, SfxViewFrame, WhatsNewHandler)); - } - } - // show tip-of-the-day dialog if it due, but not if there is the impress modal template dialog // open where SdModule::ExecuteNewDocument will launch it instead when that dialog is dismissed if (SfxApplication::IsTipOfTheDayDue() && !bIsHeadlessOrUITest && !IsInModalMode()) @@ -1396,64 +1384,6 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) SfxUnoFrameItem aDocFrame(SID_FILLFRAME, GetFrame().GetFrameInterface()); GetDispatcher()->ExecuteList(SID_TIPOFTHEDAY, SfxCallMode::SLOT, {}, { &aDocFrame }); } - - // inform about the community involvement - const auto t0 = std::chrono::system_clock::now().time_since_epoch(); - const sal_Int64 nLastGetInvolvedShown = officecfg::Setup::Product::LastTimeGetInvolvedShown::get(); - const sal_Int64 nNow = std::chrono::duration_cast<std::chrono::seconds>(t0).count(); - const sal_Int64 nPeriodSec(60 * 60 * 24 * 180); // 180 days in seconds - bool bUpdateLastTimeGetInvolvedShown = false; - - if (nLastGetInvolvedShown == 0) - bUpdateLastTimeGetInvolvedShown = true; - else if (nPeriodSec < nNow && nLastGetInvolvedShown < (nNow + nPeriodSec/2) - nPeriodSec) // 90d alternating with donation - { - bUpdateLastTimeGetInvolvedShown = true; - - VclPtr<SfxInfoBarWindow> pInfoBar = AppendInfoBar("getinvolved", "", SfxResId(STR_GET_INVOLVED_TEXT), InfobarType::INFO); - - if (pInfoBar) - { - weld::Button& rGetInvolvedButton = pInfoBar->addButton(); - rGetInvolvedButton.set_label(SfxResId(STR_GET_INVOLVED_BUTTON)); - rGetInvolvedButton.connect_clicked(LINK(this, SfxViewFrame, GetInvolvedHandler)); - } - } - - if (bUpdateLastTimeGetInvolvedShown - && !officecfg::Setup::Product::LastTimeGetInvolvedShown::isReadOnly()) - { - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); - officecfg::Setup::Product::LastTimeGetInvolvedShown::set(nNow, batch); - batch->commit(); - } - - // inform about donations - const sal_Int64 nLastDonateShown = officecfg::Setup::Product::LastTimeDonateShown::get(); - bool bUpdateLastTimeDonateShown = false; - - if (nLastDonateShown == 0) - bUpdateLastTimeDonateShown = true; - else if (nPeriodSec < nNow && nLastDonateShown < nNow - nPeriodSec) // 90d alternating with getinvolved - { - bUpdateLastTimeDonateShown = true; - - VclPtr<SfxInfoBarWindow> pInfoBar = AppendInfoBar("donate", "", SfxResId(STR_DONATE_TEXT), InfobarType::INFO); - if (pInfoBar) - { - weld::Button& rDonateButton = pInfoBar->addButton(); - rDonateButton.set_label(SfxResId(STR_DONATE_BUTTON)); - rDonateButton.connect_clicked(LINK(this, SfxViewFrame, DonationHandler)); - } - } - - if (bUpdateLastTimeDonateShown - && !officecfg::Setup::Product::LastTimeDonateShown::isReadOnly()) - { - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); - officecfg::Setup::Product::LastTimeDonateShown::set(nNow, batch); - batch->commit(); - } #endif if (officecfg::Office::Common::Passwords::HasMaster::get() && officecfg::Office::Common::Passwords::StorageVersion::get() == 0) @@ -1636,23 +1566,6 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) } } -#if !ENABLE_WASM_STRIP_PINGUSER -IMPL_LINK_NOARG(SfxViewFrame, WhatsNewHandler, weld::Button&, void) -{ - GetDispatcher()->Execute(SID_WHATSNEW); -} - -IMPL_LINK_NOARG(SfxViewFrame, GetInvolvedHandler, weld::Button&, void) -{ - GetDispatcher()->Execute(SID_GETINVOLVED); -} - -IMPL_LINK_NOARG(SfxViewFrame, DonationHandler, weld::Button&, void) -{ - GetDispatcher()->Execute(SID_DONATION); -} -#endif - IMPL_LINK(SfxViewFrame, SwitchReadOnlyHandler, weld::Button&, rButton, void) { if (m_xObjSh.is() && m_xObjSh->IsSignPDF())
