8#include "insertimagedialog.h"
9#include "insertimagewidget.h"
11#include <KLocalizedString>
14#include <QDialogButtonBox>
20class InsertImageDialogPrivate
23 explicit InsertImageDialogPrivate(InsertImageDialog *qq)
26 auto vbox =
new QVBoxLayout(q);
27 q->setWindowTitle(
i18nc(
"@title:window",
"Insert Image"));
29 imageWidget =
new InsertImageWidget(q);
30 vbox->addWidget(imageWidget);
31 q->connect(imageWidget, &InsertImageWidget::enableButtonOk, q, [
this](
bool b) {
32 _k_slotEnabledButtonChanged(b);
36 okButton->setText(
i18n(
"Insert"));
38 vbox->addWidget(buttonBox);
42 okButton->setEnabled(
false);
45 void _k_slotEnabledButtonChanged(
bool enabled)
47 okButton->setEnabled(enabled);
50 InsertImageWidget *imageWidget =
nullptr;
51 QPushButton *okButton =
nullptr;
52 InsertImageDialog *
const q;
55InsertImageDialog::InsertImageDialog(QWidget *parent)
57 , d(new InsertImageDialogPrivate(this))
61InsertImageDialog::~InsertImageDialog() =
default;
63int InsertImageDialog::imageWidth()
const
65 return d->imageWidget->imageWidth();
68int InsertImageDialog::imageHeight()
const
70 return d->imageWidget->imageHeight();
73void InsertImageDialog::setImageWidth(
int value)
75 d->imageWidget->setImageWidth(value);
78void InsertImageDialog::setImageHeight(
int value)
80 d->imageWidget->setImageHeight(value);
83QUrl InsertImageDialog::imageUrl()
const
85 return d->imageWidget->imageUrl();
88void InsertImageDialog::setImageUrl(
const QUrl &url)
90 d->imageWidget->setImageUrl(url);
93bool InsertImageDialog::keepOriginalSize()
const
95 return d->imageWidget->keepOriginalSize();
98#include "moc_insertimagedialog.cpp"
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)