-
Notifications
You must be signed in to change notification settings - Fork 776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add publish action for PDF export #2618
Draft
dhmint
wants to merge
11
commits into
xournalpp:master
Choose a base branch
from
dhmint:pr_publish_action
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7becbb8
Publish action and PublishJob stub added
dhmint 1e9fa4b
Added script execution to publish action
dhmint 4793d78
Options and timer for publish action added
dhmint 4ec6dc7
Silent PDF publish operation
dhmint 12e4ba5
clang format requests applied
dhmint a539ce4
Windows C compatibility fix
dhmint 466d40c
Windows C string refixed
dhmint c5eee53
Removed debug g_message
dhmint c838fe2
Windows C string conversion fixed
dhmint 013985e
Windows C file to string removed
dhmint 56cb8fd
Windows C string fix again
dhmint File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "PdfPublishJob.h" | ||
|
||
#include "control/Control.h" | ||
|
||
#include "i18n.h" | ||
|
||
PdfPublishJob::PdfPublishJob(Control* control, const string& script): PdfExportJob(control) { this->script = script; } | ||
|
||
PdfPublishJob::~PdfPublishJob() = default; | ||
|
||
void PdfPublishJob::afterExport() { | ||
PdfExportJob::afterExport(); | ||
|
||
if (script != "") { | ||
string modscript(script); | ||
string parameter = "$1"; | ||
size_t pos = 0; | ||
while (true) { | ||
pos = modscript.find(parameter, pos); | ||
if (pos == string::npos) | ||
break; | ||
modscript.erase(pos, parameter.length()); | ||
modscript.insert(pos, string(this->filepath.c_str())); | ||
pos += 1; | ||
} | ||
system(modscript.c_str()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Xournal++ | ||
* | ||
* A job to export and publish PDF | ||
* | ||
* @author Xournal++ Team | ||
* https://github.com/xournalpp/xournalpp | ||
* | ||
* @license GNU GPLv2 or later | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "PdfExportJob.h" | ||
|
||
class PdfPublishJob: public PdfExportJob { | ||
public: | ||
PdfPublishJob(Control* control, const string& script); | ||
|
||
protected: | ||
virtual void afterExport(); | ||
virtual ~PdfPublishJob(); | ||
|
||
private: | ||
string script; | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is confusing; I initially thought this was the publication interval. Can you rename this to something like
autoPublishHandler
?