kwave  18.07.70
ConfirmCancelProxy.cpp
Go to the documentation of this file.
1 /*************************************************************************
2  ConfirmCancelProxy.cpp - ask for confirm before cancelling an action
3  -------------------
4  begin : Fri Apr 26 2002
5  copyright : (C) 2002 by Thomas Eschenbacher
6  email : Thomas.Eschenbacher@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "config.h"
19 #include <QObject>
20 #include <QString>
21 #include <QWidget>
22 
23 #include <KLocalizedString>
24 
26 #include "libkwave/MessageBox.h"
27 
28 //***************************************************************************
30  QObject *sender, const char *signal,
31  QObject *receiver, const char *slot)
32  :QObject(), m_widget(widget)
33 {
34  Q_ASSERT(receiver);
35  if (!receiver) return;
36 
37  if (sender) QObject::connect(sender, signal, this, SLOT(cancel()));
38  QObject::connect(this, SIGNAL(canceled()), receiver, slot);
39 }
40 
41 //***************************************************************************
43 {
44 }
45 
46 //***************************************************************************
48 {
50  i18n("Do you really want to abort the current action?"))
51  != KMessageBox::Yes) return; // no cancel
52  emit canceled();
53 }
54 
55 //***************************************************************************
56 //***************************************************************************
static int questionYesNo(QWidget *widget, QString message, QString caption=QString(), const QString buttonYes=QString(), const QString buttonNo=QString(), const QString &dontAskAgainName=QString())
Definition: MessageBox.cpp:63
bool connect(Kwave::StreamObject &source, const char *output, Kwave::StreamObject &sink, const char *input)
Definition: Connect.cpp:48
ConfirmCancelProxy(QWidget *widget, QObject *sender, const char *signal, QObject *receiver, const char *slot)