2 Copyright (c) 2009 Michael Leupold <lemma@confuego.org>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #include "mdnadvicedialog.h"
21 #include <KMessageBox>
22 #include <KLocalizedString>
23 #include <QtCore/QPointer>
25 MDNAdviceDialog::MDNAdviceDialog( const QString
&text
, bool canDeny
, QWidget
*parent
)
26 : KDialog( parent
), m_result(MDNIgnore
)
28 setCaption( i18n( "Message Disposition Notification Request" ) );
30 setButtons( KDialog::Yes
| KDialog::User1
| KDialog::User2
);
31 setButtonText( KDialog::User2
, "Send \"&denied\"" );
33 setButtons( KDialog::Yes
| KDialog::User1
);
35 setButtonText( KDialog::Yes
, "&Ignore" );
36 setButtonText( KDialog::User1
, "&Send" );
37 setEscapeButton( KDialog::Yes
);
38 KMessageBox::createKMessageBox( this, QMessageBox::Question
, text
,
39 QStringList(), QString(), 0, KMessageBox::NoExec
);
40 connect( this, SIGNAL( buttonClicked( KDialog::ButtonCode
) ),
41 this, SLOT( slotButtonClicked( KDialog::ButtonCode
) ) );
44 MDNAdviceDialog::~MDNAdviceDialog()
48 MDNAdviceDialog::MDNAdvice
MDNAdviceDialog::questionIgnoreSend( const QString
&text
, bool canDeny
)
50 MDNAdvice rc
= MDNIgnore
;
51 QPointer
<MDNAdviceDialog
> dlg( new MDNAdviceDialog( text
, canDeny
) );
60 void MDNAdviceDialog::slotButtonClicked( int button
)
70 m_result
= MDNSendDenied
;
83 #include "mdnadvicedialog.moc"