KIO
skipdialog.cpp
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2000 David Faure <faure@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #include "kio/skipdialog.h" 00020 00021 #include <stdio.h> 00022 #include <assert.h> 00023 00024 #include <QtGui/QMessageBox> 00025 #include <QtGui/QWidget> 00026 #include <QtGui/QLayout> 00027 #include <QtGui/QLabel> 00028 00029 #include <klocale.h> 00030 #include <kurl.h> 00031 00032 using namespace KIO; 00033 00034 SkipDialog::SkipDialog(QWidget *parent, bool _multi, const QString& _error_text ) 00035 : KDialog ( parent ), d( 0 ) 00036 { 00037 setCaption( i18n( "Information" ) ); 00038 00039 if ( !_multi ) { 00040 setButtons( Cancel ); 00041 } else { 00042 setButtons( Cancel | User1 | User2 ); 00043 00044 setButtonText( User1, i18n( "Skip" ) ); 00045 connect( this, SIGNAL( user1Clicked() ), SLOT(skipPressed()) ); 00046 00047 setButtonText( User2, i18n( "AutoSkip" ) ); 00048 connect( this, SIGNAL( user2Clicked() ), SLOT(autoSkipPressed()) ); 00049 } 00050 00051 connect( this, SIGNAL( cancelClicked() ), SLOT(cancelPressed()) ); 00052 00053 setMainWidget( new QLabel( _error_text, this ) ); 00054 00055 resize( sizeHint() ); 00056 } 00057 00058 SkipDialog::~SkipDialog() 00059 { 00060 } 00061 00062 void SkipDialog::cancelPressed() 00063 { 00064 done(S_CANCEL); 00065 } 00066 00067 void SkipDialog::skipPressed() 00068 { 00069 done(S_SKIP); 00070 } 00071 00072 void SkipDialog::autoSkipPressed() 00073 { 00074 done(S_AUTO_SKIP); 00075 } 00076 00077 #include "skipdialog.moc"
KDE 4.7 API Reference