summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/backingwindow.cxx18
-rw-r--r--sfx2/source/dialog/backingwindow.hxx3
-rw-r--r--sfx2/uiconfig/ui/startcenter.ui47
3 files changed, 59 insertions, 9 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index 3c90d1ea2ade..b16a0abce44a 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -170,6 +170,7 @@ BackingWindow::BackingWindow(vcl::Window* i_pParent)
, mxBrandImageWeld(new weld::CustomWeld(*m_xBuilder, u"daBrand"_ustr, *mxBrandImage))
, mxHelpButton(m_xBuilder->weld_button(u"help"_ustr))
, mxExtensionsButton(m_xBuilder->weld_button(u"extensions"_ustr))
+ , mxDonateButton(m_xBuilder->weld_button(u"donate"_ustr))
, mxAllButtonsBox(m_xBuilder->weld_container(u"all_buttons_box"_ustr))
, mxButtonsBox(m_xBuilder->weld_container(u"buttons_box"_ustr))
, mxSmallButtonsBox(m_xBuilder->weld_container(u"small_buttons_box"_ustr))
@@ -193,17 +194,19 @@ BackingWindow::BackingWindow(vcl::Window* i_pParent)
mxHelpButton->set_label(mxAltHelpLabel->get_label());
mxHelpButton->connect_clicked(LINK(this, BackingWindow, ClickHelpHdl));
- // tdf#161796 make the extension button show the donation page
+ // tdf#161796 replace the extension button with a donate button
if (officecfg::Office::Common::Misc::ShowDonation::get())
{
- mxExtensionsButton->set_from_icon_name(BMP_DONATE); // icon first needed on gtk3 to apply the label
+ mxExtensionsButton->hide();
+ mxDonateButton->show();
+ mxDonateButton->set_from_icon_name(BMP_DONATE);
OUString sDonate(SfxResId(STR_DONATE_BUTTON));
if (sDonate.getLength() > 8)
{
- mxExtensionsButton->set_tooltip_text(sDonate);
+ mxDonateButton->set_tooltip_text(sDonate);
sDonate = OUString::Concat(sDonate.subView(0, 7)) + "...";
}
- mxExtensionsButton->set_label(sDonate);
+ mxDonateButton->set_label(sDonate);
}
mxDropTarget = mxAllRecentThumbnails->GetDropTarget();
@@ -266,6 +269,7 @@ void BackingWindow::dispose()
mxBrandImageWeld.reset();
mxBrandImage.reset();
mxHelpButton.reset();
+ mxDonateButton.reset();
mxExtensionsButton.reset();
mxAllButtonsBox.reset();
mxButtonsBox.reset();
@@ -321,6 +325,7 @@ void BackingWindow::initControls()
checkInstalledModules();
mxExtensionsButton->connect_clicked(LINK(this, BackingWindow, ExtLinkClickHdl));
+ mxDonateButton->connect_clicked(LINK(this, BackingWindow, ExtLinkClickHdl));
mxOpenButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));
@@ -543,11 +548,8 @@ void BackingWindow::setOwningFrame( const css::uno::Reference< css::frame::XFram
xFramesSupplier->setActiveFrame(mxFrame);
}
-IMPL_LINK(BackingWindow, ExtLinkClickHdl, weld::Button&, rButton,void)
+IMPL_STATIC_LINK_NOARG(BackingWindow, ExtLinkClickHdl, weld::Button&, void)
{
- if (&rButton != mxExtensionsButton.get())
- return;
-
try
{
OUString sURL;
diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx
index 9fda28572c92..e8ac74f6a143 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -68,6 +68,7 @@ class BackingWindow : public InterimItemWindow
std::unique_ptr<weld::Button> mxHelpButton;
std::unique_ptr<weld::Button> mxExtensionsButton;
+ std::unique_ptr<weld::Button> mxDonateButton;
std::unique_ptr<weld::Container> mxAllButtonsBox;
std::unique_ptr<weld::Container> mxButtonsBox;
@@ -95,7 +96,7 @@ class BackingWindow : public InterimItemWindow
DECL_LINK(ClickHdl, weld::Button&, void);
DECL_LINK(ClickHelpHdl, weld::Button&, void);
DECL_LINK(MenuSelectHdl, const OUString&, void);
- DECL_LINK(ExtLinkClickHdl, weld::Button&, void);
+ DECL_STATIC_LINK(BackingWindow, ExtLinkClickHdl, weld::Button&, void);
DECL_LINK(CreateContextMenuHdl, ThumbnailViewItem*, void);
DECL_LINK(OpenTemplateHdl, ThumbnailViewItem*, void);
DECL_LINK(EditTemplateHdl, ThumbnailViewItem*, void);
diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui
index 657b1984006f..ea407c1a2df8 100644
--- a/sfx2/uiconfig/ui/startcenter.ui
+++ b/sfx2/uiconfig/ui/startcenter.ui
@@ -444,6 +444,53 @@
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="donate">
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
+ <property name="relief">none</property>
+ <property name="use-underline">True</property>
+ <property name="always-show-image">True</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkImage" id="donate_image">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">res/donate.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" comments="Translated via STR_DONATE_BUTTON">Donate</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </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>