project_files/HedgewarsMobile/Classes/GameLogViewController.m
branchios-develop
changeset 12872 00215a7ec5f5
parent 11177 015596575698
equal deleted inserted replaced
12871:2c06b1120749 12872:00215a7ec5f5
    39     
    39     
    40     self.title = @"Last game log";
    40     self.title = @"Last game log";
    41     
    41     
    42     UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStylePlain target:self action:@selector(dismissAction)];
    42     UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStylePlain target:self action:@selector(dismissAction)];
    43     self.navigationItem.rightBarButtonItem = closeButton;
    43     self.navigationItem.rightBarButtonItem = closeButton;
    44     [closeButton release];
       
    45     
    44     
    46 #ifdef DEBUG
    45 #ifdef DEBUG
    47     if ([self allowSendLogByEmail])
    46     if ([self allowSendLogByEmail])
    48     {
    47     {
    49         UIBarButtonItem *sendButton = [[UIBarButtonItem alloc] initWithTitle:@"Send" style:UIBarButtonItemStylePlain target:self action:@selector(sendLogByEmailAction)];
    48         UIBarButtonItem *sendButton = [[UIBarButtonItem alloc] initWithTitle:@"Send" style:UIBarButtonItemStylePlain target:self action:@selector(sendLogByEmailAction)];
    50         self.navigationItem.leftBarButtonItem = sendButton;
    49         self.navigationItem.leftBarButtonItem = sendButton;
    51         [sendButton release];
       
    52     }
    50     }
    53 #endif
    51 #endif
    54     
    52     
    55     NSString *debugStr = nil;
    53     NSString *debugStr = nil;
    56     if ([[NSFileManager defaultManager] fileExistsAtPath:DEBUG_FILE()])
    54     if ([[NSFileManager defaultManager] fileExistsAtPath:DEBUG_FILE()])
    59         debugStr = [[NSString alloc] initWithString:@"Here be log"];
    57         debugStr = [[NSString alloc] initWithString:@"Here be log"];
    60     
    58     
    61     UITextView *logView = [[UITextView alloc] initWithFrame:self.view.frame];
    59     UITextView *logView = [[UITextView alloc] initWithFrame:self.view.frame];
    62     [logView setAutoresizingMask:(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth)];
    60     [logView setAutoresizingMask:(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth)];
    63     logView.text = debugStr;
    61     logView.text = debugStr;
    64     [debugStr release];
       
    65     logView.editable = NO;
    62     logView.editable = NO;
    66     
    63     
    67     [self.view addSubview:logView];
    64     [self.view addSubview:logView];
    68     [logView release];
       
    69 }
    65 }
    70 
    66 
    71 #pragma mark - Parameters
    67 #pragma mark - Parameters
    72 
    68 
    73 #ifdef DEBUG
    69 #ifdef DEBUG
    93     // Fill out the email body text
    89     // Fill out the email body text
    94     NSString *emailBody = @"Add here description of a problem/log";
    90     NSString *emailBody = @"Add here description of a problem/log";
    95     [picker setMessageBody:emailBody isHTML:NO];
    91     [picker setMessageBody:emailBody isHTML:NO];
    96     
    92     
    97     [self presentViewController:picker animated:YES completion:nil];
    93     [self presentViewController:picker animated:YES completion:nil];
    98     [picker release];
       
    99 }
    94 }
   100 #endif
    95 #endif
   101 
    96 
   102 - (void)dismissAction
    97 - (void)dismissAction
   103 {
    98 {