Files
libreoffice/vcl/inc/qt5/QtInstanceMessageDialog.hxx
Michael Weghorn 3b6688fe11 weld: Rename weld::Dialog::{widget -> button}_for_response
Rename weld::Dialog::widget_for_response to
weld::Dialog_button_for_response as it specifically
returns a weld::Button, not a generic weld::Widget (other than GTK's
`gtk_dialog_get_widget_for_response` [1] which
returns a GtkWidget).

[1] https://docs.gtk.org/gtk3/method.Dialog.get_widget_for_response.html

Change-Id: I3b1dc34c0af752853551d2ebb706109f2214720d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177376
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-27 08:21:50 +01:00

54 lines
1.7 KiB
C++

/* -*- 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 "QtInstanceButton.hxx"
#include "QtInstanceDialog.hxx"
#include <QtWidgets/QMessageBox>
class QtInstanceMessageDialog : public QtInstanceDialog, public virtual weld::MessageDialog
{
Q_OBJECT
private:
QMessageBox* m_pMessageDialog;
// widget containing a layout to add additional items
QWidget* m_pExtraControlsContainer;
public:
QtInstanceMessageDialog(QMessageBox* pMessageDialog);
virtual void set_primary_text(const rtl::OUString& rText) override;
virtual void set_secondary_text(const rtl::OUString& rText) override;
virtual std::unique_ptr<weld::Container> weld_message_area() override;
virtual OUString get_primary_text() const override;
virtual OUString get_secondary_text() const override;
// weld::Dialog overrides
virtual void add_button(const OUString& rText, int nResponse,
const OUString& rHelpId = {}) override;
virtual void set_default_response(int nResponse) override;
std::unique_ptr<weld::Button> weld_button_for_response(int nResponse) override;
virtual int run() override;
private:
QWidget* addWidgetForExtraItems();
virtual QPushButton* buttonForResponseCode(int nResponse);
protected slots:
virtual void dialogFinished(int nResult) override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */