// $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 menu->insertItem(nls->translate("&Followup-To"), HDR_FOLLOWUP_TO); //added for KRN
mMenuBar->insertItem(nls->translate("&View"), menu); mMenuBar->insertItem(nls->translate("&View"), menu);
//---------- Menu: Attach //---------- Menu: Attach menu = new QPopupMenu();
menu = new QPopupMenu();
menu->insertItem(nls->translate("Append S&ignature"), this, menu->insertItem(nls->translate("Append S&ignature"), this,
SLOT(slotAppendSignature())); SLOT(slotAppendSignature()));
menu->insertItem(nls->translate("&Attach..."), this, SLOT(slotAttachFile())); menu->insertItem(nls->translate("&Attach..."), this, SLOT(slotAttachFile()));

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

@ -197,7 +197,14 @@ const QString KMMessage::asString(void)
return resultStr; 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) void KMMessage::fromString(const QString aStr)
{ {

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

@ -76,6 +76,8 @@ void KMReaderWin::readConfig(void)
config->setGroup("Reader"); config->setGroup("Reader");
mAtmInline = config->readNumEntry("attach-inline", 100); mAtmInline = config->readNumEntry("attach-inline", 100);
mHeaderStyle = (HeaderStyle)config->readNumEntry("hdr-style", HdrFancy); 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->setGroup("Reader");
config->writeEntry("attach-inline", mAtmInline); config->writeEntry("attach-inline", mAtmInline);
config->writeEntry("hdr-style", (int)mHeaderStyle); config->writeEntry("hdr-style", (int)mHeaderStyle);
config->writeEntry("attmnt-style",(int)mAttachmentStyle);
if (aWithSync) config->sync(); if (aWithSync) config->sync();
} }
@ -134,6 +137,11 @@ void KMReaderWin::setHeaderStyle(KMReaderWin::HeaderStyle aHeaderStyle)
update(); update();
} }
void KMReaderWin::setAttachmentStyle(int aAttachmentStyle)
{
mAttachmentStyle = aAttachmentStyle;
update();
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void KMReaderWin::setInlineAttach(int aAtmInline) void KMReaderWin::setInlineAttach(int aAtmInline)
@ -228,6 +236,7 @@ void KMReaderWin::parseMsg(void)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void KMReaderWin::writeMsgHeader(void) void KMReaderWin::writeMsgHeader(void)
{ {
QString t;
switch (mHeaderStyle) switch (mHeaderStyle)
{ {
case HdrBrief: case HdrBrief:
@ -277,7 +286,9 @@ void KMReaderWin::writeMsgHeader(void)
break; break;
case HdrAll: 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; break;
default: default:

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

Loading…
Cancel
Save