[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-05-10 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

alexxcons  changed:

   What|Removed |Added

 CC||bugme...@mailinator.com

--- Comment #19 from alexxcons  ---
*** Bug 10751 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-05-02 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

alexxcons  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-05-02 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

alexxcons  changed:

   What|Removed |Added

URL|https://github.com/jrd/thun |FIXED
   |ar/tree/rename-on-fail-copy |

--- Comment #18 from alexxcons  ---
.. pushed to master, will be released in thunar 1.9.0

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-05-02 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #17 from alexxcons  ---
Opened Bug #16794 for "Ask for a new name instead of (Copy 1)"

Thanks alot Cyrille, for your contribution !

As well thanks to Reuben for testing the patches !

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-05-02 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #16 from Git Bot  ---
Cyrille Pontvieux referenced this bugreport in commit
500026ac163dfb5f93ce187b3a5b29cca4582a34

Option to rename a file when existing copy conflicts (Bug #16686)

https://gitlab.xfce.org/xfce/thunar/commit/500026ac163dfb5f93ce187b3a5b29cca4582a34

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-05-02 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #14 from Git Bot  ---
Cyrille Pontvieux referenced this bugreport in commit
8cea485716c1304d790fa8a7677f82acc5c47e98

Split "thunar_transfer_job_execute" in multiple simpler functions to keep the
code human readable, and as preperation for Bug #16686

https://gitlab.xfce.org/xfce/thunar/commit/8cea485716c1304d790fa8a7677f82acc5c47e98

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-05-02 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #15 from Git Bot  ---
Cyrille Pontvieux referenced this bugreport in commit
544dad41c6b6eee640fed9fece3f22a856342372

Add THUNAR_JOB_RESPONSE_REPLACE and THUNAR_JOB_RESPONSE_SKIP to keep the code
human readable, and as preperation for Bug #16686

https://gitlab.xfce.org/xfce/thunar/commit/544dad41c6b6eee640fed9fece3f22a856342372

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-26 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #13 from alexxcons  ---
Nice ! I did not know that merge requests already work there :)  .. I'll take a
look !

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-26 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #12 from Cyrille Pontvieux  ---
[Here](https://gitlab.xfce.org/xfce/thunar/-/merge_requests/3) is the merge
request for job_response renames

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-25 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #11 from Cyrille Pontvieux  ---
First merge request: https://gitlab.xfce.org/xfce/thunar/-/merge_requests/2

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-25 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #10 from Cyrille Pontvieux  ---
> Reading the code:
> - Possibly g_object_unref (renamed_file); is missing in
> thunar_transfer_job_copy_file (like for duplicate_file).
> I think you can use the scope of the loop for the variable, like for
> duplicate_file.
> ... at least something is fishy there. I dont understand that part: 
> >  if (err == NULL)
> >target_file = renamed_file;
> Overwriting an argument usually is not what you want to have ... besides
> that, target_file is not used any more later in that method.
Well actually, a g_object_unref is required, but on target_file. I replace
target_file here, because it is use later on the loop for the next attempt to
copy the file. I know that replacing an argument is not usually a good idea,
but I'm not sure how to do it without heavily modify the function.

> - You can set  "n_rename = 0;" directly on variable declaration, no need for
> an extra line
Yes thanks

> > thunar-transfer-job.c:1048  "while (try_again)"
> Why you need to loop here, wheras before there was no loop. What would be a
> use-case which uses that additional loop ?
I tried not to modify too much this function. So when the new file name is
defined, the move function have already been tried and I didn't want to copy
the code (I like the DRY, Don't Repeat Yourself, approach). But maybe here was
not the best way to do it. And if you don't immediately understand the code,
that means it's a bad-written code. I will propose a easier solution.

> There is one thing bothering me when reading the code, not directly on your
> patch, but related:
> > THUNAR_JOB_RESPONSE_YES / THUNAR_JOB_RESPONSE_YES_ALL
> 
> As far as I can see, it would make much more sense to have
> THUNAR_JOB_RESPONSE_REPLACE / THUNAR_JOB_RESPONSE_REPLACE_ALL for our job in
> order to reflect what the buttons do ... that would make the code much
> simpler to understand.
> Since THUNAR_JOB_RESPONSE_YES is as well used in "thunar_job_ask_create", I
> would add addtional enum-values instead of renaming of existing enum-values.
> 
> Same for THUNAR_JOB_RESPONSE_NO / THUNAR_JOB_RESPONSE_NO_ALL which IMO
> should be THUNAR_JOB_RESPONSE_SKIP / THUNAR_JOB_RESPONSE_SKIP_ALL
> You think such a rename would be reasonable ?
Yes, I think it will clarify the code

> It should be done in a separate patch (I can do so later on .. though if you
> have time, feel free to start over)
I'll try, so I will propose two patches, one patch with improved corrections
and one patch for the response enum additions.

I will propably try to use xfce gitlab where I already cloned the thunar repo
instead of using bugzilla attachements if it's ok for you.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-22 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #9 from alexxcons  ---
(In reply to Cyrille Pontvieux from comment #8)
> Created attachment 9772 [details]
> format-patch to apply on latest master
> 
> For rename, I used the already written code about appending " (copy X)" and
> its related translations.
> 
> So I keep it simple in this commit. And let's improve it further in another
> commit/issue.
> 
> Thanks you two for taking time to look at this.

Patch works great for me, thanks !

Reading the code:
- Possibly g_object_unref (renamed_file); is missing in
thunar_transfer_job_copy_file (like for duplicate_file).
I think you can use the scope of the loop for the variable, like for
duplicate_file.
... at least something is fishy there. I dont understand that part: 
>  if (err == NULL)
>target_file = renamed_file;
Overwriting an argument usually is not what you want to have ... besides that,
target_file is not used any more later in that method.

- You can set  "n_rename = 0;" directly on variable declaration, no need for an
extra line

> thunar-transfer-job.c:1048  "while (try_again)"
Why you need to loop here, wheras before there was no loop. What would be a
use-case which uses that additional loop ?


There is one thing bothering me when reading the code, not directly on your
patch, but related:
> THUNAR_JOB_RESPONSE_YES / THUNAR_JOB_RESPONSE_YES_ALL

As far as I can see, it would make much more sense to have
THUNAR_JOB_RESPONSE_REPLACE / THUNAR_JOB_RESPONSE_REPLACE_ALL for our job in
order to reflect what the buttons do ... that would make the code much simpler
to understand.
Since THUNAR_JOB_RESPONSE_YES is as well used in "thunar_job_ask_create", I
would add addtional enum-values instead of renaming of existing enum-values.

Same for THUNAR_JOB_RESPONSE_NO / THUNAR_JOB_RESPONSE_NO_ALL which IMO should
be THUNAR_JOB_RESPONSE_SKIP / THUNAR_JOB_RESPONSE_SKIP_ALL
You think such a rename would be reasonable ?
It should be done in a separate patch (I can do so later on .. though if you
have time, feel free to start over)

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-21 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

Cyrille Pontvieux  changed:

   What|Removed |Added

   Attachment #9717|0   |1
is obsolete||

--- Comment #8 from Cyrille Pontvieux  ---
Created attachment 9772
  --> https://bugzilla.xfce.org/attachment.cgi?id=9772&action=edit
format-patch to apply on latest master

For rename, I used the already written code about appending " (copy X)" and its
related translations.

So I keep it simple in this commit. And let's improve it further in another
commit/issue.

Thanks you two for taking time to look at this.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-19 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #7 from alexxcons  ---
(In reply to Cyrille Pontvieux from comment #1)
> Created attachment 9717 [details]
> patch based on pause-copy branch

Patch does not apply on current master .. possibly you need to rebase on the
latest changes for the "pause" fix ?
(or is it me doing something wrong ?)

(In reply to Cyrille Pontvieux from comment #3)
> I'm still not sure on how to handle this for more than one file. I mean it 
> could be cumbersome to have a dialog asking for a
> name whenever a conflict filename exists on the target directory. Maybe it's 
> desirable, maybe not.
> If the more complicated (Dolphin-way) dialog is wanted, I could improve this 
> patch, but I think some UI design mockups
> should be done first, just for everybody to be sure of what is wanted.
As far as I can see, as well dolphin asks per file .. so no problem on that.
Dolphin has some "compare pictures" feature .. yes, that's nice, though lets
start with your approach, which already should improve the current situation.

(In reply to Reuben Green from comment #4)
> For more than one file, perhaps you should open the bulk renamer?
That might be confusing for people which did not use the bulk renamer till now,
and it requires knowledge on the number of possible conflicts in advance. For
now I would keep it simple, and just open one dialog per conflict ... since it
is possible to press "cancel all", I guess we are fine.

(In reply to Reuben Green from comment #6)
> On second thoughts, maybe it's just the word "copy" that is bothering me here.
> Maybe in this patch one could just rename "file_a" to "file_a (1)", as that 
> does not say it is a copy, just another version.
Afaik that's just the thunar default (or does the patch add extra-code to do
like that ?)  If you press ctrl+c + ctrl+v on a single file, you will get the
same result. So as a first step, re-using the default would be fine for me.
(Though we could generally change that default to use "file_a (1)" , etc. in a
different bug, if you think it would be worth it)
As you proposed, I guess using the rename dialog would fir better ..  would it
be hard to do ? We already have "thunar_dialogs_show_rename_file" which could
be used. If it would require alot of code-changes, I would go with the "copy
of" for this bug, and introduce "thunar_dialogs_show_rename_file" in a separate
bug.

(In reply to Reuben Green from comment #6)
> Also, there is now a new widget in libxfce4ui called XfceFilenameInput that is
> specifically for filename input and should make implementing a renamer
> dialog a bit easier. It is not used in thunar yet but I am planning to fix
So far I did not test the patch, though wouldnt it be fine to just use 
"thunar_dialogs_show_rename_file" here ? I guess only the internals of
"thunar_dialogs_show_rename_file" need to be changed in order to use
XfceFilenameInput.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-17 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686
Bug 16686 depends on bug 16685, which changed state.

Bug 16685 Summary: Allow to pause a job
https://bugzilla.xfce.org/show_bug.cgi?id=16685

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-17 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

Cyrille Pontvieux  changed:

   What|Removed |Added

 Blocks|16688   |


Referenced Bugs:

https://bugzilla.xfce.org/show_bug.cgi?id=16688
[Bug 16688] Freeze new copy where source or target device is shared with
another running one
-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-16 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #6 from Reuben Green  ---
(In reply to Cyrille Pontvieux from comment #5)

On second thoughts, maybe it's just the word "copy" that is bothering me here.
Maybe in this patch one could just rename "file_a" to "file_a (1)", as that
does not say it is a copy, just another version.

Then perhaps you could (as a second patch) work on making a more interactive
renaming process?

In any case, these are just my thoughts. It's probably best to wait to see what
alexxcons thinks of this.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-16 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #5 from Cyrille Pontvieux  ---
You're right, it's not really a “copy” and so it may be confusing to use the
same wording.

We can use something different, but a more complex solution with a filename
input *could* be better.

I'm ok to do this work (and try XfceFilenameInput) but I'm not really sure of
the workflow. We can design simple mockups on draw.io for instance.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-16 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

Reuben Green  changed:

   What|Removed |Added

 CC||reubengree...@gmail.com

--- Comment #4 from Reuben Green  ---
I've given this a quick test and it seems to work as intended with no problems.
I think it's good to have the option to rename rather than just replace or
skip/cancel.

I think it might be better to have a renamer dialog here rather than just
appending the "copy" suffix. My reasoning is as follows: when you copy a file
into the same directory, the new file is a copy of the original, so you have
"file_a" and "file_a (copy 1)" where "file_a (copy 1)" really is a copy of
"file_a". But if you are pasting some "file_a" from another directory into a
directory already containing a "file_a", then there is no guarantee that the
two files will be the same, and if you rename the pasted file to "file_a (copy
1)" then it might not be the case that the file called "file_a (copy 1)" is a
copy of "file_a". Maybe I am being too pedantic here though...

For more than one file, perhaps you should open the bulk renamer? Also, there
is now a new widget in libxfce4ui called XfceFilenameInput that is specifically
for filename input and should make implementing a renamer dialog a bit easier.
It is not used in thunar yet but I am planning to fix this soon!

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-13 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

--- Comment #3 from Cyrille Pontvieux  ---
Bug #11407 and the Dolphin implementation seems interesting, unfortunately I
didn't take that path, but a simpler one, with no filename dialog implied.

I'm still not sure on how to handle this for more than one file. I mean it
could be cumbersome to have a dialog asking for a name whenever a conflict
filename exists on the target directory. Maybe it's desirable, maybe not.
If the more complicated (Dolphin-way) dialog is wanted, I could improve this
patch, but I think some UI design mockups should be done first, just for
everybody to be sure of what is wanted.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-13 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

alexxcons  changed:

   What|Removed |Added

 CC||alexxc...@xfce.org

--- Comment #2 from alexxcons  ---
Possibly a dup: Bug #11407 ( I did not check in detail)

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-13 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

Cyrille Pontvieux  changed:

   What|Removed |Added

   Attachment #9713|0   |1
is obsolete||

--- Comment #1 from Cyrille Pontvieux  ---
Created attachment 9717
  --> https://bugzilla.xfce.org/attachment.cgi?id=9717&action=edit
patch based on pause-copy branch

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-13 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

Cyrille Pontvieux  changed:

   What|Removed |Added

 Blocks||16688


Referenced Bugs:

https://bugzilla.xfce.org/show_bug.cgi?id=16688
[Bug 16688] Freeze new copy where source or target device is shared with
another running one
-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs


[Xfce-bugs] [Bug 16686] Option to rename a file when existing copy conflicts

2020-04-13 Thread bugzilla-daemon
https://bugzilla.xfce.org/show_bug.cgi?id=16686

Cyrille Pontvieux  changed:

   What|Removed |Added

   See Also||https://bugzilla.xfce.org/s
   ||how_bug.cgi?id=10751
 CC||j...@enialis.net
 Depends on||16685


Referenced Bugs:

https://bugzilla.xfce.org/show_bug.cgi?id=16685
[Bug 16685] Allow to pause a job
-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs