-
Notifications
You must be signed in to change notification settings - Fork 200
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
cut/copy/paste actions #140
Comments
Yep, this was on my (hidden) to do list. The problem is not that we don't have cut/copy/paste actions in the menu, the problem is that we don't have them at all. The current drag & drop must be reimplemented to separate the drag & drop behavior from the cut/copy/paste code, so it could be reused in menus (popup and menu bars) and have ctrl+cxv shortcuts. It would also make #67 easier to implement. |
Before thinking about code I see a UX problem here: We currently do not have a cursor between two pages but only a selection of pages. Think of text editing: The cursor is usually not on but between two characters and you can move it in front of the first and after the last character. We could decide to make pasted pages appear before or after the current selection but either way it wouldn't be possible to paste as the first and the last page. |
As I'm not that comfortable with UX I was thinking to something like:
I don't know yet if special past should popup a dialog or be split into different actions (into a submenu). |
One way of doing it using partly already available functions (I suppose) would be first to do a modified version of the "export selection" that would save selected pages to temporary location (without having to supply a place and file location). Then delete selected pages. Then you would select the page where you would like to paste. Then choose "paste", and it would paste for example after selected page. Another thing a bit related to this, I would suggest in pdfarranger.py on line 853 "autoscroll_area = 40" would be increased to 80. |
I have been working on this. If someone wants to see it is in kbengs/pdfarranger/kben/raw fork/branch. It paste after selected item(s) (after last selected item). Paste to other instance does not work. But otherwise it seems to work. Should I continue or stop? :) |
Prevent GObject.source_remove being called with an invalid id when the timer has already been stopped. This can be triggered by adding another PDF via drag and drop or by testing kbengs' work on pdfarranger#140. Warning message: ``` pdfarranger/pdfarranger.py:491: Warning: Source ID 26 was not found when attempting to remove it GObject.source_remove(self.progress_bar_timeout_id) ```
I just gave it a try and it definitely feels like a good addition! 👍 Like I mentioned before we now have the problem, that you can't paste something before the first page. I wonder if we could add a selectable dummy before the first page that could be selected by arrow buttons or clicking so that pages pasted there would end up at the beginning. (I may be aiming high here, a "paste before" action would be probably easier to implement and sufficiently usable when mapped to Ctrl+Shift+V.) For allowing copy and paste between instances you could serialize all the data to a string and put that in the actual clipboard, similar to the current implementation of drag and drop. Like Jerome already mentioned, the current drag and drop code should be reused in that case. (And it probably needs some refactoring beforehand.) |
Ok, thanks for comments. I have done more changes now: Dont know of any problem with it. Not tested anything on windows. |
Prevent GObject.source_remove being called with an invalid id when the timer has already been stopped. This can be triggered by adding another PDF via drag and drop or by testing kbengs' work on #140. Warning message: ``` pdfarranger/pdfarranger.py:491: Warning: Source ID 26 was not found when attempting to remove it GObject.source_remove(self.progress_bar_timeout_id) ```
|
Thanks for comments. I have cleaned the history and fixed the things you commented. It is now in kben/cutcopypaste branch. If/when I feel I have no more to add to this, is it too early to make a PR, too far from 1.5? |
Yes, it looks perfect ! I will probably release 1.4.2 tomorrow so you can make your PR. |
I couldn't resist the paste interleave..,
What do you think about this behavior? All is in same branch. |
I'll give it a try and see how it feels asap |
I also changed paste after/before so that:
|
@kbengs It looks good. Do you have any objection to me merging it now? |
No I am happy with it, you can merge it. 👍 |
That's great, good work @kbengs 👍 PDF Arranger is getting really fancy now with drag and drop, undo, redo and now copy & paste 😀 |
Would be nice to have option to cut / paste selected pages when right clicking. It is now a bit hard to move for example the last page to the beginning when there is a lot of pages..
The text was updated successfully, but these errors were encountered: