kmacctseldlg.cpp
00001 /* 00002 * kmail: KDE mail client 00003 * This file: Copyright (C) 2000 Espen Sand, <espen@kde.org> 00004 * Contains code segments and ideas from earlier kmail dialog code 00005 * by Stefan Taferner <taferner@kde.org> 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00020 * 00021 */ 00022 00023 #ifdef HAVE_CONFIG_H 00024 #include <config.h> 00025 #endif 00026 00027 #include <tqbuttongroup.h> 00028 #include <tqlayout.h> 00029 #include <tqradiobutton.h> 00030 00031 #include <tdelocale.h> 00032 00033 #include "kmacctseldlg.moc" 00034 00035 KMAcctSelDlg::KMAcctSelDlg( TQWidget *parent, const char *name, bool modal ) 00036 : KDialogBase( parent, name, modal, i18n("Add Account"), Ok|Cancel, Ok ) 00037 { 00038 TQFrame *page = makeMainWidget(); 00039 TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); 00040 00041 TQButtonGroup *group = new TQButtonGroup( i18n("Account Type"), page ); 00042 connect(group, TQT_SIGNAL(clicked(int)), TQT_SLOT(buttonClicked(int)) ); 00043 00044 topLayout->addWidget( group, 10 ); 00045 TQVBoxLayout *vlay = new TQVBoxLayout( group, spacingHint()*2, spacingHint() ); 00046 vlay->addSpacing( fontMetrics().lineSpacing() ); 00047 00048 TQRadioButton *radioButton1 = new TQRadioButton( i18n("&Local mailbox"), group ); 00049 vlay->addWidget( radioButton1 ); 00050 TQRadioButton *radioButton2 = new TQRadioButton( i18n("&POP3"), group ); 00051 vlay->addWidget( radioButton2 ); 00052 TQRadioButton *radioButton3 = new TQRadioButton( i18n("&IMAP"), group ); 00053 vlay->addWidget( radioButton3 ); 00054 TQRadioButton *radioButton4 = new TQRadioButton( i18n("&Disconnected IMAP"), group ); 00055 vlay->addWidget( radioButton4 ); 00056 TQRadioButton *radioButton5 = new TQRadioButton( i18n("&Maildir mailbox"), group ); 00057 vlay->addWidget( radioButton5 ); 00058 00059 vlay->addStretch( 10 ); 00060 00061 radioButton2->setChecked(true); // Pop is most common ? 00062 buttonClicked(1); 00063 } 00064 00065 00066 void KMAcctSelDlg::buttonClicked( int id ) 00067 { 00068 mSelectedButton = id; 00069 } 00070 00071 00072 int KMAcctSelDlg::selected( void ) const 00073 { 00074 return mSelectedButton; 00075 } 00076 00077