summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-21 11:01:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-03-21 16:08:29 +0100
commit8d55371997dd1e98a602b397fa86f20481119047 (patch)
treef10127e68c4ebcec309f4cfb9342c2b63395e322
parent417d26291cd13c861e8f6262d0fb6afa026f015c (diff)
add optional helpid to add_button
Change-Id: I9606d0788c78397feb0840463991c5498e759b5a Reviewed-on: https://gerrit.libreoffice.org/51703 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/vcl/weld.hxx3
-rw-r--r--vcl/source/app/salvtables.cxx3
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx6
3 files changed, 8 insertions, 4 deletions
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 1d0e3f390076..58b0ddd80284 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -135,7 +135,8 @@ private:
public:
virtual int run() = 0;
virtual void response(int response) = 0;
- virtual void add_button(const OUString& rText, int response) = 0;
+ virtual void add_button(const OUString& rText, int response, const OString& rHelpId = OString())
+ = 0;
virtual void set_default_response(int response) = 0;
};
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 63db48d4a1de..52ff2baf67a7 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -468,11 +468,12 @@ public:
m_xDialog->EndDialog(nResponse);
}
- virtual void add_button(const OUString& rText, int nResponse) override
+ virtual void add_button(const OUString& rText, int nResponse, const OString& rHelpId) override
{
VclButtonBox* pBox = m_xDialog->get_action_area();
VclPtr<PushButton> xButton(VclPtr<PushButton>::Create(pBox, WB_CLIPCHILDREN|WB_CENTER|WB_VCENTER));
xButton->SetText(rText);
+ xButton->SetHelpId(rHelpId);
xButton->Show();
m_xDialog->add_button(xButton, nResponse, true);
}
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 3c825d167061..49581bb180e8 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1635,9 +1635,11 @@ public:
gtk_dialog_response(m_pDialog, VclToGtk(nResponse));
}
- virtual void add_button(const OUString& rText, int nResponse) override
+ virtual void add_button(const OUString& rText, int nResponse, const OString& rHelpId) override
{
- gtk_dialog_add_button(m_pDialog, MapToGtkAccelerator(rText).getStr(), VclToGtk(nResponse));
+ GtkWidget* pWidget = gtk_dialog_add_button(m_pDialog, MapToGtkAccelerator(rText).getStr(), VclToGtk(nResponse));
+ if (!rHelpId.isEmpty())
+ ::set_help_id(pWidget, rHelpId);
}
virtual void set_default_response(int nResponse) override