MCPcopy Create free account
hub / github.com/KDE/konsole / ZModemDialog

Method ZModemDialog

src/ZModemDialog.cpp:18–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16using Konsole::ZModemDialog;
17
18ZModemDialog::ZModemDialog(QWidget *aParent, bool modal, const QString &caption)
19 : QDialog(aParent)
20 , _textEdit(nullptr)
21 , mButtonBox(nullptr)
22{
23 setObjectName(QStringLiteral("zmodem_progress"));
24 setModal(modal);
25 setWindowTitle(caption);
26
27 mButtonBox = new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Close);
28 auto mainWidget = new QWidget(this);
29 auto mainLayout = new QVBoxLayout;
30 setLayout(mainLayout);
31 mainLayout->addWidget(mainWidget);
32 mainLayout->addWidget(mButtonBox);
33
34 // Use Cancel here to stop the transfer
35 mButtonBox->button(QDialogButtonBox::Cancel)->setEnabled(true);
36 mButtonBox->button(QDialogButtonBox::Close)->setEnabled(false);
37
38 connect(mButtonBox, &QDialogButtonBox::rejected, this, &Konsole::ZModemDialog::slotCancel);
39 connect(mButtonBox, &QDialogButtonBox::accepted, this, &Konsole::ZModemDialog::slotClose);
40
41 _textEdit = new KTextEdit(this);
42 _textEdit->setMinimumSize(400, 100);
43 _textEdit->setReadOnly(true);
44 mainLayout->addWidget(_textEdit);
45
46 addText(QStringLiteral("Note: pressing Cancel will almost certainly cause the terminal to be unusable."));
47 addText(QStringLiteral("-----------------"));
48}
49
50void ZModemDialog::addText(const QString &text)
51{

Callers

nothing calls this directly

Calls 2

setEnabledMethod · 0.80
setReadOnlyMethod · 0.80

Tested by

no test coverage detected