DESCRIPTION

Bug 506967 - Remember last selected registry account used in push/pull

- add toString method to RegistryInfo class
- add LAST_REGISTRY_ACCOUNT constant to PreferenceConstants
- in ImagePullPushPage get the LAST_REGISTRY_ACCOUNT stored and
  default to select it in the list, if it exists, otherwise, set
  to first element in list
- in ImagePullPushPageModel, save the last registry that was set

Change-Id: I248af02c1b002a8c7d7fdb4209929fcc03072189


COMMENTS

author: Kaylin Maxwell
date: 2016-11-04 22:24:09.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2016-11-04 22:24:15.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/11311/

-------------------------------------
author: Brenden Conley
date: 2016-11-04 22:43:10.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/11311/ : SUCCESS

-------------------------------------
author: Zechariah Krause
date: 2016-11-07 09:58:03.000000000

Patch Set 1: Code-Review-1

(2 comments)

Line:115, containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImagePullPushPage.java -> you should use the existing 'getServerAddress()' method which is safer than 'toString()' which could change in the future.

Line:118, containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImagePullPushPage.java -> the check expression could be 'if(selectedRegistry != null)' instead.

-------------------------------------
author: Kaylin Maxwell
date: 2016-11-07 17:45:19.000000000

Patch Set 1:

(2 comments)

Line:115, containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImagePullPushPage.java -> I did this because it could be a RegistryInfo or a RegistryAccountInfo which is much more than just the server address.  The RegistryAccountInfo toString() method includes the user id and email address.  I had to add a default toString() method to RegistryInfo which is essentially getServerAddress().  The key is matching an account from before.  The server address is not enough information (e.g. you could be logged to same server with two different ids).

Line:118, containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImagePullPushPage.java -> Done

-------------------------------------
author: Gerrit Code Review
date: 2016-11-07 20:52:37.000000000

Change has been successfully cherry-picked as 886fe799bf207fffe00d2523e71cf4ccd3b61ae2 by Kaylin Maxwell

-------------------------------------
author: Zechariah Krause
date: 2016-11-08 08:41:10.000000000

Patch Set 1:

(1 comment)

Line:115, containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImagePullPushPage.java -> ok, I understand now. But in that case, I would prefer that we use a more specific method, such as 'getId()' instead of 'toString()' which I personally use for logging purpose, and whose returned content may change and break the process.

-------------------------------------
author: Kaylin Maxwell
date: 2016-11-08 20:17:42.000000000

Patch Set 1:

(1 comment)

Line:115, containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImagePullPushPage.java -> I have created a getRegistryId() method in RegistryInfo and overridden in RegistryAccountInfo for this purpose.  I have created a separate patch for this which is referenced by the bug.

-------------------------------------
author: Zechariah Krause
date: 2016-11-09 08:36:10.000000000

Patch Set 1:

(1 comment)

Line:115, containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImagePullPushPage.java -> great, thanks !

-------------------------------------
