diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 173 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/licensedialog.ui | 2 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/panel.ui | 3 |
3 files changed, 95 insertions, 83 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index c6b25637cc..b14ff206fa 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1496,88 +1496,8 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) rBind.Invalidate( SID_RELOAD ); rBind.Invalidate( SID_EDITDOC ); -#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()) - { - // tdf#127946 pass in argument for dialog parent - 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)); - } - } + bool bIsInfobarShown(false); - 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) { @@ -1585,6 +1505,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) VclPtr<SfxInfoBarWindow> pOldMasterPasswordInfoBar = AppendInfoBar("oldmasterpassword", "", SfxResId(STR_REFRESH_MASTER_PASSWORD), InfobarType::DANGER, false); + bIsInfobarShown = true; if (pOldMasterPasswordInfoBar) { weld::Button& rButton = pOldMasterPasswordInfoBar->addButton(); @@ -1611,10 +1532,14 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) (( pVSh = m_xObjSh->GetViewShell()) && (pFSh = pVSh->GetFormShell()) && pFSh->IsDesignMode()))) { AppendReadOnlyInfobar(); + bIsInfobarShown = true; } if (!bEmbedded && m_xObjSh->Get_Impl()->getCurrentMacroExecMode() == css::document::MacroExecMode::NEVER_EXECUTE) + { AppendContainsMacrosInfobar(); + bIsInfobarShown = true; + } if (vcl::CommandInfoProvider::GetModuleIdentifier(GetFrame().GetFrameInterface()) == "com.sun.star.text.TextDocument") sfx2::SfxNotebookBar::ReloadNotebookBar(u"modules/swriter/ui/"); @@ -1655,6 +1580,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) AppendInfoBar(aInfobarData.msId, aInfobarData.msPrimaryMessage, aInfobarData.msSecondaryMessage, aInfobarData.maInfobarType, aInfobarData.mbShowCloseButton); + bIsInfobarShown = true; // tdf#148913 don't extend this condition to keep it thread-safe if (pInfoBar) @@ -1680,11 +1606,96 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) AppendInfoBar(aInfobarData.msId, aInfobarData.msPrimaryMessage, aInfobarData.msSecondaryMessage, aInfobarData.maInfobarType, aInfobarData.mbShowCloseButton); + bIsInfobarShown = true; } aPendingInfobars.pop_back(); } +#if !ENABLE_WASM_STRIP_PINGUSER + bool bIsHeadlessOrUITest = SfxApplication::IsHeadlessOrUITest(); //uitest.uicheck fails when the dialog is open + + //what's new infobar + if (!bIsInfobarShown && utl::isProductVersionUpgraded(true) && !bIsHeadlessOrUITest) + { + VclPtr<SfxInfoBarWindow> pInfoBar = AppendInfoBar("whatsnew", "", SfxResId(STR_WHATSNEW_TEXT), InfobarType::INFO); + bIsInfobarShown = true; + 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()) + { + // tdf#127946 pass in argument for dialog parent + 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 (!bIsInfobarShown && 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); + bIsInfobarShown = true; + 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 (!bIsInfobarShown && 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 + break; } default: break; diff --git a/sfx2/uiconfig/ui/licensedialog.ui b/sfx2/uiconfig/ui/licensedialog.ui index 9253f3c9d2..ee82f69685 100644 --- a/sfx2/uiconfig/ui/licensedialog.ui +++ b/sfx2/uiconfig/ui/licensedialog.ui @@ -71,7 +71,7 @@ Third Party Code Additional copyright notices and license terms applicable to po All trademarks and registered trademarks mentioned herein are the property of their respective owners. -Copyright © 2000–2023 LibreOffice contributors. All rights reserved. +Copyright © 2000–2024 LibreOffice contributors. All rights reserved. This product was created by %OOOVENDOR, based on OpenOffice.org, which is Copyright 2000, 2011 Oracle and/or its affiliates. %OOOVENDOR acknowledges all community members, please see http://www.libreoffice.org/ for more details.</property> <property name="wrap">True</property> diff --git a/sfx2/uiconfig/ui/panel.ui b/sfx2/uiconfig/ui/panel.ui index 981a2f2d60..fb40097ee6 100644 --- a/sfx2/uiconfig/ui/panel.ui +++ b/sfx2/uiconfig/ui/panel.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.38.2 --> +<!-- Generated with glade 3.40.0 --> <interface domain="sfx"> <requires lib="gtk+" version="3.20"/> <object class="GtkBox" id="Panel"> @@ -64,6 +64,7 @@ <object class="GtkToolbar" id="toolbar"> <property name="can-focus">True</property> <property name="no-show-all">True</property> + <property name="margin-end">9</property> <property name="toolbar-style">icons</property> <property name="show-arrow">False</property> <property name="icon_size">2</property> |