@@ -11,10 +11,11 @@ class PublishView : Subview
1111 private const string Title = "Publish this repository to GitHub" ;
1212 private const string PrivateRepoMessage = "You choose who can see and commit to this repository" ;
1313 private const string PublicRepoMessage = "Anyone can see this repository. You choose who can commit" ;
14- private const string PublishViewCreateButton = "Create" ;
14+ private const string PublishViewCreateButton = "Publish" ;
15+ private const string OwnersDefaultText = "Select a user or org" ;
1516
1617 [ SerializeField ] private string username ;
17- [ SerializeField ] private string [ ] owners = { } ;
18+ [ SerializeField ] private string [ ] owners = { OwnersDefaultText } ;
1819 [ SerializeField ] private int selectedOwner ;
1920 [ SerializeField ] private string repoName = String . Empty ;
2021 [ SerializeField ] private string repoDescription = "" ;
@@ -70,7 +71,7 @@ private void PopulateView()
7071 return ;
7172 }
7273
73- owners = new [ ] { user . Login } ;
74+ owners = owners . Union ( new [ ] { user . Login } ) . ToArray ( ) ;
7475 username = user . Login ;
7576
7677 Logger . Trace ( "GetOrganizations" ) ;
@@ -134,7 +135,7 @@ public override void OnGUI()
134135 GUILayout . Label ( "Owner" ) ;
135136
136137 GUI . enabled = ! isBusy ;
137- selectedOwner = EditorGUILayout . Popup ( 0 , owners ) ;
138+ selectedOwner = EditorGUILayout . Popup ( selectedOwner , owners ) ;
138139 GUI . enabled = true ;
139140 }
140141 GUILayout . EndVertical ( ) ;
@@ -194,7 +195,7 @@ public override void OnGUI()
194195 GUILayout . BeginHorizontal ( ) ;
195196 {
196197 GUILayout . FlexibleSpace ( ) ;
197- GUI . enabled = ! string . IsNullOrEmpty ( repoName ) && ! isBusy ;
198+ GUI . enabled = ! string . IsNullOrEmpty ( repoName ) && ! isBusy && selectedOwner != 0 ;
198199 if ( GUILayout . Button ( PublishViewCreateButton ) )
199200 {
200201 isBusy = true ;
0 commit comments