Feat: script editor in `pre` and `post` backup scripts
Description
I've added buttons beside the pre-backup and post-backup line edits in the Schedule tab in the Shell Commands section.
https://github.com/borgbase/vorta/assets/71956678/71676ac1-5db2-4a34-8adc-f7f3b9033907
Related Issue
#1945
Motivation and Context
Makes it more convenient to add the commands using a shell script.
How Has This Been Tested?
does effect much of the code, only extends some functionality
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] I have read the CONTRIBUTING guide.
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.
Oh even I was ready with a PR, I shared a screenshot in the issue thread. Could've saved one of us the work if you told me that you were working on this :sweat_smile:
Oh even I was ready with a PR, I shared a screenshot in the issue thread. Could've saved one of us the work if you told me that you were working on this 😅
damn 😔 yeah I should've. I just finished this one today.
To avoid overlaps, you can make sure the issue is assigned to you before working on it.
As for this implementation, it's reading a file. We should also look into having a larger editor window instead. Often it's hard to decide what's the best way without seeing it. So even PRs that aren't merged can help with discovering a good solution.
To avoid overlaps, you can make sure the issue is assigned to you before working on it.
As for this implementation, it's reading a file. We should also look into having a larger editor window instead. Often it's hard to decide what's the best way without seeing it. So even PRs that aren't merged can help with discovering a good solution.
Thank you Will try implementing that as well.
PS: please assign me the issue #1945
Well, apparently I have exams starting soon and also have to ready my proposal for GSOC. So, I'll add this one along with some more issues in my proposal.
To avoid overlaps, you can make sure the issue is assigned to you before working on it.
As for this implementation, it's reading a file. We should also look into having a larger editor window instead. Often it's hard to decide what's the best way without seeing it. So even PRs that aren't merged can help with discovering a good solution.
Well, I snatched some time and implemented a small editor window for it. I've updated this PR. This is how it looks so far:
PS: monospace fonts aren't installed in my system, so that must be why it is appearing in simple noto font.
Editor looks good. Just what I imagined.
I'd remove the "Load from file" button though. Since the problem it solves is very minor. One can easily copy and paste in the editor. Would just make sure the editor window can be resized.
Editor looks good. Just what I imagined.
I'd remove the "Load from file" button though. Since the problem it solves is very minor. One can easily copy and paste in the editor. Would just make sure the editor window can be resized.
sure, that can be done. Yeah, The editor window is resizable, will make it wider ig.
Update:
some spacing between the field and Save button would look good IMO.
Looks good to me. Will try it locally and then merge, if there are no other concerns or things that come up.
Updated
| Before | |
|---|---|
| After |
Updated:
- Now the label does change depending upon the context (pre/post-backup script).
- Controlled the spacing. Looks more aligned now.
- Use of
QDialogButtonBoxfor 'Save' and 'Cancel' buttons.
Now that it's complete, how about I add some syntax highlighting to it as well? Need some thoughts.
Now that it's complete, how about I add some syntax highlighting to it as well? Need some thoughts.
Seems to much efford for such a small use case. Most people will copy paste the script from another editor anyways.
Seems to much efford for such a small use case. Most people will copy paste the script from another editor anyways.
Yeah, I'll drop the idea. Its fine as it is.