diff --git a/Classes/BuschJaegerApp.xib b/Classes/BuschJaegerApp.xib index 89d7ba768..8eb1c26c3 100644 --- a/Classes/BuschJaegerApp.xib +++ b/Classes/BuschJaegerApp.xib @@ -47,8 +47,8 @@ NO NO - IBCocoaTouchFramework + YES YES @@ -116,7 +116,7 @@ - 28 + 31 diff --git a/Classes/BuschJaegerCallView.m b/Classes/BuschJaegerCallView.m index 628c62f60..ab4f64fcd 100644 --- a/Classes/BuschJaegerCallView.m +++ b/Classes/BuschJaegerCallView.m @@ -178,12 +178,15 @@ [microButton update]; switch (state) { + case LinphoneCallIncomingEarlyMedia: case LinphoneCallIncomingReceived: { [self displayIncomingCall:call]; break; } case LinphoneCallOutgoingInit: + case LinphoneCallOutgoingProgress: + case LinphoneCallOutgoingRinging: case LinphoneCallConnected: case LinphoneCallStreamsRunning: case LinphoneCallUpdated: diff --git a/Classes/BuschJaegerCallView.xib b/Classes/BuschJaegerCallView.xib index 288fab755..ba5bdebcf 100644 --- a/Classes/BuschJaegerCallView.xib +++ b/Classes/BuschJaegerCallView.xib @@ -44,7 +44,7 @@ _NS:196 - + 3 MAA @@ -178,7 +178,6 @@ {{207, 0}, {73, 58}} - _NS:225 NO @@ -323,10 +322,7 @@ - - 1 - MC4wNTQ5MDE5NjA3OCAwLjA4MjM1Mjk0MTE4IDAuMTI5NDExNzY0NwA - + IBCocoaTouchFramework diff --git a/Classes/BuschJaegerConfiguration.h b/Classes/BuschJaegerConfiguration.h index 501daa1bc..802821ec7 100644 --- a/Classes/BuschJaegerConfiguration.h +++ b/Classes/BuschJaegerConfiguration.h @@ -33,6 +33,11 @@ @interface BuschJaegerConfiguration : NSObject { } +typedef enum _BuschJaegerConfigurationRequestType{ + BuschJaegerConfigurationRequestType_Local, + BuschJaegerConfigurationRequestType_Global +} BuschJaegerConfigurationRequestType; + @property (readonly) NSMutableSet *history; @property (readonly) NSMutableSet *outdoorStations; @property (readonly) Network *network; @@ -43,8 +48,10 @@ - (BOOL)saveFile:(NSString*)file; - (BOOL)parseQRCode:(NSString*)data delegate:(id)delegate; -- (BOOL)loadHistory:(NSString*)url delegate:(id)delegate; +- (BOOL)loadHistory:(BuschJaegerConfigurationRequestType)type delegate:(id)delegate; +- (NSString*)getImageUrl:(BuschJaegerConfigurationRequestType)type image:(NSString *)image; + +- (NSString*)getGateway:(BuschJaegerConfigurationRequestType)type; + (NSString*)getRegexValue:(NSString*)regexString data:(NSString*)data; - @end diff --git a/Classes/BuschJaegerConfiguration.m b/Classes/BuschJaegerConfiguration.m index 5287c8df7..50625351d 100644 --- a/Classes/BuschJaegerConfiguration.m +++ b/Classes/BuschJaegerConfiguration.m @@ -118,9 +118,11 @@ - (BOOL)parseHistory:(NSString*)data delegate:(id)delegate { NSArray *arr = [data componentsSeparatedByString:@"\n"]; for (NSString *line in arr) { - History *his = [History parse:line]; - if(his) { - [history addObject:his]; + if([line length]) { + History *his = [History parse:line]; + if(his) { + [history addObject:his]; + } } } return TRUE; @@ -256,7 +258,9 @@ return FALSE; } -- (BOOL)loadHistory:(NSString*)url delegate:(id)delegate { +- (BOOL)loadHistory:(BuschJaegerConfigurationRequestType)type delegate:(id)delegate { + [history removeAllObjects]; + NSString *url = (type == BuschJaegerConfigurationRequestType_Local)? network.localHistory: network.globalHistory; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:5]; if(request != nil) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long)NULL), ^(void) { @@ -269,11 +273,13 @@ [delegate buschJaegerConfigurationError:[error localizedDescription]]; }); } else { - if([self parseHistory:[NSString stringWithUTF8String:[data bytes]] delegate:delegate]) { + NSString *dataString = [[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding: NSUTF8StringEncoding]; + if([self parseHistory:dataString delegate:delegate]) { dispatch_async(dispatch_get_main_queue(), ^{ [delegate buschJaegerConfigurationSuccess]; }); } + [dataString release]; } }); return TRUE; @@ -281,4 +287,20 @@ return FALSE; } + +- (NSString*)getGateway:(BuschJaegerConfigurationRequestType)type { + NSString *gateway = nil; + NSString *urlString = (type == BuschJaegerConfigurationRequestType_Local)? network.localHistory: network.globalHistory; + NSURL *url = [NSURL URLWithString:urlString]; + NSRange range = [urlString rangeOfString:[url relativePath]]; + if(range.location != NSNotFound) { + gateway = [urlString substringToIndex:range.location]; + } + return gateway; +} + +- (NSString*)getImageUrl:(BuschJaegerConfigurationRequestType)type image:(NSString *)image { + return [NSString stringWithFormat:@"%@/%@", [self getGateway:type], image]; +} + @end diff --git a/Classes/BuschJaegerHistoryDetailsView.h b/Classes/BuschJaegerHistoryDetailsView.h new file mode 100644 index 000000000..67532e63e --- /dev/null +++ b/Classes/BuschJaegerHistoryDetailsView.h @@ -0,0 +1,41 @@ +/* BuschJaegerHistoryDetailsView.h + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import +#import "History.h" +#import "UIRemoteImageView.h" + +@interface BuschJaegerHistoryDetailsView : UIViewController { +@private + int currentIndex; + NSDateFormatter *dateFormatter; +} + +@property (nonatomic, retain) IBOutlet UIView *backButton; +@property (nonatomic, retain) History *history; +@property (nonatomic, retain) IBOutlet UITableViewController *tableController; +@property (nonatomic, retain) IBOutlet UILabel *stationLabel; +@property (nonatomic, retain) IBOutlet UILabel *dateLabel; +@property (nonatomic, retain) IBOutlet UIRemoteImageView *imageView; + +- (IBAction)nextImage:(id)sender; +- (IBAction)previousImage:(id)sender; +- (IBAction)hideImage:(id)sender; + +@end diff --git a/Classes/BuschJaegerHistoryDetailsView.m b/Classes/BuschJaegerHistoryDetailsView.m new file mode 100644 index 000000000..4af817c70 --- /dev/null +++ b/Classes/BuschJaegerHistoryDetailsView.m @@ -0,0 +1,199 @@ +/* BuschJaegerHistoryDetailsView.m + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import "BuschJaegerHistoryDetailsView.h" +#import "UIHistoryDetailsCell.h" +#import "BuschJaegerMainView.h" +#import "BuschJaegerUtils.h" +#import "UACellBackgroundView.h" + +@implementation BuschJaegerHistoryDetailsView + +@synthesize history; +@synthesize tableController; +@synthesize backButton; +@synthesize stationLabel; +@synthesize dateLabel; +@synthesize imageView; + +#pragma mark - Lifecycle Functions + +- (void)initBuschJaegerHistoryDetailsView { + dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setTimeStyle:NSDateFormatterMediumStyle]; + [dateFormatter setDateStyle:NSDateFormatterMediumStyle]; + NSLocale *locale = [NSLocale currentLocale]; + [dateFormatter setLocale:locale]; +} + +- (id)init { + self = [super init]; + if(self != nil) { + [self initBuschJaegerHistoryDetailsView]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if(self != nil) { + [self initBuschJaegerHistoryDetailsView]; + } + return self; +} + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if(self != nil) { + [self initBuschJaegerHistoryDetailsView]; + } + return self; +} + +- (void)dealloc { + [tableController release]; + [history release]; + [backButton release]; + [stationLabel release]; + [dateLabel release]; + + [imageView release]; + + [dateFormatter release]; + + [super dealloc]; +} + +#pragma mark - ViewController Functions + +- (void)viewDidLoad { + [super viewDidLoad]; + + [tableController.view setBackgroundColor:[UIColor clearColor]]; + + /* init gradients */ + { + UIColor* col1 = BUSCHJAEGER_NORMAL_COLOR; + UIColor* col2 = BUSCHJAEGER_NORMAL_COLOR2; + + [BuschJaegerUtils createGradientForView:backButton withTopColor:col1 bottomColor:col2 cornerRadius:BUSCHJAEGER_DEFAULT_CORNER_RADIUS]; + } +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + [imageView setHidden:TRUE]; +} + + +#pragma mark - Property Functions + +- (void)setHistory:(History *)ahistory { + [history release]; + history = [ahistory retain]; + [self update]; +} + + +#pragma mark - + +- (void)update { + [self view]; // Force view load + [self.tableController.tableView reloadData]; + + NSString *stationName = @"Unknown"; + NSSet *set = [[[LinphoneManager instance].configuration outdoorStations] filteredSetUsingPredicate:[NSPredicate predicateWithFormat:@"ID == %i", history.stationID]]; + if([set count] == 1) { + OutdoorStation *station = [[set allObjects] objectAtIndex:0]; + stationName = station.name; + } + // Station + [stationLabel setText:stationName]; + + // Date + [dateLabel setText:[dateFormatter stringFromDate:history.date]]; +} + + +#pragma mark - Action Functions + +- (IBAction)onBackClick:(id)sender { + [[BuschJaegerMainView instance].navigationController popViewControllerAnimated:FALSE]; +} + +- (IBAction)nextImage:(id)sender { + if([history.images count]) { + currentIndex = (currentIndex - 1); + if(currentIndex < 0) currentIndex = [history.images count] - 1; + [imageView loadImage:[[LinphoneManager instance].configuration getImageUrl:BuschJaegerConfigurationRequestType_Local image:[history.images objectAtIndex:currentIndex]]]; + } +} + +- (IBAction)previousImage:(id)sender { + if([history.images count]) { + currentIndex = (currentIndex + 1) % [history.images count]; + [imageView loadImage:[[LinphoneManager instance].configuration getImageUrl:BuschJaegerConfigurationRequestType_Local image:[history.images objectAtIndex:currentIndex]]]; + } +} + +- (IBAction)hideImage:(id)sender { + [imageView setHidden:TRUE]; +} + + +#pragma mark - UITableViewDataSource Functions + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return [history.images count]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + static NSString *kCellId = @"UIHistoryCell"; + UIHistoryDetailsCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; + if (cell == nil) { + cell = [[[UIHistoryDetailsCell alloc] initWithIdentifier:kCellId] autorelease]; + + // Background View + UACellBackgroundView *selectedBackgroundView = [[[UACellBackgroundView alloc] initWithFrame:CGRectZero] autorelease]; + cell.selectedBackgroundView = selectedBackgroundView; + [selectedBackgroundView setBackgroundColor:BUSCHJAEGER_NORMAL_COLOR]; + [selectedBackgroundView setBorderColor:[UIColor clearColor]]; + } + + [cell setImage:[history.images objectAtIndex:[indexPath row]]]; + + return cell; +} + + +#pragma mark - UITableViewDelegate Functions + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + [tableView deselectRowAtIndexPath:indexPath animated:NO]; + currentIndex = [indexPath row]; + [imageView setHidden:FALSE]; + [imageView setImage:nil]; + [imageView loadImage:[[LinphoneManager instance].configuration getImageUrl:BuschJaegerConfigurationRequestType_Local image:[history.images objectAtIndex:currentIndex]]]; +} + +@end diff --git a/Classes/BuschJaegerHistoryDetailsView.xib b/Classes/BuschJaegerHistoryDetailsView.xib new file mode 100644 index 000000000..e9a171653 --- /dev/null +++ b/Classes/BuschJaegerHistoryDetailsView.xib @@ -0,0 +1,583 @@ + + + + 1296 + 11E53 + 2549 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1498 + + + IBProxyObject + IBUIButton + IBUIImageView + IBUILabel + IBUISwipeGestureRecognizer + IBUITableView + IBUITableViewController + IBUITapGestureRecognizer + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 274 + {{0, 34}, {320, 368}} + + + + _NS:10 + + 3 + MQA + + NO + YES + NO + IBCocoaTouchFramework + YES + 0 + YES + 110 + 22 + 22 + + + + 292 + {{5, 5}, {180, 21}} + + + + _NS:9 + NO + YES + 7 + NO + IBCocoaTouchFramework + Station 1 + + + 0 + 10 + + 1 + 20 + + + Helvetica + 20 + 16 + + + + + 292 + {{203, 5}, {112, 21}} + + + + _NS:9 + NO + YES + 7 + NO + IBCocoaTouchFramework + 2011 01 01 00:01 + + + 0 + 10 + + 1 + 11 + + + Helvetica + 11 + 16 + + + + + 292 + + + + 274 + {280, 40} + + + + _NS:9 + NO + YES + 7 + NO + IBCocoaTouchFramework + Back + + + 0 + 10 + 1 + + 1 + 24 + + + Helvetica + 24 + 16 + + + + + 274 + {280, 40} + + + _NS:9 + + 3 + MCAwAA + + NO + IBCocoaTouchFramework + 0 + 0 + + + + 3 + MC41AA + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + {{20, 410}, {280, 40}} + + + + _NS:9 + + IBCocoaTouchFramework + + + + 292 + {320, 460} + + + + _NS:9 + + 3 + MAA + + 1 + YES + + IBCocoaTouchFramework + + + {{0, 20}, {320, 460}} + + + + + + IBCocoaTouchFramework + + + + + 1 + 1 + + IBCocoaTouchFramework + NO + + + + + 2 + + + + + + + view + + + + 3 + + + + backButton + + + + 17 + + + + tableController + + + + 18 + + + + dateLabel + + + + 19 + + + + stationLabel + + + + 20 + + + + imageView + + + + 32 + + + + view + + + + 10 + + + + dataSource + + + + 11 + + + + delegate + + + + 12 + + + + onBackClick: + + + 7 + + 16 + + + + gestureRecognizers + + + NSArray + NO + + 25 + + + + gestureRecognizers + + + NSArray + NO + + 30 + + + + gestureRecognizers + + + NSArray + NO + + 31 + + + + hideImage: + + + + 33 + + + + nextImage: + + + + 34 + + + + previousImage: + + + + 35 + + + + + + 0 + + + + + + 1 + + + + + + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + + + + 5 + + + + + 8 + + + Label - Date + + + 9 + + + Label - Station + + + 13 + + + + + + + Back Button View + + + 15 + + + + + 14 + + + + + 21 + + + + + + 23 + + + + + 28 + + + Right Swipe Gesture Recognizer + + + 29 + + + Left Swipe Gesture Recognizer + + + + + BuschJaegerHistoryDetailsView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIRemoteImageView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 35 + + + + + BuschJaegerHistoryDetailsView + UIViewController + + id + id + id + id + + + + hideImage: + id + + + nextImage: + id + + + onBackClick: + id + + + previousImage: + id + + + + UIView + UILabel + UIRemoteImageView + UILabel + UITableViewController + + + + backButton + UIView + + + dateLabel + UILabel + + + imageView + UIRemoteImageView + + + stationLabel + UILabel + + + tableController + UITableViewController + + + + IBProjectSource + ./Classes/BuschJaegerHistoryDetailsView.h + + + + UIRemoteImageView + UIImageView + + IBProjectSource + ./Classes/UIRemoteImageView.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + 1498 + + diff --git a/Classes/BuschJaegerHistoryTableViewController.m b/Classes/BuschJaegerHistoryTableViewController.m index 6277c7a31..2bb749a39 100644 --- a/Classes/BuschJaegerHistoryTableViewController.m +++ b/Classes/BuschJaegerHistoryTableViewController.m @@ -19,6 +19,7 @@ #import "BuschJaegerHistoryTableViewController.h" #import "BuschJaegerUtils.h" +#import "BuschJaegerMainView.h" #import "UIHistoryCell.h" #import "UACellBackgroundView.h" @@ -26,6 +27,17 @@ @synthesize history; + +#pragma mark - Lifecycle Functions + +- (void)dealloc { + [history release]; + [super dealloc]; +} + + +#pragma mark - Property Functions + - (void)setHistory:(NSArray *)ahistory { if ([ahistory isEqualToArray:history]) { return; @@ -70,6 +82,8 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:NO]; + [[BuschJaegerMainView instance].historyDetailsView setHistory:[history objectAtIndex:[indexPath row]]]; + [[BuschJaegerMainView instance].navigationController pushViewController:[BuschJaegerMainView instance].historyDetailsView animated:FALSE]; } diff --git a/Classes/BuschJaegerHistoryView.h b/Classes/BuschJaegerHistoryView.h index d902a62de..e243e3cba 100644 --- a/Classes/BuschJaegerHistoryView.h +++ b/Classes/BuschJaegerHistoryView.h @@ -31,4 +31,6 @@ - (IBAction)onBackClick:(id)sender; +- (void)reload; + @end diff --git a/Classes/BuschJaegerHistoryView.m b/Classes/BuschJaegerHistoryView.m index f0c158d08..3628cbbec 100644 --- a/Classes/BuschJaegerHistoryView.m +++ b/Classes/BuschJaegerHistoryView.m @@ -20,6 +20,7 @@ #import "BuschJaegerHistoryView.h" #import "BuschJaegerMainView.h" +#import "BuschJaegerUtils.h" @implementation BuschJaegerHistoryView @@ -27,6 +28,7 @@ @synthesize waitView; @synthesize tableController; + #pragma mark - Lifecycle Functions - (void)dealloc { @@ -37,6 +39,7 @@ [super dealloc]; } + #pragma mark - ViewController Functions - (void)viewDidLoad { @@ -45,34 +48,42 @@ [tableController.view setBackgroundColor:[UIColor clearColor]]; [waitView setHidden:TRUE]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - - [LinphoneManager instance].configuration.network.localHistory = @"http://elviish.eu/history.ini"; //tmp - if([[LinphoneManager instance].configuration loadHistory:[LinphoneManager instance].configuration.network.localHistory delegate:self]) { - [waitView setHidden:FALSE]; - } else { - [waitView setHidden:TRUE]; + /* init gradients */ + { + UIColor* col1 = BUSCHJAEGER_NORMAL_COLOR; + UIColor* col2 = BUSCHJAEGER_NORMAL_COLOR2; + + [BuschJaegerUtils createGradientForView:backButton withTopColor:col1 bottomColor:col2 cornerRadius:BUSCHJAEGER_DEFAULT_CORNER_RADIUS]; } } + #pragma mark - Action Functions - (IBAction)onBackClick:(id)sender { [[BuschJaegerMainView instance].navigationController popViewControllerAnimated:FALSE]; } + #pragma mark - +- (void)reload { + [self view]; // Force view load + if([[LinphoneManager instance].configuration loadHistory:BuschJaegerConfigurationRequestType_Local delegate:self]) { + [waitView setHidden:FALSE]; + } else { + [waitView setHidden:TRUE]; + } +} + - (void)update { - NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"ID" ascending:YES]; + NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"date" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [tableController setHistory:[[LinphoneManager instance].configuration.history sortedArrayUsingDescriptors:sortDescriptors]]; } + #pragma mark - BuschJaegerConfigurationDelegate Functions - (void)buschJaegerConfigurationSuccess { diff --git a/Classes/BuschJaegerHistoryView.xib b/Classes/BuschJaegerHistoryView.xib index 1d10bd83b..601ce0f5a 100644 --- a/Classes/BuschJaegerHistoryView.xib +++ b/Classes/BuschJaegerHistoryView.xib @@ -46,7 +46,7 @@ 274 - {280, 60} + {280, 40} @@ -78,7 +78,7 @@ 274 - {280, 60} + {280, 40} _NS:9 @@ -107,7 +107,7 @@ - {{20, 380}, {280, 60}} + {{20, 410}, {280, 40}} @@ -118,7 +118,7 @@ 274 - {334, 372} + {334, 392} @@ -127,6 +127,7 @@ YES IBCocoaTouchFramework YES + 2 0 YES 44 @@ -143,6 +144,7 @@ {{142, 211}, {37, 37}} + _NS:9 NO IBCocoaTouchFramework @@ -154,11 +156,11 @@ {320, 460} - + _NS:9 3 - MSAwLjQAA + MCAwLjQ1AA IBCocoaTouchFramework @@ -304,6 +306,7 @@ 12 + diff --git a/Classes/BuschJaegerMainView.h b/Classes/BuschJaegerMainView.h index d62497b86..a46d8fde1 100644 --- a/Classes/BuschJaegerMainView.h +++ b/Classes/BuschJaegerMainView.h @@ -23,6 +23,7 @@ #import "BuschJaegerSettingsView.h" #import "BuschJaegerWelcomeView.h" #import "BuschJaegerHistoryView.h" +#import "BuschJaegerHistoryDetailsView.h" @interface BuschJaegerMainView : UIViewController { @@ -33,6 +34,7 @@ @property (nonatomic, retain) IBOutlet BuschJaegerSettingsView *settingsView; @property (nonatomic, retain) IBOutlet BuschJaegerWelcomeView *welcomeView; @property (nonatomic, retain) IBOutlet BuschJaegerHistoryView *historyView; +@property (nonatomic, retain) IBOutlet BuschJaegerHistoryDetailsView *historyDetailsView; + (BuschJaegerMainView*) instance; diff --git a/Classes/BuschJaegerMainView.m b/Classes/BuschJaegerMainView.m index 6595cd8f6..a18503d63 100644 --- a/Classes/BuschJaegerMainView.m +++ b/Classes/BuschJaegerMainView.m @@ -26,6 +26,7 @@ @synthesize settingsView; @synthesize welcomeView; @synthesize historyView; +@synthesize historyDetailsView; static BuschJaegerMainView* mainViewInstance=nil; @@ -67,6 +68,7 @@ static BuschJaegerMainView* mainViewInstance=nil; [settingsView release]; [welcomeView release]; [historyView release]; + [historyDetailsView release]; // Remove all observer [[NSNotificationCenter defaultCenter] removeObserver:self]; @@ -80,6 +82,8 @@ static BuschJaegerMainView* mainViewInstance=nil; - (void)viewDidLoad { [super viewDidLoad]; + [self setWantsFullScreenLayout:TRUE]; + UIView *view = navigationController.view; [view setFrame:[self.view bounds]]; [self.view addSubview:view]; diff --git a/Classes/BuschJaegerMainView.xib b/Classes/BuschJaegerMainView.xib index c3972f9ba..76371bf51 100644 --- a/Classes/BuschJaegerMainView.xib +++ b/Classes/BuschJaegerMainView.xib @@ -37,7 +37,7 @@ 292 - {320, 460} + {320, 480} @@ -91,6 +91,16 @@ IBCocoaTouchFramework NO + + BuschJaegerHistoryDetailsView + + + 1 + 1 + + IBCocoaTouchFramework + NO + @@ -175,6 +185,14 @@ 25 + + + historyDetailsView + + + + 27 + @@ -248,6 +266,11 @@ + + 26 + + + @@ -264,6 +287,8 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin BuschJaegerHistoryView com.apple.InterfaceBuilder.IBCocoaTouchPlugin + BuschJaegerHistoryDetailsView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin BuschJaegerWelcomeView com.apple.InterfaceBuilder.IBCocoaTouchPlugin BuschJaegerSettingsView @@ -273,7 +298,7 @@ - 25 + 27 @@ -353,6 +378,25 @@ ./Classes/BuschJaegerCallView.h + + BuschJaegerHistoryDetailsView + UIViewController + + tableViewController + UITableViewController + + + tableViewController + + tableViewController + UITableViewController + + + + IBProjectSource + ./Classes/BuschJaegerHistoryDetailsView.h + + BuschJaegerHistoryTableViewController UITableViewController @@ -378,6 +422,7 @@ UIView BuschJaegerHistoryTableViewController + UIView @@ -388,6 +433,10 @@ tableController BuschJaegerHistoryTableViewController + + waitView + UIView + IBProjectSource @@ -399,6 +448,7 @@ UIViewController BuschJaegerCallView + BuschJaegerHistoryDetailsView BuschJaegerHistoryView UINavigationController BuschJaegerSettingsView @@ -409,6 +459,10 @@ callView BuschJaegerCallView + + historyDetailsView + BuschJaegerHistoryDetailsView + historyView BuschJaegerHistoryView @@ -500,7 +554,7 @@ UIButton UIButton - BuschJaegerStationViewController + BuschJaegerStationTableViewController @@ -513,7 +567,7 @@ tableController - BuschJaegerStationViewController + BuschJaegerStationTableViewController diff --git a/Classes/BuschJaegerSettingsView.m b/Classes/BuschJaegerSettingsView.m index de546dfc5..9c2473f69 100644 --- a/Classes/BuschJaegerSettingsView.m +++ b/Classes/BuschJaegerSettingsView.m @@ -74,8 +74,8 @@ UIColor* col1 = BUSCHJAEGER_NORMAL_COLOR; UIColor* col2 = BUSCHJAEGER_NORMAL_COLOR2; - [BuschJaegerUtils createGradientForView:scanButton withTopColor:col1 bottomColor:col2]; - [BuschJaegerUtils createGradientForView:backButton withTopColor:col1 bottomColor:col2]; + [BuschJaegerUtils createGradientForView:scanButton withTopColor:col1 bottomColor:col2 cornerRadius:BUSCHJAEGER_DEFAULT_CORNER_RADIUS]; + [BuschJaegerUtils createGradientForView:backButton withTopColor:col1 bottomColor:col2 cornerRadius:BUSCHJAEGER_DEFAULT_CORNER_RADIUS]; } [waitView setHidden:TRUE]; } diff --git a/Classes/BuschJaegerSettingsView.xib b/Classes/BuschJaegerSettingsView.xib index 081a88c51..40d6c86a9 100644 --- a/Classes/BuschJaegerSettingsView.xib +++ b/Classes/BuschJaegerSettingsView.xib @@ -136,7 +136,7 @@ 274 - {280, 60} + {280, 40} @@ -158,9 +158,10 @@ 274 - {280, 60} + {280, 40} + _NS:9 NO @@ -174,7 +175,7 @@ - {{20, 380}, {280, 60}} + {{20, 410}, {280, 40}} @@ -208,7 +209,7 @@ _NS:9 3 - MSAwLjQ1AA + MCAwLjQ1AA IBCocoaTouchFramework diff --git a/Classes/BuschJaegerStationTableViewController.m b/Classes/BuschJaegerStationTableViewController.m index 8d45550b6..4783920c8 100644 --- a/Classes/BuschJaegerStationTableViewController.m +++ b/Classes/BuschJaegerStationTableViewController.m @@ -27,6 +27,17 @@ @synthesize stations; + +#pragma mark - Lifecycle Functions + +- (void)dealloc { + [stations release]; + [super dealloc]; +} + + +#pragma mark - Property Functions + - (void)setStations:(NSArray *)astations { if ([astations isEqualToArray:stations]) { return; diff --git a/Classes/BuschJaegerUtils.h b/Classes/BuschJaegerUtils.h index e79b1c410..ef25f6929 100644 --- a/Classes/BuschJaegerUtils.h +++ b/Classes/BuschJaegerUtils.h @@ -28,10 +28,13 @@ #define BUSCHJAEGER_GREEN_COLOR [UIColor colorWithRed:91.0/255 green:161.0/255 blue:89.0/255 alpha:1.0] #define BUSCHJAEGER_GREEN_COLOR2 [UIColor colorWithRed:25.0/255 green:54.0/255 blue:24.0/255 alpha:1.0] +#define BUSCHJAEGER_DEFAULT_CORNER_RADIUS 5 @interface BuschJaegerUtils : NSObject + (void)createGradientForView:(UIView*)view withTopColor:(UIColor*)topColor bottomColor:(UIColor*)bottomColor; + (void)createGradientForButton:(UIButton*)button withTopColor:(UIColor*)topColor bottomColor:(UIColor*)bottomColor; ++ (void)createGradientForView:(UIView*)view withTopColor:(UIColor*)topColor bottomColor:(UIColor*)bottomColor cornerRadius:(int)cornerRadius; ++ (void)createGradientForButton:(UIButton*)button withTopColor:(UIColor*)topColor bottomColor:(UIColor*)bottomColor cornerRadius:(int)cornerRadius; @end diff --git a/Classes/BuschJaegerUtils.m b/Classes/BuschJaegerUtils.m index 8d80c75b6..f968ea450 100644 --- a/Classes/BuschJaegerUtils.m +++ b/Classes/BuschJaegerUtils.m @@ -25,15 +25,25 @@ @implementation BuschJaegerUtils + (void)createGradientForView:(UIView*)view withTopColor:(UIColor*)topColor bottomColor:(UIColor*)bottomColor { + [BuschJaegerUtils createGradientForView:view withTopColor:topColor bottomColor:bottomColor cornerRadius:0]; +} + ++ (void)createGradientForButton:(UIButton*)button withTopColor:(UIColor*)topColor bottomColor:(UIColor*)bottomColor { + [BuschJaegerUtils createGradientForButton:button withTopColor:topColor bottomColor:bottomColor cornerRadius:0]; +} + ++ (void)createGradientForView:(UIView*)view withTopColor:(UIColor*)topColor bottomColor:(UIColor*)bottomColor cornerRadius:(int)corner{ CAGradientLayer* gradient = [CAGradientLayer layer]; gradient.frame = view.bounds; + gradient.cornerRadius = corner; gradient.colors = [NSArray arrayWithObjects:(id)topColor.CGColor, (id)bottomColor.CGColor, nil]; [view.layer insertSublayer:gradient atIndex:0]; } -+ (void)createGradientForButton:(UIButton*)button withTopColor:(UIColor*)topColor bottomColor:(UIColor*)bottomColor { ++ (void)createGradientForButton:(UIButton*)button withTopColor:(UIColor*)topColor bottomColor:(UIColor*)bottomColor cornerRadius:(int)corner{ CAGradientLayer* gradient = [CAGradientLayer layer]; gradient.frame = button.bounds; + gradient.cornerRadius = corner; gradient.colors = [NSArray arrayWithObjects:(id)topColor.CGColor, (id)bottomColor.CGColor, nil]; [button.layer insertSublayer:gradient below:button.imageView.layer]; } diff --git a/Classes/BuschJaegerWelcomeView.m b/Classes/BuschJaegerWelcomeView.m index 6d2f8aeb6..5bb185cec 100644 --- a/Classes/BuschJaegerWelcomeView.m +++ b/Classes/BuschJaegerWelcomeView.m @@ -85,11 +85,12 @@ #pragma mark - - (IBAction)settingsClick:(id)sender { - [[BuschJaegerMainView instance].navigationController pushViewController:[BuschJaegerMainView instance].settingsView animated:TRUE]; + [[BuschJaegerMainView instance].navigationController pushViewController:[BuschJaegerMainView instance].settingsView animated:FALSE]; } - (IBAction)historyClick:(id)sender { - [[BuschJaegerMainView instance].navigationController pushViewController:[BuschJaegerMainView instance].historyView animated:TRUE]; + [[BuschJaegerMainView instance].historyView reload]; + [[BuschJaegerMainView instance].navigationController pushViewController:[BuschJaegerMainView instance].historyView animated:FALSE]; } @end diff --git a/Classes/LinphoneUI/UIHistoryCell.h b/Classes/LinphoneUI/UIHistoryCell.h index ac940343a..4b41c622a 100644 --- a/Classes/LinphoneUI/UIHistoryCell.h +++ b/Classes/LinphoneUI/UIHistoryCell.h @@ -19,6 +19,7 @@ #import #import "History.h" +#import "UIRemoteImageView.h" @interface UIHistoryCell : UITableViewCell { @private @@ -27,9 +28,9 @@ @property (nonatomic, retain) History *history; -@property (nonatomic, retain) UIImageView *iconImage; -@property (nonatomic, retain) UILabel *stationLabel; -@property (nonatomic, retain) UILabel *dateLabel; +@property (nonatomic, retain) IBOutlet UIRemoteImageView *iconImage; +@property (nonatomic, retain) IBOutlet UILabel *stationLabel; +@property (nonatomic, retain) IBOutlet UILabel *dateLabel; - (id)initWithIdentifier:(NSString*)identifier; diff --git a/Classes/LinphoneUI/UIHistoryCell.m b/Classes/LinphoneUI/UIHistoryCell.m index 9dddfe277..4489fe4c4 100644 --- a/Classes/LinphoneUI/UIHistoryCell.m +++ b/Classes/LinphoneUI/UIHistoryCell.m @@ -27,6 +27,7 @@ @synthesize stationLabel; @synthesize dateLabel; + #pragma mark - Lifecycle Functions - (id)initWithIdentifier:(NSString*)identifier { @@ -74,16 +75,23 @@ #pragma mark - - (void)update { - NSString *station = @"Unknown"; + NSString *stationName = @"Unknown"; NSSet *set = [[[LinphoneManager instance].configuration outdoorStations] filteredSetUsingPredicate:[NSPredicate predicateWithFormat:@"ID == %i", history.stationID]]; if([set count] == 1) { - station = [[set allObjects] objectAtIndex:0]; + OutdoorStation *station = [[set allObjects] objectAtIndex:0]; + stationName = station.name; } // Station - [stationLabel setText:station]; + [stationLabel setText:stationName]; // Date [dateLabel setText:[dateFormatter stringFromDate:history.date]]; + + if([history.images count] > 0) { + NSString *image = [history.images objectAtIndex:0]; + [iconImage setImage:nil]; + [iconImage loadImage:[[LinphoneManager instance].configuration getImageUrl:BuschJaegerConfigurationRequestType_Local image:image]]; + } } @end diff --git a/Classes/LinphoneUI/UIHistoryCell.xib b/Classes/LinphoneUI/UIHistoryCell.xib index 140260f76..da2a4c1eb 100644 --- a/Classes/LinphoneUI/UIHistoryCell.xib +++ b/Classes/LinphoneUI/UIHistoryCell.xib @@ -50,7 +50,7 @@ 292 - {{45, 10}, {174, 21}} + {{45, 10}, {155, 21}} @@ -60,10 +60,10 @@ 7 NO IBCocoaTouchFramework - Label - - 1 - MCAwIDAAA + Station 1 + + 3 + MQA 0 @@ -81,7 +81,7 @@ 292 - {{227, 10}, {93, 21}} + {{208, 10}, {112, 21}} @@ -91,8 +91,8 @@ 7 NO IBCocoaTouchFramework - Label - + 2011 01 01 00:01 + 0 10 @@ -113,14 +113,39 @@ _NS:9 - 1 - MCAxIDAuMTkxOTQ1NDc1NQA + 3 + MCAwAA IBCocoaTouchFramework - + + + + dateLabel + + + + 9 + + + + iconImage + + + + 10 + + + + stationLabel + + + + 11 + + @@ -144,9 +169,9 @@ 2 + - @@ -171,21 +196,61 @@ + UIHistoryCell com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIRemoteImageView com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 8 + 11 + + + + + UIHistoryCell + UITableViewCell + + UILabel + UIImageView + UILabel + + + + dateLabel + UILabel + + + iconImage + UIImageView + + + stationLabel + UILabel + + + + IBProjectSource + ./Classes/UIHistoryCell.h + + + + UIRemoteImageView + UIImageView + + IBProjectSource + ./Classes/UIRemoteImageView.h + + + - 0 IBCocoaTouchFramework diff --git a/Classes/LinphoneUI/UIHistoryDetailsCell.h b/Classes/LinphoneUI/UIHistoryDetailsCell.h new file mode 100644 index 000000000..b57e31f14 --- /dev/null +++ b/Classes/LinphoneUI/UIHistoryDetailsCell.h @@ -0,0 +1,33 @@ +/* UIHistoryCell.h + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import +#import "History.h" +#import "UIRemoteImageView.h" + +@interface UIHistoryDetailsCell : UITableViewCell { +} + +@property (nonatomic, retain) NSString *image; + +@property (nonatomic, retain) IBOutlet UIRemoteImageView *imageView; + +- (id)initWithIdentifier:(NSString*)identifier; + +@end diff --git a/Classes/LinphoneUI/UIHistoryDetailsCell.m b/Classes/LinphoneUI/UIHistoryDetailsCell.m new file mode 100644 index 000000000..cdb9960e6 --- /dev/null +++ b/Classes/LinphoneUI/UIHistoryDetailsCell.m @@ -0,0 +1,71 @@ +/* UIHistoryCell.m + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import "UIHistoryDetailsCell.h" +#import "LinphoneManager.h" + +@implementation UIHistoryDetailsCell + +@synthesize image; +@synthesize imageView; + +#pragma mark - Lifecycle Functions + +- (id)initWithIdentifier:(NSString*)identifier { + if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]) != nil) { + NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"UIHistoryDetailsCell" + owner:self + options:nil]; + + if ([arrayOfViews count] >= 1) { + [self addSubview:[[arrayOfViews objectAtIndex:0] retain]]; + } + } + return self; +} + +- (void)dealloc { + [image release]; + [imageView release]; + [super dealloc]; +} + + +#pragma mark - Property Functions + +- (void)setImage:(NSString *)aimage { + if(aimage == image) { + return; + } + [image release]; + image = [aimage retain]; + [self update]; +} + + +#pragma mark - + +- (void)update { + if(image) { + [imageView setImage:nil]; + [imageView loadImage:[[LinphoneManager instance].configuration getImageUrl:BuschJaegerConfigurationRequestType_Local image:image]]; + } +} + +@end diff --git a/Classes/LinphoneUI/UIHistoryDetailsCell.xib b/Classes/LinphoneUI/UIHistoryDetailsCell.xib new file mode 100644 index 000000000..3f2bc9f69 --- /dev/null +++ b/Classes/LinphoneUI/UIHistoryDetailsCell.xib @@ -0,0 +1,165 @@ + + + + 1296 + 11E53 + 2549 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1498 + + + IBProxyObject + IBUIImageView + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 292 + + + + 274 + {{5, 5}, {310, 100}} + + + + _NS:9 + 1 + NO + IBCocoaTouchFramework + + + {320, 110} + + + + _NS:9 + + 3 + MCAwAA + + IBCocoaTouchFramework + + + + + + + imageView + + + + 12 + + + + + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 2 + + + + + + + + 8 + + + Image + + + + + UIHistoryDetailsCell + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIRemoteImageView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 12 + + + + + UIHistoryDetailsCell + UITableViewCell + + imageView + UIRemoteImageView + + + imageView + + imageView + UIRemoteImageView + + + + IBProjectSource + ./Classes/UIHistoryDetailsCell.h + + + + UIRemoteImageView + UIImageView + + IBProjectSource + ./Classes/UIRemoteImageView.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + 1498 + + diff --git a/Classes/LinphoneUI/UIRemoteImageView.h b/Classes/LinphoneUI/UIRemoteImageView.h new file mode 100644 index 000000000..bfc0e46f6 --- /dev/null +++ b/Classes/LinphoneUI/UIRemoteImageView.h @@ -0,0 +1,29 @@ +/* UIRemoteImageView.h + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + +#import + +@interface UIRemoteImageView : UIImageView + +@property (retain) UIActivityIndicatorView *waitIndicatorView; + + +- (void)loadImage:(NSString*) url; +@end diff --git a/Classes/LinphoneUI/UIRemoteImageView.m b/Classes/LinphoneUI/UIRemoteImageView.m new file mode 100644 index 000000000..e74168140 --- /dev/null +++ b/Classes/LinphoneUI/UIRemoteImageView.m @@ -0,0 +1,110 @@ +/* UIRemoteImageView.m + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import "UIRemoteImageView.h" + +@implementation UIRemoteImageView + +@synthesize waitIndicatorView; + + +#pragma mark - Lifecycle Functions + +- (void)initUIRemoteImageView { + waitIndicatorView = [[UIActivityIndicatorView alloc] initWithFrame:self.frame]; + waitIndicatorView.hidesWhenStopped = TRUE; + waitIndicatorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + [self addSubview:waitIndicatorView]; +} + +- (id)init { + self = [super init]; + if(self != nil) { + [self initUIRemoteImageView]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if(self != nil) { + [self initUIRemoteImageView]; + } + return self; +} + +- (id)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if(self != nil) { + [self initUIRemoteImageView]; + } + return self; +} + +- (id)initWithImage:(UIImage *)image { + self = [super initWithImage:image]; + if(self != nil) { + [self initUIRemoteImageView]; + } + return self; +} + +- (id)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage { + self = [super initWithImage:image highlightedImage:highlightedImage]; + if(self != nil) { + [self initUIRemoteImageView]; + } + return self; +} + +- (void)dealloc { + [waitIndicatorView release]; + + [super dealloc]; +} + + +#pragma mark - + +- (void)loadImage:(NSString*)url { + [waitIndicatorView startAnimating]; + NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:5]; + if(request != nil) { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long)NULL), ^(void) { + NSURLResponse *response = nil; + NSError *error = nil; + NSData *data = nil; + data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; + if(data != nil) { + UIImage *image = [UIImage imageWithData:data]; + dispatch_async(dispatch_get_main_queue(), ^{ + [waitIndicatorView stopAnimating]; + [self setImage:image]; + }); + } else { + dispatch_async(dispatch_get_main_queue(), ^{ + [waitIndicatorView stopAnimating]; + }); + } + }); + + } +} + +@end diff --git a/Classes/Model/History.m b/Classes/Model/History.m index b0ff65dbe..38d7b74af 100644 --- a/Classes/Model/History.m +++ b/Classes/Model/History.m @@ -44,7 +44,7 @@ History *history; NSError *error; NSRegularExpression *regex = [NSRegularExpression - regularExpressionWithPattern:@"([\\d]+) ([\\d]+ [\\d]+) ([\\d]+) (.)" + regularExpressionWithPattern:@"([\\d]+) ([\\d]+ [\\d]+) ([\\d]+) (i|o)" options:NSRegularExpressionCaseInsensitive error:&error]; @@ -54,15 +54,14 @@ history.ID = [[line substringWithRange:[result rangeAtIndex:1]] intValue]; NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; - [dateFormat setDateFormat:@"yyyyMMdd hhmm"]; + [dateFormat setDateFormat:@"yyyyMMdd HHmm"]; NSString *stringDate = [line substringWithRange:[result rangeAtIndex:2]]; history.date = [dateFormat dateFromString:stringDate]; [dateFormat release]; history.stationID = [[line substringWithRange:[result rangeAtIndex:3]] intValue]; - history.incoming = [[line substringWithRange:[result rangeAtIndex:4]] compare:@"i" options:NSCaseInsensitiveSearch] == 0 || - [[line substringWithRange:[result rangeAtIndex:4]] compare:@"1" options:NSCaseInsensitiveSearch] == 0; + history.incoming = [[line substringWithRange:[result rangeAtIndex:4]] compare:@"i" options:NSCaseInsensitiveSearch] == 0; NSRange range = [result rangeAtIndex:0]; range.location += range.length; @@ -70,7 +69,7 @@ NSArray *array = [[line substringWithRange:range] componentsSeparatedByString:@" "]; history.images = [array filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"length > 0"]]; } else { - [LinphoneLogger log:LinphoneLoggerWarning format:@"Invalid history line", line]; + [LinphoneLogger log:LinphoneLoggerWarning format:@"Invalid history line: %@", line]; } return history; diff --git a/buschjaeger-Info.plist b/buschjaeger-Info.plist index 05a3e8766..4e9d3e3bb 100644 --- a/buschjaeger-Info.plist +++ b/buschjaeger-Info.plist @@ -66,7 +66,7 @@ UIRequiresPersistentWiFi - UIStatusBarHidden - + UIStatusBarStyle + UIStatusBarStyleBlackOpaque diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 23faabf9c..669d4f6bf 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -254,6 +254,16 @@ D3F7998215BD32370018C273 /* TPMultiLayoutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F7998015BD32370018C273 /* TPMultiLayoutViewController.m */; }; D3F9A9EE15AF277E0045320F /* UACellBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A9ED15AF277D0045320F /* UACellBackgroundView.m */; }; D3F9A9EF15AF277E0045320F /* UACellBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A9ED15AF277D0045320F /* UACellBackgroundView.m */; }; + D3FE9F3E15E789A30024F3E4 /* UIRemoteImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3FE9F3D15E789A30024F3E4 /* UIRemoteImageView.m */; }; + D3FE9F3F15E789A30024F3E4 /* UIRemoteImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3FE9F3D15E789A30024F3E4 /* UIRemoteImageView.m */; }; + D3FE9F4415E78D720024F3E4 /* BuschJaegerHistoryDetailsView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3FE9F4215E78D700024F3E4 /* BuschJaegerHistoryDetailsView.m */; }; + D3FE9F4515E78D720024F3E4 /* BuschJaegerHistoryDetailsView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3FE9F4215E78D700024F3E4 /* BuschJaegerHistoryDetailsView.m */; }; + D3FE9F4615E78D720024F3E4 /* BuschJaegerHistoryDetailsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3FE9F4315E78D710024F3E4 /* BuschJaegerHistoryDetailsView.xib */; }; + D3FE9F4715E78D720024F3E4 /* BuschJaegerHistoryDetailsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3FE9F4315E78D710024F3E4 /* BuschJaegerHistoryDetailsView.xib */; }; + D3FE9F4B15E790D80024F3E4 /* UIHistoryDetailsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3FE9F4915E790D80024F3E4 /* UIHistoryDetailsCell.m */; }; + D3FE9F4C15E790D80024F3E4 /* UIHistoryDetailsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3FE9F4915E790D80024F3E4 /* UIHistoryDetailsCell.m */; }; + D3FE9F4D15E790D80024F3E4 /* UIHistoryDetailsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3FE9F4A15E790D80024F3E4 /* UIHistoryDetailsCell.xib */; }; + D3FE9F4E15E790D80024F3E4 /* UIHistoryDetailsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3FE9F4A15E790D80024F3E4 /* UIHistoryDetailsCell.xib */; }; F476004B147AAF2800FFF19B /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB911475562600DEE054 /* liblinphone.a */; }; F476004C147AAF4600FFF19B /* libmediastreamer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB8F147555C800DEE054 /* libmediastreamer.a */; }; /* End PBXBuildFile section */ @@ -658,6 +668,14 @@ D3F7998015BD32370018C273 /* TPMultiLayoutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TPMultiLayoutViewController.m; path = Utils/TPMultiLayoutViewController/TPMultiLayoutViewController.m; sourceTree = ""; }; D3F9A9EC15AF277D0045320F /* UACellBackgroundView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UACellBackgroundView.h; path = Utils/UACellBackgroundView/UACellBackgroundView.h; sourceTree = ""; }; D3F9A9ED15AF277D0045320F /* UACellBackgroundView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UACellBackgroundView.m; path = Utils/UACellBackgroundView/UACellBackgroundView.m; sourceTree = ""; }; + D3FE9F3C15E789A30024F3E4 /* UIRemoteImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIRemoteImageView.h; sourceTree = ""; }; + D3FE9F3D15E789A30024F3E4 /* UIRemoteImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIRemoteImageView.m; sourceTree = ""; }; + D3FE9F4115E78D700024F3E4 /* BuschJaegerHistoryDetailsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuschJaegerHistoryDetailsView.h; sourceTree = ""; }; + D3FE9F4215E78D700024F3E4 /* BuschJaegerHistoryDetailsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BuschJaegerHistoryDetailsView.m; sourceTree = ""; }; + D3FE9F4315E78D710024F3E4 /* BuschJaegerHistoryDetailsView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BuschJaegerHistoryDetailsView.xib; sourceTree = ""; }; + D3FE9F4815E790D70024F3E4 /* UIHistoryDetailsCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIHistoryDetailsCell.h; sourceTree = ""; }; + D3FE9F4915E790D80024F3E4 /* UIHistoryDetailsCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIHistoryDetailsCell.m; sourceTree = ""; }; + D3FE9F4A15E790D80024F3E4 /* UIHistoryDetailsCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UIHistoryDetailsCell.xib; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -776,6 +794,9 @@ D37CD30015E21E320028869A /* BuschJaegerCallView.xib */, D37CD30115E21E320028869A /* BuschJaegerConfiguration.h */, D37CD30215E21E320028869A /* BuschJaegerConfiguration.m */, + D3FE9F4115E78D700024F3E4 /* BuschJaegerHistoryDetailsView.h */, + D3FE9F4215E78D700024F3E4 /* BuschJaegerHistoryDetailsView.m */, + D3FE9F4315E78D710024F3E4 /* BuschJaegerHistoryDetailsView.xib */, D384468315E6577600DF89DF /* BuschJaegerHistoryTableViewController.h */, D384468415E6577700DF89DF /* BuschJaegerHistoryTableViewController.m */, D384467515E64D7400DF89DF /* BuschJaegerHistoryView.h */, @@ -1029,6 +1050,9 @@ D384467C15E656D600DF89DF /* UIHistoryCell.h */, D384467D15E656D600DF89DF /* UIHistoryCell.m */, D384468015E656ED00DF89DF /* UIHistoryCell.xib */, + D3FE9F4815E790D70024F3E4 /* UIHistoryDetailsCell.h */, + D3FE9F4915E790D80024F3E4 /* UIHistoryDetailsCell.m */, + D3FE9F4A15E790D80024F3E4 /* UIHistoryDetailsCell.xib */, D37CD31F15E21E520028869A /* UILightButton.h */, D37CD32015E21E520028869A /* UILightButton.m */, D3E84F3C15B018A600420DAC /* UILinphone.h */, @@ -1039,6 +1063,8 @@ 2214EBF212F86360002A5394 /* UIMicroButton.m */, D36FB2D31589EF7C0036F6F2 /* UIPauseButton.h */, D36FB2D41589EF7C0036F6F2 /* UIPauseButton.m */, + D3FE9F3C15E789A30024F3E4 /* UIRemoteImageView.h */, + D3FE9F3D15E789A30024F3E4 /* UIRemoteImageView.m */, 22968A5D12F875C600588287 /* UISpeakerButton.h */, 22968A5E12F875C600588287 /* UISpeakerButton.m */, D37CD39815E244D10028869A /* UIStationCell.h */, @@ -1474,6 +1500,8 @@ D384467315E64CD600DF89DF /* bj_history.png in Resources */, D384467A15E64D7400DF89DF /* BuschJaegerHistoryView.xib in Resources */, D384468115E656ED00DF89DF /* UIHistoryCell.xib in Resources */, + D3FE9F4615E78D720024F3E4 /* BuschJaegerHistoryDetailsView.xib in Resources */, + D3FE9F4D15E790D80024F3E4 /* UIHistoryDetailsCell.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1518,6 +1546,8 @@ D384467415E64CD600DF89DF /* bj_history.png in Resources */, D384467B15E64D7400DF89DF /* BuschJaegerHistoryView.xib in Resources */, D384468215E656ED00DF89DF /* UIHistoryCell.xib in Resources */, + D3FE9F4715E78D720024F3E4 /* BuschJaegerHistoryDetailsView.xib in Resources */, + D3FE9F4E15E790D80024F3E4 /* UIHistoryDetailsCell.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1600,6 +1630,9 @@ D384467E15E656D600DF89DF /* UIHistoryCell.m in Sources */, D384468515E6577700DF89DF /* BuschJaegerHistoryTableViewController.m in Sources */, D384468915E65CFE00DF89DF /* History.m in Sources */, + D3FE9F3E15E789A30024F3E4 /* UIRemoteImageView.m in Sources */, + D3FE9F4415E78D720024F3E4 /* BuschJaegerHistoryDetailsView.m in Sources */, + D3FE9F4B15E790D80024F3E4 /* UIHistoryDetailsCell.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1650,6 +1683,9 @@ D384467F15E656D600DF89DF /* UIHistoryCell.m in Sources */, D384468615E6577700DF89DF /* BuschJaegerHistoryTableViewController.m in Sources */, D384468A15E65CFE00DF89DF /* History.m in Sources */, + D3FE9F3F15E789A30024F3E4 /* UIRemoteImageView.m in Sources */, + D3FE9F4515E78D720024F3E4 /* BuschJaegerHistoryDetailsView.m in Sources */, + D3FE9F4C15E790D80024F3E4 /* UIHistoryDetailsCell.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/linphonerc-factory~ipad b/linphonerc-factory~ipad index 9b73acd34..e7171b115 100644 --- a/linphonerc-factory~ipad +++ b/linphonerc-factory~ipad @@ -13,6 +13,8 @@ default_proxy=-1 register_only_when_network_is_up=1 auto_net_state_mon=0 keepalive_period=30000 +media_encryption=none +incoming_calls_early_media=1 [rtp] audio_jitt_comp=60 @@ -28,11 +30,11 @@ dtmf_player_amp=0.007 [misc] history_max_size=30 -max_calls=3 +max_calls=1 [video] display=1 -capture=1 +capture=0 show_local=0 enabled=1 size=vga