project_files/HedgewarsMobile/Classes/EditableCellView.m
author koda
Thu, 22 Jul 2010 03:08:17 +0200
changeset 3662 a44406f4369b
parent 3661 2378ada8a6ee
child 3667 9359a70df013
permissions -rw-r--r--
polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
     1
//
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
     2
//  WeaponCellView.m
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
     3
//  Hedgewars
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
     4
//
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
     5
//  Created by Vittorio on 03/07/10.
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
     6
//  Copyright 2010 __MyCompanyName__. All rights reserved.
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
     7
//
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
     8
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
     9
#import "EditableCellView.h"
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    10
#import "CommodityFunctions.h"
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    11
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    12
@implementation EditableCellView
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    13
@synthesize delegate, textField, titleLabel, minimumCharacters, maximumCharacters, oldValue;
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    14
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    15
-(id) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    16
    if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    17
        delegate = nil;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    18
        
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    19
        textField = [[UITextField alloc] initWithFrame:CGRectZero];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    20
        textField.backgroundColor = [UIColor clearColor];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    21
        textField.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    22
        textField.delegate = self;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    23
        textField.clearButtonMode = UITextFieldViewModeWhileEditing;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    24
        textField.clearsOnBeginEditing = NO;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    25
        textField.returnKeyType = UIReturnKeyDone;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    26
        textField.adjustsFontSizeToFitWidth = YES;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    27
        [textField addTarget:self action:@selector(save:) forControlEvents:UIControlEventEditingDidEndOnExit];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    28
        
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    29
        [self.contentView addSubview:textField];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    30
        [textField release];
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
    31
        
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    32
        titleLabel = [[UILabel alloc] init];
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    33
        titleLabel.textAlignment = UITextAlignmentLeft;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    34
        titleLabel.backgroundColor = [UIColor clearColor];
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    35
        titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    36
        [self.contentView addSubview:titleLabel];
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    37
        [titleLabel release];
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    38
        
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    39
        minimumCharacters = 1;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    40
        maximumCharacters = 64;
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
    41
        oldValue = nil;
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    42
    }
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    43
    return self;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    44
}
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    45
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    46
-(void) layoutSubviews {
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    47
    [super layoutSubviews];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    48
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    49
    CGRect contentRect = self.contentView.bounds;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    50
    CGFloat boundsX = contentRect.origin.x;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    51
    
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
    52
    int offset = 0;
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    53
    int skew = 0;
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
    54
    if (self.imageView != nil)
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    55
        offset += self.imageView.frame.size.width;
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
    56
    
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    57
    if ([self.titleLabel.text length] == 0)
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    58
        titleLabel.frame = CGRectZero;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    59
    else {
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    60
        titleLabel.frame = CGRectMake(boundsX+offset+10, 10, 100, [UIFont labelFontSize] + 4);
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    61
        offset += 100;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    62
        skew +=2;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    63
    }
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    64
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    65
    textField.frame = CGRectMake(boundsX+offset+10, skew+10, 250, [UIFont labelFontSize] + 4);
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    66
}
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    67
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    68
-(void) setSelected:(BOOL)selected animated:(BOOL)animated {
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    69
    [super setSelected:selected animated:animated];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    70
    // Configure the view for the selected state
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    71
}
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    72
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    73
-(void) dealloc {
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    74
    [oldValue release], oldValue = nil;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    75
    [titleLabel release], titleLabel = nil;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    76
    [textField release], textField = nil;
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    77
    [super dealloc];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    78
}
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    79
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    80
#pragma mark -
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    81
#pragma mark textField delegate
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    82
// limit the size of the field to 64 characters like in original frontend
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    83
-(BOOL) textField:(UITextField *)aTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    84
    return !([aTextField.text length] > self.maximumCharacters && [string length] > range.length);
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    85
}
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    86
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    87
// allow editing only if delegate is set and conformant to protocol
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    88
-(BOOL) textFieldShouldBeginEditing:(UITextField *)aTextField {
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
    89
    return (delegate != nil) && [delegate respondsToSelector:@selector(saveTextFieldValue:withTag:)];
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    90
}
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    91
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    92
// the textfield is being modified, update the navigation controller
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    93
-(void) textFieldDidBeginEditing:(UITextField *)aTextField{
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
    94
    // don't interact with table below
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    95
    ((UITableView*)[self superview]).scrollEnabled = NO;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    96
    
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
    97
    self.oldValue = self.textField.text;
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
    98
    
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
    99
    UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Cancel",@"")
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   100
                                                                     style:UIBarButtonItemStylePlain
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   101
                                                                    target:self
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   102
                                                                    action:@selector(cancel:)];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   103
    [(UITableViewController *)delegate navigationItem].leftBarButtonItem = cancelButton;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   104
    [cancelButton release];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   105
    
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   106
    UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Save",@"")
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   107
                                                                     style:UIBarButtonItemStyleDone
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   108
                                                                    target:self
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   109
                                                                    action:@selector(save:)];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   110
    [(UITableViewController *)delegate navigationItem].rightBarButtonItem = saveButton;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   111
    [saveButton release];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   112
}
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   113
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   114
/* with this a field might remain in editing status even if the view moved;
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   115
   use method below instead that allows some more interaction
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   116
// don't accept 0-length strings
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   117
-(BOOL) textFieldShouldEndEditing:(UITextField *)aTextField {
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   118
    return ([aTextField.text length] > 0); 
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   119
}
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   120
*/
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   121
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   122
-(BOOL) textFieldShouldReturn:(UITextField *)aTextField {
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
   123
    return ([aTextField.text length] >= self.minimumCharacters); 
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   124
}
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   125
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   126
// the textfield has been modified, tell the delegate to do something
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   127
-(void) textFieldDidEndEditing:(UITextField *)aTextField{
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   128
    ((UITableView*)[self superview]).scrollEnabled = YES;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   129
    
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   130
    [(UITableViewController *)delegate navigationItem].rightBarButtonItem = [(UITableViewController *)delegate navigationItem].backBarButtonItem;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   131
    [(UITableViewController *)delegate navigationItem].leftBarButtonItem = nil;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   132
}
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   133
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
   134
#pragma mark -
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
   135
#pragma mark instance methods
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
   136
// the user wants to show the keyboard
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   137
-(void) replyKeyboard {
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   138
    [self.textField becomeFirstResponder];
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   139
}
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   140
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   141
// the user pressed cancel so hide keyboard
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   142
-(void) cancel:(id) sender {
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   143
    self.textField.text = self.oldValue;
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   144
    [self save:sender];
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   145
}
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   146
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   147
// send the value to the delegate
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   148
-(void) save:(id) sender {
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3661
diff changeset
   149
    if (delegate == nil || ![delegate respondsToSelector:@selector(saveTextFieldValue:withTag:)])
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   150
        return;
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   151
    
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   152
    // don't save if the textfield is invalid
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   153
    if (![self textFieldShouldReturn:textField])
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   154
        return;
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   155
    
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   156
    [delegate saveTextFieldValue:self.textField.text withTag:self.tag];
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   157
    [self.textField resignFirstResponder];
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   158
    self.oldValue = nil;
3659
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   159
}
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   160
f8d5ac50e307 half reworking of the settings page with delegation
koda
parents:
diff changeset
   161
@end