Specifiy an identity for every mailing list.

Patch by Ingo Klöcker <ingo.kloecker@epost.de>

svn path=/trunk/kdenetwork/kmail/; revision=93728
wilder-work
Michael Haeckel 25 years ago
parent f0f31e2eea
commit 7a32089a2c
  1. 2
      kmfolder.cpp
  2. 6
      kmfolder.h
  3. 30
      kmfolderdia.cpp
  4. 1
      kmfolderdia.h
  5. 2
      kmfoldertree.cpp
  6. 28
      kmheaders.cpp
  7. 5
      kmmainwin.cpp

@ -1782,6 +1782,7 @@ void KMFolder::readConfig()
mMailingListEnabled = config->readBoolEntry("MailingListEnabled");
mMailingListPostingAddress = config->readEntry("MailingListPostingAddress");
mMailingListAdminAddress = config->readEntry("MailingListAdminAddress");
mMailingListIdentity = config->readEntry("MailingListIdentity");
}
//-----------------------------------------------------------------------------
@ -1793,6 +1794,7 @@ void KMFolder::writeConfig()
config->writeEntry("MailingListEnabled", mMailingListEnabled);
config->writeEntry("MailingListPostingAddress", mMailingListPostingAddress);
config->writeEntry("MailingListAdminAddress", mMailingListAdminAddress);
config->writeEntry("MailingListIdentity", mMailingListIdentity);
}
//-----------------------------------------------------------------------------

@ -256,6 +256,11 @@ public:
const QString& mailingListAdminAddress() const
{ return mMailingListAdminAddress; }
void setMailingListIdentity(const QString &identity)
{ mMailingListIdentity = identity; writeConfig(); }
const QString& mailingListIdentity() const
{ return mMailingListIdentity; }
/** Tell the folder that a header field that is usually used for
the index (subject, from, ...) has changed of given message.
This method is usually called from within KMMessage::setSubject/set... */
@ -379,6 +384,7 @@ protected:
bool mMailingListEnabled;
QString mMailingListPostingAddress;
QString mMailingListAdminAddress;
QString mMailingListIdentity;
QString mImapPath;
QString mUidValidity;

@ -13,6 +13,7 @@
#include <qstring.h>
#include <qtextstream.h>
#include <qvbox.h>
#include <qcombobox.h>
#include <klocale.h>
#include <kmessagebox.h>
@ -24,6 +25,7 @@
#include "kmacctmgr.h"
#include "kmacctfolder.h"
#include "kmfoldermgr.h"
#include "kmidentity.h"
#include "kmfolderdia.moc"
@ -103,7 +105,7 @@ KMFolderDialog::KMFolderDialog(KMFolder* aFolder, KMFolderDir *aFolderDir,
topLayout = new QVBoxLayout( page, 0, spacingHint() );
hl = new QHBoxLayout();
//hl = new QHBoxLayout();
topLayout->addSpacing( spacingHint()*2 );
holdsMailingList = new QCheckBox( i18n("folder holds a mailing-list"), page);
@ -112,16 +114,26 @@ KMFolderDialog::KMFolderDialog(KMFolder* aFolder, KMFolderDir *aFolderDir,
topLayout->addWidget(holdsMailingList);
QGridLayout *grid = new QGridLayout(page, 2, 2, 0, 8);
grid->setColStretch(0, 1);
grid->setColStretch(1, 100);
topLayout->addSpacing( spacingHint()*2 );
topLayout->addLayout( hl );
topLayout->addLayout( grid );
topLayout->addSpacing( spacingHint()*2 );
label = new QLabel( i18n("Identity:"), page );
grid->addWidget( label, 0, 0 );
mailingListIdentity = new QComboBox( page );
mailingListIdentity->insertStringList( KMIdentity::identities() );
mailingListIdentity->setMinimumSize(mailingListIdentity->sizeHint());
grid->addWidget( mailingListIdentity, 0, 1 );
label = new QLabel( i18n("Post Address:"), page );
hl->addWidget( label );
grid->addWidget( label, 1, 0 );
mailingListPostAddress = new QLineEdit( page );
mailingListPostAddress->setMinimumSize(mailingListPostAddress->sizeHint());
hl->addWidget( mailingListPostAddress );
grid->addWidget( mailingListPostAddress, 1, 1 );
// hl = new QHBoxLayout();
// topLayout->addLayout( hl );
@ -138,7 +150,14 @@ KMFolderDialog::KMFolderDialog(KMFolder* aFolder, KMFolderDir *aFolderDir,
// mailingListAdminAddress->setText(folder->mailingListAdminAddress());
mailingListPostAddress->setEnabled(folder->isMailingList());
// mailingListAdminAddress->setEnabled(folder->isMailingList());
mailingListIdentity->setEnabled(folder->isMailingList());
holdsMailingList->setChecked(folder->isMailingList());
for (int i=0; i < mailingListIdentity->count(); ++i)
if (mailingListIdentity->text(i) == folder->mailingListIdentity()) {
mailingListIdentity->setCurrentItem(i);
break;
}
}
kdDebug()<<"Exiting KMFolderDialog::KMFolderDialog()\n";
}
@ -216,6 +235,7 @@ void KMFolderDialog::slotOk()
folder->setMailingListPostAddress( mailingListPostAddress->text() );
// folder->setMailingListAdminAddress( mailingListAdminAddress->text() );
folder->setMailingListAdminAddress( QString::null );
folder->setMailingListIdentity( mailingListIdentity->currentText() );
KMFolderDialogInherited::slotOk();
}
@ -233,5 +253,7 @@ void KMFolderDialog::slotHoldsML( bool holdsML )
mailingListPostAddress->setEnabled(false);
// mailingListAdminAddress->setEnabled(false);
}
mailingListIdentity->setEnabled(holdsML);
}

