summaryrefslogtreecommitdiffstats
path: root/kmail/accountwizard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/accountwizard.cpp')
-rw-r--r--kmail/accountwizard.cpp188
1 files changed, 94 insertions, 94 deletions
diff --git a/kmail/accountwizard.cpp b/kmail/accountwizard.cpp
index cc831790d..de6c43178 100644
--- a/kmail/accountwizard.cpp
+++ b/kmail/accountwizard.cpp
@@ -32,13 +32,13 @@
#include <klistbox.h>
#include <klocale.h>
-#include <qcheckbox.h>
-#include <qdir.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qvbox.h>
+#include <tqcheckbox.h>
+#include <tqdir.h>
+#include <tqhbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
+#include <tqvbox.h>
#include "kmacctlocal.h"
#include "kmkernel.h"
@@ -81,7 +81,7 @@ class AccountTypeBox : public KListBox
public:
enum Type { Local, POP3, IMAP, dIMAP, Maildir };
- AccountTypeBox( QWidget *parent )
+ AccountTypeBox( TQWidget *parent )
: KListBox( parent, "AccountTypeBox" )
{
mTypeList << i18n( "Local mailbox" );
@@ -104,10 +104,10 @@ class AccountTypeBox : public KListBox
}
private:
- QStringList mTypeList;
+ TQStringList mTypeList;
};
-AccountWizard::AccountWizard( KMKernel *kernel, QWidget *parent )
+AccountWizard::AccountWizard( KMKernel *kernel, TQWidget *parent )
: KWizard( parent, "KWizard" ), mKernel( kernel ),
mAccount( 0 ), mTransportInfo( 0 ), mServerTest( 0 )
{
@@ -118,21 +118,21 @@ AccountWizard::AccountWizard( KMKernel *kernel, QWidget *parent )
setupServerInformationPage();
}
-void AccountWizard::start( KMKernel *kernel, QWidget *parent )
+void AccountWizard::start( KMKernel *kernel, TQWidget *parent )
{
KConfigGroup wizardConfig( KMKernel::config(), "AccountWizard" );
if ( wizardConfig.readBoolEntry( "ShowOnStartup", true ) ) {
AccountWizard wizard( kernel, parent );
int result = wizard.exec();
- if ( result == QDialog::Accepted ) {
+ if ( result == TQDialog::Accepted ) {
wizardConfig.writeEntry( "ShowOnStartup", false );
kernel->slotConfigChanged();
}
}
}
-void AccountWizard::showPage( QWidget *page )
+void AccountWizard::showPage( TQWidget *page )
{
if ( page == mWelcomePage ) {
// do nothing
@@ -152,7 +152,7 @@ void AccountWizard::showPage( QWidget *page )
} else if ( page == mLoginInformationPage ) {
if ( mLoginName->text().isEmpty() ) {
// try to extract login from email address
- QString email = mEMailAddress->text();
+ TQString email = mEMailAddress->text();
int pos = email.find( '@' );
if ( pos != -1 )
mLoginName->setText( email.left( pos ) );
@@ -167,9 +167,9 @@ void AccountWizard::showPage( QWidget *page )
mIncomingLabel->setText( i18n( "Location:" ) );
if ( mTypeBox->type() == AccountTypeBox::Local )
- mIncomingLocation->setText( QDir::homeDirPath() + "/inbox" );
+ mIncomingLocation->setText( TQDir::homeDirPath() + "/inbox" );
else
- mIncomingLocation->setText( QDir::homeDirPath() + "/Mail/" );
+ mIncomingLocation->setText( TQDir::homeDirPath() + "/Mail/" );
} else {
mIncomingLocationWdg->hide();
mIncomingServerWdg->show();
@@ -179,20 +179,20 @@ void AccountWizard::showPage( QWidget *page )
setFinishEnabled( mServerInformationPage, true );
}
- QWizard::showPage( page );
+ TQWizard::showPage( page );
}
void AccountWizard::setupWelcomePage()
{
- mWelcomePage = new QVBox( this );
- ((QVBox*)mWelcomePage)->setSpacing( KDialog::spacingHint() );
+ mWelcomePage = new TQVBox( this );
+ ((TQVBox*)mWelcomePage)->setSpacing( KDialog::spacingHint() );
- QLabel *label = new QLabel( i18n( "Welcome to KMail" ), mWelcomePage );
- QFont font = label->font();
+ TQLabel *label = new TQLabel( i18n( "Welcome to KMail" ), mWelcomePage );
+ TQFont font = label->font();
font.setBold( true );
label->setFont( font );
- new QLabel( i18n( "<qt>It seems you have started KMail for the first time. "
+ new TQLabel( i18n( "<qt>It seems you have started KMail for the first time. "
"You can use this wizard to setup your mail accounts. Just "
"enter the connection data that you received from your email provider "
"into the following pages.</qt>" ), mWelcomePage );
@@ -202,10 +202,10 @@ void AccountWizard::setupWelcomePage()
void AccountWizard::setupAccountTypePage()
{
- mAccountTypePage = new QVBox( this );
- ((QVBox*)mAccountTypePage)->setSpacing( KDialog::spacingHint() );
+ mAccountTypePage = new TQVBox( this );
+ ((TQVBox*)mAccountTypePage)->setSpacing( KDialog::spacingHint() );
- new QLabel( i18n( "Select what kind of account you would like to create" ), mAccountTypePage );
+ new TQLabel( i18n( "Select what kind of account you would like to create" ), mAccountTypePage );
mTypeBox = new AccountTypeBox( mAccountTypePage );
@@ -214,25 +214,25 @@ void AccountWizard::setupAccountTypePage()
void AccountWizard::setupAccountInformationPage()
{
- mAccountInformationPage = new QWidget( this );
- QGridLayout *layout = new QGridLayout( mAccountInformationPage, 3, 2,
+ mAccountInformationPage = new TQWidget( this );
+ TQGridLayout *layout = new TQGridLayout( mAccountInformationPage, 3, 2,
KDialog::marginHint(), KDialog::spacingHint() );
- QLabel *label = new QLabel( i18n( "Real name:" ), mAccountInformationPage );
+ TQLabel *label = new TQLabel( i18n( "Real name:" ), mAccountInformationPage );
mRealName = new KLineEdit( mAccountInformationPage );
label->setBuddy( mRealName );
layout->addWidget( label, 0, 0 );
layout->addWidget( mRealName, 0, 1 );
- label = new QLabel( i18n( "E-mail address:" ), mAccountInformationPage );
+ label = new TQLabel( i18n( "E-mail address:" ), mAccountInformationPage );
mEMailAddress = new KLineEdit( mAccountInformationPage );
label->setBuddy( mEMailAddress );
layout->addWidget( label, 1, 0 );
layout->addWidget( mEMailAddress, 1, 1 );
- label = new QLabel( i18n( "Organization:" ), mAccountInformationPage );
+ label = new TQLabel( i18n( "Organization:" ), mAccountInformationPage );
mOrganization = new KLineEdit( mAccountInformationPage );
label->setBuddy( mOrganization );
@@ -244,20 +244,20 @@ void AccountWizard::setupAccountInformationPage()
void AccountWizard::setupLoginInformationPage()
{
- mLoginInformationPage = new QWidget( this );
- QGridLayout *layout = new QGridLayout( mLoginInformationPage, 2, 2,
+ mLoginInformationPage = new TQWidget( this );
+ TQGridLayout *layout = new TQGridLayout( mLoginInformationPage, 2, 2,
KDialog::marginHint(), KDialog::spacingHint() );
- QLabel *label = new QLabel( i18n( "Login name:" ), mLoginInformationPage );
+ TQLabel *label = new TQLabel( i18n( "Login name:" ), mLoginInformationPage );
mLoginName = new KLineEdit( mLoginInformationPage );
label->setBuddy( mLoginName );
layout->addWidget( label, 0, 0 );
layout->addWidget( mLoginName, 0, 1 );
- label = new QLabel( i18n( "Password:" ), mLoginInformationPage );
+ label = new TQLabel( i18n( "Password:" ), mLoginInformationPage );
mPassword = new KLineEdit( mLoginInformationPage );
- mPassword->setEchoMode( QLineEdit::Password );
+ mPassword->setEchoMode( TQLineEdit::Password );
label->setBuddy( mPassword );
layout->addWidget( label, 1, 0 );
@@ -268,67 +268,67 @@ void AccountWizard::setupLoginInformationPage()
void AccountWizard::setupServerInformationPage()
{
- mServerInformationPage = new QWidget( this );
- QGridLayout *layout = new QGridLayout( mServerInformationPage, 3, 2,
+ mServerInformationPage = new TQWidget( this );
+ TQGridLayout *layout = new TQGridLayout( mServerInformationPage, 3, 2,
KDialog::marginHint(), KDialog::spacingHint() );
- mIncomingLabel = new QLabel( mServerInformationPage );
+ mIncomingLabel = new TQLabel( mServerInformationPage );
- mIncomingServerWdg = new QVBox( mServerInformationPage );
+ mIncomingServerWdg = new TQVBox( mServerInformationPage );
mIncomingServer = new KLineEdit( mIncomingServerWdg );
- mIncomingUseSSL = new QCheckBox( i18n( "Use secure connection (SSL)" ), mIncomingServerWdg );
+ mIncomingUseSSL = new TQCheckBox( i18n( "Use secure connection (SSL)" ), mIncomingServerWdg );
- mIncomingLocationWdg = new QHBox( mServerInformationPage );
+ mIncomingLocationWdg = new TQHBox( mServerInformationPage );
mIncomingLocation = new KLineEdit( mIncomingLocationWdg );
- mChooseLocation = new QPushButton( i18n( "Choose..." ), mIncomingLocationWdg );
+ mChooseLocation = new TQPushButton( i18n( "Choose..." ), mIncomingLocationWdg );
- connect( mChooseLocation, SIGNAL( clicked() ),
- this, SLOT( chooseLocation() ) );
+ connect( mChooseLocation, TQT_SIGNAL( clicked() ),
+ this, TQT_SLOT( chooseLocation() ) );
layout->addWidget( mIncomingLabel, 0, 0, AlignTop );
layout->addWidget( mIncomingLocationWdg, 0, 1 );
layout->addWidget( mIncomingServerWdg, 0, 1 );
- QLabel *label = new QLabel( i18n( "Outgoing server:" ), mServerInformationPage );
+ TQLabel *label = new TQLabel( i18n( "Outgoing server:" ), mServerInformationPage );
mOutgoingServer = new KLineEdit( mServerInformationPage );
label->setBuddy( mOutgoingServer );
layout->addWidget( label, 1, 0 );
layout->addWidget( mOutgoingServer, 1, 1 );
- mOutgoingUseSSL = new QCheckBox( i18n( "Use secure connection (SSL)" ), mServerInformationPage );
+ mOutgoingUseSSL = new TQCheckBox( i18n( "Use secure connection (SSL)" ), mServerInformationPage );
layout->addWidget( mOutgoingUseSSL, 2, 1 );
- mLocalDelivery = new QCheckBox( i18n( "Use local delivery" ),
+ mLocalDelivery = new TQCheckBox( i18n( "Use local delivery" ),
mServerInformationPage );
layout->addWidget( mLocalDelivery, 3, 0 );
- connect( mLocalDelivery, SIGNAL( toggled( bool ) ),
- mOutgoingServer, SLOT( setDisabled( bool ) ) );
+ connect( mLocalDelivery, TQT_SIGNAL( toggled( bool ) ),
+ mOutgoingServer, TQT_SLOT( setDisabled( bool ) ) );
addPage( mServerInformationPage, i18n( "Server Information" ) );
}
void AccountWizard::chooseLocation()
{
- QString location;
+ TQString location;
if ( mTypeBox->type() == AccountTypeBox::Local ) {
- location = KFileDialog::getSaveFileName( QString(), QString(), this );
+ location = KFileDialog::getSaveFileName( TQString(), TQString(), this );
} else if ( mTypeBox->type() == AccountTypeBox::Maildir ) {
- location = KFileDialog::getExistingDirectory( QString(), this );
+ location = KFileDialog::getExistingDirectory( TQString(), this );
}
if ( !location.isEmpty() )
mIncomingLocation->setText( location );
}
-QString AccountWizard::accountName() const
+TQString AccountWizard::accountName() const
{
// create account name
- QString name( i18n( "None" ) );
+ TQString name( i18n( "None" ) );
- QString email = mEMailAddress->text();
+ TQString email = mEMailAddress->text();
int pos = email.find( '@' );
if ( pos != -1 ) {
name = email.mid( pos + 1 );
@@ -338,10 +338,10 @@ QString AccountWizard::accountName() const
return name;
}
-QLabel *AccountWizard::createInfoLabel( const QString &msg )
+TQLabel *AccountWizard::createInfoLabel( const TQString &msg )
{
- QLabel *label = new QLabel( msg, this );
- label->setFrameStyle( QFrame::Panel | QFrame::Raised );
+ TQLabel *label = new TQLabel( msg, this );
+ label->setFrameStyle( TQFrame::Panel | TQFrame::Raised );
label->resize( fontMetrics().width( msg ) + 20, label->height() * 2 );
label->move( width() / 2 - label->width() / 2, height() / 2 - label->height() / 2 );
label->show();
@@ -361,7 +361,7 @@ void AccountWizard::accept()
manager->commit();
- QTimer::singleShot( 0, this, SLOT( createTransport() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( createTransport() ) );
}
void AccountWizard::createTransport()
@@ -386,7 +386,7 @@ void AccountWizard::createTransport()
mTransportInfo->auth = false;
mTransportInfo->setStorePasswd( false );
- QTimer::singleShot( 0, this, SLOT( transportCreated() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( transportCreated() ) );
} else { // delivery via SMTP
mTransportInfo->type = "smtp";
mTransportInfo->name = accountName();
@@ -425,7 +425,7 @@ void AccountWizard::transportCreated()
mTransportInfoList.setAutoDelete( true );
mTransportInfoList.clear();
- QTimer::singleShot( 0, this, SLOT( createAccount() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( createAccount() ) );
}
void AccountWizard::createAccount()
@@ -485,7 +485,7 @@ void AccountWizard::createAccount()
else if ( mTypeBox->type() == AccountTypeBox::IMAP || mTypeBox->type() == AccountTypeBox::dIMAP )
checkImapCapabilities( mIncomingServer->text(), port );
else
- QTimer::singleShot( 0, this, SLOT( accountCreated() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( accountCreated() ) );
}
void AccountWizard::accountCreated()
@@ -503,48 +503,48 @@ void AccountWizard::finished()
{
GlobalSettings::self()->writeConfig();
- QWizard::accept();
+ TQWizard::accept();
}
// ----- Security Checks --------------
-void AccountWizard::checkPopCapabilities( const QString &server, int port )
+void AccountWizard::checkPopCapabilities( const TQString &server, int port )
{
delete mServerTest;
mServerTest = new KMServerTest( POP_PROTOCOL, server, port );
- connect( mServerTest, SIGNAL( capabilities( const QStringList&, const QStringList& ) ),
- this, SLOT( popCapabilities( const QStringList&, const QStringList& ) ) );
+ connect( mServerTest, TQT_SIGNAL( capabilities( const TQStringList&, const TQStringList& ) ),
+ this, TQT_SLOT( popCapabilities( const TQStringList&, const TQStringList& ) ) );
mAuthInfoLabel = createInfoLabel( i18n( "Check for supported security capabilities of %1..." ).arg( server ) );
}
-void AccountWizard::checkImapCapabilities( const QString &server, int port )
+void AccountWizard::checkImapCapabilities( const TQString &server, int port )
{
delete mServerTest;
mServerTest = new KMServerTest( IMAP_PROTOCOL, server, port );
- connect( mServerTest, SIGNAL( capabilities( const QStringList&, const QStringList& ) ),
- this, SLOT( imapCapabilities( const QStringList&, const QStringList& ) ) );
+ connect( mServerTest, TQT_SIGNAL( capabilities( const TQStringList&, const TQStringList& ) ),
+ this, TQT_SLOT( imapCapabilities( const TQStringList&, const TQStringList& ) ) );
mAuthInfoLabel = createInfoLabel( i18n( "Check for supported security capabilities of %1..." ).arg( server ) );
}
-void AccountWizard::checkSmtpCapabilities( const QString &server, int port )
+void AccountWizard::checkSmtpCapabilities( const TQString &server, int port )
{
delete mServerTest;
mServerTest = new KMServerTest( SMTP_PROTOCOL, server, port );
- connect( mServerTest, SIGNAL( capabilities( const QStringList&, const QStringList&,
- const QString&, const QString&, const QString& ) ),
- this, SLOT( smtpCapabilities( const QStringList&, const QStringList&,
- const QString&, const QString&, const QString& ) ) );
+ connect( mServerTest, TQT_SIGNAL( capabilities( const TQStringList&, const TQStringList&,
+ const TQString&, const TQString&, const TQString& ) ),
+ this, TQT_SLOT( smtpCapabilities( const TQStringList&, const TQStringList&,
+ const TQString&, const TQString&, const TQString& ) ) );
mAuthInfoLabel = createInfoLabel( i18n( "Check for supported security capabilities of %1..." ).arg( server ) );
}
-void AccountWizard::popCapabilities( const QStringList &capaNormalList,
- const QStringList &capaSSLList )
+void AccountWizard::popCapabilities( const TQStringList &capaNormalList,
+ const TQStringList &capaSSLList )
{
uint capaNormal = popCapabilitiesFromStringList( capaNormalList );
uint capaTLS = 0;
@@ -593,8 +593,8 @@ void AccountWizard::popCapabilities( const QStringList &capaNormalList,
}
-void AccountWizard::imapCapabilities( const QStringList &capaNormalList,
- const QStringList &capaSSLList )
+void AccountWizard::imapCapabilities( const TQStringList &capaNormalList,
+ const TQStringList &capaSSLList )
{
uint capaNormal = imapCapabilitiesFromStringList( capaNormalList );
uint capaTLS = 0;
@@ -641,11 +641,11 @@ void AccountWizard::imapCapabilities( const QStringList &capaNormalList,
accountCreated();
}
-void AccountWizard::smtpCapabilities( const QStringList &capaNormal,
- const QStringList &capaSSL,
- const QString &authNone,
- const QString &authSSL,
- const QString &authTLS )
+void AccountWizard::smtpCapabilities( const TQStringList &capaNormal,
+ const TQStringList &capaSSL,
+ const TQString &authNone,
+ const TQString &authSSL,
+ const TQString &authTLS )
{
uint authBitsNone, authBitsSSL, authBitsTLS;
@@ -699,12 +699,12 @@ void AccountWizard::smtpCapabilities( const QStringList &capaNormal,
transportCreated();
}
-uint AccountWizard::popCapabilitiesFromStringList( const QStringList & l )
+uint AccountWizard::popCapabilitiesFromStringList( const TQStringList & l )
{
unsigned int capa = 0;
- for ( QStringList::const_iterator it = l.begin() ; it != l.end() ; ++it ) {
- QString cur = (*it).upper();
+ for ( TQStringList::const_iterator it = l.begin() ; it != l.end() ; ++it ) {
+ TQString cur = (*it).upper();
if ( cur == "PLAIN" )
capa |= Plain;
else if ( cur == "LOGIN" )
@@ -726,12 +726,12 @@ uint AccountWizard::popCapabilitiesFromStringList( const QStringList & l )
return capa;
}
-uint AccountWizard::imapCapabilitiesFromStringList( const QStringList & l )
+uint AccountWizard::imapCapabilitiesFromStringList( const TQStringList & l )
{
unsigned int capa = 0;
- for ( QStringList::const_iterator it = l.begin() ; it != l.end() ; ++it ) {
- QString cur = (*it).upper();
+ for ( TQStringList::const_iterator it = l.begin() ; it != l.end() ; ++it ) {
+ TQString cur = (*it).upper();
if ( cur == "AUTH=PLAIN" )
capa |= Plain;
else if ( cur == "AUTH=LOGIN" )
@@ -753,12 +753,12 @@ uint AccountWizard::imapCapabilitiesFromStringList( const QStringList & l )
return capa;
}
-uint AccountWizard::authMethodsFromString( const QString & s )
+uint AccountWizard::authMethodsFromString( const TQString & s )
{
unsigned int result = 0;
- QStringList sl = QStringList::split( '\n', s.upper() );
- for ( QStringList::const_iterator it = sl.begin() ; it != sl.end() ; ++it )
+ TQStringList sl = TQStringList::split( '\n', s.upper() );
+ for ( TQStringList::const_iterator it = sl.begin() ; it != sl.end() ; ++it )
if ( *it == "SASL/LOGIN" )
result |= Login;
else if ( *it == "SASL/PLAIN" )
@@ -775,11 +775,11 @@ uint AccountWizard::authMethodsFromString( const QString & s )
return result;
}
-uint AccountWizard::authMethodsFromStringList( const QStringList & sl )
+uint AccountWizard::authMethodsFromStringList( const TQStringList & sl )
{
unsigned int result = 0;
- for ( QStringList::const_iterator it = sl.begin() ; it != sl.end() ; ++it )
+ for ( TQStringList::const_iterator it = sl.begin() ; it != sl.end() ; ++it )
if ( *it == "LOGIN" )
result |= Login;
else if ( *it == "PLAIN" )