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 range selection for pages #862
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #862 +/- ##
==========================================
- Coverage 79.62% 78.69% -0.94%
==========================================
Files 13 13
Lines 4962 5031 +69
==========================================
+ Hits 3951 3959 +8
- Misses 1011 1072 +61 ☔ View full report in Codecov by Sentry. |
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.
There are exceptions if you write a page number that does not exist. Also if you write a character.
But other than that it appears to work well. I suggest you wait for comments from other reviewers before doing changes.
pdfarranger/pdfarranger.py
Outdated
row = model[page-1] | ||
self.iconview.select_path(row.path) | ||
|
||
with self.render_lock(): |
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.
The code lines 2504-2513 can be replaced with:
if range_selected is not None:
self.update_statusbar()
(the rest is not needed here)
pdfarranger/pageutils.py
Outdated
self.selection = selection | ||
|
||
def run_get(self): | ||
""" Open the dialog and return the crop value """ |
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.
Not crop
pdfarranger/pageutils.py
Outdated
label.set_max_width_chars(38) | ||
grid.attach(label, 0, 0, 2, 1) | ||
|
||
label = Gtk.Label(label="Select range of pages") |
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 need to be translatable too
Can you fix what was commented here? Also good if you can rebase/squash/fixup so all is in one commit. |
@bilgetutak are you interested in following up here? Is anyone else? Otherwise I propose to copy this branch to our repo for further reference and close this stale pr. |
I am sorry @dreua. I was in a long project commitment, just delivered. I will work on it this week, if not I will close. Thanks for reminding. |
the range selection. - Added menu item to select menu and select context menus. - Added range_select_dialog method to pdfarranger.py for completing the range selection. - Handles ranges with '-' or comma separated list of values - Handles min/max cases. (-3 ==> 0 to 3, or 4- ==> 4 to end) - Dialog has real time check of user input to limited set of characters ('0123456789,- ') using on_change signal. - Labels/titles are translatable.
I have reviewed the comments here, and I believe I fixed them all. All changes in one commit this time (reversed my original fork). |
Appears to work. A few comments on what I notice:
(I added a missing space and remove 'Page range to select.') And place the label under the entry instead of above? (not sure)
|
(,,,,, and ----) in the selection dialog during the text entry - Removed unused variables - Adjusted labels and buttons in dialog.
|
You should remove them here, as they are not used. They can be added later if needed. Can you also remove |
7295cc4
to
624767f
Compare
the range selection. - Added menu item to select menu and select context menus. - Added range_select_dialog method to pdfarranger.py for completing the range selection. - Handles ranges with '-' or comma separated list of values - Handles min/max cases. (-3 ==> 0 to 3, or 4- ==> 4 to end) - Dialog has real time check of user input to limited set of characters ('0123456789,- ') using on_change signal. - Labels/titles are translatable.
@bilgetutak it is currently in a state so that it can not be merged. The commits would need to be moved to top of the main branch. And ideally in one commit. If you do not want to/can't fix it I can do it. |
@kbengs I actually thought that I did reduce it in to one commit, but I didn't have experience with it before and I think I had trouble (gotta get better with git :)). If not much trouble, can you complete it. Much appreciated. |
soft bump 🥲 |
As discussed in #861
Added RangeSelectDialog class to handle the range selection.