Kaydet (Commit) a1700d52 authored tarafından heiko tietze's avatar heiko tietze Kaydeden (comit) Heiko Tietze

tdf#124238 - Show a Tip-Of-The-Day dialog on startup

New dialog

Change-Id: If1e501de26eb5a9c20a59e621f9e805c3b5e2cf8
Reviewed-on: https://gerrit.libreoffice.org/69498
Tested-by: Jenkins
Reviewed-by: 's avatarHeiko Tietze <tietze.heiko@gmail.com>
üst 3d7a67cd
......@@ -945,6 +945,7 @@ $(eval $(call gb_Helper_register_packages_for_install,ooo,\
wizards_basicusr \
wizards_properties \
wizards_wizardshare \
tipoftheday_images \
vcl_opengl_shader \
vcl_theme_definitions \
$(if $(filter WNT,$(OS)), \
......
......@@ -115,6 +115,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
cui/source/dialogs/hltpbase \
cui/source/dialogs/hyphen \
cui/source/dialogs/iconcdlg \
cui/source/dialogs/tipofthedaydlg \
cui/source/dialogs/insdlg \
cui/source/dialogs/insrc \
cui/source/dialogs/linkdlg \
......
......@@ -87,6 +87,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/hyphenate \
cui/uiconfig/ui/iconchangedialog \
cui/uiconfig/ui/iconselectordialog \
cui/uiconfig/ui/tipofthedaydialog \
cui/uiconfig/ui/insertfloatingframe \
cui/uiconfig/ui/insertoleobject \
cui/uiconfig/ui/insertrowcolumn \
......
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <tipofthedaydlg.hxx>
#include <config_folders.h>
#include <dialmgr.hxx>
#include <officecfg/Office/Common.hxx>
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
#include <tipoftheday.hrc>
#include <vcl/graphicfilter.hxx>
#include <vcl/virdev.hxx>
TipOfTheDayDialog::TipOfTheDayDialog(weld::Window* pParent)
: GenericDialogController(pParent, "cui/ui/tipofthedaydialog.ui", "TipOfTheDayDialog")
, m_pImage(m_xBuilder->weld_image("imImage"))
, m_pText(m_xBuilder->weld_label("lbText"))
, m_pShowTip(m_xBuilder->weld_check_button("cbShowTip"))
, m_pNext(m_xBuilder->weld_button("btnNext"))
, m_pLink(m_xBuilder->weld_link_button("btnLink"))
{
m_pShowTip->connect_toggled(LINK(this, TipOfTheDayDialog, OnShowTipToggled));
m_pNext->connect_clicked(LINK(this, TipOfTheDayDialog, OnNextClick));
nNumberOfTips = SAL_N_ELEMENTS(TIPOFTHEDAY_STRINGARRAY);
nCurrentTip = rand() % nNumberOfTips;
UpdateTip();
}
TipOfTheDayDialog::~TipOfTheDayDialog()
{
std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
comphelper::ConfigurationChanges::create());
const auto t0 = std::chrono::system_clock::now().time_since_epoch();
const sal_Int32 nDay
= std::chrono::duration_cast<std::chrono::hours>(t0).count() / 24; // days since 1970-01-01
officecfg::Office::Common::Misc::LastTipOfTheDayShown::set(nDay, xChanges);
xChanges->commit();
}
static bool file_exists(const OUString& fileName)
{
::osl::File aFile(fileName);
return aFile.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None;
}
void TipOfTheDayDialog::UpdateTip()
{
//get string
OUString aText;
aText = CuiResId(TIPOFTHEDAY_STRINGARRAY[nCurrentTip]);
//move hyperlink into linkbutton
sal_Int32 nPos = aText.indexOf("http");
if (nPos > 0)
{
m_pLink->set_visible(true);
if (aText.getLength() - nPos > 40)
m_pLink->set_label(aText.copy(nPos, 40) + "...");
else
m_pLink->set_label(aText.copy(nPos));
m_pLink->set_uri(aText.copy(nPos));
aText = aText.copy(0, nPos - 1);
}
else
m_pLink->set_visible(false);
m_pText->set_label(aText);
// import the image
OUString aURL("$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/tipoftheday/");
rtl::Bootstrap::expandMacros(aURL);
OUString aName = "tipoftheday_" + OUString::number(nCurrentTip) + ".png";
// use default image if none is available with the number
if (!file_exists(aURL + aName))
aName = "tipoftheday.png";
// draw image
Graphic aGraphic;
if (GraphicFilter::LoadGraphic(aURL + aName, OUString(), aGraphic) == ERRCODE_NONE)
{
ScopedVclPtr<VirtualDevice> m_pVirDev;
m_pVirDev = m_pImage->create_virtual_device();
m_pVirDev->SetOutputSizePixel(aGraphic.GetSizePixel());
m_pVirDev->DrawBitmapEx(Point(0, 0), aGraphic.GetBitmapEx());
m_pImage->set_image(m_pVirDev.get());
m_pVirDev.disposeAndClear();
}
}
IMPL_STATIC_LINK(TipOfTheDayDialog, OnShowTipToggled, weld::ToggleButton&, rButton, void)
{
std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
comphelper::ConfigurationChanges::create());
officecfg::Office::Common::Misc::ShowTipOfTheDay::set(rButton.get_active(), xChanges);
xChanges->commit();
}
IMPL_LINK_NOARG(TipOfTheDayDialog, OnNextClick, weld::Button&, void)
{
nCurrentTip = rand() % nNumberOfTips;
UpdateTip();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
......@@ -50,6 +50,7 @@
#include <thesdlg.hxx>
#include <hangulhanjadlg.hxx>
#include <dstribut.hxx>
#include <tipofthedaydlg.hxx>
#include "dlgfact.hxx"
#include <sal/types.h>
......
......@@ -88,6 +88,7 @@
#include <hyphen.hxx>
#include <thesdlg.hxx>
#include <about.hxx>
#include <tipofthedaydlg.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::frame;
......@@ -1344,6 +1345,11 @@ short SvxMacroAssignDialog::Execute()
return m_xDialog->run();
}
short AbstractTipOfTheDayDialog_Impl::Execute()
{
return m_xDlg->run();
}
VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateSvxMacroAssignDlg(
weld::Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode,
const Reference< XNameReplace >& _rxEvents, const sal_uInt16 _nInitiallySelectedEvent )
......@@ -1588,4 +1594,10 @@ AbstractDialogFactory_Impl::CreateSignSignatureLineDialog(weld::Window* pParent,
std::make_unique<SignSignatureLineDialog>(pParent, xModel));
}
VclPtr<AbstractTipOfTheDayDialog>
AbstractDialogFactory_Impl::CreateTipOfTheDayDialog(weld::Window* pParent)
{
return VclPtr<AbstractTipOfTheDayDialog_Impl>::Create(std::make_unique<TipOfTheDayDialog>(pParent));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -658,6 +658,20 @@ public:
virtual short Execute() override;
};
class TipOfTheDayDialog;
class AbstractTipOfTheDayDialog_Impl : public AbstractTipOfTheDayDialog
{
protected:
std::unique_ptr<TipOfTheDayDialog> m_xDlg;
public:
explicit AbstractTipOfTheDayDialog_Impl(std::unique_ptr<TipOfTheDayDialog> p)
: m_xDlg(std::move(p))
{
}
virtual short Execute() override;
};
//AbstractDialogFactory_Impl implementations
class AbstractDialogFactory_Impl : public SvxAbstractDialogFactory
{
......@@ -836,6 +850,8 @@ public:
virtual VclPtr<AbstractSignSignatureLineDialog>
CreateSignSignatureLineDialog(weld::Window* pParent,
const css::uno::Reference<css::frame::XModel> xModel) override;
virtual VclPtr<AbstractTipOfTheDayDialog> CreateTipOfTheDayDialog(weld::Window* pParent) override;
};
#endif
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_CUI_SOURCE_INC_TIPOFTHEDAYDLG_HXX
#define INCLUDED_CUI_SOURCE_INC_TIPOFTHEDAYDLG_HXX
#include <vcl/weld.hxx>
class TipOfTheDayDialog : public weld::GenericDialogController
{
private:
std::unique_ptr<weld::Image> m_pImage;
std::unique_ptr<weld::Label> m_pText;
std::unique_ptr<weld::CheckButton> m_pShowTip;
std::unique_ptr<weld::Button> m_pNext;
std::unique_ptr<weld::LinkButton> m_pLink;
sal_uInt32 nCurrentTip;
sal_uInt32 nNumberOfTips;
void UpdateTip();
DECL_STATIC_LINK(TipOfTheDayDialog, OnShowTipToggled, weld::ToggleButton&, void);
DECL_LINK(OnNextClick, weld::Button&, void);
public:
TipOfTheDayDialog(weld::Window* pWindow);
virtual ~TipOfTheDayDialog() override;
};
#endif // INCLUDED_CUI_SOURCE_INC_TIPOFTHEDAYDLG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -260,6 +260,7 @@ OfaMiscTabPage::OfaMiscTabPage(TabPageParent pParent, const SfxItemSet& rSet)
: SfxTabPage(pParent, "cui/ui/optgeneralpage.ui", "OptGeneralPage", &rSet)
, m_xExtHelpCB(m_xBuilder->weld_check_button("exthelp"))
, m_xPopUpNoHelpCB(m_xBuilder->weld_check_button("popupnohelp"))
, m_xShowTipOfTheDay(m_xBuilder->weld_check_button("cbShowTipOfTheDay"))
, m_xFileDlgFrame(m_xBuilder->weld_widget("filedlgframe"))
, m_xPrintDlgFrame(m_xBuilder->weld_widget("printdlgframe"))
, m_xFileDlgROImage(m_xBuilder->weld_widget("lockimage"))
......@@ -329,6 +330,12 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet )
if ( m_xExtHelpCB->get_state_changed_from_saved() )
aHelpOptions.SetExtendedHelp( m_xExtHelpCB->get_active() );
if ( m_xShowTipOfTheDay->get_state_changed_from_saved() )
{
officecfg::Office::Common::Misc::ShowTipOfTheDay::set(m_xShowTipOfTheDay->get_active(), batch);
bModified = true;
}
if ( m_xFileDlgCB->get_state_changed_from_saved() )
{
SvtMiscOptions aMiscOpt;
......@@ -382,6 +389,8 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet )
m_xExtHelpCB->save_state();
m_xPopUpNoHelpCB->set_active( aHelpOptions.IsOfflineHelpPopUp() );
m_xPopUpNoHelpCB->save_state();
m_xShowTipOfTheDay->set_active( officecfg::Office::Common::Misc::ShowTipOfTheDay::get() );
m_xShowTipOfTheDay->save_state();
SvtMiscOptions aMiscOpt;
m_xFileDlgCB->set_active( !aMiscOpt.UseSystemFileDialog() );
m_xFileDlgCB->save_state();
......
......@@ -44,6 +44,7 @@ private:
std::unique_ptr<weld::CheckButton> m_xExtHelpCB;
std::unique_ptr<weld::CheckButton> m_xPopUpNoHelpCB;
std::unique_ptr<weld::CheckButton> m_xShowTipOfTheDay;
std::unique_ptr<weld::Widget> m_xFileDlgFrame;
std::unique_ptr<weld::Widget> m_xPrintDlgFrame;
std::unique_ptr<weld::Widget> m_xFileDlgROImage;
......
......@@ -59,6 +59,20 @@
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="cbShowTipOfTheDay">
<property name="label" translatable="yes" context="optgeneralpage|TipOfTheDayCheckbox">Show "Tip of the day" Dialog on Start-up</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>
</child>
</object>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="TipOfTheDayDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="TipOfTheDayDialog|Name">Tip of the day</property>
<property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkCheckButton" id="cbShowTip">
<property name="label" translatable="yes" context="TipOfTheDay|Checkbox">_Show tips on startup</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes" context="TipOfTheDay|Checkbox_Tooltip">Enable the dialog again at Tools &gt; Options &gt; General</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btnNext">
<property name="label" translatable="yes" context="TipOfTheDayDialog|Next_Button">_Next Tip</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="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btnOk">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</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>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="imImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">12</property>
<property name="margin_right">12</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lbTitle">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">12</property>
<property name="label" translatable="yes" context="TipOfTheDayDialog|Title">Did you know?</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.5"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbText">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<property name="wrap">True</property>
<property name="max_width_chars">50</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="btnLink">
<property name="label" translatable="yes" context="TipOfTheDayDialog|Link_Button">Link</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-5">btnOk</action-widget>
</action-widgets>
</object>
</interface>
......@@ -119,6 +119,12 @@ protected:
virtual ~AbstractSignSignatureLineDialog() override = default;
};
class VCL_DLLPUBLIC AbstractTipOfTheDayDialog : public VclAbstractDialog
{
protected:
virtual ~AbstractTipOfTheDayDialog() override = default;
};
class VCL_DLLPUBLIC VclAbstractDialogFactory
{
public:
......@@ -147,6 +153,10 @@ public:
virtual VclPtr<AbstractScreenshotAnnotationDlg> CreateScreenshotAnnotationDlg(
vcl::Window* pParent,
Dialog& rParentDialog) = 0;
// create info dialog to show tip-of-the-day
virtual VclPtr<AbstractTipOfTheDayDialog>
CreateTipOfTheDayDialog(weld::Window* pParent) = 0;
};
#endif
......
......@@ -1089,6 +1089,7 @@ class VCL_DLLPUBLIC Image : virtual public Widget
{
public:
virtual void set_from_icon_name(const OUString& rIconName) = 0;
virtual void set_image(VirtualDevice* pDevice) = 0;
};
class VCL_DLLPUBLIC Calendar : virtual public Widget
......
......@@ -5458,6 +5458,19 @@
</info>
<value>false</value>
</prop>
<prop oor:name="ShowTipOfTheDay" oor:type="xs:boolean" oor:nillable="false">
<!-- UIHints: Tools - Options - General -->
<info>
<desc>Determines whether the Tip-Of-The-Day dialog is shown on startup.</desc>
</info>
<value>true</value>
</prop>
<prop oor:name="LastTipOfTheDayShown" oor:type="xs:int" oor:nillable="false">
<info>
<desc>The last time when the Tip-of-the-day dialog was shown.</desc>
</info>
<value>0</value>
</prop>
<prop oor:name="UseOpenCL" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Determines whether OpenCL can be used, when available, to speed up
......
......@@ -1219,9 +1219,30 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
rBind.Invalidate( SID_RELOAD );
rBind.Invalidate( SID_EDITDOC );
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;
}
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();
VclPtr<VclAbstractDialog> pDlg =
pFact->CreateTipOfTheDayDialog( GetWindow().GetFrameWeld() );
pDlg->Execute();
}
}
// inform about the community involvement
const sal_Int64 nLastGetInvolvedShown = officecfg::Setup::Product::LastTimeGetInvolvedShown::get();
const sal_Int64 nNow = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch()).count();
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;
......
......@@ -245,6 +245,8 @@ cui/uiconfig/ui/hyphenate.ui://GtkButton[@id='right'] button-no-label
cui/uiconfig/ui/iconchangedialog.ui://GtkTextView[@id='addrTextview'] no-labelled-by
cui/uiconfig/ui/iconchangedialog.ui://GtkLabel[@id='label1'] orphan-label
cui/uiconfig/ui/iconselectordialog.ui://GtkLabel[@id='noteLabel'] orphan-label
cui/uiconfig/ui/tipofthedaydialog.ui://GtkLabel[@id='lbTitle'] orphan-label
cui/uiconfig/ui/tipofthedaydialog.ui://GtkLabel[@id='lbText'] orphan-label
cui/uiconfig/ui/insertfloatingframe.ui://GtkEntry[@id='edname'] no-labelled-by
cui/uiconfig/ui/insertfloatingframe.ui://GtkEntry[@id='edurl'] no-labelled-by
cui/uiconfig/ui/insertfloatingframe.ui://GtkLabel[@id='label6'] orphan-label
......
......@@ -23,6 +23,7 @@ $(eval $(call gb_Module_add_targets,vcl,\
Library_vcl \
Package_opengl \
Package_theme_definitions \
Package_tipoftheday \
UIConfig_vcl \
$(if $(filter WNT,$(OS)), \
Package_opengl_blacklist ) \
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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/.
#
$(eval $(call gb_Package_Package,tipoftheday_images,extras/source/tipoftheday))
$(eval $(call gb_Package_add_files_with_dir,tipoftheday_images,$(LIBO_SHARE_FOLDER)/tipoftheday,\
tipoftheday.png \
tipoftheday_1.png \
tipoftheday_2.png \
))
# vim: set noet sw=4 ts=4:
......@@ -2023,6 +2023,11 @@ public:
{
m_xImage->SetImage(::Image(StockImage::Yes, rIconName));
}
virtual void set_image(VirtualDevice* pDevice) override
{
m_xImage->SetImage(createImage(*pDevice));
}
};
class SalInstanceCalendar : public SalInstanceWidget, public virtual weld::Calendar
......
......@@ -5109,6 +5109,18 @@ public:
gtk_image_set_from_pixbuf(m_pImage, pixbuf);
g_object_unref(pixbuf);
}
virtual void set_image(VirtualDevice* pDevice) override
{
if (gtk_check_version(3, 20, 0) == nullptr)
gtk_image_set_from_surface(m_pImage, get_underlying_cairo_surface(*pDevice));
else
{
GdkPixbuf* pixbuf = getPixbuf(*pDevice);
gtk_image_set_from_pixbuf(m_pImage, pixbuf);
g_object_unref(pixbuf);
}
}
};
class GtkInstanceCalendar : public GtkInstanceWidget, public virtual weld::Calendar
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment