Bug 90115 - print to file. please remove "Page: 1 Name: W1 Date:..." comment at the bottom of pages.
Summary: print to file. please remove "Page: 1 Name: W1 Date:..." comment at the b...
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Mandrake RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: George Staikos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-23 17:44 UTC by Carrie MacTavish
Modified: 2004-09-24 16:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carrie MacTavish 2004-09-23 17:44:06 UTC
Version:           0.99 (using KDE 3.1.0)
Installed from:    Mandrake Linux Cooker i586 - Cooker
Compiler:          gcc version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)
OS:                Linux (i686) release 2.4.21-0.13mdk

when printing to file there is a text message which appears at the bottom pf plots...would love if this was removed...alternatively when exporting to eps or ps plots are cropped and become blck and white...if this could be fixed that would also be great!
Comment 1 George Staikos 2004-09-23 17:57:00 UTC
Confirmed.  Will disable that shortly.  It may be re-added as a kdeprint option later.

The EPS export bug, if I can confirm it, must also be fixed.
Comment 2 George Staikos 2004-09-23 18:01:14 UTC
CVS commit by staikos: 

Disable printing of page/date/etc.  Will re-add later in an optional manner.
CCMAIL: 90115@bugs.kde.org


  M +2 -0      kst.cpp   1.234


--- kdeextragear-2/kst/kst/kst.cpp  #1.233:1.234
@@ -1016,5 +1016,7 @@ void KstApp::slotFilePrint() {
 
               pView->view()->resizeForPrint(size);
+#if 0
               paint.drawText(rect, Qt::AlignLeft | Qt::AlignVCenter, title);
+#endif
               pView->view()->paint(P_PRINT, paint);
               pView->view()->revertForPrint();


Comment 3 George Staikos 2004-09-23 22:28:23 UTC
CVS commit by staikos: 

Kst print settings page
CCMAIL: 90115@bugs.kde.org, 90124@bugs.kde.org, 90125@bugs.kde.org


  M +9 -7      kst.cpp   1.236
  M +18 -1     kstprintoptionspage.cpp   1.2
  M +1 -1      kstprintoptionspage.h   1.2


--- kdeextragear-2/kst/kst/kst.cpp  #1.235:1.236
@@ -58,4 +58,5 @@
 #include "kstplotdialog_i.h"
 #include "kstplugindialog_i.h"
+#include "kstprintoptionspage.h"
 #include "kstpsddialog_i.h"
 #include "kstsettingsdlg.h"
@@ -983,4 +984,5 @@ void KstApp::slotFilePrint() {
 
     iNumPages = 0;
+    printer.addDialogPage(new KstPrintOptionsPage);
     if (printer.setup(this, i18n("Print"))) {
       QDateTime dateTime = QDateTime::currentDateTime();
@@ -997,7 +999,7 @@ void KstApp::slotFilePrint() {
       rect.setRight(size.height());
       rect.setBottom(size.height());
-#if 0
+      if (printer.option("kst-plot-datetime-footer") == "1") {
       size.setHeight(9 * size.height() / 10);
-#endif
+      }
       rect.setTop(size.height());
 
@@ -1015,10 +1017,10 @@ void KstApp::slotFilePrint() {
               }
 
-              QString title = i18n("Page: %1  Name: %2  Date: %3").arg(iNumPages).arg(pView->caption()).arg(dateTime.toString(Qt::ISODate));
 
               pView->view()->resizeForPrint(size);
-#if 0
+              if (printer.option("kst-plot-datetime-footer") == "1") {
+                QString title = i18n("Page: %1  Name: %2  Date: %3").arg(iNumPages).arg(pView->caption()).arg(dateTime.toString(Qt::ISODate));
               paint.drawText(rect, Qt::AlignLeft | Qt::AlignVCenter, title);
-#endif
+              }
               pView->view()->paint(P_PRINT, paint);
               pView->view()->revertForPrint();

--- kdeextragear-2/kst/kst/kstprintoptionspage.cpp  #1.1:1.2
@@ -17,7 +17,17 @@
 
 #include <qcheckbox.h>
+#include <qlayout.h>
+
+#include <klocale.h>
+
 #include "kstprintoptionspage.h"
 
-KstPrintOptionsPage::KstPrintOptionsPage() {
+KstPrintOptionsPage::KstPrintOptionsPage(QWidget *parent, const char *name)
+: KPrintDialogPage(parent, name) {
+  setTitle(i18n("Kst Options"));
+  QGridLayout *grid = new QGridLayout(this, 1, 1);
+  _dateTimeFooter = new QCheckBox(i18n("Append plot information to each page"), this);
+  grid->addWidget(_dateTimeFooter, 0, 0);
+  grid->activate();
 }
 
@@ -28,12 +38,19 @@ KstPrintOptionsPage::~KstPrintOptionsPag
 
 void KstPrintOptionsPage::setOptions(const QMap<QString,QString>& opts) {
+  _dateTimeFooter->setChecked(opts["kst-plot-datetime-footer"] == "1");
 }
 
 
 void KstPrintOptionsPage::getOptions(QMap<QString,QString>& opts, bool include_def) {
+  // datetime footer - default is false
+  if (_dateTimeFooter->isChecked() || include_def) {
+    opts["kst-plot-datetime-footer"] = _dateTimeFooter->isChecked() ? "1" : "0";
+  }
 }
 
 
 bool KstPrintOptionsPage::isValid(QString& msg) {
+  Q_UNUSED(msg)
+  return true;
 }
 

--- kdeextragear-2/kst/kst/kstprintoptionspage.h  #1.1:1.2
@@ -24,5 +24,5 @@ class QCheckBox;
 class KstPrintOptionsPage : public KPrintDialogPage {
   public:
-    KstPrintOptionsPage();
+    KstPrintOptionsPage(QWidget *parent = 0L, const char *name = 0L);
     virtual ~KstPrintOptionsPage();
 


Comment 4 George Staikos 2004-09-24 16:52:28 UTC
Output is certainly monochrome for EPS, but that's not a Kst bug.  Looks to be a KDE or Qt bug perhaps.  I'm not sure where though.  Since Postscript printing is fixed, I think that solves your problems.