GUI: uhhh huhuhhuhu uhhhhhh huhuhh hey beavis huhuhu

mmnmnmnmn nyyyy  yeah butthead?
      uhhh huhuh   Some dumbass added SSL support for imap.
      nnnnyyyyeeeeeeee  heheheheh  dumbass.  you said ass
      uhh hhuhh  uhhh yeah.  dumbass.
      AAAIIIIIIiI AM THE GREAT KMAILIO.  I NEED SUPPORT FOR KIO_SMTP.

svn path=/trunk/kdenetwork/kmail/; revision=96328
wilder-work
George Staikos 25 years ago
parent 68458b3fa9
commit cff1d99c91
  1. 35
      accountdialog.cpp
  2. 2
      accountdialog.h
  3. 13
      kmacctimap.cpp
  4. 5
      kmacctimap.h

@ -475,7 +475,7 @@ void AccountDialog::makePopAccountPage()
void AccountDialog::makeImapAccountPage()
{
QFrame *page = makeMainWidget();
QGridLayout *topLayout = new QGridLayout( page, 13, 2, 0, spacingHint() );
QGridLayout *topLayout = new QGridLayout( page, 14, 2, 0, spacingHint() );
topLayout->addColSpacing( 1, fontMetrics().maxWidth()*15 );
topLayout->setRowStretch( 12, 10 );
topLayout->setColStretch( 1, 10 );
@ -533,6 +533,11 @@ void AccountDialog::makeImapAccountPage()
new QCheckBox( i18n("Store IMAP password in configuration file"), page );
topLayout->addMultiCellWidget( mImap.storePasswordCheck, 10, 10, 0, 1 );
mImap.useSSLCheck =
new QCheckBox( i18n("Use SSL for secure mail download"), page );
topLayout->addMultiCellWidget( mImap.useSSLCheck, 11, 11, 0, 1 );
connect(mImap.useSSLCheck, SIGNAL(clicked()), this, SLOT(slotImapSSLChanged()));
QButtonGroup *group = new QButtonGroup( 1, Qt::Horizontal,
i18n("Authentication method"), page );
mImap.authAuto = new QRadioButton( i18n("Clear text"), group );
@ -540,7 +545,7 @@ void AccountDialog::makeImapAccountPage()
"authentification method only, if you have a good reason", "LOGIN"), group );
mImap.authCramMd5 = new QRadioButton( i18n("CRAM-MD5"), group );
mImap.authAnonymous = new QRadioButton( i18n("Anonymous"), group );
topLayout->addMultiCellWidget( group, 11, 11, 0, 1 );
topLayout->addMultiCellWidget( group, 12, 12, 0, 1 );
connect(kapp,SIGNAL(kdisplayFontChanged()),SLOT(slotFontChanged()));
}
@ -614,6 +619,7 @@ void AccountDialog::setupSettings()
mImap.autoExpungeCheck->setChecked( ai.autoExpunge() );
mImap.hiddenFoldersCheck->setChecked( ai.hiddenFolders() );
mImap.storePasswordCheck->setChecked( ai.storePasswd() );
mImap.useSSLCheck->setChecked( ai.useSSL() );
if (ai.auth() == "CRAM-MD5")
mImap.authCramMd5->setChecked( TRUE );
else if (ai.auth() == "ANONYMOUS")
@ -665,6 +671,30 @@ void AccountDialog::setupSettings()
}
void AccountDialog::slotImapSSLChanged()
{
if (mImap.useSSLCheck->isChecked()) {
struct servent *serv = getservbyname("imaps", "tcp");
if (serv) {
QString x;
x.sprintf("%u", ntohs(serv->s_port));
mImap.portEdit->setText(x);
} else {
mImap.portEdit->setText("995");
}
} else {
struct servent *serv = getservbyname("imap", "tcp");
if (serv) {
QString x;
x.sprintf("%u", ntohs(serv->s_port));
mImap.portEdit->setText(x);
} else {
mImap.portEdit->setText("110");
}
}
}
void AccountDialog::slotSSLChanged()
{
if (mPop.useSSLCheck->isChecked()) {
@ -771,6 +801,7 @@ void AccountDialog::saveSettings()
epa.setLogin( mImap.loginEdit->text() );
epa.setAutoExpunge( mImap.autoExpungeCheck->isChecked() );
epa.setHiddenFolders( mImap.hiddenFoldersCheck->isChecked() );
epa.setUseSSL( mImap.useSSLCheck->isChecked() );
epa.setStorePasswd( mImap.storePasswordCheck->isChecked() );
epa.setPasswd( mImap.passwordEdit->text(), epa.storePasswd() );

@ -92,6 +92,7 @@ class AccountDialog : public KDialogBase
QCheckBox *autoExpungeCheck;
QCheckBox *hiddenFoldersCheck;
QCheckBox *storePasswordCheck;
QCheckBox *useSSLCheck;
QRadioButton *authAuto;
QRadioButton *authLogin;
QRadioButton *authCramMd5;
@ -105,6 +106,7 @@ class AccountDialog : public KDialogBase
void slotEnableLocalInterval( bool state );
void slotFontChanged();
void slotSSLChanged();
void slotImapSSLChanged();
private:
void makeLocalAccountPage();

@ -105,6 +105,7 @@ void KMAcctImap::init(void)
mPrefix = "/";
mAutoExpunge = TRUE;
mHiddenFolders = FALSE;
mUseSSL = FALSE;
}
//-----------------------------------------------------------------------------
@ -125,6 +126,7 @@ void KMAcctImap::pseudoAssign(KMAccount* account)
setHiddenFolders(acct->hiddenFolders());
setStorePasswd(acct->storePasswd());
setPasswd(acct->passwd(), acct->storePasswd());
setUseSSL(acct->useSSL());
}
@ -132,7 +134,7 @@ void KMAcctImap::pseudoAssign(KMAccount* account)
KURL KMAcctImap::getUrl()
{
KURL url;
url.setProtocol(QString("imap"));
url.setProtocol(mUseSSL ? QString("imaps") : QString("imap"));
url.setUser(mLogin + ";AUTH=" + mAuth);
url.setPass(decryptStr(mPasswd));
url.setHost(mHost);
@ -970,6 +972,7 @@ void KMAcctImap::readConfig(KConfig& config)
mPrefix = config.readEntry("prefix", "/");
mAutoExpunge = config.readBoolEntry("auto-expunge", TRUE);
mHiddenFolders = config.readBoolEntry("hidden-folders", FALSE);
mUseSSL = config.readBoolEntry("use-ssl", FALSE);
}
@ -989,6 +992,7 @@ void KMAcctImap::writeConfig(KConfig& config)
config.writeEntry("prefix", mPrefix);
config.writeEntry("auto-expunge", mAutoExpunge);
config.writeEntry("hidden-folders", mHiddenFolders);
config.writeEntry("use-ssl", mUseSSL);
}
@ -1026,6 +1030,13 @@ void KMAcctImap::setStorePasswd(bool b)
}
//-----------------------------------------------------------------------------
void KMAcctImap::setUseSSL(bool b)
{
mUseSSL = b;
}
//-----------------------------------------------------------------------------
void KMAcctImap::setLogin(const QString& aLogin)
{

@ -120,6 +120,10 @@ public:
bool hiddenFolders() { return mHiddenFolders; }
virtual void setHiddenFolders(bool);
/** Use SSL or not */
bool useSSL() { return mUseSSL; }
virtual void setUseSSL(bool);
/** List a directory and add the contents to a KMFolderTreeItem */
void listDirectory(KMFolderTreeItem * fti, bool secondStep = FALSE);
@ -200,6 +204,7 @@ protected:
unsigned short int mPort;
bool mStorePasswd;
bool mAutoExpunge;
bool mUseSSL;
bool mHiddenFolders;
bool gotMsgs;
bool mProgressEnabled;

Loading…
Cancel
Save