When there are not username and token provided during startup, preferences are shown.
[pithos-macos] / pithos-macos / PithosPreferencesController.m
index 3dc3635..fcf2122 100644 (file)
@@ -71,8 +71,7 @@
 }
 
 - (void)windowWillClose:(NSNotification *)notification {
-    [[self window] makeFirstResponder:nil];
-    [(pithos_macosAppDelegate *)[[NSApplication sharedApplication] delegate] authenticate];
+    [self authenticationApply:self];
 }
 
 - (IBAction)toolbarItemSelected:(id)sender {
 #pragma mark -
 #pragma Authentication
 
+- (IBAction)authenticationApply:(id)sender {
+    [[self window] makeFirstResponder:nil];
+    [(pithos_macosAppDelegate *)[[NSApplication sharedApplication] delegate] authenticate];
+}
+
 - (IBAction)authenticationLogin:(id)sender {
     NSProcessInfo *processInfo = [NSProcessInfo processInfo];
     NSString *loginURL = [NSString stringWithFormat:@"%@?next=pithos://%@_%d",