fix IncallView

add advance view controller
This commit is contained in:
Jehan Monnier 2011-02-10 08:51:57 +01:00
parent ead9b92605
commit e005eddd92
5 changed files with 175 additions and 185 deletions

View file

@ -0,0 +1,28 @@
/* AdvancedPhoneViewController.h
*
* Copyright (C) 2009 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 <UIKit/UIKit.h>
#import "PhoneViewController.h"
@interface AdvancedPhoneViewController : PhoneViewController {
IncallViewController* mIncallViewController;
}
@end

View file

@ -0,0 +1,75 @@
/* AdvancedPhoneViewController.m
*
* Copyright (C) 2009 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 "AdvancedPhoneViewController.h"
@implementation AdvancedPhoneViewController
- (void)viewDidLoad {
[super viewDidLoad];
mIncallViewController = [[IncallViewController alloc] initWithNibName:@"IncallViewController"
bundle:[NSBundle mainBundle]];
}
-(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[super displayDialerFromUI:viewCtrl
forUser:username
withDisplayName:displayName];
[mIncallViewController displayDialerFromUI:viewCtrl
forUser:username
withDisplayName:displayName];
}
-(void) displayCallInProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
/*[super displayCallInProgressFromUI:viewCtrl
forUser:username
withDisplayName:displayName];*/
[self presentModalViewController:mIncallViewController animated:true];
[mIncallViewController displayCallInProgressFromUI:viewCtrl
forUser:username
withDisplayName:displayName];
}
-(void) displayIncallFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[super displayIncallFromUI:viewCtrl
forUser:username
withDisplayName:displayName];
[mIncallViewController displayIncallFromUI:viewCtrl
forUser:username
withDisplayName:displayName];
}
-(void) displayStatus:(NSString*) message {
[super displayStatus:message];
[mIncallViewController displayStatus:message];
}
- (void)dealloc {
[mIncallViewController release];
[super dealloc];
}
@end

View file

@ -32,7 +32,7 @@
UILabel* peerNumber;
UIDuration* callDuration;
UILabel* status;
UIHangUpButton* end;
UIHangUpButton* endCtrl;
UIButton* dialer;
UIMuteButton* mute;
UISpeakerButton* speaker;
@ -54,6 +54,7 @@
UIDigitButton* star;
UIDigitButton* zero;
UIDigitButton* hash;
UIHangUpButton* endPad;
UIButton* close;
ABPeoplePickerNavigationController* myPeoplePickerController;
@ -70,7 +71,7 @@
@property (nonatomic, retain) IBOutlet UILabel* peerNumber;
@property (nonatomic, retain) IBOutlet UILabel* callDuration;
@property (nonatomic, retain) IBOutlet UILabel* status;
@property (nonatomic, retain) IBOutlet UIButton* end;
@property (nonatomic, retain) IBOutlet UIButton* endCtrl;
@property (nonatomic, retain) IBOutlet UIButton* dialer;
@property (nonatomic, retain) IBOutlet UIButton* mute;
@property (nonatomic, retain) IBOutlet UIButton* speaker;
@ -90,5 +91,5 @@
@property (nonatomic, retain) IBOutlet UIButton* zero;
@property (nonatomic, retain) IBOutlet UIButton* hash;
@property (nonatomic, retain) IBOutlet UIButton* close;
@property (nonatomic, retain) IBOutlet UIButton* endPad;
@end

View file

