2
Copyright (c) 2008 Volker Krause <vkrause@kde.org>
4
This library is free software; you can redistribute it and/or modify it
5
under the terms of the GNU Library General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or (at your
7
option) any later version.
9
This library is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12
License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to the
16
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20
#include "infodialog.h"
25
#include <QListWidget>
27
InfoDialog::InfoDialog( bool closeWhenDone ) :
31
mCloseWhenDone( closeWhenDone )
35
enableButton( Close, false );
36
mList = new QListWidget( this );
37
mList->setMinimumWidth( 640 );
38
setMainWidget( mList );
40
connect( this, SIGNAL(closeClicked()), SLOT(deleteLater()) );
43
InfoDialog::~InfoDialog()
48
void InfoDialog::message(KResMigratorBase::MessageType type, const QString & msg)
50
QListWidgetItem *item = new QListWidgetItem( msg, mList );
52
case KResMigratorBase::Success:
53
item->setIcon( KIcon( "dialog-ok-apply" ) );
57
case KResMigratorBase::Skip:
58
item->setIcon( KIcon( "dialog-ok" ) );
61
case KResMigratorBase::Info:
62
item->setIcon( KIcon( "dialog-information" ) );
65
case KResMigratorBase::Error:
66
item->setIcon( KIcon( "dialog-error" ) );
75
void InfoDialog::migratorAdded()
80
void InfoDialog::migratorDone()
83
if ( mMigratorCount == 0 ) {
84
enableButton( Close, true );
85
if ( mCloseWhenDone && !hasError() && !hasChange() )