Skip to content
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

repo picker: move 'add repo' functionality to a menu item or a separate button. #1468 #1486

Merged

Conversation

raisfathin
Copy link
Contributor

No description provided.

@raisfathin raisfathin force-pushed the 1468-move-add-repo-functionality branch 2 times, most recently from b6edf3a to 91cb8db Compare April 6, 2016 12:53
@raisfathin raisfathin force-pushed the 1468-move-add-repo-functionality branch 3 times, most recently from 567e3d4 to c1a4053 Compare April 6, 2016 13:01
@raisfathin
Copy link
Contributor Author

Ready for review!

@raisfathin raisfathin force-pushed the 1468-move-add-repo-functionality branch 2 times, most recently from 88a6d26 to f223605 Compare April 6, 2016 13:46
@damithc
Copy link
Contributor

damithc commented Apr 6, 2016

Can post a screenshot?

@raisfathin
Copy link
Contributor Author

Dialog asking for new repository:
screen shot 2016-04-06 at 21 50 39

When the user enters an invalid GitHub repo:
screen shot 2016-04-06 at 21 51 11

Optional<String> chosenRepo = dialog.showAndWait();
if (chosenRepo.isPresent() && !defaultRepo.equals(chosenRepo.get())) {
onValueChangeCallback.accept(chosenRepo.get());
if (repoId != null && !defaultRepo.equals(repoId)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just realised the repo picker isn't a Dialog subclass, and so doesn't have access to showAndWait.

Instead of using null, could we pass an optional instead? That's a bit of an abuse of optionals (their use case is as return values, not parameters), but since we're not using showAndWait I guess it's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was, but apparently I couldn't get it to spawn another dialog (the addRepository dialog one). So I had to make it not subclassing Dialog. Is it okay?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it's fine.

@raisfathin
Copy link
Contributor Author

Done. Ready for another review!

@raisfathin raisfathin force-pushed the 1468-move-add-repo-functionality branch from aefbc5c to be8da2c Compare April 9, 2016 14:36
@raisfathin raisfathin merged commit be8da2c into HubTurbo:master Apr 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants