@@ -46,7 +46,7 @@ func (s *serviceClient) showProfilesUI() {
46
46
widget .NewLabel ("" ), // profile name
47
47
layout .NewSpacer (),
48
48
widget .NewButton ("Select" , nil ),
49
- widget .NewButton ("Logout " , nil ),
49
+ widget .NewButton ("Deregister " , nil ),
50
50
widget .NewButton ("Remove" , nil ),
51
51
)
52
52
},
@@ -128,7 +128,7 @@ func (s *serviceClient) showProfilesUI() {
128
128
}
129
129
130
130
logoutBtn .Show ()
131
- logoutBtn .SetText ("Logout " )
131
+ logoutBtn .SetText ("Deregister " )
132
132
logoutBtn .OnTapped = func () {
133
133
s .handleProfileLogout (profile .Name , refresh )
134
134
}
@@ -143,7 +143,7 @@ func (s *serviceClient) showProfilesUI() {
143
143
if ! confirm {
144
144
return
145
145
}
146
-
146
+
147
147
err = s .removeProfile (profile .Name )
148
148
if err != nil {
149
149
log .Errorf ("failed to remove profile: %v" , err )
@@ -334,44 +334,44 @@ func (s *serviceClient) getProfiles() ([]Profile, error) {
334
334
335
335
func (s * serviceClient ) handleProfileLogout (profileName string , refreshCallback func ()) {
336
336
dialog .ShowConfirm (
337
- "Logout " ,
338
- fmt .Sprintf ("Are you sure you want to logout from '%s'?" , profileName ),
337
+ "Deregister " ,
338
+ fmt .Sprintf ("Are you sure you want to deregister from '%s'?" , profileName ),
339
339
func (confirm bool ) {
340
340
if ! confirm {
341
341
return
342
342
}
343
-
343
+
344
344
conn , err := s .getSrvClient (defaultFailTimeout )
345
345
if err != nil {
346
346
log .Errorf ("failed to get service client: %v" , err )
347
347
dialog .ShowError (fmt .Errorf ("failed to connect to service" ), s .wProfiles )
348
348
return
349
349
}
350
-
350
+
351
351
currUser , err := user .Current ()
352
352
if err != nil {
353
353
log .Errorf ("failed to get current user: %v" , err )
354
354
dialog .ShowError (fmt .Errorf ("failed to get current user" ), s .wProfiles )
355
355
return
356
356
}
357
-
357
+
358
358
username := currUser .Username
359
359
_ , err = conn .Logout (s .ctx , & proto.LogoutRequest {
360
360
ProfileName : & profileName ,
361
361
Username : & username ,
362
362
})
363
363
if err != nil {
364
364
log .Errorf ("logout failed: %v" , err )
365
- dialog .ShowError (fmt .Errorf ("logout failed" ), s .wProfiles )
365
+ dialog .ShowError (fmt .Errorf ("deregister failed" ), s .wProfiles )
366
366
return
367
367
}
368
-
368
+
369
369
dialog .ShowInformation (
370
- "Logged Out " ,
371
- fmt .Sprintf ("Successfully logged out from '%s'" , profileName ),
370
+ "Deregistered " ,
371
+ fmt .Sprintf ("Successfully deregistered from '%s'" , profileName ),
372
372
s .wProfiles ,
373
373
)
374
-
374
+
375
375
refreshCallback ()
376
376
},
377
377
s .wProfiles ,
@@ -602,7 +602,7 @@ func (p *profileMenu) refresh() {
602
602
603
603
// Add Logout menu item
604
604
ctx2 , cancel2 := context .WithCancel (context .Background ())
605
- logoutItem := p .profileMenuItem .AddSubMenuItem ("Logout " , "" )
605
+ logoutItem := p .profileMenuItem .AddSubMenuItem ("Deregister " , "" )
606
606
p .logoutSubItem = & subItem {logoutItem , ctx2 , cancel2 }
607
607
608
608
go func () {
@@ -616,9 +616,9 @@ func (p *profileMenu) refresh() {
616
616
}
617
617
if err := p .eventHandler .logout (p .ctx ); err != nil {
618
618
log .Errorf ("logout failed: %v" , err )
619
- p .app .SendNotification (fyne .NewNotification ("Error" , "Failed to logout " ))
619
+ p .app .SendNotification (fyne .NewNotification ("Error" , "Failed to deregister " ))
620
620
} else {
621
- p .app .SendNotification (fyne .NewNotification ("Success" , "Logged out successfully" ))
621
+ p .app .SendNotification (fyne .NewNotification ("Success" , "Deregistered successfully" ))
622
622
}
623
623
}
624
624
}
0 commit comments