[Add] Add a slot to clipboard.
This commit is contained in:
parent
207a5f7a0d
commit
e8f1d2ce3f
@ -54,22 +54,23 @@ bool PDFJam::removePage(int fileIndex, int numPages, int deletedPageIndex) {
|
|||||||
pushCommand(cmd);
|
pushCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PDFJam::cutPage(int fileIndex, int numPages, int pageIndex) {
|
void PDFJam::cutPage(int fileIndex, int numPages, int pageIndex, int slot) {
|
||||||
if((pageIndex < 0) || (pageIndex >= numPages)) {
|
if((pageIndex < 0) || (pageIndex >= numPages)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
copyPage(fileIndex, numPages, pageIndex);
|
copyPage(fileIndex, numPages, pageIndex, 0);
|
||||||
removePage(fileIndex, numPages, pageIndex);
|
removePage(fileIndex, numPages, pageIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PDFJam::copyPage(int fileIndex, int numPages, int pageIndex) {
|
void PDFJam::copyPage(int fileIndex, int numPages, int pageIndex, int slot) {
|
||||||
QString cpTmp = "cp /tmp/hpdf/%1%2.pdf /tmp/hpdf/clipboard.pdf ";
|
QString cpTmp = "cp /tmp/hpdf/%1/%2.pdf /tmp/hpdf/clipboard%3.pdf";
|
||||||
QString cmd = cpTmp.arg(QString::number(fileIndex)).arg(QString::number(pageIndex));
|
QString cmd = cpTmp.arg(QString::number(fileIndex)).arg(QString::number(pageIndex))
|
||||||
|
.arg(QString::number(slot));
|
||||||
pushCommand(cmd);
|
pushCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PDFJam::pastePage(int fileIndex, int numPages, int pageIndex) {
|
void PDFJam::pastePage(int fileIndex, int numPages, int pageIndex, int slot) {
|
||||||
/* TODO: Check if the clipboard file exists. */
|
/* TODO: Check if the clipboard file exists. */
|
||||||
QString cmd = "";
|
QString cmd = "";
|
||||||
QString mvTmp = "mv /tmp/hpdf/%1/%2.pdf /tmp/hpdf/%3/%4.pdf ";
|
QString mvTmp = "mv /tmp/hpdf/%1/%2.pdf /tmp/hpdf/%3/%4.pdf ";
|
||||||
@ -79,8 +80,9 @@ void PDFJam::pastePage(int fileIndex, int numPages, int pageIndex) {
|
|||||||
if(i > pageIndex) cmd += " && ";
|
if(i > pageIndex) cmd += " && ";
|
||||||
}
|
}
|
||||||
|
|
||||||
QString pasteTmp = "cp /tmp/hpdf/clipboard.pdf /tmp/hpdf/%1/%2.pdf ";
|
QString pasteTmp = "cp /tmp/hpdf/clipboard%3.pdf /tmp/hpdf/%1/%2.pdf ";
|
||||||
cmd += " && " + pasteTmp.arg(QString::number(fileIndex)).arg(QString::number(pageIndex));
|
cmd += " && " + pasteTmp.arg(QString::number(fileIndex))
|
||||||
|
.arg(QString::number(pageIndex)).arg(QString::number(slot));
|
||||||
pushCommand(cmd);
|
pushCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,8 +97,8 @@ void PDFJam::movePage(int fromFileIndex, int fromFileNumPage, int fromPageIndex,
|
|||||||
toPageIndex--;
|
toPageIndex--;
|
||||||
}
|
}
|
||||||
|
|
||||||
cutPage(fromFileIndex, fromFileNumPage, fromPageIndex);
|
cutPage(fromFileIndex, fromFileNumPage, fromPageIndex, 0);
|
||||||
pastePage(toFileIndex, toFileNumPage, toPageIndex);
|
pastePage(toFileIndex, toFileNumPage, toPageIndex, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PDFJam::savePageAsImage(Poppler::Page pp, QString dst, double dpi = 72) {
|
void PDFJam::savePageAsImage(Poppler::Page pp, QString dst, double dpi = 72) {
|
||||||
|
@ -17,9 +17,10 @@ public:
|
|||||||
void exportFile(int, int, QString, QSize, bool, bool, int, int);
|
void exportFile(int, int, QString, QSize, bool, bool, int, int);
|
||||||
void savePageAsImage(Poppler::Page pp, QString dst, double);
|
void savePageAsImage(Poppler::Page pp, QString dst, double);
|
||||||
void movePage(int, int, int, int, int, int);
|
void movePage(int, int, int, int, int, int);
|
||||||
void pastePage(int, int, int);
|
|
||||||
void copyPage(int, int, int);
|
void pastePage(int, int, int, int);
|
||||||
void cutPage(int, int, int);
|
void copyPage(int, int, int, int);
|
||||||
|
void cutPage(int, int, int, int);
|
||||||
|
|
||||||
bool removePage(int, int, int);
|
bool removePage(int, int, int);
|
||||||
bool rotatePage(int, int, int);
|
bool rotatePage(int, int, int);
|
||||||
|
Loading…
Reference in New Issue
Block a user