@ -32,7 +32,7 @@
@synthesize peerNumber;
@synthesize callDuration;
@synthesize status;
@synthesize end;
@synthesize endCtrl;
@synthesize close;
@synthesize mute;
@synthesize dialer;
@ -51,7 +51,7 @@
@synthesize star;
@synthesize zero;
@synthesize hash;
@synthesize endPad;
/*
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
@ -71,6 +71,7 @@
//Controls
[mute initWithOnImage:[UIImage imageNamed:@"mic_muted.png"] offImage:[UIImage imageNamed:@"mic_active.png"] ];
[speaker initWithOnImage:[UIImage imageNamed:@"Speaker-32-on.png"] offImage:[UIImage imageNamed:@"Speaker-32-off.png"] ];
//Dialer init
[zero initWithNumber:'0'];
@ -101,7 +102,14 @@
[status setText:message];
}
-(void) displayPad:(bool) enable {
[controlSubView setHidden:enable];
[padSubView setHidden:!enable];
}
-(void) displayCallInProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
//restaure view
[self displayPad:false];
if (displayName && [displayName length]>0) {
[peerName setText:displayName];
[peerNumber setText:username];
@ -122,8 +130,7 @@
- (IBAction)doAction:(id)sender {
if (sender == dialer) {
[controlSubView setHidden:true];
[padSubView setHidden:false];
[self displayPad:true];
} else if (sender == contacts) {
// start people picker
@ -132,8 +139,7 @@
[self presentModalViewController: myPeoplePickerController animated:true];
} else if (sender == close) {
[controlSubView setHidden:false];
[padSubView setHidden:true];
[self displayPad:false];
}
}

View file

@ -538,7 +538,7 @@
<reference key="IBUINormalTitleShadowColor" ref="785445938"/>
</object>
</object>
<string key="NSFrame">{{400, 110}, {270, 317}}</string>
<string key="NSFrame">{{25, 110}, {270, 317}}</string>
<reference key="NSSuperview" ref="858247959"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
@ -570,15 +570,6 @@
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="953411930"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">20</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
@ -587,15 +578,6 @@
</object>
<int key="connectionID">23</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="846404401"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">42</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">controlSubView</string>
@ -612,15 +594,6 @@
</object>
<int key="connectionID">45</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="759251781"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">47</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">dialer</string>
@ -629,15 +602,6 @@
</object>
<int key="connectionID">49</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="752456321"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">50</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">close</string>
@ -646,14 +610,6 @@
</object>
<int key="connectionID">51</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">end</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="953411930"/>
</object>
<int key="connectionID">53</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">one</string>
@ -710,60 +666,6 @@
</object>
<int key="connectionID">60</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="1037442441"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">1</int>
</object>
<int key="connectionID">61</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="583355032"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">1</int>
</object>
<int key="connectionID">62</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="540604734"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">1</int>
</object>
<int key="connectionID">63</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="848096264"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">1</int>
</object>
<int key="connectionID">64</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="256512846"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">1</int>
</object>
<int key="connectionID">65</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="323385706"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">1</int>
</object>
<int key="connectionID">66</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">four</string>
@ -772,15 +674,6 @@
</object>
<int key="connectionID">67</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="652269854"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">1</int>
</object>
<int key="connectionID">68</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">five</string>
@ -789,15 +682,6 @@
</object>
<int key="connectionID">69</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="373062361"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">1</int>
</object>
<int key="connectionID">70</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">six</string>
@ -806,15 +690,6 @@
</object>
<int key="connectionID">71</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="673101328"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">1</int>
</object>
<int key="connectionID">72</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">seven</string>
@ -823,15 +698,6 @@
</object>
<int key="connectionID">73</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="313356310"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">1</int>
</object>
<int key="connectionID">74</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">eight</string>
@ -840,24 +706,6 @@
</object>
<int key="connectionID">75</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="175014683"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">1</int>
</object>
<int key="connectionID">76</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="723131369"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">1</int>
</object>
<int key="connectionID">77</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">mute</string>
@ -866,15 +714,6 @@
</object>
<int key="connectionID">80</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="861550739"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">81</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">speaker</string>
@ -883,15 +722,6 @@
</object>
<int key="connectionID">82</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="406189871"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">83</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">contacts</string>
@ -932,6 +762,49 @@
</object>
<int key="connectionID">94</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">endPad</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="846404401"/>
</object>
<int key="connectionID">98</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">endCtrl</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="953411930"/>
</object>
<int key="connectionID">99</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="752456321"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">100</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="759251781"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">101</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doAction:</string>
<reference key="source" ref="478667533"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">103</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@ -1083,7 +956,7 @@
<int key="objectID">31</int>
<reference key="object" ref="256512846"/>
<reference key="parent" ref="759087764"/>
<string key="objectName">start</string>
<string key="objectName">star</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">32</int>
@ -1272,7 +1145,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">94</int>
<int key="maxID">103</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -1301,7 +1174,8 @@
<string>controlSubView</string>
<string>dialer</string>
<string>eight</string>
<string>end</string>
<string>endCtrl</string>
<string>endPad</string>
<string>five</string>
<string>four</string>
<string>hash</string>
@ -1335,6 +1209,7 @@
<string>UIButton</string>
<string>UIButton</string>
<string>UIButton</string>
<string>UIButton</string>
<string>UIView</string>
<string>UILabel</string>
<string>UILabel</string>
@ -1358,7 +1233,8 @@
<string>controlSubView</string>
<string>dialer</string>
<string>eight</string>
<string>end</string>
<string>endCtrl</string>
<string>endPad</string>
<string>five</string>
<string>four</string>
<string>hash</string>
@ -1404,7 +1280,11 @@
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">end</string>
<string key="name">endCtrl</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">endPad</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo">