// $markus:

- added differenciation between header style and attachment style
- added all hdr style

svn path=/trunk/kdenetwork/kmail/; revision=3301
wilder-work
Markus Wuebben 29 years ago
parent ab7d361dfc
commit fecd20f30b
  1. 3
      kmcomposewin.cpp
  2. 17
      kmmainwin.cpp
  3. 9
      kmmessage.cpp
  4. 2
      kmmessage.h
  5. 13
      kmreaderwin.cpp
  6. 7
      kmreaderwin.h

@ -370,8 +370,7 @@ void KMComposeWin::setupMenuBar(void)
menu->insertItem(nls->translate("&Followup-To"), HDR_FOLLOWUP_TO); //added for KRN
mMenuBar->insertItem(nls->translate("&View"), menu);
//---------- Menu: Attach
menu = new QPopupMenu();
//---------- Menu: Attach menu = new QPopupMenu();
menu->insertItem(nls->translate("Append S&ignature"), this,
SLOT(slotAppendSignature()));
menu->insertItem(nls->translate("&Attach..."), this, SLOT(slotAttachFile()));

@ -437,10 +437,18 @@ void KMMainWin::slotViewChange()
void KMMainWin::slotSetHeaderStyle(int id)
{
if (!mMsgView) return;
mViewMenu->setItemChecked((int)mMsgView->headerStyle(), FALSE);
mMsgView->setHeaderStyle((KMReaderWin::HeaderStyle)id);
mViewMenu->setItemChecked(id, TRUE);
if(id <= 5)
{mViewMenu->setItemChecked((int)mMsgView->headerStyle(), FALSE);
mMsgView->setHeaderStyle((KMReaderWin::HeaderStyle)id);
mViewMenu->setItemChecked(id, TRUE);
return;
}
if(id > 5)
{mViewMenu->setItemChecked((int)mMsgView->attachmentStyle()+5, FALSE);
mMsgView->setAttachmentStyle(id-5);
mViewMenu->setItemChecked(id, TRUE);
return;
}
}
@ -652,6 +660,7 @@ void KMMainWin::setupMenuBar()
mViewMenu->insertItem(nls->translate("Smart Attachments"));
mViewMenu->insertItem(nls->translate("Inlined Attachments"));
mViewMenu->setItemChecked((int)mMsgView->headerStyle(), TRUE);
mViewMenu->setItemChecked((int)mMsgView->attachmentStyle()+5, TRUE);
//----- Help Menu
QPopupMenu *helpMenu = kapp->getHelpMenu(TRUE, aboutText);

@ -197,7 +197,14 @@ const QString KMMessage::asString(void)
return resultStr;
}
//----------------------------------------------------------------------------
const QString KMMessage::headerAsString(void)
{
DwHeaders& header = mMsg->Headers();
if(header.AsString() != "")
return header.AsString().c_str();
return "";
}
//-----------------------------------------------------------------------------
void KMMessage::fromString(const QString aStr)
{

@ -57,6 +57,8 @@ public:
/** Return the entire message contents as a string. */
virtual const QString asString(void);
/** Return header as string. */
virtual const QString headerAsString(void);
/** Returns message body with quoting header and indented by the
given indentation string. This is suitable for including the message

@ -76,6 +76,8 @@ void KMReaderWin::readConfig(void)
config->setGroup("Reader");
mAtmInline = config->readNumEntry("attach-inline", 100);
mHeaderStyle = (HeaderStyle)config->readNumEntry("hdr-style", HdrFancy);
mAttachmentStyle = (AttachmentStyle)config->readNumEntry("attmnt-style",
IconicAttmnt);
}
@ -87,6 +89,7 @@ void KMReaderWin::writeConfig(bool aWithSync)
config->setGroup("Reader");
config->writeEntry("attach-inline", mAtmInline);
config->writeEntry("hdr-style", (int)mHeaderStyle);
config->writeEntry("attmnt-style",(int)mAttachmentStyle);
if (aWithSync) config->sync();
}
@ -134,6 +137,11 @@ void KMReaderWin::setHeaderStyle(KMReaderWin::HeaderStyle aHeaderStyle)
update();
}
void KMReaderWin::setAttachmentStyle(int aAttachmentStyle)
{
mAttachmentStyle = aAttachmentStyle;
update();
}
//-----------------------------------------------------------------------------
void KMReaderWin::setInlineAttach(int aAtmInline)
@ -228,6 +236,7 @@ void KMReaderWin::parseMsg(void)
//-----------------------------------------------------------------------------
void KMReaderWin::writeMsgHeader(void)
{
QString t;
switch (mHeaderStyle)
{
case HdrBrief:
@ -277,7 +286,9 @@ void KMReaderWin::writeMsgHeader(void)
break;
case HdrAll:
emit statusMsg("`all' header style not yet implemented.");
t = mMsg->headerAsString();
t = t.replace(QRegExp("\n"),"<br>");
mViewer->write(t+"<br><br>");
break;
default:

@ -38,11 +38,17 @@ public:
/** Style of the message header. */
enum HeaderStyle { HdrFancy=1, HdrBrief=2, HdrStandard=3, HdrLong=4,
HdrAll=5 };
//** Stype of attachments. */
enum AttachmentStyle {IconicAttmnt=1, SmartAttmnt =2, InlineAttmnt = 3};
/** Get/set the message header style. */
HeaderStyle headerStyle(void) const { return mHeaderStyle; }
virtual void setHeaderStyle(HeaderStyle style);
/** Get/set the message attachment style. */
AttachmentStyle attachmentStyle(void) const { return mAttachmentStyle;}
virtual void setAttachmentStyle(int style);
/** Set the message that shall be shown. If NULL, an empty page is
displayed. */
virtual void setMsg(KMMessage* msg);
@ -137,6 +143,7 @@ protected:
QScrollBar *mSbVert, *mSbHorz;
QString mPicsDir;
HeaderStyle mHeaderStyle;
AttachmentStyle mAttachmentStyle;
};

Loading…
Cancel
Save