@ -38,6 +38,7 @@ protected:
QCheckBox *holdsMailingList;
QLineEdit *mailingListPostAddress;
QComboBox *mailingListIdentity;
// QLineEdit *mailingListAdminAddress;
};

@ -874,7 +874,7 @@ void KMFolderTree::mouseButtonPressed(int btn, QListViewItem *lvi, const QPoint
KMMessage *msg = new KMMessage;
msg->initHeader();
msg->setTo(fti->folder->mailingListPostAddress());
KMComposeWin *win = new KMComposeWin(msg);
KMComposeWin *win = new KMComposeWin(msg,fti->folder->mailingListIdentity());
win->show();
}

@ -1328,13 +1328,16 @@ void KMHeaders::noQuoteReplyToMsg()
{
KMComposeWin *win;
KMMessage *msg = currentMsg();
QString id;
if (!msg)
return;
kernel->kbp()->busy();
win = new KMComposeWin(msg->createReply(FALSE, FALSE, "", TRUE),
msg->headerField( "X-KMail-Identity" ));
id = msg->headerField( "X-KMail-Identity" );
if (id.isEmpty() && mFolder->isMailingList())
id = mFolder->mailingListIdentity();
win = new KMComposeWin(msg->createReply(FALSE, FALSE, "", TRUE),id);
win->setCharset(msg->codec()->name(), TRUE);
win->setReplyFocus(false);
win->show();
@ -1346,13 +1349,16 @@ void KMHeaders::replyToMsg (QString selection)
{
KMComposeWin *win;
KMMessage *msg = currentMsg();
QString id;
if (!msg)
return;
kernel->kbp()->busy();
win = new KMComposeWin(msg->createReply(FALSE, FALSE, selection),
msg->headerField( "X-KMail-Identity" ));
id = msg->headerField( "X-KMail-Identity" );
if (id.isEmpty() && mFolder->isMailingList())
id = mFolder->mailingListIdentity();
win = new KMComposeWin(msg->createReply(FALSE, FALSE, selection),id);
win->setCharset(msg->codec()->name(), TRUE);
win->setReplyFocus();
win->show();
@ -1365,12 +1371,15 @@ void KMHeaders::replyAllToMsg (QString selection)
{
KMComposeWin *win;
KMMessage *msg = currentMsg();
QString id;
if (!msg) return;
kernel->kbp()->busy();
win = new KMComposeWin(msg->createReply(TRUE, FALSE, selection),
msg->headerField( "X-KMail-Identity" ));
id = msg->headerField( "X-KMail-Identity" );
if (id.isEmpty() && mFolder->isMailingList())
id = mFolder->mailingListIdentity();
win = new KMComposeWin(msg->createReply(TRUE, FALSE, selection),id);
win->setCharset(msg->codec()->name(), TRUE);
win->setReplyFocus();
win->show();
@ -1382,12 +1391,15 @@ void KMHeaders::replyListToMsg (QString selection)
{
KMComposeWin *win;
KMMessage *msg = currentMsg();
QString id;
if (!msg) return;
kernel->kbp()->busy();
win = new KMComposeWin(msg->createReply(true, true, selection),
msg->headerField( "X-KMail-Identity" ));
id = msg->headerField( "X-KMail-Identity" );
if (id.isEmpty() && mFolder->isMailingList())
id = mFolder->mailingListIdentity();
win = new KMComposeWin(msg->createReply(true, true, selection),id);
win->setCharset(msg->codec()->name(), TRUE);
win->setReplyFocus();
win->show();

@ -685,9 +685,12 @@ void KMMainWin::slotCompose()
if (mFolder && mFolder->isMailingList()) {
kdDebug()<<QString("mFolder->isMailingList() %1").arg( mFolder->mailingListPostAddress().latin1())<<endl;;
msg->setTo(mFolder->mailingListPostAddress());
win = new KMComposeWin(msg,mFolder->mailingListIdentity());
}
else
win = new KMComposeWin(msg);
win = new KMComposeWin(msg);
win->show();
}

Loading…
Cancel
Save