kmail

kmacctseldlg.cpp
1 /*
2  * kmail: KDE mail client
3  * This file: Copyright (C) 2000 Espen Sand, <espen@kde.org>
4  * Contains code segments and ideas from earlier kmail dialog code
5  * by Stefan Taferner <taferner@kde.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26 
27 #include <tqbuttongroup.h>
28 #include <tqlayout.h>
29 #include <tqradiobutton.h>
30 
31 #include <tdelocale.h>
32 
33 #include "kmacctseldlg.moc"
34 
35 KMAcctSelDlg::KMAcctSelDlg( TQWidget *parent, const char *name, bool modal )
36  : KDialogBase( parent, name, modal, i18n("Add Account"), Ok|Cancel, Ok )
37 {
38  TQFrame *page = makeMainWidget();
39  TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() );
40 
41  TQButtonGroup *group = new TQButtonGroup( i18n("Account Type"), page );
42  connect(group, TQ_SIGNAL(clicked(int)), TQ_SLOT(buttonClicked(int)) );
43 
44  topLayout->addWidget( group, 10 );
45  TQVBoxLayout *vlay = new TQVBoxLayout( group, spacingHint()*2, spacingHint() );
46  vlay->addSpacing( fontMetrics().lineSpacing() );
47 
48  TQRadioButton *radioButton1 = new TQRadioButton( i18n("&Local mailbox"), group );
49  vlay->addWidget( radioButton1 );
50  TQRadioButton *radioButton2 = new TQRadioButton( i18n("&POP3"), group );
51  vlay->addWidget( radioButton2 );
52  TQRadioButton *radioButton3 = new TQRadioButton( i18n("&IMAP"), group );
53  vlay->addWidget( radioButton3 );
54  TQRadioButton *radioButton4 = new TQRadioButton( i18n("&Disconnected IMAP"), group );
55  vlay->addWidget( radioButton4 );
56  TQRadioButton *radioButton5 = new TQRadioButton( i18n("&Maildir mailbox"), group );
57  vlay->addWidget( radioButton5 );
58 
59  vlay->addStretch( 10 );
60 
61  radioButton2->setChecked(true); // Pop is most common ?
62  buttonClicked(1);
63 }
64 
65 
66 void KMAcctSelDlg::buttonClicked( int id )
67 {
68  mSelectedButton = id;
69 }
70 
71 
72 int KMAcctSelDlg::selected( void ) const
73 {
74  return mSelectedButton;
75 }
76 
77 
int selected(void) const
Returns selected button from the account selection group: 0=local mail, 1=pop3.
@ Ok
The user rights/ACL have been fetched from the server sucessfully.
Definition: acljobs.h:66