Add support for removing a site
This commit is contained in:
parent
43adab7b39
commit
c7872db0ba
3 changed files with 35 additions and 1 deletions
|
@ -402,7 +402,14 @@
|
|||
<outlet property="delegate" destination="ayJ-fs-aIU" id="af9-4J-p1D"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<navigationItem key="navigationItem" id="xhc-og-4ho"/>
|
||||
<navigationItem key="navigationItem" id="xhc-og-4ho">
|
||||
<barButtonItem key="rightBarButtonItem" title="Remove" id="vzP-cA-Wig">
|
||||
<color key="tintColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<connections>
|
||||
<action selector="remove:" destination="ayJ-fs-aIU" id="0mA-Jx-Oqa"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
</navigationItem>
|
||||
<connections>
|
||||
<outlet property="legacySwitch" destination="qW3-51-hZP" id="NsI-F3-hVQ"/>
|
||||
<outlet property="lengthField" destination="Lp1-jC-8cn" id="05B-m5-JnB"/>
|
||||
|
|
|
@ -37,4 +37,6 @@
|
|||
@property (retain, nonatomic) IBOutlet UISwitch *legacySwitch;
|
||||
@property (retain, nonatomic) IBOutlet UITextField *passphraseField;
|
||||
@property (retain) MainViewController *mainViewController;
|
||||
|
||||
- (IBAction)remove: (id)sender;
|
||||
@end
|
||||
|
|
|
@ -183,4 +183,29 @@ clearNSMutableString(NSMutableString *string)
|
|||
|
||||
return password;
|
||||
}
|
||||
|
||||
- (IBAction)remove: (id)sender
|
||||
{
|
||||
UIAlertController *alert = [UIAlertController
|
||||
alertControllerWithTitle: @"Remove Site?"
|
||||
message: @"Do you want to remove this site?"
|
||||
preferredStyle: UIAlertControllerStyleAlert];
|
||||
[alert addAction:
|
||||
[UIAlertAction actionWithTitle: @"No"
|
||||
style: UIAlertActionStyleCancel
|
||||
handler: nil]];
|
||||
[alert addAction:
|
||||
[UIAlertAction actionWithTitle: @"Yes"
|
||||
style: UIAlertActionStyleDestructive
|
||||
handler: ^ (UIAlertAction *action) {
|
||||
[self.mainViewController.siteStorage removeSite: _name];
|
||||
[self.mainViewController.tableView reloadData];
|
||||
|
||||
[self.navigationController popViewControllerAnimated: YES];
|
||||
}]];
|
||||
|
||||
[self presentViewController: alert
|
||||
animated: YES
|
||||
completion: nil];
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue