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

On connect dialog, in the directory list, remove 'Custom' and add all custom central servers #1894

Closed

Conversation

jp8
Copy link
Contributor

@jp8 jp8 commented Jun 28, 2021

On the connect dialog, in the directory (custom central server) list,

  • remove Custom from list
  • add the user's custom central servers to the list

Addresses discussion #1869
Is an alternative to pull request #1884

It is a change to the UI. If the pull request is accepted, I will make a corresponding pull request to the website documentation.

Working implementation

It's a UI change so testing and feedback are appreciated. It is one alternative UI among several that are under discussion in #1869 and #1884

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

Last steps:

  • Read through code and test it (should be done already)
  • Add @jp8 to contributor page
  • Add Change log entry
  • Get two approvals

@ann0see
Copy link
Member

ann0see commented Jun 28, 2021

Hi @jp8 thank you for your contribution. The style doesn't seem to be right. Could you please have a look at clang format?

Also would it be possible to have screenshots?

@jp8
Copy link
Contributor Author

jp8 commented Jun 28, 2021

Thanks @ann0see

clang format is in progress.

Screenshots copied from #1884

Screenshot_2021-06-26_08-18-23
Screenshot_2021-06-26_08-20-31

@ann0see
Copy link
Member

ann0see commented Jun 28, 2021

Ok. Wasn't up to date with the other PR. Once the artifacts are built - and I find time - I'd be happy to test your proposal. From a first glance it looks interesting ;-)

@ann0see
Copy link
Member

ann0see commented Jun 28, 2021

BTW, you can run clang-format -i /path/to/files locally to fix the code style.

@jp8
Copy link
Contributor Author

jp8 commented Jun 28, 2021

Thanks - I did try that approach several weeks ago but got errors, likely due to an old clang-format in Debian 10.

@jp8
Copy link
Contributor Author

jp8 commented Jun 28, 2021

I tried to write it in a way that would remain compatible with all the other proposals that are still under discussion in #1884

@ann0see
Copy link
Member

ann0see commented Jun 28, 2021

Yeah. Not a big deal since the check now seems to be ok.

After having compiled it I'd say I'm quite happy with this change!
Sure, it doesn't follow the original request from the discussion, however, I think moving directory management from settings to the connect dialog might become a religious discussion ;-).

What about:

  1. Reviewing and merging this PR
  2. Adding an "edit" button which opens settings in the connect dialog?

Copy link
Member

@ann0see ann0see left a comment

Choose a reason for hiding this comment

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

Quite small but effective ;-)

src/connectdlg.cpp Outdated Show resolved Hide resolved
src/connectdlg.cpp Show resolved Hide resolved
src/connectdlg.cpp Outdated Show resolved Hide resolved
@jp8
Copy link
Contributor Author

jp8 commented Jun 28, 2021

2\. Adding an "edit" button which opens settings in the connect dialog?

I do think an edit button or link that opens the settings dialog to the correct page is the likely best way to get to the management interface.

But there might be a lot of discussion and ideas around that, and I don't think this small pull request depends on it. Could we save it as a separate topic ?

src/connectdlg.cpp Outdated Show resolved Hide resolved
src/connectdlg.cpp Outdated Show resolved Hide resolved
src/connectdlg.cpp Outdated Show resolved Hide resolved
src/connectdlg.cpp Outdated Show resolved Hide resolved
src/settings.h Outdated Show resolved Hide resolved
src/connectdlg.cpp Outdated Show resolved Hide resolved
src/settings.h Outdated Show resolved Hide resolved
Copy link
Contributor

@dcorson-ticino-com dcorson-ticino-com left a comment

Choose a reason for hiding this comment

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

Sorry I can't really comment, this week on vacation with only a cellphone.

src/settings.cpp Outdated Show resolved Hide resolved
@pljones
Copy link
Collaborator

pljones commented Jun 29, 2021

By the way, feel free to

git checkout master
git pull upstream master
git pull upstream master --tags --force
git push
git push --tags --force
git checkout -

to refresh your local git and then

git rebase -i master

and squash history (use "fix" if you want). I don't think any of us review on a commit by commit basis and the extra commit history will need cleaning up before it's merged.

src/settings.cpp Outdated Show resolved Hide resolved
jp8 added 6 commits June 29, 2021 21:51
- remove Custom from list
- add the user's custom central servers to the list

Fix code formatting

More fixes to coding style

Fixed code comment

Improved code comments to clarify how iCustomDirectoryIndex is used.

Further code comments
rename cbxCentServAddrType to cbxDirectoryServer

Fix code formatting

renamed handler OnCentServAddrTypeChanged -> OnDirectoryServerChanged
Copy link
Member

@ann0see ann0see left a comment

Choose a reason for hiding this comment

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

