[prev in list] [next in list] [prev in thread] [next in thread]
List: kmail-devel
Subject: Re: future request for kmail
From: Daniel Andor <da209 () cam ! ac ! uk>
Date: 2001-04-19 19:46:31
[Download RAW message or body]
On Saturday 31 March 2001 8:58 pm, Carsten Pfeiffer wrote:
> Am Samstag, 31. März 2001 21:21 schrieb Waldo Bastian:
> > That might be possible I guess. We already replace text that looks like a
> > URL with a html-style link, so replacing an emoticon with a small image
> > should be possible as well.
> >
> > The chances of that happening would be a lot higher if you provide a
> > patch for it though :-) <--- test emoticon
This seemed like a fun thing to try. :-) A few lines are all that's needed to
add the icons. Presumably this would need a config option? And some icons...
Perhaps Japie can say whether this is what he had in mind:
http://www.tcm.phy.cam.ac.uk/~da209/emoticon-snapshot.png
http://www.tcm.phy.cam.ac.uk/~da209/emoticon-snapshot2.png
Patch (minus the icon) attached for the curious.
> knode does this btw, so you know where to look for example code :)
It does *bold*, /italics/ and _underline_, but I couldn't find it doing
emoticons.
Daniel.
--
"We are sorry, you have reached an imaginary number. Please rotate your phone
through 90 degrees and try again."
http://www.spnm.org.uk/shortlist/andor.html
["emoticon-patch" (text/plain)]
? pics/emoticon-happy.png
Index: kmreaderwin.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmreaderwin.cpp,v
retrieving revision 1.269
diff -u -3 -p -r1.269 kmreaderwin.cpp
--- kmreaderwin.cpp 2001/04/18 12:20:57 1.269
+++ kmreaderwin.cpp 2001/04/19 19:29:15
@@ -1193,6 +1193,17 @@ QString KMReaderWin::strToHtml(const QSt
x = -1;
}
else if (ch=='&') HTML_ADD("&", 5);
+ else if ((ch==':' && strncmp(pos,":-)", 3)==0) ||
+ (ch==';' && strncmp(pos,";-)", 3)==0))
+ {
+ pos += 2;
+ KIconLoader loader;
+ QString path = loader.iconPath("emoticon-happy",0);
+ HTML_ADD("<img src=\"", 10);
+ HTML_ADD(path.latin1(), path.length());
+ HTML_ADD("\">", 2);
+
+ }
else if ((ch=='h' && strncmp(pos,"http:", 5)==0) ||
(ch=='h' && strncmp(pos,"https:", 6)==0) ||
(ch=='f' && strncmp(pos,"ftp:", 4)==0) ||
Index: pics/Makefile.am
===================================================================
RCS file: /home/kde/kdenetwork/kmail/pics/Makefile.am,v
retrieving revision 1.15
diff -u -3 -p -r1.15 Makefile.am
--- pics/Makefile.am 2001/04/05 20:19:09 1.15
+++ pics/Makefile.am 2001/04/19 19:29:15
@@ -8,7 +8,8 @@ data_DATA = green-bullet.png kmfldin.png
kmmsgflag.png kmfldsent.png closed.png green-bullet.png \
stopwatch.xbm stopwatchMask.xbm kdelogo.xpm \
feather_white.png pub_key_red.png pgp-keys.png \
- kmfolderfull.png abup.png abdown.png
+ kmfolderfull.png abup.png abdown.png \
+ emoticon-happy.png
datadir = $(kde_datadir)/kmail/pics
_______________________________________________
Kmail Developers mailing list
Kmail@master.kde.org
http://master.kde.org/mailman/listinfo/kmail
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic