Kaydet (Commit) 8d553719 authored tarafından Caolán McNamara's avatar Caolán McNamara

add optional helpid to add_button

Change-Id: I9606d0788c78397feb0840463991c5498e759b5a
Reviewed-on: https://gerrit.libreoffice.org/51703Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 417d2629
...@@ -135,7 +135,8 @@ private: ...@@ -135,7 +135,8 @@ private:
public: public:
virtual int run() = 0; virtual int run() = 0;
virtual void response(int response) = 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; virtual void set_default_response(int response) = 0;
}; };
......
...@@ -468,11 +468,12 @@ public: ...@@ -468,11 +468,12 @@ public:
m_xDialog->EndDialog(nResponse); 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(); VclButtonBox* pBox = m_xDialog->get_action_area();
VclPtr<PushButton> xButton(VclPtr<PushButton>::Create(pBox, WB_CLIPCHILDREN|WB_CENTER|WB_VCENTER)); VclPtr<PushButton> xButton(VclPtr<PushButton>::Create(pBox, WB_CLIPCHILDREN|WB_CENTER|WB_VCENTER));
xButton->SetText(rText); xButton->SetText(rText);
xButton->SetHelpId(rHelpId);
xButton->Show(); xButton->Show();
m_xDialog->add_button(xButton, nResponse, true); m_xDialog->add_button(xButton, nResponse, true);
} }
......
...@@ -1635,9 +1635,11 @@ public: ...@@ -1635,9 +1635,11 @@ public:
gtk_dialog_response(m_pDialog, VclToGtk(nResponse)); 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 virtual void set_default_response(int nResponse) override
......
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