@@ -11,10 +11,11 @@ class PublishView : Subview
11
11
private const string Title = "Publish this repository to GitHub" ;
12
12
private const string PrivateRepoMessage = "You choose who can see and commit to this repository" ;
13
13
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" ;
15
16
16
17
[ SerializeField ] private string username ;
17
- [ SerializeField ] private string [ ] owners = { } ;
18
+ [ SerializeField ] private string [ ] owners = { OwnersDefaultText } ;
18
19
[ SerializeField ] private int selectedOwner ;
19
20
[ SerializeField ] private string repoName = String . Empty ;
20
21
[ SerializeField ] private string repoDescription = "" ;
@@ -70,7 +71,7 @@ private void PopulateView()
70
71
return ;
71
72
}
72
73
73
- owners = new [ ] { user . Login } ;
74
+ owners = owners . Union ( new [ ] { user . Login } ) . ToArray ( ) ;
74
75
username = user . Login ;
75
76
76
77
Logger . Trace ( "GetOrganizations" ) ;
@@ -134,7 +135,7 @@ public override void OnGUI()
134
135
GUILayout . Label ( "Owner" ) ;
135
136
136
137
GUI . enabled = ! isBusy ;
137
- selectedOwner = EditorGUILayout . Popup ( 0 , owners ) ;
138
+ selectedOwner = EditorGUILayout . Popup ( selectedOwner , owners ) ;
138
139
GUI . enabled = true ;
139
140
}
140
141
GUILayout . EndVertical ( ) ;
@@ -194,7 +195,7 @@ public override void OnGUI()
194
195
GUILayout . BeginHorizontal ( ) ;
195
196
{
196
197
GUILayout . FlexibleSpace ( ) ;
197
- GUI . enabled = ! string . IsNullOrEmpty ( repoName ) && ! isBusy ;
198
+ GUI . enabled = ! string . IsNullOrEmpty ( repoName ) && ! isBusy && selectedOwner != 0 ;
198
199
if ( GUILayout . Button ( PublishViewCreateButton ) )
199
200
{
200
201
isBusy = true ;
0 commit comments