Bug 90125 - Option to adjust all curve widths when printing would be nice
Summary: Option to adjust all curve widths when printing would be nice
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-23 19:03 UTC by Matthew Truch
Modified: 2004-09-24 08:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Truch 2004-09-23 19:03:34 UTC
Version:           1.0.0_devel (using KDE KDE 3.2.3)
OS:                Linux

Printers vary widely in size of paper and resolution.  It would be nice if one could select a global adjustment (plus or minus) for curve widths for a printed plot.  This way, if a printout produces very thin or very thick curves, one can adjust this for their printout without adjusting curves widths' permanently.
Comment 1 Nicolas Brisset 2004-09-23 19:17:07 UTC
Oh yes, please do this. I noticed that lines are very nice on the screen but too thin for my Epson inkjet printer as well as a Lexmark color laser printer I tried with. Grid lines are especially hard to see in the printed result.
The ideal way for this would be to keep things the way they are for on-screen display, but generate postscript with thicker lines. Don't know if that's possible, though...

Comment 2 George Staikos 2004-09-23 19:22:53 UTC
On Thursday 23 September 2004 13:03, Matthew Truch wrote:
> Printers vary widely in size of paper and resolution.  It would be nice if
> one could select a global adjustment (plus or minus) for curve widths for a
> printed plot.  This way, if a printout produces very thin or very thick
> curves, one can adjust this for their printout without adjusting curves
> widths' permanently. _______________________________________________

  I have a partially implemented extension to the print dialog when used in 
Kst.  When I commit it, we can add this too.

Comment 3 George Staikos 2004-09-23 22:28:22 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 08:15:58 UTC
CVS commit by staikos: 

Implemented monochrome printing option.  It's "good enough" for now, but
a more general solution for switching to monochrome would be a good idea
someday.

CCMAIL: 90125-done@bugs.kde.org


  M +15 -6     kst.cpp   1.239
  M +34 -0     kst2dplot.cpp   1.270
  M +7 -0      kst2dplot.h   1.110
  M +10 -8     kstbasecurve.h   1.24
  M +11 -4     kstprintoptionspage.cpp   1.4
  M +1 -1      kstprintoptionspage.h   1.4



Comment 5 George Staikos 2004-09-24 08:18:14 UTC
90124 is fixed with the commit that closed 90125 (by accident).  90125 was 
also fixed, though a bit earlier.