From: Michael J. Rubinsky Date: Sun, 1 Feb 2009 20:17:55 +0000 (-0500) Subject: Fix logic. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=26781eef88e6d26d7cb6b047ccf8f849af287222;p=horde.git Fix logic. Make sure we don't attempt to connect to a server if we are here because we edited the server list. --- diff --git a/iPhoto2Ansel/AnselExportController.m b/iPhoto2Ansel/AnselExportController.m index de2d3561f..e77650862 100644 --- a/iPhoto2Ansel/AnselExportController.m +++ b/iPhoto2Ansel/AnselExportController.m @@ -125,19 +125,22 @@ NSString * const TURAnselServerPasswordKey = @"password"; [self updateServersPopupMenu]; } - +// Action sent by the server pop up menu - (IBAction)clickServer: (id)sender { - // Servers list if ([mServersPopUp indexOfSelectedItem] == [mServersPopUp numberOfItems] - 1) { + // Server list [self showServerListPanel]; - } - - // Add new server - if ([mServersPopUp indexOfSelectedItem] == [mServersPopUp numberOfItems] - 2) { + + // Disconnect from the current server. + // TODO: See which server we deleted and only disconnect if that was the + // one we removed. + [self disconnect]; + } else if ([mServersPopUp indexOfSelectedItem] == [mServersPopUp numberOfItems] - 2) { + // New Server [self showNewServerSheet]; } else if (![[[mServersPopUp selectedItem] title] isEqual:@"(None)"]) { - + // Connect to a server if (currentServer == [[mServersPopUp selectedItem] representedObject]) { return; }