diff -Naur scribus-1.5.3/scribus/pdflib_core.cpp scribus-1.5.3.new/scribus/pdflib_core.cpp
--- scribus-1.5.3/scribus/pdflib_core.cpp 2017-05-28 11:10:25.000000000 +0200
+++ scribus-1.5.3.new/scribus/pdflib_core.cpp 2017-08-24 19:06:31.321370451 +0200
@@ -2531,12 +2531,15 @@
PutDoc("/Name ");
PutDoc(EncStringUTF16(ll.Name, optionalContent));
PutDoc("\n");
- PutDoc("/Usage <> ");
+ }
else
- PutDoc("/OFF");
- PutDoc(">> /View <> ");
+ PutDoc("/View <at(la2);
layer.isViewable = ll.isViewable;
layer.isPrintable = ll.isPrintable;
+ layer.isPrintableView = ll.isPrintableView;
layer.isEditable = ll.isEditable;
layer.isSelectable = ll.isSelectable;
layer.ID = ll.ID;
@@ -503,6 +507,25 @@
return true;
}
return false;
+}
+
+bool ScLayers::layerPrintableView(const int layerID) const
+{
+ const ScLayer* layer = layerByID(layerID);
+ if (layer)
+ return layer->isPrintableView;
+ return false;
+}
+
+bool ScLayers::setLayerPrintableView(const int layerID, const bool isPrintableView)
+{
+ ScLayer* layer = byID(layerID);
+ if (layer)
+ {
+ layer->isPrintableView = isPrintableView;
+ return true;
+ }
+ return false;
}
bool ScLayers::layerVisible(const int layerID) const
diff -Naur scribus-1.5.3/scribus/sclayer.h scribus-1.5.3.new/scribus/sclayer.h
--- scribus-1.5.3/scribus/sclayer.h 2017-05-28 11:10:26.000000000 +0200
+++ scribus-1.5.3.new/scribus/sclayer.h 2017-08-22 23:33:10.000000000 +0200
@@ -23,6 +23,7 @@
int ID;
int Level;
bool isPrintable;
+ bool isPrintableView;
bool isViewable;
bool isEditable;
bool isSelectable;
@@ -214,12 +215,27 @@
/**
* @brief Set the layer printable via the layer ID
* @param layerID ID of the layer
- * @param isPrintable bool true = layer is prantable
+ * @param isPrintable bool true = layer is printable
* @return Success or failure
*/
bool setLayerPrintable(const int layerID, const bool isPrintable);
/**
+ * @brief Is the layer printable on view only
+ * @param layerID ID of the layer
+ * @return Printable view only or not
+ */
+ bool layerPrintableView(const int layerID) const;
+
+ /**
+ * @brief Set the layer printable view only via the layer ID
+ * @param layerID ID of the layer
+ * @param IsPrintableView bool true = layer is printable view only
+ * @return Success or failure
+ */
+ bool setLayerPrintableView(const int layerID, const bool IsPrintableView);
+
+ /**
* @brief Is the layer visible
* @param layerID ID of the layer
* @return Visible or not
diff -Naur scribus-1.5.3/scribus/scribusdoc.cpp scribus-1.5.3.new/scribus/scribusdoc.cpp
--- scribus-1.5.3/scribus/scribusdoc.cpp 2017-05-28 11:10:24.000000000 +0200
+++ scribus-1.5.3.new/scribus/scribusdoc.cpp 2017-08-23 07:41:14.000000000 +0200
@@ -1786,6 +1786,12 @@
setLayerPrintable(ss->getInt("ACTIVE"), isUndo ? !print : print);
layersUndo=true;
}
+ else if (ss->contains("PRINTVIEW_LAYER"))
+ {
+ bool print = ss->getBool("PRINTVIEW");
+ setLayerPrintableView(ss->getInt("ACTIVE"), isUndo ? !print : print);
+ layersUndo=true;
+ }
else if (ss->contains("LAYER_FLOW"))
{
bool flow = ss->getBool("FLOW");
@@ -3091,6 +3097,47 @@
}
return false;
}
+
+
+bool ScribusDoc::setLayerPrintableView(const int layerID, const bool isPrintableView)
+{
+ ScLayers::iterator itend=Layers.end();
+ ScLayers::iterator it;
+ bool found=false;
+ for (it = Layers.begin(); it != itend; ++it)
+ {
+ if (it->ID == layerID)
+ {
+ if (it->isPrintableView!=isPrintableView && UndoManager::undoEnabled())
+ {
+ SimpleState *ss = new SimpleState(isPrintableView ? Um::PrintLayer : Um::DoNotPrintLayer, "", Um::IPrint);
+ ss->set("PRINTVIEW_LAYER");
+ ss->set("ACTIVE", it->ID);
+ ss->set("PRINTVIEW", isPrintableView);
+ m_undoManager->action(this, ss, it->Name, Um::ILayer);
+ }
+ it->isPrintableView = isPrintableView;
+ found=true;
+ break;
+ }
+ }
+ if (found)
+ changed();
+ return found;
+}
+
+
+bool ScribusDoc::layerPrintableView(const int layerID)
+{
+ ScLayers::iterator itend=Layers.end();
+ ScLayers::iterator it;
+ for (it = Layers.begin(); it != itend; ++it)
+ {
+ if (it->ID == layerID)
+ return it->isPrintableView;
+ }
+ return false;
+}
bool ScribusDoc::setLayerVisible(const int layerID, const bool isViewable)
diff -Naur scribus-1.5.3/scribus/scribusdoc.h scribus-1.5.3.new/scribus/scribusdoc.h
--- scribus-1.5.3/scribus/scribusdoc.h 2017-05-28 11:10:25.000000000 +0200
+++ scribus-1.5.3.new/scribus/scribusdoc.h 2017-08-23 00:07:06.000000000 +0200
@@ -326,6 +326,19 @@
*/
bool layerPrintable(const int layerID);
/**
+ * @brief Set the layer printable view via the layer number
+ * @param layerID ID of the layer
+ * @param isPrintableView bool true = layer is printable
+ * @return Success or failure
+ */
+ bool setLayerPrintableView(const int layerID, const bool isPrintableView);
+ /**
+ * @brief Is the layer printable view
+ * @param layerID ID of the layer
+ * @return Printable view or not
+ */
+ bool layerPrintableView(const int layerID);
+ /**
* @brief Set the layer visible via the layer number
* @param layerID ID of the layer
* @param isViewable true = layer is visible
diff -Naur scribus-1.5.3/scribus/ui/layers.cpp scribus-1.5.3.new/scribus/ui/layers.cpp
--- scribus-1.5.3/scribus/ui/layers.cpp 2017-05-28 11:10:23.000000000 +0200
+++ scribus-1.5.3.new/scribus/ui/layers.cpp 2017-08-24 19:31:14.403569551 +0200
@@ -69,15 +69,16 @@
LayerPaletteLayout->addLayout( layout1 );
IconManager* im = IconManager::instance();
- Table = new QTableWidget(0, 8, this );
+ Table = new QTableWidget(0, 9, this );
Table->setHorizontalHeaderItem(0, new QTableWidgetItem(""));
Table->setHorizontalHeaderItem(1, new QTableWidgetItem(im->loadIcon("16/show-object.png"), ""));
Table->setHorizontalHeaderItem(2, new QTableWidgetItem(im->loadIcon("16/document-print.png"), ""));
- Table->setHorizontalHeaderItem(3, new QTableWidgetItem(im->loadIcon("16/lock.png"), ""));
- Table->setHorizontalHeaderItem(4, new QTableWidgetItem(im->loadIcon("16/layer-flow-around.png"), ""));
- Table->setHorizontalHeaderItem(5, new QTableWidgetItem(im->loadIcon("layer-outline.png"), ""));
- Table->setHorizontalHeaderItem(6, new QTableWidgetItem(im->loadIcon("16/pointer.png"), ""));
- Table->setHorizontalHeaderItem(7, new QTableWidgetItem( tr("Name")));
+ Table->setHorizontalHeaderItem(3, new QTableWidgetItem(im->loadIcon("acroread16.png"), ""));
+ Table->setHorizontalHeaderItem(4, new QTableWidgetItem(im->loadIcon("16/lock.png"), ""));
+ Table->setHorizontalHeaderItem(5, new QTableWidgetItem(im->loadIcon("16/layer-flow-around.png"), ""));
+ Table->setHorizontalHeaderItem(6, new QTableWidgetItem(im->loadIcon("layer-outline.png"), ""));
+ Table->setHorizontalHeaderItem(7, new QTableWidgetItem(im->loadIcon("16/pointer.png"), ""));
+ Table->setHorizontalHeaderItem(8, new QTableWidgetItem( tr("Name")));
QHeaderView *header = Table->horizontalHeader();
header->setStretchLastSection(true);
@@ -93,6 +94,7 @@
Table->setColumnWidth(4, 24);
Table->setColumnWidth(5, 24);
Table->setColumnWidth(6, 24);
+ Table->setColumnWidth(7, 24);
Table->setSortingEnabled(false);
Table->setSelectionBehavior( QAbstractItemView::SelectRows );
QHeaderView *Header = Table->verticalHeader();
@@ -256,48 +258,59 @@
QWidget *cw3 = new QWidget(Table);
QCheckBox *cp3 = new QCheckBox(cw3);
cp3->setObjectName(tmp);
- cp3->setChecked(m_Doc->layerLocked(layerID));
+ cp3->setChecked(m_Doc->layerPrintableView(layerID));
QHBoxLayout *cl3 = new QHBoxLayout(cw3);
cl3->addWidget(cp3);
cl3->setAlignment(Qt::AlignCenter);
cl3->setContentsMargins(0,0,0,0);
Table->setCellWidget(row, 3, cw3);
- connect(cp3, SIGNAL(clicked()), this, SLOT(lockLayer()));
+ connect(cp3, SIGNAL(clicked()), this, SLOT(printviewLayer()));
QWidget *cw4 = new QWidget(Table);
QCheckBox *cp4 = new QCheckBox(cw4);
cp4->setObjectName(tmp);
- cp4->setChecked(m_Doc->layerFlow(layerID));
+ cp4->setChecked(m_Doc->layerLocked(layerID));
QHBoxLayout *cl4 = new QHBoxLayout(cw4);
cl4->addWidget(cp4);
cl4->setAlignment(Qt::AlignCenter);
cl4->setContentsMargins(0,0,0,0);
Table->setCellWidget(row, 4, cw4);
- connect(cp4, SIGNAL(clicked()), this, SLOT(flowToggleLayer()));
+ connect(cp4, SIGNAL(clicked()), this, SLOT(lockLayer()));
QWidget *cw5 = new QWidget(Table);
QCheckBox *cp5 = new QCheckBox(cw5);
cp5->setObjectName(tmp);
- cp5->setChecked(m_Doc->layerOutline(layerID));
+ cp5->setChecked(m_Doc->layerFlow(layerID));
QHBoxLayout *cl5 = new QHBoxLayout(cw5);
cl5->addWidget(cp5);
cl5->setAlignment(Qt::AlignCenter);
cl5->setContentsMargins(0,0,0,0);
Table->setCellWidget(row, 5, cw5);
- connect(cp5, SIGNAL(clicked()), this, SLOT(outlineToggleLayer()));
+ connect(cp5, SIGNAL(clicked()), this, SLOT(flowToggleLayer()));
QWidget *cw6 = new QWidget(Table);
QCheckBox *cp6 = new QCheckBox(cw6);
cp6->setObjectName(tmp);
- cp6->setChecked(m_Doc->layerSelectable(layerID));
+ cp6->setChecked(m_Doc->layerOutline(layerID));
QHBoxLayout *cl6 = new QHBoxLayout(cw6);
cl6->addWidget(cp6);
cl6->setAlignment(Qt::AlignCenter);
cl6->setContentsMargins(0,0,0,0);
Table->setCellWidget(row, 6, cw6);
- connect(cp6, SIGNAL(clicked()), this, SLOT(selectToggleLayer()));
+ connect(cp6, SIGNAL(clicked()), this, SLOT(outlineToggleLayer()));
- Table->setItem(row, 7, new QTableWidgetItem(m_Doc->layerName(layerID)));
+ QWidget *cw7 = new QWidget(Table);
+ QCheckBox *cp7 = new QCheckBox(cw6);
+ cp7->setObjectName(tmp);
+ cp7->setChecked(m_Doc->layerSelectable(layerID));
+ QHBoxLayout *cl7 = new QHBoxLayout(cw7);
+ cl7->addWidget(cp7);
+ cl7->setAlignment(Qt::AlignCenter);
+ cl7->setContentsMargins(0,0,0,0);
+ Table->setCellWidget(row, 7, cw7);
+ connect(cp7, SIGNAL(clicked()), this, SLOT(selectToggleLayer()));
+
+ Table->setItem(row, 8, new QTableWidgetItem(m_Doc->layerName(layerID)));
}
connect(Table, SIGNAL(cellChanged(int, int)), this, SLOT(changeName(int, int)));
connect(Table, SIGNAL(cellClicked(int, int)), this, SLOT(setActiveLayer(int, int)));
@@ -446,6 +459,23 @@
}
}
+void LayerPalette::printviewLayer()
+{
+ if (!m_Doc)
+ return;
+ int level = QString(sender()->objectName()).toInt();
+ int layerID=m_Doc->layerIDFromLevel(level);
+ if (layerID==-1)
+ return;
+ const QObject* senderBox=sender();
+ if (strcmp(senderBox->metaObject()->className(), "QCheckBox") == 0)
+ {
+ m_Doc->setLayerPrintableView(layerID,((QCheckBox*)(senderBox))->isChecked());
+ setActiveLayer(Table->currentRow(), -1);
+ emit LayerChanged();
+ }
+}
+
void LayerPalette::lockLayer()
{
if (!m_Doc)
@@ -537,17 +567,22 @@
if (index == 3)
{
((QCheckBox*)(Table->cellWidget(row, 3)))->toggle();
- it->isEditable = !((QCheckBox*)(Table->cellWidget(row, 3)))->isChecked();
+ it->isPrintableView = ((QCheckBox*)(Table->cellWidget(row, 3)))->isChecked();
}
if (index == 4)
{
((QCheckBox*)(Table->cellWidget(row, 4)))->toggle();
- it->flowControl = ((QCheckBox*)(Table->cellWidget(row, 4)))->isChecked();
+ it->isEditable = !((QCheckBox*)(Table->cellWidget(row, 4)))->isChecked();
}
- else if (index == 5)
+ if (index == 5)
{
((QCheckBox*)(Table->cellWidget(row, 5)))->toggle();
- it->outlineMode = ((QCheckBox*)(Table->cellWidget(row, 5)))->isChecked();
+ it->flowControl = ((QCheckBox*)(Table->cellWidget(row, 5)))->isChecked();
+ }
+ else if (index == 6)
+ {
+ ((QCheckBox*)(Table->cellWidget(row, 6)))->toggle();
+ it->outlineMode = ((QCheckBox*)(Table->cellWidget(row, 6)))->isChecked();
}
}
emit LayerChanged();
@@ -720,11 +755,12 @@
Table->horizontalHeaderItem(0)->setToolTip("" + tr("Color of the Layer Indicator. Each layer has a color assigned to display on the canvas when layer indicators are enabled. You can double click to edit the color.") + "");
Table->horizontalHeaderItem(1)->setToolTip("" + tr("Make Layer Visible. Uncheck to hide the layer from the display.") + "" );
Table->horizontalHeaderItem(2)->setToolTip("" + tr("Print Layer. Uncheck to disable printing.") + "" );
- Table->horizontalHeaderItem(3)->setToolTip("" + tr("Lock or Unlock Layer. Unchecked is unlocked.") + "" );
- Table->horizontalHeaderItem(4)->setToolTip("" + tr("Make text in lower layers flow around objects. Enabling this forces text in lower layers to flow around objects of the layer for which this option has been enabled.") + "" );
- Table->horizontalHeaderItem(5)->setToolTip("" + tr("Outline Mode. Toggles the 'wireframe' display of objects to speed the display of very complex objects.") + "" ) ;
- Table->horizontalHeaderItem(6)->setToolTip("" + tr("Select Objects on Layer. Check to enable selecting.") + "" );
- Table->horizontalHeaderItem(7)->setToolTip("" + tr("Name of the Layer. Double click on the name of a layer to edit the name.") + "" );
+ Table->horizontalHeaderItem(3)->setToolTip("" + tr("Print Layer on view only. Check to print layer PDF on view only.") + "" );
+ Table->horizontalHeaderItem(4)->setToolTip("" + tr("Lock or Unlock Layer. Unchecked is unlocked.") + "" );
+ Table->horizontalHeaderItem(5)->setToolTip("" + tr("Make text in lower layers flow around objects. Enabling this forces text in lower layers to flow around objects of the layer for which this option has been enabled.") + "" );
+ Table->horizontalHeaderItem(6)->setToolTip("" + tr("Outline Mode. Toggles the 'wireframe' display of objects to speed the display of very complex objects.") + "" ) ;
+ Table->horizontalHeaderItem(7)->setToolTip("" + tr("Select Objects on Layer. Check to enable selecting.") + "" );
+ Table->horizontalHeaderItem(8)->setToolTip("" + tr("Name of the Layer. Double click on the name of a layer to edit the name.") + "" );
}
diff -Naur scribus-1.5.3/scribus/ui/layers.h scribus-1.5.3.new/scribus/ui/layers.h
--- scribus-1.5.3/scribus/ui/layers.h 2017-05-28 11:10:23.000000000 +0200
+++ scribus-1.5.3.new/scribus/ui/layers.h 2017-08-22 23:51:19.000000000 +0200
@@ -52,6 +52,7 @@
void changeName(int row, int col);
void visibleLayer();
void printLayer();
+ void printviewLayer();
void lockLayer();
void flowToggleLayer();
void outlineToggleLayer();