Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / apps / konsole / src / ZModemDialog.cpp
blobf8647c472fddcf550c7a1cfe3095d10d35425194
1 /* This file is part of the KDE libraries
2 * Copyright (C) 2002 Waldo Bastian <bastian@kde.org>
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;
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.
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 **/
19 // Own
20 #include "ZModemDialog.h"
22 // Qt
23 #include <QtGui/QTextEdit>
25 // KDE
26 #include <KLocale>
28 using namespace Konsole;
30 ZModemDialog::ZModemDialog(QWidget *parent, bool modal, const QString &caption)
31 : KDialog( parent )
33 setObjectName( "zmodem_progress" );
34 setModal( modal );
35 setCaption( caption );
36 setButtons( User1|Close );
37 setButtonGuiItem( User1, KGuiItem(i18n("&Stop")) );
39 setDefaultButton( User1 );
40 setEscapeButton(User1);
42 showButtonSeparator( true );
43 enableButton(Close, false);
44 _textEdit = new QTextEdit(this);
45 _textEdit->setMinimumSize(400, 100);
46 _textEdit->setReadOnly(true);
47 setMainWidget(_textEdit);
48 connect(this, SIGNAL(user1Clicked()), this, SLOT(slotClose()));
49 connect(this,SIGNAL(closeClicked()),this,SLOT(slotClose()));
52 void ZModemDialog::addProgressText(const QString &txt)
54 QTextCursor cursor = _textEdit->textCursor();
56 cursor.insertBlock();
57 cursor.insertText(txt);
60 void ZModemDialog::transferDone()
62 enableButton(Close, true);
63 enableButton(User1, false);
66 void ZModemDialog::slotClose()
68 delayedDestruct();
69 accept();
72 #include "ZModemDialog.moc"