• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Konsole

  • kde-4.14
  • applications
  • konsole
  • src
ZModemDialog.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  * Copyright 2002 Waldo Bastian <bastian@kde.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License version 2 as published by the Free Software Foundation;
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Library General Public License for more details.
12  *
13  * You should have received a copy of the GNU Library General Public License
14  * along with this library; see the file COPYING.LIB. If not, write to
15  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  * Boston, MA 02110-1301, USA.
17  **/
18 
19 // Own
20 #include "ZModemDialog.h"
21 
22 // KDE
23 #include <KLocalizedString>
24 #include <KTextEdit>
25 
26 using Konsole::ZModemDialog;
27 
28 ZModemDialog::ZModemDialog(QWidget* aParent, bool modal, const QString& caption)
29  : KDialog(aParent)
30 {
31  setObjectName(QLatin1String("zmodem_progress"));
32  setModal(modal);
33  setCaption(caption);
34 
35  setButtons(KDialog::User1 | KDialog::Close);
36  setButtonGuiItem(KDialog::User1, KGuiItem(i18n("&Stop")));
37  setDefaultButton(KDialog::Close);
38  setEscapeButton(KDialog::User1);
39  enableButton(KDialog::Close, false);
40 
41  _textEdit = new KTextEdit(this);
42  _textEdit->setMinimumSize(400, 100);
43  _textEdit->setReadOnly(true);
44  setMainWidget(_textEdit);
45 
46  connect(this, SIGNAL(user1Clicked()), this, SLOT(slotClose()));
47  connect(this, SIGNAL(closeClicked()), this, SLOT(slotClose()));
48 }
49 
50 void ZModemDialog::addProgressText(const QString& text)
51 {
52  QTextCursor currentCursor = _textEdit->textCursor();
53 
54  currentCursor.insertBlock();
55  currentCursor.insertText(text);
56 }
57 
58 void ZModemDialog::transferDone()
59 {
60  enableButton(KDialog::Close, true);
61  enableButton(KDialog::User1, false);
62 }
63 
64 void ZModemDialog::slotClose()
65 {
66  delayedDestruct();
67  accept();
68 }
69 
70 #include "ZModemDialog.moc"
QWidget
QTextCursor
Konsole::ZModemDialog
Definition: ZModemDialog.h:29
KDialog
QTextCursor::insertBlock
void insertBlock()
QTextCursor::insertText
void insertText(const QString &text)
QString
ZModemDialog.h
Konsole::ZModemDialog::transferDone
void transferDone()
To indicate the process is finished.
Definition: ZModemDialog.cpp:58
QLatin1String
Konsole::ZModemDialog::addProgressText
void addProgressText(const QString &)
Adds a line of text to the progress window.
Definition: ZModemDialog.cpp:50
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal