project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m
author koda
Sun, 24 Jul 2011 19:14:56 +0200
changeset 5451 e359a79e3d08
parent 5370 a3f87be7b09a
child 5662 99083392cd4f
permissions -rw-r--r--
rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3829
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
     1
/*
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
4976
088d40d8aba2 Happy 2011 :)
koda
parents: 4947
diff changeset
     3
 * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
3829
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
     4
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
     8
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
    12
 * GNU General Public License for more details.
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
    13
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
    14
 * You should have received a copy of the GNU General Public License
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
    15
 * along with this program; if not, write to the Free Software
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
    17
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
    18
 * File created on 08/01/2010.
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
    19
 */
81db3c85784b headers ftw, also right project file
koda
parents: 3803
diff changeset
    20
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    21
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    22
#import "GeneralSettingsViewController.h"
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    23
#import "CommodityFunctions.h"
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    24
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    25
@implementation GeneralSettingsViewController
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    26
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    27
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    28
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    29
    return rotationManager(interfaceOrientation);
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    30
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    31
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    32
#pragma mark -
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    33
#pragma mark View Lifecycle
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    34
-(void) viewDidLoad {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    35
    [super viewDidLoad];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    36
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    37
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    38
-(void) viewWillAppear:(BOOL)animated {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    39
    [self.tableView setContentOffset:CGPointMake(0,0) animated:NO];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    40
    [super viewWillAppear:animated];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    41
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    42
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    43
-(void) viewWillDisappear:(BOOL)animated {
5224
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    44
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    45
    [userDefaults synchronize];
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    46
    if ([[userDefaults objectForKey:@"music"] boolValue] == NO)
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    47
        [HedgewarsAppDelegate stopBackgroundMusic];
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    48
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3663
diff changeset
    49
    [super viewWillDisappear:animated];
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    50
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    51
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    52
#pragma mark -
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    53
-(void) switchValueChanged:(id) sender {
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    54
    UISwitch *theSwitch = (UISwitch *)sender;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    55
    UISwitch *theOtherSwitch = nil;
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    56
    NSUserDefaults *settings = [NSUserDefaults standardUserDefaults];
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3663
diff changeset
    57
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    58
    switch (theSwitch.tag) {
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    59
        case 10:    //soundSwitch
5224
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    60
            // setting this off will turn off also the switch below (music)
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    61
            [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"sound"];
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    62
            [settings setObject:[NSNumber numberWithBool:NO] forKey:@"music"];
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    63
            theOtherSwitch = (UISwitch *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:1]].accessoryView;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    64
            [theOtherSwitch setOn:NO animated:YES];
5370
a3f87be7b09a ios: disble logging, stop music correctly in preferences, move script command before seed, try using reatin instead of if
koda
parents: 5224
diff changeset
    65
a3f87be7b09a ios: disble logging, stop music correctly in preferences, move script command before seed, try using reatin instead of if
koda
parents: 5224
diff changeset
    66
            if (theOtherSwitch.on)
a3f87be7b09a ios: disble logging, stop music correctly in preferences, move script command before seed, try using reatin instead of if
koda
parents: 5224
diff changeset
    67
                [HedgewarsAppDelegate pauseBackgroundMusic];
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    68
            break;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    69
        case 20:    //musicSwitch
5224
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    70
            // if switch above (sound) is off, never turn on
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    71
            if (NO == [[settings objectForKey:@"sound"] boolValue]) {
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    72
                [settings setObject:[NSNumber numberWithBool:NO] forKey:@"music"];
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    73
                theOtherSwitch = (UISwitch *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:1]].accessoryView;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    74
                [theOtherSwitch setOn:NO animated:YES];
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    75
            } else
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    76
                [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"music"];
5224
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    77
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    78
            if (theSwitch.on)
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    79
                [HedgewarsAppDelegate playBackgroundMusic];
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    80
            else
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    81
                [HedgewarsAppDelegate pauseBackgroundMusic];
6e8fbbfb0de5 muuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusic for the ios frontend finally
koda
parents: 5207
diff changeset
    82
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    83
            break;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    84
        case 30:    //alternateSwitch
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    85
            [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"alternate"];
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    86
            break;
5451
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
    87
        case 90:    //synched weapons/scheme
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
    88
            [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"sync_ws"];
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
    89
            break;
4540
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
    90
        case 70:    //enhanced graphics
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    91
            [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"enhanced"];
4540
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
    92
            break;
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
    93
        case 80:    //nomultitasking
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    94
            [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"multitasking"];
4540
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
    95
            break;
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
    96
        case 60:    //classic menu
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    97
            [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"classic_menu"];
3779
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
    98
            break;
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
    99
        default:
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   100
            DLog(@"Wrong tag");
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   101
            break;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   102
    }
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   103
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   104
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   105
-(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue {
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
   106
    NSUserDefaults *settings = [NSUserDefaults standardUserDefaults];
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
   107
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   108
    if (tagValue == 40)
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
   109
        [settings setObject:textString forKey:@"username"];
5206
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 4976
diff changeset
   110
    else
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
   111
        [settings setObject:[textString MD5hash] forKey:@"password"];
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   112
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   113
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   114
#pragma mark -
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   115
#pragma mark TableView Methods
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   116
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   117
    return 3;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   118
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   119
4539
bad3411cba49 store the (future) password with md5 for ifrontend
koda
parents: 4341
diff changeset
   120
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger )section {
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   121
    switch (section) {
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   122
        case 0:     // user and pass
5451
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   123
            return 1;   // set 2 here to show the password field
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   124
            break;
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   125
        case 1:     // audio
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   126
            return 2;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   127
            break;
5451
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   128
        case 2:     // other options
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   129
            return 5;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   130
            break;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   131
        default:
3935
5ca27a0e9a63 made the new menu toggable
koda
parents: 3884
diff changeset
   132
            DLog(@"Nope");
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   133
            break;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   134
    }
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   135
    return 0;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   136
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   137
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   138
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   139
    NSString *sectionTitle = nil;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   140
    switch (section) {
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   141
        case 0:
3803
e4a8a4e378de remove now useless toggle, add ai team
koda
parents: 3783
diff changeset
   142
            sectionTitle = NSLocalizedString(@"Main Configuration", @"");
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   143
            break;
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   144
        case 1:
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   145
            sectionTitle = NSLocalizedString(@"Audio Preferences", @"");
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   146
            break;
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   147
        case 2:
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   148
            sectionTitle = NSLocalizedString(@"Other Settings", @"");
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   149
            break;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   150
        default:
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   151
            DLog(@"Nope");
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   152
            break;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   153
    }
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   154
    return sectionTitle;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   155
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   156
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   157
-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   158
    static NSString *cellIdentifier0 = @"Cell0";
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   159
    static NSString *cellIdentifier1 = @"Cell1";
3779
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   160
    static NSString *cellIdentifier2 = @"Cell2";
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   161
    NSInteger row = [indexPath row];
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   162
    NSInteger section = [indexPath section];
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
   163
    NSUserDefaults *settings = [NSUserDefaults standardUserDefaults];
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3663
diff changeset
   164
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   165
    UITableViewCell *cell = nil;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   166
    EditableCellView *editableCell = nil;
3779
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   167
    UISwitch *switchContent = nil;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   168
    switch(section) {
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   169
        case 0:
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   170
            editableCell = (EditableCellView *)[aTableView dequeueReusableCellWithIdentifier:cellIdentifier0];
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   171
            if (nil == editableCell) {
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   172
                editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier0] autorelease];
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   173
                editableCell.minimumCharacters = 0;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   174
                editableCell.delegate = self;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   175
                editableCell.textField.font = [UIFont systemFontOfSize:[UIFont systemFontSize]];
4341
46b8791e577f minor things
koda
parents: 4244
diff changeset
   176
                editableCell.textField.textColor = [UIColor blackColor];
3779
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   177
            }
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   178
            
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   179
            if (row == 0) {
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   180
                editableCell.titleLabel.text = NSLocalizedString(@"Nickname","from the settings table");
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   181
                editableCell.textField.placeholder = NSLocalizedString(@"Insert your username (if you have one)",@"");
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
   182
                editableCell.textField.text = [settings objectForKey:@"username"];
3779
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   183
                editableCell.textField.secureTextEntry = NO;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   184
                editableCell.tag = 40;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   185
            } else {
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   186
                editableCell.titleLabel.text = NSLocalizedString(@"Password","from the settings table");
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   187
                editableCell.textField.placeholder = NSLocalizedString(@"Insert your password",@"");
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
   188
                editableCell.textField.text = [settings objectForKey:@"password"];
3779
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   189
                editableCell.textField.secureTextEntry = YES;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   190
                editableCell.tag = 50;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   191
            }
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   192
            
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   193
            editableCell.accessoryView = nil;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   194
            cell = editableCell;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   195
            break;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   196
        case 1:
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   197
            cell = [aTableView dequeueReusableCellWithIdentifier:cellIdentifier1];
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   198
            if (nil == cell) {
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   199
                cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier1] autorelease];
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   200
                UISwitch *theSwitch = [[UISwitch alloc] init];
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   201
                [theSwitch addTarget:self action:@selector(switchValueChanged:) forControlEvents:UIControlEventValueChanged];
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   202
                cell.accessoryView = theSwitch;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   203
                [theSwitch release];
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   204
            }
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   205
            
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   206
            switchContent = (UISwitch *)cell.accessoryView;
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   207
            if (row == 0) {
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   208
                cell.textLabel.text = NSLocalizedString(@"Sound", @"");
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
   209
                switchContent.on = [[settings objectForKey:@"sound"] boolValue];
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   210
                switchContent.tag = 10;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   211
            } else {
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   212
                cell.textLabel.text = NSLocalizedString(@"Music", @"");
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
   213
                switchContent.on = [[settings objectForKey:@"music"] boolValue];
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   214
                switchContent.tag = 20;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   215
            }
3779
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   216
            break;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   217
        case 2:
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   218
            cell = [aTableView dequeueReusableCellWithIdentifier:cellIdentifier2];
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   219
            if (nil == cell) {
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   220
                cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier2] autorelease];
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   221
                UISwitch *theSwitch = [[UISwitch alloc] init];
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   222
                [theSwitch addTarget:self action:@selector(switchValueChanged:) forControlEvents:UIControlEventValueChanged];
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   223
                cell.accessoryView = theSwitch;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   224
                [theSwitch release];
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   225
            }
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   226
            
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   227
            switchContent = (UISwitch *)cell.accessoryView;
5451
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   228
            cell.detailTextLabel.adjustsFontSizeToFitWidth = YES;
4540
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   229
            switch (row) {
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   230
                case 0:
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   231
                    cell.textLabel.text = NSLocalizedString(@"Alternate Damage", @"");
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   232
                    cell.detailTextLabel.text = NSLocalizedString(@"Damage popups will notify you on every single hit", @"");
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
   233
                    switchContent.on = [[settings objectForKey:@"alternate"] boolValue];
4540
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   234
                    switchContent.tag = 30;
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   235
                    break;
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   236
                case 1:
5451
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   237
                    cell.textLabel.text = NSLocalizedString(@"Sync Schemes and Weapons", @"");
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   238
                    cell.detailTextLabel.text = NSLocalizedString(@"Choosing a Scheme will select its associated Weapon", @"");
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   239
                    switchContent.on = [[settings objectForKey:@"sync_ws"] boolValue];
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   240
                    switchContent.tag = 90;
4540
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   241
                    break;
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   242
                case 2:
5451
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   243
                    cell.textLabel.text = NSLocalizedString(@"Multitasking", @"");
4540
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   244
                    cell.detailTextLabel.text = NSLocalizedString(@"Disable it in case of issues when returing in game", @"");
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
   245
                    switchContent.on = [[settings objectForKey:@"multitasking"] boolValue];
4540
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   246
                    switchContent.tag = 80;
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   247
                    break;
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   248
                case 3:
5451
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   249
                    cell.textLabel.text = NSLocalizedString(@"Enanched Graphics", @"");
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   250
                    cell.detailTextLabel.text = NSLocalizedString(@"Beware that the game will consume more memory", @"");
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   251
                    switchContent.on = [[settings objectForKey:@"enhanced"] boolValue];
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   252
                    switchContent.tag = 70;
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   253
                    // prevent the oldest devices to even think about enabling it
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   254
                    if (IS_NOT_POWERFUL(getModelType()))
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   255
                        switchContent.enabled = NO;
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   256
                    break;
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   257
                case 4:
4540
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   258
                    cell.textLabel.text = NSLocalizedString(@"Classic Ammo Menu", @"");
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   259
                    cell.detailTextLabel.text = NSLocalizedString(@"Select which style of ammo menu you prefer",@"");
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
   260
                    switchContent.on = [[settings objectForKey:@"classic_menu"] boolValue];
4540
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   261
                    switchContent.tag = 60;
5451
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   262
                    // remove this when classic ammomenu works on iphone as well
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   263
                    if (IS_IPAD() == NO)
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5370
diff changeset
   264
                        switchContent.enabled = NO;
4540
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   265
                    break;
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   266
                default:
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   267
                    DLog(@"Nope");
9b614e420de5 add two preferences for enabling/disabling blurry land and multitasking
koda
parents: 4539
diff changeset
   268
                    break;
3779
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   269
            }
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   270
            break;
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   271
        default:
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   272
            break;
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   273
    }
3779
3351a017d4ad tap to dismiss 'get ready', add a toggle to enable/disable it
koda
parents: 3703
diff changeset
   274
    
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   275
    cell.accessoryType = UITableViewCellAccessoryNone;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   276
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   277
    cell.imageView.image = nil;
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3663
diff changeset
   278
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   279
    return cell;
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   280
}
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   281
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   282
#pragma mark -
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   283
#pragma mark Table view delegate
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   284
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
3660
bc125bea5849 complete settings page rework
koda
parents: 3659
diff changeset
   285
    if (0 == [indexPath section]) {
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   286
        EditableCellView *cell = (EditableCellView *)[aTableView cellForRowAtIndexPath:indexPath];
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   287
        [cell replyKeyboard];
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   288
    }
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   289
}
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3660
diff changeset
   290
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   291
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   292
#pragma mark -
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   293
#pragma mark Memory management
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   294
-(void) didReceiveMemoryWarning {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   295
    [super didReceiveMemoryWarning];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   296
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   297
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   298
-(void) viewDidUnload {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   299
    [super viewDidUnload];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   300
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   301
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   302
-(void) dealloc {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   303
    [super dealloc];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   304
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   305
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   306
@end