Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Implemented '546162 - Generate overrides code fix ui'#3699

Merged
slluis merged 5 commits intomasterfrom
master-fix546162
Feb 21, 2018
Merged

Implemented '546162 - Generate overrides code fix ui'#3699
slluis merged 5 commits intomasterfrom
master-fix546162

Conversation

@mkrueger
Copy link
Contributor

@mkrueger mkrueger commented Jan 19, 2018

https://devdiv.visualstudio.com/DevDiv/_workitems?id=546162&_a=edit

Test instructions :

  • Place caret inside a new class:

class Test {
|
}

  • Right click -> Quck Fix -> select Generate overrides...
  • Select overrides & hit ok -> the overriden members should be created
  • Select cancel -> nothing should happen

@Therzok
Copy link
Contributor

Therzok commented Jan 19, 2018

f449a46

I implemented it here too.

@Therzok
Copy link
Contributor

Therzok commented Jan 19, 2018

Vaclav had some issues on the design: http://vncr.in/ovIf

@Therzok
Copy link
Contributor

Therzok commented Jan 19, 2018

Your version is definitely better, as it handles the pickmembers options. I'll remove the commit from my PR.

@slluis
Copy link
Member

slluis commented Jan 19, 2018

Can you attach a screenshot of the UI?

@mkrueger
Copy link
Contributor Author

mkrueger commented Jan 22, 2018

@Therzok: Why did you implement that - that's what we've task assignments for

@Therzok
Copy link
Contributor

Therzok commented Jan 22, 2018

@mkrueger was easy copy-paste, wanted to have it functional before handing off codefixes service to QA.

@mkrueger
Copy link
Contributor Author

pasted image at 2018_01_22 10_43 am

@mkrueger
Copy link
Contributor Author

Not sure what's with the dialog buttons - the margins should be corrected by xwt automatically IMO.

Copy link
Member

@sevoku sevoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tha paddings/margins of an Xwt.Dialog can't be adjusted, because the native APIs don't allow it (see the Gtk.Dialog docs). The only way to have the dialog buttons "aligned" is to use a custom dialog with simple buttons inside the content area, without all the dialog result handling (it's a toolkit limitation, not Xwt).

But all the layout is not a big issue, if we use the native backend on Mac, the layout will be better there.

{
PickMembersResult IPickMembersService.PickMembers(string title, ImmutableArray<ISymbol> members, ImmutableArray<PickMembersOption> options)
{
var dialog = new PickMembersDialog ();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap this whole thing in an IdeApp.RunWhenIdle() and a Xwt.Toolkit.NativeEngine.Invoke to make the dialog native and to make sure that you don't lock the UI.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See LicenseAcceptanceDialog for an example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that works here because I would need to return

res.Task.Result. And if it locks it would lock at that. However I can implement it like that - but no idea if it really would help in that case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locks the UI in that case - it's running on the UI thread and the task gets added to the idle threat and res.Task.Result is locking there.

It's IMO wrong here to use that in this case because the actions run on the UI thread.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok, I didn't look into the actual context, so if it doesn't come from some background task, then RunWhenIdle() doesn't make sense. But can we make it native using Xwt.Toolkit.NativeEngine.Invoke?

this.Height = 321;
this.Resizable = false;

Show ();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't call Show() in the constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/fixed

var dialog = new PickMembersDialog ();
try {
dialog.Init (title, members, options);
bool performChange = dialog.Run () == Xwt.Command.Ok;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the dialog be transient? Using dialog.Run (Xwt.MessageDialog.RootWindow) will make it modal for the main IDE window.

Copy link
Contributor Author

@mkrueger mkrueger Jan 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No should be modal. The result is required for making the editor to continue it's operation.

var checkBoxCellView = new CheckBoxCellView (symbolIncludedField);
checkBoxCellView.Editable = true;
checkBoxCellView.Toggled += delegate { UpdateOkButton (); };
listViewPublicMembers.Columns.Add ("", checkBoxCellView);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't use an additional column for this, just pack everything in one column, or even better use a ListBox.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ListBox sounds reasonable - I usually just tend to use the more complex list view :)

@sevoku
Copy link
Member

sevoku commented Jan 22, 2018

slluis
slluis previously approved these changes Feb 20, 2018
@slluis
Copy link
Member

slluis commented Feb 20, 2018

@mkrueger This has been approved. Please fix the conflicts and merge. Thanks!

Copy link
Member

@slluis slluis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add corresponding release notes.

@slluis slluis merged commit 0302f89 into master Feb 21, 2018
@slluis slluis deleted the master-fix546162 branch February 21, 2018 11:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants