add an accepted signal, differentiate between accepted and finished; more qdialog-like and lets the widget react to a failed file dialog

svn path=/trunk/KDE/kdebase/runtime/; revision=1051186
This commit is contained in:
Aaron J. Seigo 2009-11-18 23:26:28 +00:00
parent e968acb6e6
commit 86b12fc8cb
2 changed files with 6 additions and 2 deletions

View File

@ -28,12 +28,12 @@ FileDialogProxy::FileDialogProxy(KFileDialog::OperationMode mode, QObject *paren
{
kDebug() << "hello beautiful";
m_dialog->setOperationMode(mode);
connect(m_dialog, SIGNAL(okClicked()), this, SLOT(dialogFinished()));
connect(m_dialog, SIGNAL(finished()), this, SLOT(dialogFinished()));
}
FileDialogProxy::~FileDialogProxy()
{
kDebug() << "bye bye";
kDebug() << this << "bye bye";
delete m_dialog;
}
@ -126,6 +126,9 @@ void FileDialogProxy::show()
void FileDialogProxy::dialogFinished()
{
if (m_dialog->result() == QDialog::Accepted) {
emit accepted(this);
}
emit finished(this);
}

View File

@ -72,6 +72,7 @@ public Q_SLOTS:
void show();
Q_SIGNALS:
void accepted(FileDialogProxy *);
void finished(FileDialogProxy *);
private Q_SLOTS: