From 1e8f0d9de20b3e961bf5b9280eab674d81ffc28c Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 3 Aug 2015 12:08:31 +0200 Subject: [PATCH] wizard --- Classes/Base.lproj/ChatViewController.xib | 8 +- Classes/Base.lproj/DialerViewController.xib | 24 +-- Classes/Base.lproj/InCallViewController.xib | 2 +- .../Base.lproj/OutgoingCallViewController.xib | 1 + Classes/Base.lproj/WizardViewController.xib | 154 +++++++--------- .../Base.lproj/WizardViewController~ipad.xib | 5 +- Classes/Base.lproj/WizardViews.xib | 153 +++++++--------- Classes/LinphoneUI/Base.lproj/UICallBar.xib | 169 ++++++++---------- .../LinphoneUI/Base.lproj/UIContactCell.xib | 11 +- .../LinphoneUI/Base.lproj/UIHistoryCell.xib | 22 ++- Classes/LinphoneUI/UIHistoryCell.h | 2 +- Classes/LinphoneUI/UIHistoryCell.m | 3 +- Classes/LinphoneUI/UILinphoneButton.h | 30 ---- Classes/LinphoneUI/UILinphoneButton.m | 77 -------- Classes/WizardViewController.h | 3 +- Classes/WizardViewController.m | 8 +- 16 files changed, 249 insertions(+), 423 deletions(-) delete mode 100644 Classes/LinphoneUI/UILinphoneButton.h delete mode 100644 Classes/LinphoneUI/UILinphoneButton.m diff --git a/Classes/Base.lproj/ChatViewController.xib b/Classes/Base.lproj/ChatViewController.xib index d12f1026b..7e96402e3 100644 --- a/Classes/Base.lproj/ChatViewController.xib +++ b/Classes/Base.lproj/ChatViewController.xib @@ -29,7 +29,7 @@ - + - - + + + + + + + + + + + + + + + - - - - + + + - - - - - - - - + + + + diff --git a/Classes/Base.lproj/WizardViewController~ipad.xib b/Classes/Base.lproj/WizardViewController~ipad.xib index eee0b856d..ab6d51252 100644 --- a/Classes/Base.lproj/WizardViewController~ipad.xib +++ b/Classes/Base.lproj/WizardViewController~ipad.xib @@ -1,7 +1,6 @@ - @@ -44,7 +43,7 @@ - + - - - - + @@ -395,11 +363,11 @@ - + - + @@ -426,7 +394,7 @@ - + @@ -436,7 +404,7 @@ - + @@ -448,7 +416,7 @@ - + - - - + + + - - - - - - - - - - - - - - - - @@ -776,9 +747,19 @@ - + + + + + + + + + + + @@ -791,10 +772,12 @@ + + diff --git a/Classes/LinphoneUI/Base.lproj/UIContactCell.xib b/Classes/LinphoneUI/Base.lproj/UIContactCell.xib index b3f458109..28c94bfa2 100644 --- a/Classes/LinphoneUI/Base.lproj/UIContactCell.xib +++ b/Classes/LinphoneUI/Base.lproj/UIContactCell.xib @@ -54,7 +54,7 @@ 274 - {{79, 0}, {281, 44}} + {{46, 0}, {273, 44}} @@ -112,11 +112,10 @@ - 300 - {{46, 11}, {25, 22}} + 297 + {{327, 11}, {25, 22}} - _NS:9 NO IBCocoaTouchFramework @@ -340,8 +339,8 @@ YES 3 - {751, 751} - {77, 66} + {261, 261} + {27, 23} diff --git a/Classes/LinphoneUI/Base.lproj/UIHistoryCell.xib b/Classes/LinphoneUI/Base.lproj/UIHistoryCell.xib index abe44e0a9..2cc0065da 100644 --- a/Classes/LinphoneUI/Base.lproj/UIHistoryCell.xib +++ b/Classes/LinphoneUI/Base.lproj/UIHistoryCell.xib @@ -9,7 +9,7 @@ - + @@ -21,6 +21,10 @@ + + + + - - + - - + + + diff --git a/Classes/LinphoneUI/UIHistoryCell.h b/Classes/LinphoneUI/UIHistoryCell.h index 5c47019f7..61bc21ddf 100644 --- a/Classes/LinphoneUI/UIHistoryCell.h +++ b/Classes/LinphoneUI/UIHistoryCell.h @@ -30,8 +30,8 @@ @property (nonatomic, assign) LinphoneCallLog *callLog; @property(weak, nonatomic) IBOutlet UIRoundedImageView *avatarImage; -@property(nonatomic, strong) IBOutlet UIButton *historyStateButton; @property(nonatomic, strong) IBOutlet UILabel *displayNameLabel; +@property(weak, nonatomic) IBOutlet UIImageView *stateImage; - (id)initWithIdentifier:(NSString*)identifier; diff --git a/Classes/LinphoneUI/UIHistoryCell.m b/Classes/LinphoneUI/UIHistoryCell.m index 181acc2d6..d877e17c5 100644 --- a/Classes/LinphoneUI/UIHistoryCell.m +++ b/Classes/LinphoneUI/UIHistoryCell.m @@ -26,7 +26,6 @@ @synthesize callLog; @synthesize displayNameLabel; -@synthesize historyStateButton; #pragma mark - Lifecycle Functions @@ -116,7 +115,7 @@ image = [UIImage imageNamed:@"call_status_outgoing.png"]; addr = linphone_call_log_get_to_address(callLog); } - [historyStateButton setImage:image forState:UIControlStateNormal]; + _stateImage.image = image; ABRecordRef contact = [FastAddressBook getContactWithLinphoneAddress:addr]; [FastAddressBook setDisplayNameLabel:displayNameLabel forContact:contact]; diff --git a/Classes/LinphoneUI/UILinphoneButton.h b/Classes/LinphoneUI/UILinphoneButton.h deleted file mode 100644 index bebee47dd..000000000 --- a/Classes/LinphoneUI/UILinphoneButton.h +++ /dev/null @@ -1,30 +0,0 @@ -/* UILinphoneButton.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 Library 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 - -@interface UILinphoneButton : UIButton { - -} - -@property (strong, nonatomic) IBOutlet TUNinePatch *backgroundNinePatch; -@property (strong, nonatomic) IBOutlet TUNinePatch *backgroundOverNinePatch; - -@end diff --git a/Classes/LinphoneUI/UILinphoneButton.m b/Classes/LinphoneUI/UILinphoneButton.m deleted file mode 100644 index 4c5f04549..000000000 --- a/Classes/LinphoneUI/UILinphoneButton.m +++ /dev/null @@ -1,77 +0,0 @@ -/* UILinphoneButton.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 Library 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 "UILinphoneButton.h" - -@implementation UILinphoneButton - -@synthesize backgroundNinePatch; -@synthesize backgroundOverNinePatch; - -#pragma mark - Lifecycle Functions - -- (void)initUILinphoneButton { - self.backgroundNinePatch = [TUNinePatch ninePatchNamed:@"button_background_default"]; - self.backgroundOverNinePatch = [TUNinePatch ninePatchNamed:@"button_background_over"]; - [self setBackgroundImage:nil forState:UIControlStateNormal]; - [self setBackgroundImage:nil forState:UIControlStateHighlighted]; - [self setContentMode:UIViewContentModeRedraw]; -} - -- (id)init { - self = [super init]; - if (self != nil) { - [self initUILinphoneButton]; - } - return self; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self != nil) { - [self initUILinphoneButton]; - } - return self; -} - -- (id)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self != nil) { - [self initUILinphoneButton]; - } - return self; -} - -- (void)setHighlighted:(BOOL)highlighted { - [super setHighlighted:highlighted]; - [self setNeedsDisplay]; -} - -- (void)drawRect:(CGRect)rect { - // we ignore the rect and redraw the entire view - CGContextRef context = UIGraphicsGetCurrentContext(); - if (context) { - if (self.highlighted) { - [self.backgroundOverNinePatch inContext:context drawInRect:[self bounds]]; - } else { - [self.backgroundNinePatch inContext:context drawInRect:[self bounds]]; - } - } -} - -@end diff --git a/Classes/WizardViewController.h b/Classes/WizardViewController.h index 87aa1a152..90c80fe89 100644 --- a/Classes/WizardViewController.h +++ b/Classes/WizardViewController.h @@ -74,9 +74,8 @@ - (void)reset; - (void)fillDefaultValues; -- (IBAction)onStartClick:(id)sender; - (IBAction)onBackClick:(id)sender; -- (IBAction)onCancelClick:(id)sender; +- (IBAction)onDialerBackClick:(id)sender; - (IBAction)onCreateAccountClick:(id)sender; - (IBAction)onConnectLinphoneAccountClick:(id)sender; diff --git a/Classes/WizardViewController.m b/Classes/WizardViewController.m index 7921b072e..912ea465a 100644 --- a/Classes/WizardViewController.m +++ b/Classes/WizardViewController.m @@ -183,7 +183,7 @@ static UICompositeViewDescription *compositeDescription = nil; linphone_address_destroy(addr); if (auth) { LOGI(@"A proxy config was set up with the remote provisioning, skip wizard"); - [self onCancelClick:nil]; + [self onDialerBackClick:nil]; } } } @@ -657,10 +657,6 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - Action Functions -- (IBAction)onStartClick:(id)sender { - [self changeView:choiceView back:FALSE animation:TRUE]; -} - - (IBAction)onBackClick:(id)sender { if ([historyViews count] > 0) { UIView *view = [historyViews lastObject]; @@ -669,7 +665,7 @@ static UICompositeViewDescription *compositeDescription = nil; } } -- (IBAction)onCancelClick:(id)sender { +- (IBAction)onDialerBackClick:(id)sender { [[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]]; }