diff --git a/kmuddy/ctranscript.cpp b/kmuddy/ctranscript.cpp index 2781f5413d6f3f4d76506089208d4e20215784b2..34d95da0f9f26eccb2a7b98492d0bdb72f8c572d 100644 --- a/kmuddy/ctranscript.cpp +++ b/kmuddy/ctranscript.cpp @@ -112,11 +112,10 @@ void cTranscript::addLineToTranscript (cTextChunk *chunk) cANSIParser *ap = dynamic_cast(object ("ansiparser")); QString s; switch (type) { - case TRANSCRIPT_PLAIN: s = chunk->toText (); break; - case TRANSCRIPT_ANSI: s = chunk->toAnsi (ap); break; + case TRANSCRIPT_PLAIN: s = chunk->toText () + "\n"; break; + case TRANSCRIPT_ANSI: s = chunk->toAnsi (ap) + "\n"; break; case TRANSCRIPT_HTML: s = chunk->toHTML (); break; }; - s += "\n"; // we use
 in HTML, so this applies equally to all three
   file.write (s.toLocal8Bit ());
   file.flush();
 }
@@ -137,11 +136,10 @@ void cTranscript::addLineToAdvTranscript (cTextChunk *chunk)
   cANSIParser *ap = dynamic_cast(object ("ansiparser"));
   QString s;
   switch (advtype) {
-    case TRANSCRIPT_PLAIN: s = chunk->toText (); break;
-    case TRANSCRIPT_ANSI: s = chunk->toAnsi (ap); break;
+    case TRANSCRIPT_PLAIN: s = chunk->toText () + "\n"; break;
+    case TRANSCRIPT_ANSI: s = chunk->toAnsi (ap) + "\n"; break;
     case TRANSCRIPT_HTML: s = chunk->toHTML (); break;
   };
-  s += "\n";  // we use 
 in HTML, so this applies equally to all three
   advfile.write (s.toLocal8Bit ());
   
   advfile.flush();
@@ -268,10 +266,13 @@ void cTranscript::startTranscript ()
   file.write ("\n\n");
   if (type == TRANSCRIPT_HTML)
   {
+    cProfileSettings *sett = settings();
     //TODO: what if we're adding to an existing HTML transcript?
-    file.write ("\n");
+    file.write ("\n");
     file.write ("\n");
-    file.write ("").toLatin1());
+    file.write ("");
+    file.write ("\n");
   }
diff --git a/kmuddy/dialogs/dlgeditprofile.cpp b/kmuddy/dialogs/dlgeditprofile.cpp
index fe447b100e73d615cfb57c6b514fae0c7c98e0bb..67112849f6f4181131981bf06a8e0dc8893c414d 100644
--- a/kmuddy/dialogs/dlgeditprofile.cpp
+++ b/kmuddy/dialogs/dlgeditprofile.cpp
@@ -44,8 +44,8 @@ dlgEditProfile::dlgEditProfile(QWidget *parent) : QDialog (parent)
   QGridLayout *layout = new QGridLayout (this);
 
   // create the button that opens the MUD listing
-  QPushButton *btlist = new QPushButton (i18n ("&Select from MUD list"), this);
-  connect (btlist, SIGNAL (clicked()), this, SLOT (openMudList()));
+//  QPushButton *btlist = new QPushButton (i18n ("&Select from MUD list"), this);
+//  connect (btlist, SIGNAL (clicked()), this, SLOT (openMudList()));
 
   // put some edit boxes there
   QLabel *l1 = new QLabel (i18n ("Profile &name:"), this);
@@ -90,7 +90,7 @@ dlgEditProfile::dlgEditProfile(QWidget *parent) : QDialog (parent)
   l6->setBuddy (connstr);
   
   layout->setSpacing (10);
-  layout->addWidget (btlist, 0, 0);
+//  layout->addWidget (btlist, 0, 0);
   layout->addWidget (l1, 1, 0);
   layout->addWidget (l2, 2, 0);
   layout->addWidget (l3, 3, 0);
diff --git a/libs/cconsole.cpp b/libs/cconsole.cpp
index 1bec0b42aee75b95d161b70bb2a7f74fa4c17806..4aeaa40a56396188af4f3a0251bd272ff7f3fe53 100644
--- a/libs/cconsole.cpp
+++ b/libs/cconsole.cpp
@@ -29,8 +29,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -116,7 +118,7 @@ class cConsole::Private {
   QColor bgcolor;
   QFont font;
   int sess;
-  int charWidth, charHeight;
+  double charWidth, charHeight;
   bool wantNewLine;
   bool atBottom;
 
@@ -142,7 +144,7 @@ cConsole::cConsole(QWidget *parent) : QGraphicsView(parent) {
   connect (verticalScrollBar (), SIGNAL (valueChanged (int)), this, SLOT (sliderChanged (int)));
     
   d->text = new QTextDocument;
-  QString stylesheet = "* { color: " + QColor (Qt::lightGray).name() + "; white-space: pre-wrap; } a { color: " + QColor (Qt::blue).name() + ": } ";
+  QString stylesheet = "* { color: " + QColor (Qt::lightGray).name() + "; white-space: pre-wrap; } a { color: " + QColor (Qt::blue).name() + "; } p,div { padding: 1px; line-spacing: 1.3 } ";
   d->text->setDefaultStyleSheet (stylesheet);
   QTextOption opt;
   opt.setWrapMode (QTextOption::WrapAtWordBoundaryOrAnywhere);
@@ -232,7 +234,7 @@ void cConsole::setFont (QFont f) {
 
   QFontMetrics fm (f);
   d->charWidth = fm.width ("m");
-  d->charHeight = fm.lineSpacing();
+  d->charHeight = fm.lineSpacing() + 2;
 
   fixupOutput();
 }
@@ -311,7 +313,13 @@ void cConsole::forceEmitSize () {
 }
 
 void cConsole::dumpBuffer (bool fromcurrent, QFile &file, char dumpType) {
-  // TODO
+  QString contents;
+  // TODO: support 'fromcurrent'
+  if ((dumpType == TRANSCRIPT_PLAIN) || (dumpType == TRANSCRIPT_ANSI))
+    contents = d->text->toPlainText();
+  else if (dumpType == TRANSCRIPT_HTML)
+    contents = d->text->toHtml();
+  file.write (contents.toLocal8Bit());
 }
 
 void cConsole::setHistorySize (int size) {
@@ -372,6 +380,9 @@ void cConsole::addNewText (cTextChunk *chunk, bool endTheLine)
     if (d->wantNewLine) {
       cursor.insertBlock ();
       d->wantNewLine = false;
+      QTextBlockFormat bformat = cursor.blockFormat();
+      bformat.setLineHeight (2, QTextBlockFormat::LineDistanceHeight);
+      cursor.setBlockFormat (bformat);
     }
 
     cursor.insertHtml (chunk->toHTML());
diff --git a/libs/ctextchunk.cpp b/libs/ctextchunk.cpp
index 11bb59b8d910a229c49884418f99ff35d00fd45c..71309b05231628aa8941b527d5baaa4fa7882a02 100644
--- a/libs/ctextchunk.cpp
+++ b/libs/ctextchunk.cpp
@@ -717,7 +717,7 @@ QString cTextChunk::toHTML ()
   for (it = _entries.begin(); it != _entries.end(); ++it)
     s += (*it)->toHTML (suffix);
   s += suffix;
-  return s;
+  return "

" + s + "

"; } cTextChunk *cTextChunk::makeLine (const QString &text, QColor fg, QColor bg, cConsole *console)