diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2024-05-22 13:18:27 +0200 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2024-05-22 21:19:46 +0200 |
commit | 1bd9747a126a3e82b6093c2b4af3b3a74774a3e9 (patch) | |
tree | 27295039430bf19456107e0b71054eb19da988a4 /cui | |
parent | 08da27fc377f443d1d6698f4a061fa462849062d (diff) |
tdf#161209 - Reverts WhatsNew/Welcome dialog
dd889b290304b73f96a9a8e6e0f144d3aa2ba7e1
Change-Id: Idf0594c546e4d9ca263272ed1534b27948e8e930
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167956
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Jenkins
Diffstat (limited to 'cui')
-rw-r--r-- | cui/Library_cui.mk | 1 | ||||
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/inc/whatsnew.hrc | 42 | ||||
-rw-r--r-- | cui/source/dialogs/whatsnew.cxx | 172 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 14 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 2 | ||||
-rw-r--r-- | cui/source/inc/whatsnew.hxx | 79 | ||||
-rw-r--r-- | cui/uiconfig/ui/whatsnewdialog.ui | 131 |
8 files changed, 0 insertions, 442 deletions
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index 3ee744e32d0f..e01e33ecb4ec 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -114,7 +114,6 @@ $(eval $(call gb_Library_add_exception_objects,cui,\ cui/source/customize/SvxNotebookbarConfigPage \ cui/source/customize/CustomNotebookbarGenerator \ cui/source/dialogs/about \ - cui/source/dialogs/whatsnew \ $(call gb_Helper_optional,EXTENSIONS, \ cui/source/dialogs/AdditionsDialog) \ cui/source/dialogs/colorpicker \ diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 79ff7696a93a..10acd83c8c39 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -18,7 +18,6 @@ endif ifneq ($(ENABLE_WASM_STRIP_PINGUSER),TRUE) $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/tipofthedaydialog \ - cui/uiconfig/ui/whatsnewdialog \ )) endif diff --git a/cui/inc/whatsnew.hrc b/cui/inc/whatsnew.hrc deleted file mode 100644 index e155a597bcf2..000000000000 --- a/cui/inc/whatsnew.hrc +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#pragma once - -#define NC_(Context, String) TranslateId(Context, u8##String) - -#include <rtl/ustring.hxx> -#include <config_python.h> -#include <tuple> -#include <unotools/resmgr.hxx> - -/* - * std:tuple consists of <text, image> - * image: - * place new images at extra/source/whatsnew - * do not forget to add the files to vcl/Package_whatsnew.mk - * images are cut-off at 600x400px -*/ - -const std::tuple<TranslateId, OUString> WELCOME_STRINGARRAY[] = -{ - { NC_("RID_CUI_WHATSNEW", "%PRODUCTNAME is a powerful and free office suite, used by millions of people around the world."), "LibreOffice.gif"}, - { NC_("RID_CUI_WHATSNEW", "%PRODUCTNAME uses the reliable and trustworthy standard open document format."), "ODF.png"}, - { NC_("RID_CUI_WHATSNEW", "%PRODUCTNAME blends into every operation system and provides full customization."), "Configurability.png"}, - { NC_("RID_CUI_WHATSNEW", "%PRODUCTNAME is open source: Your project, your data, your freedom."), "Community.png"}, -}; - -const std::tuple<TranslateId, OUString> WHATSNEW_STRINGARRAY[] = -{ - { NC_("RID_CUI_WHATSNEW", "Version 24.8 brings a shiny WhatsNew dialog :-)"), "whatsnew1.png"}, -}; - -#define STR_WELCOME NC_("STR_WELCOME", "Welcome to %PRODUCTNAME!") - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
\ No newline at end of file diff --git a/cui/source/dialogs/whatsnew.cxx b/cui/source/dialogs/whatsnew.cxx deleted file mode 100644 index 5136c62f33ca..000000000000 --- a/cui/source/dialogs/whatsnew.cxx +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include <whatsnew.hxx> -#include <whatsnew.hrc> - -#include <dialmgr.hxx> -#include <comphelper/DirectoryHelper.hxx> -#include <rtl/bootstrap.hxx> -#include <vcl/graphicfilter.hxx> -#include <vcl/svapp.hxx> -#include <vcl/gdimtf.hxx> - -constexpr tools::Long TEXT_HEIGHT(120); -constexpr tools::Long PROGRESS_DOTSIZE(24); -constexpr tools::Long PROGRESS_DOTSPACING(4); - -WhatsNewDialog::WhatsNewDialog(weld::Window* pParent, const bool bWelcome) - : GenericDialogController(pParent, u"cui/ui/whatsnewdialog.ui"_ustr, u"WhatsNewDialog"_ustr) - , m_bWelcome(bWelcome) - , m_aPreview() - , m_aProgress() - , m_pPrevBtn(m_xBuilder->weld_button(u"btnPrev"_ustr)) - , m_pNextBtn(m_xBuilder->weld_button(u"btnNext"_ustr)) - , m_pProgress(new weld::CustomWeld(*m_xBuilder, u"imProgress"_ustr, m_aProgress)) - , m_pImage(new weld::CustomWeld(*m_xBuilder, u"imNews"_ustr, m_aPreview)) -{ - if (m_bWelcome) - m_xDialog->set_title(CuiResId(STR_WELCOME)); - m_pPrevBtn->set_sensitive(false); - - m_pPrevBtn->connect_clicked(LINK(this, WhatsNewDialog, OnPrevClick)); - m_pNextBtn->connect_clicked(LINK(this, WhatsNewDialog, OnNextClick)); - - m_nNumberOfNews = m_bWelcome ? std::size(WELCOME_STRINGARRAY) : std::size(WHATSNEW_STRINGARRAY); - m_nCurrentNews = 0; - m_pNextBtn->set_sensitive(m_nNumberOfNews > 1); - m_pProgress->set_size_request(m_nNumberOfNews * (PROGRESS_DOTSIZE + PROGRESS_DOTSPACING), - PROGRESS_DOTSIZE + 1); - - LoadImage(); -} - -WhatsNewDialog::~WhatsNewDialog() {} - -void WhatsNewDialog::LoadImage() -{ - if (m_nCurrentNews < m_nNumberOfNews) - { - auto[sText, sImage] = m_bWelcome ? WELCOME_STRINGARRAY[m_nCurrentNews] - : WHATSNEW_STRINGARRAY[m_nCurrentNews]; - OUString aURL(u"$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/whatsnew/"_ustr); - rtl::Bootstrap::expandMacros(aURL); - - const bool bFileExists = comphelper::DirectoryHelper::fileExists(aURL + sImage); - if (!sImage.isEmpty() && bFileExists) - m_aPreview.Update(aURL + sImage, CuiResId(sText)); - - m_aProgress.Update(m_nCurrentNews, m_nNumberOfNews); - } -} - -IMPL_LINK_NOARG(WhatsNewDialog, OnPrevClick, weld::Button&, void) -{ - m_nCurrentNews--; - if (m_nCurrentNews == 0) - m_pPrevBtn->set_sensitive(false); - m_pNextBtn->set_sensitive(true); - LoadImage(); -} - -IMPL_LINK_NOARG(WhatsNewDialog, OnNextClick, weld::Button&, void) -{ - m_nCurrentNews++; - if (m_nCurrentNews == m_nNumberOfNews - 1) - m_pNextBtn->set_sensitive(false); - m_pPrevBtn->set_sensitive(true); - LoadImage(); -} - -void WhatsNewImg::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) -{ - const StyleSettings rSettings(Application::GetSettings().GetStyleSettings()); - - //clear - rRenderContext.SetBackground(Wallpaper(rSettings.GetDialogColor())); - rRenderContext.Erase(); - - //background image - Graphic aGraphic; - GraphicFilter::LoadGraphic(m_sImage, OUString(), aGraphic); - const Size aGraphicSize(aGraphic.GetSizePixel()); - - if (aGraphic.IsAnimated()) - aGraphic.StartAnimation(rRenderContext, Point(), aGraphicSize); - else - aGraphic.Draw(rRenderContext, Point(), aGraphicSize); - - tools::Rectangle aRect(Point(0, aGraphicSize.Height() - TEXT_HEIGHT), - Size(aGraphicSize.Width(), TEXT_HEIGHT)); - - //transparent text background - ScopedVclPtrInstance<VirtualDevice> aVDev; - GDIMetaFile aMetafile; - - aMetafile.Record(aVDev.get()); - aMetafile.SetPrefSize(aRect.GetSize()); - aVDev->SetOutputSize(aRect.GetSize()); - aVDev->SetBackground(Color(0x10, 0x68, 0x02)); - aVDev->Erase(); - aMetafile.Stop(); - - Gradient aVCLGradient; - aVCLGradient.SetStyle(css::awt::GradientStyle_LINEAR); - aVCLGradient.SetStartColor(COL_GRAY); - aVCLGradient.SetEndColor(COL_GRAY); - aVCLGradient.SetStartIntensity(33); - aVCLGradient.SetEndIntensity(66); - - rRenderContext.DrawTransparent(aMetafile, aRect.TopLeft(), aRect.GetSize(), aVCLGradient); - - //text - vcl::Font aFont = rRenderContext.GetFont(); - const Size aFontSize = aFont.GetFontSize(); - aFont.SetFontSize(Size(0, 24)); - aFont.SetColor(COL_WHITE); - aFont.SetWeight(WEIGHT_BOLD); - rRenderContext.SetFont(aFont); - - DrawTextFlags nDrawTextStyle(DrawTextFlags::MultiLine | DrawTextFlags::WordBreak - | DrawTextFlags::EndEllipsis); - const bool bIsRTL = rRenderContext.GetTextIsRTL(m_sText, 0, m_sText.getLength()); - if (bIsRTL) - nDrawTextStyle |= DrawTextFlags::Right; - - aRect.shrink(6); - aRect.setWidth(rRenderContext.GetOutputSizePixel().Width() - 12); - rRenderContext.DrawText(aRect, m_sText, nDrawTextStyle); - - aFont.SetFontSize(aFontSize); - aFont.SetWeight(WEIGHT_NORMAL); - rRenderContext.SetFont(aFont); -} - -void WhatsNewProgress::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) -{ - const StyleSettings rSettings(Application::GetSettings().GetStyleSettings()); - rRenderContext.SetBackground(rSettings.GetDialogColor()); - rRenderContext.Erase(); - rRenderContext.SetAntialiasing(AntialiasingFlags::Enable); - - tools::Rectangle aRect(Point(1, 1), Size(PROGRESS_DOTSIZE, PROGRESS_DOTSIZE)); - for (sal_Int32 i = 0; i < m_nTotal; i++) - { - if (i == m_nCurrent) - rRenderContext.SetFillColor(rSettings.GetAccentColor()); - else - rRenderContext.SetFillColor(COL_WHITE); - rRenderContext.DrawEllipse(aRect); - - aRect.AdjustLeft(PROGRESS_DOTSIZE + PROGRESS_DOTSPACING); - aRect.AdjustRight(PROGRESS_DOTSIZE + PROGRESS_DOTSPACING); - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
\ No newline at end of file diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index afd9f41b1616..e3556334e6a3 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -24,7 +24,6 @@ #include "dlgfact.hxx" #include <about.hxx> -#include <whatsnew.hxx> #include <sfx2/app.hxx> #include <sfx2/basedlgs.hxx> #include <sfx2/pageids.hxx> @@ -1533,19 +1532,6 @@ AbstractDialogFactory_Impl::CreateAboutDialog(weld::Window* pParent) } VclPtr<VclAbstractDialog> -AbstractDialogFactory_Impl::CreateWhatsNewDialog(weld::Window* pParent, const bool bWelcome) -{ -#if !ENABLE_WASM_STRIP_PINGUSER - return VclPtr<CuiAbstractControllerAsync_Impl>::Create( - std::make_shared<WhatsNewDialog>(pParent, bWelcome)); -#else - (void) pParent; - (void) bWelcome; - return nullptr; -#endif -} - -VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateTipOfTheDayDialog(weld::Window* pParent) { #if !ENABLE_WASM_STRIP_PINGUSER diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index a10837f6cd48..ca11ec7427dc 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -619,8 +619,6 @@ public: virtual VclPtr<VclAbstractDialog> CreateAboutDialog(weld::Window* pParent) override; - virtual VclPtr<VclAbstractDialog> CreateWhatsNewDialog(weld::Window* pParent, const bool bWelcome) override; - virtual VclPtr<VclAbstractDialog> CreateTipOfTheDayDialog(weld::Window* pParent) override; virtual VclPtr<VclAbstractDialog> CreateWidgetTestDialog(weld::Window* pParent) override; diff --git a/cui/source/inc/whatsnew.hxx b/cui/source/inc/whatsnew.hxx deleted file mode 100644 index 979fff919df2..000000000000 --- a/cui/source/inc/whatsnew.hxx +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#pragma once - -#include <vcl/customweld.hxx> -#include <vcl/weld.hxx> -#include "cuigrfflt.hxx" - -class WhatsNewImg : public weld::CustomWidgetController -{ - OUString m_sImage; - OUString m_sText; - virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override; - -public: - WhatsNewImg() {} - void Update(const OUString& sImage, const OUString& sText) - { - m_sImage = sImage; - m_sText = sText; - SetAccessibleName(m_sText); - Invalidate(); - } -}; - -class WhatsNewProgress : public weld::CustomWidgetController -{ - sal_Int32 m_nTotal; - sal_Int32 m_nCurrent; - virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override; - -public: - WhatsNewProgress() - : m_nTotal(0) - , m_nCurrent(0) - { - } - void Update(const sal_Int32 nCurrent, const sal_Int32 nTotal) - { - m_nTotal = nTotal; - m_nCurrent = nCurrent; - Invalidate(); - } -}; - -class WhatsNewDialog : public weld::GenericDialogController -{ -private: - const bool m_bWelcome; - - WhatsNewImg m_aPreview; - WhatsNewProgress m_aProgress; - - std::unique_ptr<weld::Button> m_pPrevBtn; - std::unique_ptr<weld::Button> m_pNextBtn; - std::unique_ptr<weld::CustomWeld> m_pProgress; - std::unique_ptr<weld::CustomWeld> m_pImage; - - DECL_LINK(OnPrevClick, weld::Button&, void); - DECL_LINK(OnNextClick, weld::Button&, void); - - void LoadImage(); // loads WHATSNEW_STRINGARRAY[m_nCurrentNews] - - sal_Int32 m_nNumberOfNews; - sal_Int32 m_nCurrentNews; - -public: - WhatsNewDialog(weld::Window* pParent, const bool bWelcome); - virtual ~WhatsNewDialog() override; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/uiconfig/ui/whatsnewdialog.ui b/cui/uiconfig/ui/whatsnewdialog.ui deleted file mode 100644 index 0a4949c398bf..000000000000 --- a/cui/uiconfig/ui/whatsnewdialog.ui +++ /dev/null @@ -1,131 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.40.0 --> -<interface domain="cui"> - <requires lib="gtk+" version="3.20"/> - <object class="GtkDialog" id="WhatsNewDialog"> - <property name="can-focus">False</property> - <property name="border-width">6</property> - <property name="title" translatable="yes" context="whatsnewdialog|WhatsNewDialog">What's new in %PRODUCTVERSION</property> - <property name="resizable">False</property> - <property name="modal">True</property> - <property name="window-position">center-on-parent</property> - <property name="type-hint">dialog</property> - <child internal-child="vbox"> - <object class="GtkBox"> - <property name="can-focus">False</property> - <property name="orientation">vertical</property> - <property name="spacing">12</property> - <child internal-child="action_area"> - <object class="GtkButtonBox"> - <property name="can-focus">False</property> - <property name="margin-top">12</property> - <property name="hexpand">True</property> - <property name="layout-style">end</property> - <child> - <object class="GtkButton" id="btnClose"> - <property name="label" translatable="yes" context="stock">_Close</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">True</property> - <property name="fill">True</property> - <property name="pack-type">end</property> - <property name="position">3</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack-type">end</property> - <property name="position">0</property> - </packing> - </child> - <child> - <!-- n-columns=3 n-rows=2 --> - <object class="GtkGrid" id="grid"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <child> - <object class="GtkDrawingArea" id="imNews"> - <property name="width-request">600</property> - <property name="height-request">400</property> - <property name="visible">True</property> - <property name="can-focus">False</property> - <child internal-child="accessible"> - <object class="AtkObject" id="imNews-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="whatsnewdialog|extended_tip|news">Picture illustrating what is new</property> - </object> - </child> - </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">0</property> - <property name="width">3</property> - </packing> - </child> - <child> - <object class="GtkButton" id="btnPrev"> - <property name="label" translatable="yes" context="whatsnewdialog|prev">Previous</property> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">True</property> - <property name="halign">end</property> - <property name="valign">center</property> - <property name="use-underline">True</property> - </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">1</property> - </packing> - </child> - <child> - <object class="GtkButton" id="btnNext"> - <property name="label" translatable="yes" context="whatsnewdialog|next">Next</property> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">True</property> - <property name="halign">start</property> - <property name="valign">center</property> - <property name="use-underline">True</property> - <property name="image-position">right</property> - </object> - <packing> - <property name="left-attach">2</property> - <property name="top-attach">1</property> - </packing> - </child> - <child> - <object class="GtkDrawingArea" id="imProgress"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="halign">center</property> - <property name="valign">center</property> - <child internal-child="accessible"> - <object class="AtkObject" id="imProgress-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="whatsnewdialog|extended_tip|progress">Progress of news</property> - </object> - </child> - </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - </child> - <action-widgets> - <action-widget response="-7">btnClose</action-widget> - </action-widgets> - </object> -</interface> |