Please use pljones suggestion to rebase your work: #1894 (comment)

Doing it with a merge makes stuff complicated

@gilgongo
Copy link
Member

@hoffie

I still agree with the arguments there.

Sorry to be a pain but in the interests of clarity, can you detail why you agree, against the points made here? #1884 (comment)

@jp8
Copy link
Contributor Author

jp8 commented Jun 30, 2021

Please use pljones suggestion to rebase your work: #1894 (comment)

Doing it with a merge makes stuff complicated

I am really sorry to be so new to git. I did follow the steps from pljones but on my next attempt to push, it left me with:

hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart.

...and asked me to pull from my feature branch to local and then merge conflicts. I am guessing that after following the steps, I should have pulled from my feature branch, before doing any further work.

@ann0see
Copy link
Member

ann0see commented Jun 30, 2021

No. That’s what git push --force is used for ;-). However you might want to give https://git-scm.com/docs/git-rebase a short read.

I‘d suggest to undo the merge, and then force push everything.

@jp8
Copy link
Contributor Author

jp8 commented Jun 30, 2021

I‘d suggest to undo the merge, and then force push everything.

OK I will figure out how to do that. If I understand right, the goal is to take the 20 commits that are now on the feature branch in my fork, and condense them into just one or a few commits... is it right ?

@ann0see
Copy link
Member

ann0see commented Jun 30, 2021

Kind of. Yes:
Goal:

Multiple (or one) commit/s based on the latest master code.

You‘d git checkout this commit: 79559e5

git push HEAD to your feature branch (https://stackoverflow.com/a/40929378) and then use git rebase -i to bring the commits together.

@jp8 jp8 force-pushed the feature-combined-central-server-list-2 branch from 09746ee to 79559e5 Compare June 30, 2021 15:11
@jp8
Copy link
Contributor Author

jp8 commented Jul 2, 2021

git push HEAD to your feature branch (https://stackoverflow.com/a/40929378) and then use git rebase -i to bring the commits together.

I think I've done all this. I condensed it to 7 commits. Is it ok ?

Copy link
Member

@ann0see ann0see left a comment

Choose a reason for hiding this comment

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

From a first glance this looks much better now ;-)

@jp8
Copy link
Contributor Author

jp8 commented Jul 5, 2021

Is there anything more I need to do, in order to get this merged ?

@ann0see
Copy link
Member

ann0see commented Jul 5, 2021

There are still some unresolved review comments above.

centservaddrtype is set to AT_CUSTOM.
@jp8
Copy link
Contributor Author

jp8 commented Jul 5, 2021

ok all done i think.

@ann0see ann0see self-requested a review July 5, 2021 12:06
@ann0see
Copy link
Member

ann0see commented Jul 5, 2021

Last steps:

  • Read through code and test it (should be done already)
  • Add @jp8 to contributor page
  • Add Change log entry
  • Get two approvals

Anything else? Could you please copy and paste this check list in your first post above?

@jp8
Copy link
Contributor Author

jp8 commented Jul 5, 2021

* [ ]  Add @jp8 to contributor page

I was already on this list, from contributions I gave directly to Volker in the past.

Copy link
Collaborator

@pljones pljones left a comment

Choose a reason for hiding this comment

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

I'm happy with it now. (Subject to the TODO item getting done ASAP.)

Copy link
Member

@ann0see ann0see left a comment

Choose a reason for hiding this comment

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

Looks OK to me. I‘ve tested an early version and the code looks ok.

@ann0see
Copy link
Member

ann0see commented Jul 5, 2021

This should be squash&merged.

@pljones
Copy link
Collaborator

pljones commented Jul 5, 2021

I couldn't get the github UI to do what I wanted, so I did it locally, hence I'm going to close this.
62a9c38

@pljones pljones closed this Jul 5, 2021
@ann0see
Copy link
Member

ann0see commented Jul 6, 2021

There’s an arrow next to the merge button with which you can change it to squash and merge?

@ann0see ann0see added this to the Release 3.8.1 milestone Jul 6, 2021
@pljones
Copy link
Collaborator

pljones commented Jul 6, 2021

There’s an arrow next to the merge button with which you can change it to squash and merge?

I don't think that lets you adjust the commit message and it's as if the branch never existed and a single commit to master happened directly. At least I think that's what happened when I first tried it. I wanted to show a merge from a branch with a single commit from jp8 with a sane commit message.

@jp8
Copy link
Contributor Author

jp8 commented Jul 6, 2021

So at the end I should have sqashed again, into a single commit ? (just so I know for next time...)

@pljones
Copy link
Collaborator

pljones commented Jul 6, 2021

Yeah, it can sometimes help to keep the history (it recently let me split a change into to two PRs) but generally, once final, one commit is preferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants