! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Allow to pause a job
Status:
RESOLVED: FIXED

Comments

Description Cyrille Pontvieux 2020-04-13 12:14:08 CEST
Created attachment 9712 
pause job patch against master

Gio cannot support pausing a copy, but with the blocking progress callback, it's possible to emulate this.

This is what I've done in this patch. The copy view get a new Pause/Resume button.

Feel free to tell me if something is wrong or should be improved.

The code could also be found in my forked repo: https://github.com/jrd/thunar/tree/pause-job

I tried to be as updated as possible on the master branch.
Comment 1 Cyrille Pontvieux 2020-04-13 12:42:06 CEST
Created attachment 9714 
screenshot
Comment 2 Cyrille Pontvieux 2020-04-13 13:00:25 CEST
Created attachment 9716 
pause job patch against master
Comment 3 alexxcons editbugs 2020-04-13 15:10:52 CEST
Thanks alot for the patches !

I will test & review them when I have time .. hopefully soon.
Comment 4 Reuben Green editbugs 2020-04-13 22:03:11 CEST
Created attachment 9722 
minor changes to whitespace

I have given this a quick test, and it seem to compile and run fine. I have just made a few very small edits to the whitespace (to save Alex from having to do it ;) ).

One small comment: the icons media-play and media-pause are not included in any of the default debian icon sets on my system so I just see a "no icon" symbol. Maybe it might be best to use other standard icons?

I like this feature!

I will try to give your other patches a test soon.
Comment 5 Cyrille Pontvieux 2020-04-14 14:07:41 CEST
`gtk-media-play-ltr` and `gtk-media-pause` icon names seems to be ok. I found them in icons/gnome and they symlinks to `media-playback-start` and `media-playback-pause` respectively. Them or their symlinks could potentially be a good replacement.

Is there a way to find out a somehow standard, or de-facto standard, list of icons expected on a regular Linux or BSD system?
Comment 6 Reuben Green editbugs 2020-04-16 15:28:12 CEST
(In reply to Cyrille Pontvieux from comment #5)
> `gtk-media-play-ltr` and `gtk-media-pause` icon names seems to be ok. I
> found them in icons/gnome and they symlinks to `media-playback-start` and
> `media-playback-pause` respectively. Them or their symlinks could
> potentially be a good replacement.
> 
> Is there a way to find out a somehow standard, or de-facto standard, list of
> icons expected on a regular Linux or BSD system?

So I found this list https://developer.gnome.org/icon-naming-spec/, which includes media-playback-start and media-playback-pause, so maybe those are good choices?
Comment 7 Cyrille Pontvieux 2020-04-16 18:42:23 CEST
Yest I think so
Comment 8 Cyrille Pontvieux 2020-04-16 19:31:25 CEST
Created attachment 9729 
New patch with whitespaces fixes and icons fixes
Comment 9 alexxcons editbugs 2020-04-16 23:32:29 CEST
(In reply to Cyrille Pontvieux from comment #8)
> Created attachment 9729 
> New patch with whitespaces fixes and icons fixes

Works fine here, nice, thanks alot !
 
There is a typo for the pause icon:
media-playpack-pause --> media-playback-pause

Some minor changes I would suggest before pushing it:
- _thunar_return_if_fail / _thunar_return_val_if_fail guards in thunar-job.c
- _thunar_transfer_job_progress_check_pause --> why an extra method, instead of just calling _thunar_transfer_job_check_pause inside thunar_transfer_job_progress ?
- Why you added a underscore in front of the method name ? (In thunar afaik no such convention is used)
- g_usleep (500 * 1000); Best put a comment: /* 500ms */
Comment 10 Cyrille Pontvieux 2020-04-17 10:36:25 CEST
Created attachment 9735 
Patch with alexxcons suggestions

Here is a new patch with your recommended modifications.

About the underscore in front of private functions, I first find one in thunar-job.c : _thunar_job_ask_accumulator

So I was under the impression that private functions were prefixed with underscore. My bad.
Comment 11 Git Bot editbugs 2020-04-17 22:38:29 CEST
Cyrille Pontvieux referenced this bugreport in commit 4e7016a3e4515603b8bdd3c7119d3e7f2197c0b7

Pause button on copy/move (Bug #16685)

https://git.xfce.org/xfce/thunar/commit?id=4e7016a3e4515603b8bdd3c7119d3e7f2197c0b7
Comment 12 alexxcons editbugs 2020-04-17 22:42:17 CEST
Pushed to master, thanks alot for your contribution !

Thanks as well to Reuben for the first review & testing !

... one down, two ahead :)
Comment 13 alexxcons editbugs 2020-05-10 22:28:36 CEST
*** Bug 10282 has been marked as a duplicate of this bug. ***

Bug #16685

Reported by:
Cyrille Pontvieux
Reported on: 2020-04-13
Last modified on: 2020-05-10
Duplicates (1):

People

Assignee:
Xfce Bug Triage
CC List:
4 users

Version

Attachments

pause job patch against master (12.63 KB, patch)
2020-04-13 12:14 CEST , Cyrille Pontvieux
no flags
screenshot (12.38 KB, image/png)
2020-04-13 12:42 CEST , Cyrille Pontvieux
no flags
pause job patch against master (13.03 KB, patch)
2020-04-13 13:00 CEST , Cyrille Pontvieux
no flags
minor changes to whitespace (13.04 KB, patch)
2020-04-13 22:03 CEST , Reuben Green
no flags
New patch with whitespaces fixes and icons fixes (13.01 KB, patch)
2020-04-16 19:31 CEST , Cyrille Pontvieux
no flags
Patch with alexxcons suggestions (12.67 KB, patch)
2020-04-17 10:36 CEST , Cyrille Pontvieux
no flags

Additional information