-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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 confirmation for dragging and dropping project files in the "Explore" panel #31797
Conversation
@snhardin there are many users that would not want to see a confirmation dialog every time and who are perfectly fine with the way it works now. I think a better approach would be to show a dialog with a checkbox (Electron has support for this) so that a user can indicate to never be asked again. When this checkbox is enabled, we should write a setting (via Does that make sense? |
Yup! Makes sense! I should have something ready to look at pretty soon. |
@snhardin Thanks for working on this. |
|
||
return onError(error, true); | ||
}); | ||
return 0; // Not sure what to do here. |
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.
@bpasero I'm not finished making all my changes yet, but in the mean time, I could use some advice on what to do here. Is a return required here? If so, is there some constant I should be returning or some standard I should be following?
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.
@snhardin no, a return value should not be needed because the method is declared as
public drop(tree: ITree, data: IDragAndDropData, target: FileStat, originalEvent: DragMouseEvent): void
@snhardin are you still working on this? |
I am indeed! I have not pushed any changes in a while, though. Just haven't
had a ton of time to look at this. Should have some free time really soon!
…On Sep 6, 2017 1:21 AM, "Benjamin Pasero" ***@***.***> wrote:
@snhardin <https://github.com/snhardin> are you still working on this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#31797 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQEL7AzoTuwVHQgoq2PXveko0sDeTg2gks5sfivtgaJpZM4OpMwT>
.
|
Cool 👍 |
|
@@ -61,6 +61,8 @@ export class MessageService extends WorkbenchMessageService implements IChoiceSe | |||
opts.checkboxLabel = confirmation.checkboxLabel; | |||
} | |||
|
|||
confirmation.checked = false; |
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.
@bpasero Based on what I've read in the Electron docs, you can only check if the checkbox is checked in a message box in a callback. That's problematic since the result is delivered in a return value. I cannot return two values. Right now, I plan on just making a small callback that assigns the checkbox value to the IConfirmation object (as checked) and checking that in the drag-drop confirmation code. Is there a better way of doing this or am I on the right track?
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.
@snhardin yeah looks like. seems the only way of doing it with a checkbox result.
I went ahead and implemented this via a42f794 |
Fixes #1414
Could use some advice here. I'm not a particularly great TypeScript developer, much less a JavaScript / electron developer. I'm trying to improve, though. Please provide detailed feedback of what needs to be changed and how my code may be improved!