Better wording
[kdepim.git] / libkdepim / pimmessagebox.cpp
blob40397346dece6cd3fd397a63cf54bdd73975a331
1 /*
2 This file is part of libkdepim.
4 Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution.
25 #include "pimmessagebox.h"
27 #include <kmessagebox.h>
28 #include <kdialog.h>
29 #include <kpushbutton.h>
31 int PIMMessageBox::fourBtnMsgBox( QWidget *parent, QMessageBox::Icon type,
32 const QString &text,
33 const QString &caption,
34 const KGuiItem &button1,
35 const KGuiItem &button2,
36 const KGuiItem &button3,
37 KMessageBox::Options options )
39 KDialog *dialog= new KDialog( parent );
40 dialog->setCaption( caption );
41 dialog->setButtons( KDialog::Yes | KDialog::No | KDialog::Ok | KDialog::Cancel );
42 dialog->setObjectName( "PIMMessageBox" );
43 dialog->setDefaultButton( KDialog::Yes );
44 dialog->setButtonGuiItem( KDialog::Ok, button3 );
45 dialog->setButtonGuiItem( KDialog::Yes, button1 );
46 dialog->setButtonGuiItem( KDialog::No, button2 );
47 // QObject::connect( dialog, SIGNAL(yesClicked()), dialog, SLOT(slotYes()));
48 // QObject::connect( dialog, SIGNAL(noClicked()), dialog, SLOT(slotNo()));
50 bool checkboxResult = false;
51 int result = KMessageBox::createKMessageBox(
52 dialog, type, text, QStringList(), QString(), &checkboxResult, options );
54 switch (result) {
55 case KDialog::Yes:
56 result = KMessageBox::Yes;
57 break;
58 case KDialog::No:
59 result = KMessageBox::No;
60 break;
61 case KDialog::Ok:
62 result = KMessageBox::Continue;
63 break;
64 case KDialog::Cancel:
65 result = KMessageBox::Cancel;
66 break;
67 default:
68 break;
71 return result;