diff options
author | Mikkel Krautz <mikkel@krautz.dk> | 2011-03-15 20:30:19 +0300 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2011-03-15 20:30:19 +0300 |
commit | b5ddaef385d72467da833df1162d2fee0ffc89a8 (patch) | |
tree | a4ae0a03724d080ea4180677dd5b3a3e4b05b99c | |
parent | 13519185cf1d76c2d31f81142b15fee6cf9cf0f5 (diff) |
Various iPad fixes.
19 files changed, 1151 insertions, 438 deletions
diff --git a/Mumble.xcodeproj/project.pbxproj b/Mumble.xcodeproj/project.pbxproj index 336c6ec..1b8eec3 100755 --- a/Mumble.xcodeproj/project.pbxproj +++ b/Mumble.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ 280D4B3D1255457B00493267 /* talking_whisper@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 280D4B351255457B00493267 /* talking_whisper@2x.png */; }; 280D4B401255463000493267 /* channel.png in Resources */ = {isa = PBXBuildFile; fileRef = 280D4B3E1255463000493267 /* channel.png */; }; 280D4B411255463000493267 /* channel@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 280D4B3F1255463000493267 /* channel@2x.png */; }; + 280EDE8912FE1E7C00774B3B /* ServerRootViewControllerPad.m in Sources */ = {isa = PBXBuildFile; fileRef = 280EDE8812FE1E7C00774B3B /* ServerRootViewControllerPad.m */; }; 281EF08811CD721D001C6B73 /* AdvancedAudioPreferencesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 281EF08711CD721D001C6B73 /* AdvancedAudioPreferencesViewController.m */; }; 2821B821124E9F4E001DF8E4 /* globe.png in Resources */ = {isa = PBXBuildFile; fileRef = 2821B820124E9F4E001DF8E4 /* globe.png */; }; 2821B829124EA09F001DF8E4 /* star.png in Resources */ = {isa = PBXBuildFile; fileRef = 2821B828124EA09F001DF8E4 /* star.png */; }; @@ -54,7 +55,6 @@ 2858DBA31233E31B000D6F75 /* VersionChecker.m in Sources */ = {isa = PBXBuildFile; fileRef = 2858DBA21233E31B000D6F75 /* VersionChecker.m */; }; 285C9E96116BEE1500A9A6A7 /* MainWindow-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 285C9E95116BEE1500A9A6A7 /* MainWindow-iPad.xib */; }; 285C9EF2116BF5B100A9A6A7 /* WelcomeScreenPad.m in Sources */ = {isa = PBXBuildFile; fileRef = 285C9EF0116BF5B100A9A6A7 /* WelcomeScreenPad.m */; }; - 285C9EF3116BF5B100A9A6A7 /* WelcomeScreenPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 285C9EF1116BF5B100A9A6A7 /* WelcomeScreenPad.xib */; }; 2861C274116BE905002B8514 /* AboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2861C25B116BE905002B8514 /* AboutViewController.m */; }; 2861C275116BE905002B8514 /* AboutViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2861C25C116BE905002B8514 /* AboutViewController.xib */; }; 2861C276116BE905002B8514 /* MumbleApplicationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2861C25E116BE905002B8514 /* MumbleApplicationDelegate.m */; }; @@ -111,6 +111,7 @@ 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; }; 288B55E01252903300563A28 /* ServerCertificateTrustViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 288B55DF1252903300563A28 /* ServerCertificateTrustViewController.m */; }; 288D6B60123D08EE00D37EDE /* CertificateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 288D6B5F123D08EE00D37EDE /* CertificateViewController.m */; }; + 288DC2BD12FD9C810044DEF5 /* WelcomeScreenPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 288DC2BC12FD9C810044DEF5 /* WelcomeScreenPad.xib */; }; 28942C0F1245476400C63A07 /* CertificatePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28942C0E1245476400C63A07 /* CertificatePickerViewController.m */; }; 28942D7C12456F9200C63A07 /* CertificateCreationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 28942D7B12456F9200C63A07 /* CertificateCreationView.m */; }; 289CBA18125693040015E58E /* ChannelNavigationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 289CBA17125693040015E58E /* ChannelNavigationViewController.m */; }; @@ -197,7 +198,7 @@ isa = PBXContainerItemProxy; containerPortal = 2861C28E116BE91B002B8514 /* MumbleKit.xcodeproj */; proxyType = 1; - remoteGlobalIDString = 100669490100669490100669 /* MumbleKitCombined */; + remoteGlobalIDString = 100669490100669490100669; remoteInfo = MumbleKitCombined; }; /* End PBXContainerItemProxy section */ @@ -227,6 +228,8 @@ 280D4B351255457B00493267 /* talking_whisper@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "talking_whisper@2x.png"; path = "Resources/icons/ios/talking_whisper@2x.png"; sourceTree = "<group>"; }; 280D4B3E1255463000493267 /* channel.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = channel.png; path = Resources/icons/ios/channel.png; sourceTree = "<group>"; }; 280D4B3F1255463000493267 /* channel@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "channel@2x.png"; path = "Resources/icons/ios/channel@2x.png"; sourceTree = "<group>"; }; + 280EDE8712FE1E7C00774B3B /* ServerRootViewControllerPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServerRootViewControllerPad.h; sourceTree = "<group>"; }; + 280EDE8812FE1E7C00774B3B /* ServerRootViewControllerPad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ServerRootViewControllerPad.m; sourceTree = "<group>"; }; 281EF08611CD721D001C6B73 /* AdvancedAudioPreferencesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdvancedAudioPreferencesViewController.h; sourceTree = "<group>"; }; 281EF08711CD721D001C6B73 /* AdvancedAudioPreferencesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdvancedAudioPreferencesViewController.m; sourceTree = "<group>"; }; 2821B820124E9F4E001DF8E4 /* globe.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = globe.png; path = Resources/icons/ios/globe.png; sourceTree = "<group>"; }; @@ -258,7 +261,6 @@ 285C9E95116BEE1500A9A6A7 /* MainWindow-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MainWindow-iPad.xib"; path = "../../Resources-iPad/Source/MainWindow-iPad.xib"; sourceTree = "<group>"; }; 285C9EEF116BF5B100A9A6A7 /* WelcomeScreenPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WelcomeScreenPad.h; sourceTree = "<group>"; }; 285C9EF0116BF5B100A9A6A7 /* WelcomeScreenPad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WelcomeScreenPad.m; sourceTree = "<group>"; }; - 285C9EF1116BF5B100A9A6A7 /* WelcomeScreenPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WelcomeScreenPad.xib; sourceTree = "<group>"; }; 2861C25A116BE905002B8514 /* AboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AboutViewController.h; sourceTree = "<group>"; }; 2861C25B116BE905002B8514 /* AboutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AboutViewController.m; sourceTree = "<group>"; }; 2861C25C116BE905002B8514 /* AboutViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AboutViewController.xib; sourceTree = "<group>"; }; @@ -331,6 +333,7 @@ 288B55DF1252903300563A28 /* ServerCertificateTrustViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ServerCertificateTrustViewController.m; sourceTree = "<group>"; }; 288D6B5E123D08EE00D37EDE /* CertificateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CertificateViewController.h; sourceTree = "<group>"; }; 288D6B5F123D08EE00D37EDE /* CertificateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CertificateViewController.m; sourceTree = "<group>"; }; + 288DC2BC12FD9C810044DEF5 /* WelcomeScreenPad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WelcomeScreenPad.xib; sourceTree = "<group>"; }; 28942C0D1245476400C63A07 /* CertificatePickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CertificatePickerViewController.h; sourceTree = "<group>"; }; 28942C0E1245476400C63A07 /* CertificatePickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CertificatePickerViewController.m; sourceTree = "<group>"; }; 28942D7A12456F9200C63A07 /* CertificateCreationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CertificateCreationView.h; sourceTree = "<group>"; }; @@ -423,12 +426,14 @@ 2861C272116BE905002B8514 /* WelcomeScreenPhone.xib */, 285C9EEF116BF5B100A9A6A7 /* WelcomeScreenPad.h */, 285C9EF0116BF5B100A9A6A7 /* WelcomeScreenPad.m */, - 285C9EF1116BF5B100A9A6A7 /* WelcomeScreenPad.xib */, + 288DC2BC12FD9C810044DEF5 /* WelcomeScreenPad.xib */, 287A60551176201E00DD4FFB /* ChannelViewController.h */, 287A60561176201E00DD4FFB /* ChannelViewController.m */, 287A60571176201E00DD4FFB /* ChannelViewController.xib */, 287852D9117BC866009E26B1 /* ServerRootViewController.h */, 287852DA117BC866009E26B1 /* ServerRootViewController.m */, + 280EDE8712FE1E7C00774B3B /* ServerRootViewControllerPad.h */, + 280EDE8812FE1E7C00774B3B /* ServerRootViewControllerPad.m */, 28A4CCD1117E064B006EB479 /* LogViewController.h */, 28A4CCD2117E064B006EB479 /* LogViewController.m */, 28A4CCF3117E1D4D006EB479 /* LogEntry.h */, @@ -441,8 +446,6 @@ 287BA3A511B996D90010E031 /* FavouriteServerEditViewController.m */, 289D254A11BC28BC00E39F2C /* LanServerListController.h */, 289D254B11BC28BC00E39F2C /* LanServerListController.m */, - 2830A18A11CE983B00970A41 /* DiagnosticsViewController.h */, - 2830A18B11CE983B00970A41 /* DiagnosticsViewController.m */, 28763AE911D2B920009DB8B6 /* UINavigationController-AnimationAdditions.h */, 28763AE311D2B77E009DB8B6 /* UINavigationController-AnimationAdditions.m */, 2858DBA11233E31B000D6F75 /* VersionChecker.h */, @@ -475,6 +478,8 @@ 281EF08711CD721D001C6B73 /* AdvancedAudioPreferencesViewController.m */, 2838EA0D129316C200035C5D /* CertificatePreferencesViewController.h */, 2838EA0E129316C200035C5D /* CertificatePreferencesViewController.m */, + 2830A18A11CE983B00970A41 /* DiagnosticsViewController.h */, + 2830A18B11CE983B00970A41 /* DiagnosticsViewController.m */, ); name = Preferences; sourceTree = "<group>"; @@ -856,7 +861,6 @@ 2861C508116BEA12002B8514 /* Continents.plist in Resources */, 2861C509116BEA12002B8514 /* Countries.plist in Resources */, 285C9E96116BEE1500A9A6A7 /* MainWindow-iPad.xib in Resources */, - 285C9EF3116BF5B100A9A6A7 /* WelcomeScreenPad.xib in Resources */, 287A60581176201E00DD4FFB /* ChannelViewController.m in Resources */, 287A60591176201E00DD4FFB /* ChannelViewController.xib in Resources */, 287639FF11D2A242009DB8B6 /* CertificateCreationProgressView.xib in Resources */, @@ -913,6 +917,7 @@ 289CBE92125934540015E58E /* deafened_server@2x.png in Resources */, 289CBE99125935990015E58E /* priorityspeaker.png in Resources */, 289CBE9A125935990015E58E /* priorityspeaker@2x.png in Resources */, + 288DC2BD12FD9C810044DEF5 /* WelcomeScreenPad.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -977,6 +982,7 @@ 288B55E01252903300563A28 /* ServerCertificateTrustViewController.m in Sources */, 289CBA18125693040015E58E /* ChannelNavigationViewController.m in Sources */, 2838EA0F129316C200035C5D /* CertificatePreferencesViewController.m in Sources */, + 280EDE8912FE1E7C00774B3B /* ServerRootViewControllerPad.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Resources/CertificateCreationProgressView.xib b/Resources/CertificateCreationProgressView.xib index ae13780..a82c555 100644 --- a/Resources/CertificateCreationProgressView.xib +++ b/Resources/CertificateCreationProgressView.xib @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10"> <data> - <int key="IBDocument.SystemTarget">1024</int> - <string key="IBDocument.SystemVersion">10F569</string> - <string key="IBDocument.InterfaceBuilderVersion">804</string> - <string key="IBDocument.AppKitVersion">1038.29</string> - <string key="IBDocument.HIToolboxVersion">461.00</string> + <int key="IBDocument.SystemTarget">1056</int> + <string key="IBDocument.SystemVersion">10J567</string> + <string key="IBDocument.InterfaceBuilderVersion">851</string> + <string key="IBDocument.AppKitVersion">1038.35</string> + <string key="IBDocument.HIToolboxVersion">462.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> - <string key="NS.object.0">123</string> + <string key="NS.object.0">141</string> </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -582,6 +582,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string key="className">UIView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">UIView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">UIKit.framework/Headers/UITextField.h</string> </object> </object> @@ -635,7 +642,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string> - <integer value="1024" key="NS.object.0"/> + <integer value="1056" key="NS.object.0"/> </object> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string> @@ -648,6 +655,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string key="NS.key.0">certificate256.png</string> <string key="NS.object.0">{256, 256}</string> </object> - <string key="IBCocoaTouchPluginVersion">123</string> + <string key="IBCocoaTouchPluginVersion">141</string> </data> </archive> diff --git a/Source/Classes/AdvancedAudioPreferencesViewController.m b/Source/Classes/AdvancedAudioPreferencesViewController.m index 0cc7a8b..f01f54a 100644 --- a/Source/Classes/AdvancedAudioPreferencesViewController.m +++ b/Source/Classes/AdvancedAudioPreferencesViewController.m @@ -40,10 +40,9 @@ #pragma mark Initialization - (id) init { - self = [super initWithStyle:UITableViewStyleGrouped]; - if (self == nil) - return nil; - + if (self = [super initWithStyle:UITableViewStyleGrouped]) { + [self setContentSizeForViewInPopover:CGSizeMake(320, 480)]; + } return self; } diff --git a/Source/Classes/CertificateCreationProgressView.m b/Source/Classes/CertificateCreationProgressView.m index 4955e45..1eedb11 100644 --- a/Source/Classes/CertificateCreationProgressView.m +++ b/Source/Classes/CertificateCreationProgressView.m @@ -37,6 +37,10 @@ _identityName = [name retain]; _emailAddress = [email retain]; NSLog(@"name = %@, email = %@", _identityName, _emailAddress); + + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { + [self.view setBackgroundColor:[UIColor groupTableViewBackgroundColor]]; + } } return self; } diff --git a/Source/Classes/CertificateCreationView.m b/Source/Classes/CertificateCreationView.m index 42f17b5..4759676 100644 --- a/Source/Classes/CertificateCreationView.m +++ b/Source/Classes/CertificateCreationView.m @@ -48,7 +48,10 @@ static void ShowAlertDialog(NSString *title, NSString *msg) { #pragma mark Initialization - (id) init { - return [super initWithStyle:UITableViewStyleGrouped]; + if (self = [super initWithStyle:UITableViewStyleGrouped]) { + [self setContentSizeForViewInPopover:CGSizeMake(320, 480)]; + } + return self; } - (void) dealloc { diff --git a/Source/Classes/CertificatePreferencesViewController.m b/Source/Classes/CertificatePreferencesViewController.m index b35f28c..71f830b 100644 --- a/Source/Classes/CertificatePreferencesViewController.m +++ b/Source/Classes/CertificatePreferencesViewController.m @@ -50,12 +50,13 @@ - (id) init { if (self = [super init]) { _picker = NO; + [self setContentSizeForViewInPopover:CGSizeMake(320, 480)]; } return self; } - (id) initAsPicker { - if (self = [super init]) { + if (self = [self init]) { _picker = YES; } return self; @@ -196,10 +197,11 @@ - (void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)idx { if (idx == 0) { // Generate New Certificate UINavigationController *navCtrl = [[UINavigationController alloc] init]; + navCtrl.modalPresentationStyle = UIModalPresentationCurrentContext; CertificateCreationView *certGen = [[CertificateCreationView alloc] init]; [navCtrl pushViewController:certGen animated:NO]; [certGen release]; - [self presentModalViewController:navCtrl animated:YES]; + [[self navigationController] presentModalViewController:navCtrl animated:YES]; [navCtrl release]; } else if (idx == 1) { // Import From Disk NSLog(@"DiskImport"); diff --git a/Source/Classes/CertificateViewController.m b/Source/Classes/CertificateViewController.m index cb4f1db..42a9d1a 100644 --- a/Source/Classes/CertificateViewController.m +++ b/Source/Classes/CertificateViewController.m @@ -45,6 +45,7 @@ static const NSUInteger CertificateViewSectionTotal = 2; if (self = [super initWithStyle:UITableViewStyleGrouped]) { _certificates = [[NSArray alloc] initWithObjects:cert, nil]; _curIdx = 0; + [self setContentSizeForViewInPopover:CGSizeMake(320, 480)]; } return self; } @@ -53,6 +54,7 @@ static const NSUInteger CertificateViewSectionTotal = 2; if (self = [super initWithStyle:UITableViewStyleGrouped]) { _certificates = [[NSArray alloc] initWithArray:cert]; _curIdx = 0; + [self setContentSizeForViewInPopover:CGSizeMake(320, 480)]; } return self; } diff --git a/Source/Classes/DiagnosticsViewController.m b/Source/Classes/DiagnosticsViewController.m index 94a6581..6a2161e 100644 --- a/Source/Classes/DiagnosticsViewController.m +++ b/Source/Classes/DiagnosticsViewController.m @@ -121,6 +121,8 @@ _updateTimer = [NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(updateDiagnostics:) userInfo:nil repeats:YES]; [self updateDiagnostics:nil]; + [self setContentSizeForViewInPopover:CGSizeMake(320, 480)]; + return self; } diff --git a/Source/Classes/FavouriteServerEditViewController.m b/Source/Classes/FavouriteServerEditViewController.m index 724ba0a..61272ac 100644 --- a/Source/Classes/FavouriteServerEditViewController.m +++ b/Source/Classes/FavouriteServerEditViewController.m @@ -77,6 +77,15 @@ static NSString *FavouriteServerPlaceholderPassword = @"Optional"; [super dealloc]; } +- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { + // On iPad, we support all interface orientations. + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { + return YES; + } + + return toInterfaceOrientation == UIInterfaceOrientationPortrait; +} + #pragma mark - #pragma mark View lifecycle diff --git a/Source/Classes/FavouriteServerListController.m b/Source/Classes/FavouriteServerListController.m index 533044b..052e8fd 100644 --- a/Source/Classes/FavouriteServerListController.m +++ b/Source/Classes/FavouriteServerListController.m @@ -36,6 +36,7 @@ #import "ServerConnectionViewController.h" #import "ServerRootViewController.h" +#import "ServerRootViewControllerPad.h" @implementation FavouriteServerListController @@ -43,18 +44,16 @@ #pragma mark Initialization - (id) init { - self = [super init]; - if (self == nil) - return nil; + if (self = [super init]) { + [[self navigationItem] setTitle:@"Favourites"]; - [[self navigationItem] setTitle:@"Favourites"]; + UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addButtonClicked:)]; + [[self navigationItem] setRightBarButtonItem:addButton]; + [addButton release]; - UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addButtonClicked:)]; - [[self navigationItem] setRightBarButtonItem:addButton]; - [addButton release]; - - _favouriteServers = [[Database fetchAllFavourites] retain]; - [_favouriteServers sortUsingSelector:@selector(compare:)]; + _favouriteServers = [[Database fetchAllFavourites] retain]; + [_favouriteServers sortUsingSelector:@selector(compare:)]; + } return self; } @@ -66,14 +65,23 @@ [super dealloc]; } +- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { + // On iPad, we support all interface orientations. + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { + return YES; + } + + return toInterfaceOrientation == UIInterfaceOrientationPortrait; +} + #pragma mark - #pragma mark Table view data source -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { +- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { return 1; } -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { +- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [_favouriteServers count]; } @@ -95,11 +103,11 @@ return cell; } -- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { +- (BOOL) tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { return YES; } -- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { +- (void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { NSUInteger row = [indexPath row]; @@ -118,11 +126,21 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { FavouriteServer *favServ = [_favouriteServers objectAtIndex:[indexPath row]]; - UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:[favServ displayName] delegate:self + BOOL pad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; + UIView *cellView = [[self tableView] cellForRowAtIndexPath:indexPath]; + + NSString *sheetTitle = pad ? nil : [favServ displayName]; + UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:sheetTitle delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Connect", @"Edit", nil]; - [sheet showInView:[self tableView]]; + if (pad) { + CGRect frame = cellView.frame; + frame.origin.y = frame.origin.y - (frame.size.height/2); + [sheet showFromRect:frame inView:self.tableView animated:YES]; + } else { + [sheet showInView:cellView]; + } [sheet release]; } @@ -134,23 +152,28 @@ // Connect if (index == 0) { - UINavigationController *navCtrl = [[UINavigationController alloc] init]; - - ServerRootViewController *serverRoot = [[ServerRootViewController alloc] initWithHostname:[favServ hostName] - port:[favServ port] - username:[favServ userName] - password:[favServ password]]; - [serverRoot setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal]; - [navCtrl setViewControllers:[NSArray arrayWithObjects:serverRoot, nil]]; - - BOOL animated = YES; -#ifdef USE_CONNECTION_ANIMATION - animated = NO; -#endif - [[self navigationController] presentModalViewController:navCtrl animated:animated]; - - [serverRoot release]; - [navCtrl release]; + if ([[UIDevice currentDevice] userInterfaceIdiom] != UIUserInterfaceIdiomPad) { + UINavigationController *navCtrl = [[UINavigationController alloc] init]; + ServerRootViewController *serverRoot = [[ServerRootViewController alloc] initWithHostname:[favServ hostName] + port:[favServ port] + username:[favServ userName] + password:[favServ password]]; + [serverRoot setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal]; + [navCtrl setViewControllers:[NSArray arrayWithObjects:serverRoot, nil]]; + [[self navigationController] presentModalViewController:navCtrl animated:YES]; + [serverRoot release]; + [navCtrl release]; + } else { + ServerRootViewControllerPad *serverRoot = [[ServerRootViewControllerPad alloc] initWithHostname:[favServ hostName] + port:[favServ port] + username:[favServ userName] + password:[favServ password]]; + UINavigationController *nav = [[UINavigationController alloc] init]; + [nav pushViewController:serverRoot animated:NO]; + [self.navigationController presentModalViewController:nav animated:YES]; + [serverRoot release]; + [nav release]; + } // Edit } else if (index == 1) { @@ -174,6 +197,7 @@ [modalNav pushViewController:editView animated:NO]; [editView release]; + modalNav.modalPresentationStyle = UIModalPresentationFormSheet; [[self navigationController] presentModalViewController:modalNav animated:YES]; [modalNav release]; } @@ -191,6 +215,7 @@ [modalNav pushViewController:editView animated:NO]; [editView release]; + modalNav.modalPresentationStyle = UIModalPresentationFormSheet; [[self navigationController] presentModalViewController:modalNav animated:YES]; [modalNav release]; } diff --git a/Source/Classes/MumbleApplicationDelegate.m b/Source/Classes/MumbleApplicationDelegate.m index a4e4da0..699d1a1 100644 --- a/Source/Classes/MumbleApplicationDelegate.m +++ b/Source/Classes/MumbleApplicationDelegate.m @@ -66,9 +66,16 @@ [imageView setImage:[UIImage imageNamed:@"Splash.png"]]; [window addSubview:imageView]; - WelcomeScreenPhone *welcomeScreen = [[WelcomeScreenPhone alloc] init]; - [navigationController pushViewController:welcomeScreen animated:YES]; - [welcomeScreen release]; + UIUserInterfaceIdiom idiom = [[UIDevice currentDevice] userInterfaceIdiom]; + if (idiom == UIUserInterfaceIdiomPad) { + WelcomeScreenPad *welcomeScreen = [[WelcomeScreenPad alloc] init]; + [navigationController pushViewController:welcomeScreen animated:YES]; + [welcomeScreen release]; + } else { + WelcomeScreenPhone *welcomeScreen = [[WelcomeScreenPhone alloc] init]; + [navigationController pushViewController:welcomeScreen animated:YES]; + [welcomeScreen release]; + } [UIView animateWithDuration:0.8f animations:^{ imageView.alpha = 0.0f; diff --git a/Source/Classes/PreferencesViewController.m b/Source/Classes/PreferencesViewController.m index 33defa8..1f9bfb9 100644 --- a/Source/Classes/PreferencesViewController.m +++ b/Source/Classes/PreferencesViewController.m @@ -49,10 +49,9 @@ #pragma mark Initialization - (id) init { - self = [super initWithStyle:UITableViewStyleGrouped]; - if (self == nil) - return nil; - + if (self = [super initWithStyle:UITableViewStyleGrouped]) { + [self setContentSizeForViewInPopover:CGSizeMake(320, 480)]; + } return self; } diff --git a/Source/Classes/ServerRootViewControllerPad.h b/Source/Classes/ServerRootViewControllerPad.h new file mode 100644 index 0000000..da23dab --- /dev/null +++ b/Source/Classes/ServerRootViewControllerPad.h @@ -0,0 +1,54 @@ +/* Copyright (C) 2009-2011 Mikkel Krautz <mikkel@krautz.dk> + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + - Neither the name of the Mumble Developers nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#import <MumbleKit/MKUser.h> +#import <MumbleKit/MKChannel.h> +#import <MumbleKit/MKConnection.h> +#import <MumbleKit/MKServerModel.h> + +#import <UIKit/UIKit.h> + +@class ServerConnectionViewController; + +@interface ServerRootViewControllerPad : UITableViewController <MKConnectionDelegate> { + MKConnection *_connection; + MKServerModel *_model; + NSMutableArray *_channelUsers; + MKChannel *_currentChannel; + NSString *_username; + NSString *_password; + BOOL _pttState; + ServerConnectionViewController *_progressController; +} + +- (id) initWithHostname:(NSString *)host port:(NSUInteger)port username:(NSString *)username password:(NSString *)password; +- (void) dealloc; + +@end diff --git a/Source/Classes/ServerRootViewControllerPad.m b/Source/Classes/ServerRootViewControllerPad.m new file mode 100644 index 0000000..36d6796 --- /dev/null +++ b/Source/Classes/ServerRootViewControllerPad.m @@ -0,0 +1,597 @@ +/* Copyright (C) 2009-2011 Mikkel Krautz <mikkel@krautz.dk> + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + - Neither the name of the Mumble Developers nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#import <MumbleKit/MKAudio.h> +#import <MumbleKit/MKCertificate.h> +#import <MumbleKit/MKConnection.h> + +#import "MumbleApplication.h" +#import "MumbleApplicationDelegate.h" +#import "Database.h" + +#import "ServerRootViewControllerPad.h" +#import "ServerConnectionViewController.h" +#import "ChannelViewController.h" +#import "LogViewController.h" +#import "CertificateViewController.h" +#import "ServerCertificateTrustViewController.h" +#import "ChannelNavigationViewController.h" + +@interface ServerRootViewControllerPad (Private) +- (void) togglePushToTalk; +- (UIView *) stateAccessoryViewForUser:(MKUser *)user; +@end + +@implementation ServerRootViewControllerPad + +- (id) initWithHostname:(NSString *)host port:(NSUInteger)port username:(NSString *)username password:(NSString *)password { + NSData *certPersistentId = [[NSUserDefaults standardUserDefaults] objectForKey:@"DefaultCertificate"]; + if (certPersistentId == nil) { + NSLog(@"ServerRootViewController: Cannot instantiate without a default certificate."); + return nil; + } + + if (self = [super init]) { + _username = [username copy]; + _password = [password copy]; + + _connection = [[MKConnection alloc] init]; + [_connection setDelegate:self]; + + _model = [[MKServerModel alloc] initWithConnection:_connection]; + [_model addDelegate:self]; + + // Try to fetch our given identity's SecIdentityRef by its persistent reference. + // If we're able to fetch it, set it as the connection's client certificate. + SecIdentityRef secIdentity = NULL; + NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys: + certPersistentId, kSecValuePersistentRef, + kCFBooleanTrue, kSecReturnRef, + kSecMatchLimitOne, kSecMatchLimit, + nil]; + if (SecItemCopyMatching((CFDictionaryRef)query, (CFTypeRef *)&secIdentity) == noErr && secIdentity != NULL) { + [_connection setClientIdentity:secIdentity]; + CFRelease(secIdentity); + } + + [_connection connectToHost:host port:port]; + } + return self; +} + +- (void) dealloc { + [_username release]; + [_password release]; + [_model release]; + [_connection release]; + + [super dealloc]; +} + +- (void) didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + +- (void) viewWillAppear:(BOOL)animated { + // Title + if (_currentChannel == nil) + [[self navigationItem] setTitle:@"Connecting..."]; + else + [[self navigationItem] setTitle:[_currentChannel channelName]]; + + // Top bar + UIBarButtonItem *disconnectButton = [[UIBarButtonItem alloc] initWithTitle:@"Disconnect" style:UIBarButtonItemStyleBordered target:self action:@selector(disconnectClicked:)]; + [[self navigationItem] setLeftBarButtonItem:disconnectButton]; + [disconnectButton release]; + + UIBarButtonItem *infoItem = [[UIBarButtonItem alloc] initWithTitle:@"Certs" style:UIBarButtonItemStyleBordered target:self action:@selector(infoClicked:)]; + [[self navigationItem] setRightBarButtonItem:infoItem]; + [infoItem release]; + + // Toolbar + UIBarButtonItem *channelsButton = [[UIBarButtonItem alloc] initWithTitle:@"Channels" style:UIBarButtonItemStyleBordered target:self action:@selector(channelsButtonClicked:)]; + UIBarButtonItem *pttButton = [[UIBarButtonItem alloc] initWithTitle:@"PushToTalk" style:UIBarButtonItemStyleBordered target:self action:@selector(pushToTalkClicked:)]; + UIBarButtonItem *usersButton = [[UIBarButtonItem alloc] initWithTitle:@"Users" style:UIBarButtonItemStyleBordered target:self action:@selector(usersButtonClicked:)]; + UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; + [self setToolbarItems:[NSArray arrayWithObjects:channelsButton, flexSpace, pttButton, flexSpace, usersButton, nil]]; + [channelsButton release]; + [pttButton release]; + [usersButton release]; + [flexSpace release]; + + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + [[self navigationController] setToolbarHidden:NO]; +} + +- (void) viewDidAppear:(BOOL)animated { +} + +- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { + return YES; +} + +#pragma mark MKConnection Delegate + +// The connection encountered an invalid SSL certificate chain. +- (void) connection:(MKConnection *)conn trustFailureInCertificateChain:(NSArray *)chain { + // Check the database whether the user trusts the leaf certificate of this server. + NSString *storedDigest = [Database digestForServerWithHostname:[conn hostname] port:[conn port]]; + NSString *serverDigest = [[[conn peerCertificates] objectAtIndex:0] hexDigest]; + if (storedDigest) { + // Match? + if ([storedDigest isEqualToString:serverDigest]) { + [conn setIgnoreSSLVerification:YES]; + [conn reconnect]; + return; + + // Mismatch. The server is using a new certificate, different from the one it previously + // presented to us. + } else { + NSString *title = @"Certificate Mismatch"; + NSString *msg = @"The server presented a different certificate than the one stored for this server"; + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:msg delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; + [alert addButtonWithTitle:@"Ignore"]; + [alert addButtonWithTitle:@"Trust New Certificate"]; + [alert addButtonWithTitle:@"Show Certificates"]; + [alert show]; + [alert release]; + } + + // No certhash of this certificate in the database for this hostname-port combo. Let the user decide + // what to do. + } else { + NSString *title = @"Unable to validate server certificate"; + NSString *msg = @"Mumble was unable to validate the certificate chain of the server."; + + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:msg delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; + [alert addButtonWithTitle:@"Ignore"]; + [alert addButtonWithTitle:@"Trust Certificate"]; + [alert addButtonWithTitle:@"Show Certificates"]; + [alert show]; + [alert release]; + } +} + +// The server rejected our connection. +- (void) connection:(MKConnection *)conn rejectedWithReason:(MKRejectReason)reason explanation:(NSString *)explanation { + NSString *title = @"Connection Rejected"; + NSString *msg = nil; + + switch (reason) { + case MKRejectReasonNone: + msg = @"No reason"; + break; + case MKRejectReasonWrongVersion: + msg = @"Version mismatch between client and server."; + break; + case MKRejectReasonInvalidUsername: + msg = @"Invalid username"; + break; + case MKRejectReasonWrongUserPassword: + msg = @"Wrong user password"; + break; + case MKRejectReasonWrongServerPassword: + msg = @"Wrong server password"; + break; + case MKRejectReasonUsernameInUse: + msg = @"Username already in use"; + break; + case MKRejectReasonServerIsFull: + msg = @"Server is full"; + break; + case MKRejectReasonNoCertificate: + msg = @"A certificate is needed to connect to this server"; + break; + } + + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + [alert show]; + [alert release]; + + [[self navigationController] dismissModalViewControllerAnimated:YES]; +} + +// Connection established... +- (void) connectionOpened:(MKConnection *)conn { + [conn authenticateWithUsername:_username password:_password]; +} + +// Connection closed... +- (void) connectionClosed:(MKConnection *)conn { + NSLog(@"ServerRootViewController: Connection closed"); +} + +#pragma mark MKServerModel Delegate + +// We've successfuly joined the server. +- (void) serverModel:(MKServerModel *)server joinedServerAsUser:(MKUser *)user { + _currentChannel = [[_model connectedUser] channel]; + _channelUsers = [[[[_model connectedUser] channel] users] mutableCopy]; + +#ifdef USE_CONNECTION_ANIMATION + [MumbleApp setStatusBarStyle:UIStatusBarStyleDefault animated:YES]; + + [UIView animateWithDuration:0.4f animations:^{ + _progressController.view.alpha = 0.0f; + } completion:^(BOOL finished){ + [_progressController.view removeFromSuperview]; + [_progressController release]; + _progressController = nil; + }]; +#endif + + [[self navigationItem] setTitle:[_currentChannel channelName]]; + [[self tableView] reloadData]; + + + ChannelNavigationViewController *chanNav = [[ChannelNavigationViewController alloc] initWithServerModel:_model]; + chanNav.view.frame = CGRectMake(200, 200, 300, 400); + [self.view addSubview:chanNav.view]; +} + +// A user joined the server. +- (void) serverModel:(MKServerModel *)server userJoined:(MKUser *)user { + NSLog(@"ServerViewController: userJoined."); +} + +// A user left the server. +- (void) serverModel:(MKServerModel *)server userLeft:(MKUser *)user { + if (_currentChannel == nil) + return; + + NSUInteger userIndex = [_channelUsers indexOfObject:user]; + if (userIndex != NSNotFound) { + [_channelUsers removeObjectAtIndex:userIndex]; + [[self tableView] deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:userIndex inSection:0]] + withRowAnimation:UITableViewRowAnimationRight]; + } +} + +// A user moved channel +- (void) serverModel:(MKServerModel *)server userMoved:(MKUser *)user toChannel:(MKChannel *)chan byUser:(MKUser *)mover { + if (_currentChannel == nil) + return; + + // Was this ourselves, or someone else? + if (user != [server connectedUser]) { + // Did the user join this channel? + if (chan == _currentChannel) { + [_channelUsers addObject:user]; + NSUInteger userIndex = [_channelUsers indexOfObject:user]; + [[self tableView] insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:userIndex inSection:0]] + withRowAnimation:UITableViewRowAnimationLeft]; + // Or did he leave it? + } else { + NSUInteger userIndex = [_channelUsers indexOfObject:user]; + if (userIndex != NSNotFound) { + [_channelUsers removeObjectAtIndex:userIndex]; + [[self tableView] deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:userIndex inSection:0]] + withRowAnimation:UITableViewRowAnimationRight]; + } + } + + // We were moved. We need to redo the array holding the users of the + // current channel. + } else { + NSUInteger numUsers = [_channelUsers count]; + [_channelUsers release]; + _channelUsers = nil; + + NSMutableArray *array = [[NSMutableArray alloc] init]; + for (NSUInteger i = 0; i < numUsers; i++) { + [array addObject:[NSIndexPath indexPathForRow:i inSection:0]]; + } + [[self tableView] deleteRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationRight]; + + _currentChannel = chan; + _channelUsers = [[chan users] mutableCopy]; + + [array removeAllObjects]; + numUsers = [_channelUsers count]; + for (NSUInteger i = 0; i < numUsers; i++) { + [array addObject:[NSIndexPath indexPathForRow:i inSection:0]]; + } + [[self tableView] insertRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationLeft]; + [array release]; + + // Update the title to match our new channel. + [[self navigationItem] setTitle:[_currentChannel channelName]]; + } +} + +// A channel was added. +- (void) serverModel:(MKServerModel *)server channelAdded:(MKChannel *)channel { + NSLog(@"ServerViewController: channelAdded."); +} + +// A channel was removed. +- (void) serverModel:(MKServerModel *)server channelRemoved:(MKChannel *)channel { + NSLog(@"ServerViewController: channelRemoved."); +} + +- (void) serverModel:(MKServerModel *)model userSelfMuted:(MKUser *)user { +} + +- (void) serverModel:(MKServerModel *)model userRemovedSelfMute:(MKUser *)user { +} + +- (void) serverModel:(MKServerModel *)model userSelfMutedAndDeafened:(MKUser *)user { +} + +- (void) serverModel:(MKServerModel *)model userRemovedSelfMuteAndDeafen:(MKUser *)user { +} + +- (void) serverModel:(MKServerModel *)model userSelfMuteDeafenStateChanged:(MKUser *)user { + NSUInteger userIndex = [_channelUsers indexOfObject:user]; + if (userIndex != NSNotFound) { + [[self tableView] reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:userIndex inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; + } +} + +// -- + +- (void) serverModel:(MKServerModel *)model userMutedAndDeafened:(MKUser *)user byUser:(MKUser *)actor { + NSLog(@"%@ muted and deafened by %@", user, actor); +} + +- (void) serverModel:(MKServerModel *)model userUnmutedAndUndeafened:(MKUser *)user byUser:(MKUser *)actor { + NSLog(@"%@ unmuted and undeafened by %@", user, actor); +} + +- (void) serverModel:(MKServerModel *)model userMuted:(MKUser *)user byUser:(MKUser *)actor { + NSLog(@"%@ muted by %@", user, actor); +} + +- (void) serverModel:(MKServerModel *)model userUnmuted:(MKUser *)user byUser:(MKUser *)actor { + NSLog(@"%@ unmuted by %@", user, actor); +} + +- (void) serverModel:(MKServerModel *)model userDeafened:(MKUser *)user byUser:(MKUser *)actor { + NSLog(@"%@ deafened by %@", user, actor); +} + +- (void) serverModel:(MKServerModel *)model userUndeafened:(MKUser *)user byUser:(MKUser *)actor { + NSLog(@"%@ undeafened by %@", user, actor); +} + +- (void) serverModel:(MKServerModel *)model userSuppressed:(MKUser *)user byUser:(MKUser *)actor { + NSLog(@"%@ suppressed by %@", user, actor); +} + +- (void) serverModel:(MKServerModel *)model userUnsuppressed:(MKUser *)user byUser:(MKUser *)actor { + NSLog(@"%@ unsuppressed by %@", user, actor); +} + +- (void) serverModel:(MKServerModel *)model userMuteStateChanged:(MKUser *)user { + NSInteger userIndex = [_channelUsers indexOfObject:user]; + if (userIndex != NSNotFound) { + [[self tableView] reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:userIndex inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; + } +} + +// -- + +- (void) serverModel:(MKServerModel *)model userPrioritySpeakerChanged:(MKUser *)user { + NSInteger userIndex = [_channelUsers indexOfObject:user]; + if (userIndex != NSNotFound) { + [[self tableView] reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:userIndex inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; + } +} + +- (void) serverModel:(MKServerModel *)server userTalkStateChanged:(MKUser *)user { + NSUInteger userIndex = [_channelUsers indexOfObject:user]; + if (userIndex == NSNotFound) + return; + + UITableViewCell *cell = [[self tableView] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:userIndex inSection:0]]; + MKTalkState talkState = [user talkState]; + NSString *talkImageName = nil; + if (talkState == MKTalkStatePassive) + talkImageName = @"talking_off"; + else if (talkState == MKTalkStateTalking) + talkImageName = @"talking_on"; + else if (talkState == MKTalkStateWhispering) + talkImageName = @"talking_whisper"; + else if (talkState == MKTalkStateShouting) + talkImageName = @"talking_alt"; + + [[cell imageView] setImage:[UIImage imageNamed:talkImageName]]; +} + +#pragma mark - +#pragma mark Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return [_channelUsers count]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + static NSString *CellIdentifier = @"Cell"; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; + } + + NSUInteger row = [indexPath row]; + MKUser *user = [_channelUsers objectAtIndex:row]; + + cell.textLabel.text = [user userName]; + if ([_model connectedUser] == user) { + cell.textLabel.font = [UIFont boldSystemFontOfSize:14.0f]; + } else { + cell.textLabel.font = [UIFont systemFontOfSize:14.0f]; + } + + MKTalkState talkState = [user talkState]; + NSString *talkImageName = nil; + if (talkState == MKTalkStatePassive) + talkImageName = @"talking_off"; + else if (talkState == MKTalkStateTalking) + talkImageName = @"talking_on"; + else if (talkState == MKTalkStateWhispering) + talkImageName = @"talking_whisper"; + else if (talkState == MKTalkStateShouting) + talkImageName = @"talking_alt"; + cell.imageView.image = [UIImage imageNamed:talkImageName]; + + cell.accessoryView = [self stateAccessoryViewForUser:user]; + + return cell; +} + +- (UIView *) stateAccessoryViewForUser:(MKUser *)user { + const CGFloat iconHeight = 28.0f; + const CGFloat iconWidth = 22.0f; + + NSMutableArray *states = [[NSMutableArray alloc] init]; + if ([user isAuthenticated]) + [states addObject:@"authenticated"]; + if ([user isSelfDeafened]) + [states addObject:@"deafened_self"]; + if ([user isSelfMuted]) + [states addObject:@"muted_self"]; + if ([user isMuted]) + [states addObject:@"muted_server"]; + if ([user isDeafened]) + [states addObject:@"deafened_server"]; + if ([user isLocalMuted]) + [states addObject:@"muted_local"]; + if ([user isSuppressed]) + [states addObject:@"muted_suppressed"]; + if ([user isPrioritySpeaker]) + [states addObject:@"priorityspeaker"]; + + CGFloat widthOffset = [states count] * iconWidth; + UIView *stateView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, widthOffset, iconHeight)]; + for (NSString *imageName in states) { + UIImage *img = [UIImage imageNamed:imageName]; + UIImageView *imgView = [[UIImageView alloc] initWithImage:img]; + CGFloat ypos = (iconHeight - img.size.height)/2.0f; + CGFloat xpos = (iconWidth - img.size.width)/2.0f; + widthOffset -= iconWidth - xpos; + imgView.frame = CGRectMake(widthOffset, ypos, img.size.width, img.size.height); + [stateView addSubview:imgView]; + } + + [states release]; + return [stateView autorelease]; +} + +#pragma mark - +#pragma mark UITableView delegate + +- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + return 28.0f; +} + +#pragma mark - +#pragma mark UIAlertView delegate + +- (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { + // Cancel + if (buttonIndex == 0) { + // Tear down the connection. + [_connection disconnect]; + + // Ignore + } else if (buttonIndex == 1) { + // Ignore just reconnects to the server without + // performing any verification on the certificate chain + // the server presents us. + [_connection setIgnoreSSLVerification:YES]; + [_connection reconnect]; + + // Trust + } else if (buttonIndex == 2) { + // Store the cert hash of the leaf certificate. We then ignore certificate + // verification errors from this host as long as it keeps on presenting us + // the same certificate it always has. + NSString *digest = [[[_connection peerCertificates] objectAtIndex:0] hexDigest]; + [Database storeDigest:digest forServerWithHostname:[_connection hostname] port:[_connection port]]; + [_connection setIgnoreSSLVerification:YES]; + [_connection reconnect]; + + // Show certificates + } else if (buttonIndex == 3) { + ServerCertificateTrustViewController *certTrustView = [[ServerCertificateTrustViewController alloc] initWithConnection:_connection]; + UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:certTrustView]; + [certTrustView release]; + [self presentModalViewController:navCtrl animated:YES]; + [navCtrl release]; + } +} + +#pragma mark - +#pragma mark Target/actions + +// Disconnect from the server +- (void) disconnectClicked:(id)sender { + [_connection disconnect]; + [[self navigationController] dismissModalViewControllerAnimated:YES]; +} + +// Info (certs) button clicked +- (void) infoClicked:(id)sender { + NSArray *certs = [_connection peerCertificates]; + CertificateViewController *certView = [[CertificateViewController alloc] initWithCertificates:certs]; + [[self navigationController] pushViewController:certView animated:YES]; + [certView release]; +} + +// Push-to-Talk button +- (void) pushToTalkClicked:(id)sender { + [self togglePushToTalk]; +} + +// Channel picker +- (void) channelsButtonClicked:(id)sender { + ChannelNavigationViewController *channelView = [[ChannelNavigationViewController alloc] initWithServerModel:_model]; + UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:channelView]; + [channelView release]; + [[self navigationController] presentModalViewController:navCtrl animated:YES]; + [navCtrl release]; +} + +// User picker +- (void) usersButtonClicked:(id)sender { + NSLog(@"users"); +} + +- (void) togglePushToTalk { + _pttState = !_pttState; + MKAudio *audio = [MKAudio sharedAudio]; + [audio setForceTransmit:_pttState]; +} + +@end diff --git a/Source/Classes/WelcomeScreenPad.h b/Source/Classes/WelcomeScreenPad.h index 1d30c6e..19f60cf 100644 --- a/Source/Classes/WelcomeScreenPad.h +++ b/Source/Classes/WelcomeScreenPad.h @@ -1,43 +1,43 @@ -/* Copyright (C) 2009-2010 Mikkel Krautz <mikkel@krautz.dk> - - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - Neither the name of the Mumble Developers nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#import <UIKit/UIKit.h> - -@interface WelcomeScreenPad : UIViewController { - IBOutlet UIBarButtonItem *publicServersButton; - IBOutlet UIBarButtonItem *favouritesButton; - IBOutlet UIBarButtonItem *lanServersButton; +/* Copyright (C) 2009-2011 Mikkel Krautz <mikkel@krautz.dk> + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + - Neither the name of the Mumble Developers nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +@interface WelcomeScreenPad : UITableViewController <UIPopoverControllerDelegate> { + UIAlertView *_aboutView; + NSInteger _aboutWebsiteButton; + NSInteger _aboutContribButton; + NSInteger _aboutLegalButton; + + UIPopoverController *_preferencesPopover; } -- (IBAction) publicServerListClicked:(id)sender; -- (IBAction) favouritesClicked:(id)sender; -- (IBAction) lanServerListClicked:(id)sender; +- (id) init; +- (void) dealloc; @end diff --git a/Source/Classes/WelcomeScreenPad.m b/Source/Classes/WelcomeScreenPad.m index 85afd69..6c7e321 100644 --- a/Source/Classes/WelcomeScreenPad.m +++ b/Source/Classes/WelcomeScreenPad.m @@ -1,98 +1,217 @@ -/* Copyright (C) 2009-2010 Mikkel Krautz <mikkel@krautz.dk> - - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - Neither the name of the Mumble Developers nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +/* Copyright (C) 2009-2011 Mikkel Krautz <mikkel@krautz.dk> + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + - Neither the name of the Mumble Developers nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ #import "WelcomeScreenPad.h" + #import "PublicServerListController.h" +#import "FavouriteServerListController.h" +#import "LanServerListController.h" +#import "PreferencesViewController.h" +#import "ServerRootViewController.h" +#import "AboutViewController.h" + +@interface WelcomeScreenPad (Private) +- (void) presentAboutDialog; +@end @implementation WelcomeScreenPad -/* - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // Custom initialization - } - return self; +- (id) init { + self = [super initWithNibName:@"WelcomeScreenPad" bundle:nil]; + if (self == nil) + return nil; + + return self; } -*/ -/* -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; +- (void) dealloc { + [super dealloc]; } -*/ - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // Overriden to allow any orientation. - return YES; +- (void) viewDidLoad { + [super viewDidLoad]; } +- (void) viewWillAppear:(BOOL)animated { + self.navigationItem.title = @"Mumble"; + self.navigationController.toolbarHidden = YES; + + UIBarButtonItem *about = [[UIBarButtonItem alloc] initWithTitle:@"About" style:UIBarButtonItemStyleBordered target:self action:@selector(aboutClicked:)]; + [self.navigationItem setRightBarButtonItem:about]; + [about release]; + + UIBarButtonItem *prefs = [[UIBarButtonItem alloc] initWithTitle:@"Preferences" style:UIBarButtonItemStyleBordered target:self action:@selector(prefsClicked:)]; + [self.navigationItem setLeftBarButtonItem:prefs]; + [prefs release]; +} -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; +- (void) didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} - // Release any cached data, images, etc that aren't in use. +- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { + return YES; } +#pragma mark - +#pragma mark TableView -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; +- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { + return 1; } +// Customize the number of rows in the table view. +- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + if (section == 0) + return 3; + return 0; +} -- (void)dealloc { - [super dealloc]; +- (NSString *) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { + if (section == 0) + return @"Servers"; + + return @"Unknown"; } -- (IBAction) publicServerListClicked:(id)sender { - PublicServerListController *public = [[PublicServerListController alloc] init]; +- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + return 35.0; +} -#ifdef __IPHONE_3_2 - Class UIPopoverControllerClass = NSClassFromString(@"UIPopoverController"); - if (UIPopoverControllerClass) { - UIPopoverController *popover = [[UIPopoverControllerClass alloc] initWithContentViewController:public]; - [popover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES]; +// Customize the appearance of table view cells. +- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"welcomeItem"]; + if (!cell) { + cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"welcomeItem"] autorelease]; + } + + /* Servers section. */ + if (indexPath.section == 0) { + if (indexPath.row == 0) { + cell.textLabel.text = @"Public"; + } else if (indexPath.row == 1) { + cell.textLabel.text = @"Favourites"; + } else if (indexPath.row == 2) { + cell.textLabel.text = @"LAN"; + } } + + [[cell textLabel] setHidden: NO]; + + return cell; +} + +// Override to support row selection in the table view. +- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + + /* Servers section. */ + if (indexPath.section == 0) { + if (indexPath.row == 0) { + PublicServerListController *serverList = [[[PublicServerListController alloc] init] autorelease]; + [self.navigationController pushViewController:serverList animated:YES]; + } else if (indexPath.row == 1) { + FavouriteServerListController *favList = [[[FavouriteServerListController alloc] init] autorelease]; + [self.navigationController pushViewController:favList animated:YES]; + } else if (indexPath.row == 2) { + LanServerListController *lanList = [[[LanServerListController alloc] init] autorelease]; + [self.navigationController pushViewController:lanList animated:YES]; + } + } +} + +- (void) aboutClicked:(id)sender { +#ifdef MUMBLE_BETA_DIST + NSString *aboutTitle = [NSString stringWithFormat:@"Mumble %@ (%@)", + [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"], + [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MumbleGitRevision"]]; +#else + NSString *aboutTitle = [NSString stringWithFormat:@"Mumble %@", + [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]; #endif + NSString *aboutMessage = @"Low-latency, high-quality VoIP app"; + + UIAlertView *aboutView = [[UIAlertView alloc] initWithTitle:aboutTitle message:aboutMessage delegate:self + cancelButtonTitle:@"OK" + otherButtonTitles:@"Website", @"Contributors", @"Legal", nil]; + [aboutView show]; + [aboutView release]; +} + +- (void) prefsClicked:(id)sender { + if (_preferencesPopover != nil) + return; + + PreferencesViewController *prefs = [[[PreferencesViewController alloc] init] autorelease]; + UINavigationController *nav = [[[UINavigationController alloc] initWithRootViewController:prefs] autorelease]; + [nav setContentSizeForViewInPopover:CGSizeMake(320, 480)]; + UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:nav]; + [popover setDelegate:self]; + [popover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; + + _preferencesPopover = popover; } -- (IBAction) favouritesClicked:(id)sender { +#pragma mark - +#pragma mark About Dialog + +- (void) alertView:(UIAlertView *)alert didDismissWithButtonIndex:(NSInteger)buttonIndex { + if (buttonIndex == 1) { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.mumble.info/"]]; + } else if (buttonIndex == 2) { + AboutViewController *contribView = [[AboutViewController alloc] initWithContent:@"Contributors"]; + UINavigationController *navController = [[UINavigationController alloc] init]; + [navController pushViewController:contribView animated:NO]; + [contribView release]; + [[self navigationController] presentModalViewController:navController animated:YES]; + [navController release]; + } else if (buttonIndex == 3) { + AboutViewController *legalView = [[AboutViewController alloc] initWithContent:@"Legal"]; + UINavigationController *navController = [[UINavigationController alloc] init]; + [navController pushViewController:legalView animated:NO]; + [legalView release]; + [[self navigationController] presentModalViewController:navController animated:YES]; + [navController release]; + } } -- (IBAction) lanServerListClicked:(id)sender { +#pragma mark - +#pragma mark UIPopoverControllerDelegate + +- (void) popoverControllerDidDismissPopover:(UIPopoverController *)popoverController { + if (popoverController == _preferencesPopover) { + [_preferencesPopover release]; + _preferencesPopover = nil; + } } @end diff --git a/Source/Classes/WelcomeScreenPad.xib b/Source/Classes/WelcomeScreenPad.xib index d3cd7e7..c2f264c 100644 --- a/Source/Classes/WelcomeScreenPad.xib +++ b/Source/Classes/WelcomeScreenPad.xib @@ -1,18 +1,18 @@ <?xml version="1.0" encoding="UTF-8"?> <archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10"> <data> - <int key="IBDocument.SystemTarget">800</int> - <string key="IBDocument.SystemVersion">10C540</string> - <string key="IBDocument.InterfaceBuilderVersion">762</string> - <string key="IBDocument.AppKitVersion">1038.25</string> - <string key="IBDocument.HIToolboxVersion">458.00</string> + <int key="IBDocument.SystemTarget">1056</int> + <string key="IBDocument.SystemVersion">10J567</string> + <string key="IBDocument.InterfaceBuilderVersion">851</string> + <string key="IBDocument.AppKitVersion">1038.35</string> + <string key="IBDocument.HIToolboxVersion">462.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> - <string key="NS.object.0">87</string> + <string key="NS.object.0">141</string> </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="2"/> + <integer value="3"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -29,79 +29,48 @@ </object> <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBProxyObject" id="841351856"> + <object class="IBProxyObject" id="372490531"> <string key="IBProxiedObjectIdentifier">IBFilesOwner</string> <string key="targetRuntimeIdentifier">IBIPadFramework</string> </object> - <object class="IBProxyObject" id="606714003"> + <object class="IBProxyObject" id="975951072"> <string key="IBProxiedObjectIdentifier">IBFirstResponder</string> <string key="targetRuntimeIdentifier">IBIPadFramework</string> </object> - <object class="IBUIView" id="766721923"> + <object class="IBUITableView" id="155911903"> <reference key="NSNextResponder"/> - <int key="NSvFlags">292</int> - <object class="NSMutableArray" key="NSSubviews"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBUIToolbar" id="662137358"> - <reference key="NSNextResponder" ref="766721923"/> - <int key="NSvFlags">266</int> - <string key="NSFrame">{{0, 960}, {768, 44}}</string> - <reference key="NSSuperview" ref="766721923"/> - <bool key="IBUIOpaque">NO</bool> - <bool key="IBUIClearsContextBeforeDrawing">NO</bool> - <string key="targetRuntimeIdentifier">IBIPadFramework</string> - <object class="NSMutableArray" key="IBUIItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBUIBarButtonItem" id="866080951"> - <string key="IBUITitle">Public Servers</string> - <string key="targetRuntimeIdentifier">IBIPadFramework</string> - <int key="IBUIStyle">1</int> - <reference key="IBUIToolbar" ref="662137358"/> - </object> - <object class="IBUIBarButtonItem" id="95088770"> - <string key="IBUITitle">Favourites</string> - <string key="targetRuntimeIdentifier">IBIPadFramework</string> - <int key="IBUIStyle">1</int> - <reference key="IBUIToolbar" ref="662137358"/> - </object> - <object class="IBUIBarButtonItem" id="790543953"> - <string key="IBUITitle">LAN Servers</string> - <string key="targetRuntimeIdentifier">IBIPadFramework</string> - <int key="IBUIStyle">1</int> - <reference key="IBUIToolbar" ref="662137358"/> - </object> - </object> - </object> - <object class="IBUIImageView" id="379387059"> - <reference key="NSNextResponder" ref="766721923"/> - <int key="NSvFlags">256</int> - <string key="NSFrame">{{0, 12}, {461, 410}}</string> - <reference key="NSSuperview" ref="766721923"/> - <bool key="IBUIOpaque">NO</bool> - <bool key="IBUIClipsSubviews">YES</bool> - <int key="IBUIContentMode">4</int> - <bool key="IBUIMultipleTouchEnabled">YES</bool> - <string key="targetRuntimeIdentifier">IBIPadFramework</string> - <object class="NSCustomResource" key="IBUIImage"> - <string key="NSClassName">NSImage</string> - <string key="NSResourceName">mumble.pdf</string> - </object> - </object> - </object> - <string key="NSFrameSize">{768, 1004}</string> + <int key="NSvFlags">274</int> + <string key="NSFrameSize">{768, 916}</string> <reference key="NSSuperview"/> <object class="NSColor" key="IBUIBackgroundColor"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MQA</bytes> - <object class="NSColorSpace" key="NSCustomColorSpace"> - <int key="NSID">2</int> - </object> + <int key="NSColorSpace">1</int> + <bytes key="NSRGB">MCAwIDAgMAA</bytes> </object> + <bool key="IBUIOpaque">NO</bool> + <bool key="IBUIClipsSubviews">YES</bool> <bool key="IBUIClearsContextBeforeDrawing">NO</bool> <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"> <int key="IBUIStatusBarStyle">2</int> </object> + <object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics"> + <int key="IBUIBarStyle">1</int> + <bool key="IBUIPrompted">NO</bool> + </object> + <object class="IBUISimulatedToolbarMetrics" key="IBUISimulatedBottomBarMetrics"> + <int key="IBUIBarStyle">1</int> + </object> <string key="targetRuntimeIdentifier">IBIPadFramework</string> + <bool key="IBUIScrollEnabled">NO</bool> + <bool key="IBUIShowsHorizontalScrollIndicator">NO</bool> + <int key="IBUIIndicatorStyle">1</int> + <bool key="IBUIBouncesZoom">NO</bool> + <int key="IBUIStyle">1</int> + <int key="IBUISeparatorStyle">2</int> + <int key="IBUISectionIndexMinimumDisplayRowCount">0</int> + <bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool> + <float key="IBUIRowHeight">44</float> + <float key="IBUISectionHeaderHeight">10</float> + <float key="IBUISectionFooterHeight">10</float> </object> </object> <object class="IBObjectContainer" key="IBDocument.Objects"> @@ -109,59 +78,27 @@ <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBConnectionRecord"> <object class="IBCocoaTouchOutletConnection" key="connection"> - <string key="label">view</string> - <reference key="source" ref="841351856"/> - <reference key="destination" ref="766721923"/> - </object> - <int key="connectionID">3</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBCocoaTouchOutletConnection" key="connection"> - <string key="label">lanServersButton</string> - <reference key="source" ref="841351856"/> - <reference key="destination" ref="790543953"/> + <string key="label">dataSource</string> + <reference key="source" ref="155911903"/> + <reference key="destination" ref="372490531"/> </object> - <int key="connectionID">13</int> + <int key="connectionID">4</int> </object> <object class="IBConnectionRecord"> <object class="IBCocoaTouchOutletConnection" key="connection"> - <string key="label">favouritesButton</string> - <reference key="source" ref="841351856"/> - <reference key="destination" ref="95088770"/> + <string key="label">delegate</string> + <reference key="source" ref="155911903"/> + <reference key="destination" ref="372490531"/> </object> - <int key="connectionID">15</int> + <int key="connectionID">5</int> </object> <object class="IBConnectionRecord"> <object class="IBCocoaTouchOutletConnection" key="connection"> - <string key="label">publicServersButton</string> - <reference key="source" ref="841351856"/> - <reference key="destination" ref="866080951"/> - </object> - <int key="connectionID">16</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBCocoaTouchEventConnection" key="connection"> - <string key="label">publicServerListClicked:</string> - <reference key="source" ref="866080951"/> - <reference key="destination" ref="841351856"/> - </object> - <int key="connectionID">22</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBCocoaTouchEventConnection" key="connection"> - <string key="label">favouritesClicked:</string> - <reference key="source" ref="95088770"/> - <reference key="destination" ref="841351856"/> - </object> - <int key="connectionID">23</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBCocoaTouchEventConnection" key="connection"> - <string key="label">lanServerListClicked:</string> - <reference key="source" ref="790543953"/> - <reference key="destination" ref="841351856"/> + <string key="label">view</string> + <reference key="source" ref="372490531"/> + <reference key="destination" ref="155911903"/> </object> - <int key="connectionID">24</int> + <int key="connectionID">6</int> </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> @@ -175,56 +112,20 @@ </object> <object class="IBObjectRecord"> <int key="objectID">-1</int> - <reference key="object" ref="841351856"/> + <reference key="object" ref="372490531"/> <reference key="parent" ref="0"/> <string key="objectName">File's Owner</string> </object> <object class="IBObjectRecord"> <int key="objectID">-2</int> - <reference key="object" ref="606714003"/> + <reference key="object" ref="975951072"/> <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> - <int key="objectID">2</int> - <reference key="object" ref="766721923"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="662137358"/> - <reference ref="379387059"/> - </object> + <int key="objectID">3</int> + <reference key="object" ref="155911903"/> <reference key="parent" ref="0"/> </object> - <object class="IBObjectRecord"> - <int key="objectID">8</int> - <reference key="object" ref="662137358"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="866080951"/> - <reference ref="95088770"/> - <reference ref="790543953"/> - </object> - <reference key="parent" ref="766721923"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">9</int> - <reference key="object" ref="866080951"/> - <reference key="parent" ref="662137358"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">10</int> - <reference key="object" ref="95088770"/> - <reference key="parent" ref="662137358"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">11</int> - <reference key="object" ref="790543953"/> - <reference key="parent" ref="662137358"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">25</int> - <reference key="object" ref="379387059"/> - <reference key="parent" ref="766721923"/> - </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> @@ -233,22 +134,19 @@ <bool key="EncodedWithXMLCoder">YES</bool> <string>-1.CustomClassName</string> <string>-2.CustomClassName</string> - <string>10.IBPluginDependency</string> - <string>11.IBPluginDependency</string> - <string>2.IBEditorWindowLastContentRect</string> - <string>2.IBPluginDependency</string> - <string>8.IBPluginDependency</string> - <string>9.IBPluginDependency</string> + <string>3.IBEditorWindowLastContentRect</string> + <string>3.IBLastUsedUIStatusBarStylesToTargetRuntimesMap</string> + <string>3.IBPluginDependency</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>WelcomeScreenPad</string> <string>UIResponder</string> - <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> - <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> - <string>{{270, 87}, {855, 919}}</string> - <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> - <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string>{{631, 51}, {783, 705}}</string> + <object class="NSMutableDictionary"> + <string key="NS.key.0">IBCocoaTouchFramework</string> + <integer value="2" key="NS.object.0"/> + </object> <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> </object> </object> @@ -268,44 +166,14 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">25</int> + <int key="maxID">6</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBPartialClassDescription"> <string key="className">WelcomeScreenPad</string> - <string key="superclassName">UIViewController</string> - <object class="NSMutableDictionary" key="actions"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>favouritesClicked:</string> - <string>lanServerListClicked:</string> - <string>publicServerListClicked:</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>id</string> - <string>id</string> - <string>id</string> - </object> - </object> - <object class="NSMutableDictionary" key="outlets"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>favouritesButton</string> - <string>lanServersButton</string> - <string>publicServersButton</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>UIBarButtonItem</string> - <string>UIBarButtonItem</string> - <string>UIBarButtonItem</string> - </object> - </object> + <string key="superclassName">UITableViewController</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">Source/Classes/WelcomeScreenPad.h</string> @@ -353,13 +221,6 @@ <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSObject.h</string> </object> </object> @@ -367,13 +228,6 @@ <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSPort.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string> </object> </object> @@ -381,35 +235,35 @@ <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSStream.h</string> + <string key="minorKey">Foundation.framework/Headers/NSThread.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSThread.h</string> + <string key="minorKey">Foundation.framework/Headers/NSURL.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSURL.h</string> + <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string> + <string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string> + <string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string> </object> </object> <object class="IBPartialClassDescription"> @@ -428,62 +282,61 @@ </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier" id="786211723"> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="36290789"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string> </object> </object> <object class="IBPartialClassDescription"> - <string key="className">UIBarButtonItem</string> - <string key="superclassName">UIBarItem</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">UIKit.framework/Headers/UIBarButtonItem.h</string> - </object> + <string key="className">UIResponder</string> + <string key="superclassName">NSObject</string> + <reference key="sourceIdentifier" ref="36290789"/> </object> <object class="IBPartialClassDescription"> - <string key="className">UIBarItem</string> - <string key="superclassName">NSObject</string> + <string key="className">UIScrollView</string> + <string key="superclassName">UIView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">UIKit.framework/Headers/UIBarItem.h</string> + <string key="minorKey">UIKit.framework/Headers/UIScrollView.h</string> </object> </object> <object class="IBPartialClassDescription"> - <string key="className">UIImageView</string> + <string key="className">UISearchBar</string> <string key="superclassName">UIView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">UIKit.framework/Headers/UIImageView.h</string> + <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string> </object> </object> <object class="IBPartialClassDescription"> - <string key="className">UIResponder</string> + <string key="className">UISearchDisplayController</string> <string key="superclassName">NSObject</string> - <reference key="sourceIdentifier" ref="786211723"/> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string> + </object> </object> <object class="IBPartialClassDescription"> - <string key="className">UISearchBar</string> - <string key="superclassName">UIView</string> + <string key="className">UITableView</string> + <string key="superclassName">UIScrollView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string> + <string key="minorKey">UIKit.framework/Headers/UITableView.h</string> </object> </object> <object class="IBPartialClassDescription"> - <string key="className">UISearchDisplayController</string> - <string key="superclassName">NSObject</string> + <string key="className">UITableViewController</string> + <string key="superclassName">UIViewController</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string> + <string key="minorKey">UIKit.framework/Headers/UITableViewController.h</string> </object> </object> <object class="IBPartialClassDescription"> - <string key="className">UIToolbar</string> - <string key="superclassName">UIView</string> + <string key="className">UIView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">UIKit.framework/Headers/UIToolbar.h</string> + <string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string> </object> </object> <object class="IBPartialClassDescription"> @@ -543,7 +396,7 @@ <string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string> - <integer value="800" key="NS.object.0"/> + <integer value="1056" key="NS.object.0"/> </object> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string> @@ -552,10 +405,6 @@ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> <string key="IBDocument.LastKnownRelativeProjectPath">../../Mumble.xcodeproj</string> <int key="IBDocument.defaultPropertyAccessControl">3</int> - <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes"> - <string key="NS.key.0">mumble.pdf</string> - <string key="NS.object.0">{400, 400}</string> - </object> - <string key="IBCocoaTouchPluginVersion">87</string> + <string key="IBCocoaTouchPluginVersion">141</string> </data> </archive> diff --git a/Source/Classes/WelcomeScreenPhone.m b/Source/Classes/WelcomeScreenPhone.m index a31e4bf..57e9597 100644 --- a/Source/Classes/WelcomeScreenPhone.m +++ b/Source/Classes/WelcomeScreenPhone.m @@ -78,6 +78,10 @@ [super didReceiveMemoryWarning]; } +- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { + return NO; +} + #pragma mark - #pragma mark TableView diff --git a/Source/Classes/WelcomeScreenPhone.xib b/Source/Classes/WelcomeScreenPhone.xib index c5e26bb..839894a 100644 --- a/Source/Classes/WelcomeScreenPhone.xib +++ b/Source/Classes/WelcomeScreenPhone.xib @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10"> <data> - <int key="IBDocument.SystemTarget">800</int> - <string key="IBDocument.SystemVersion">10C540</string> - <string key="IBDocument.InterfaceBuilderVersion">762</string> - <string key="IBDocument.AppKitVersion">1038.25</string> - <string key="IBDocument.HIToolboxVersion">458.00</string> + <int key="IBDocument.SystemTarget">1056</int> + <string key="IBDocument.SystemVersion">10J567</string> + <string key="IBDocument.InterfaceBuilderVersion">851</string> + <string key="IBDocument.AppKitVersion">1038.35</string> + <string key="IBDocument.HIToolboxVersion">462.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> - <string key="NS.object.0">87</string> + <string key="NS.object.0">141</string> </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -42,6 +42,38 @@ <int key="NSvFlags">274</int> <string key="NSFrameSize">{320, 372}</string> <reference key="NSSuperview"/> + <object class="NSColor" key="IBUIBackgroundColor"> + <int key="NSColorSpace">10</int> + <object class="NSImage" key="NSImage"> + <int key="NSImageFlags">549453824</int> + <string key="NSSize">{84, 1}</string> + <object class="NSMutableArray" key="NSReps"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray"> + <bool key="EncodedWithXMLCoder">YES</bool> + <integer value="0"/> + <object class="NSBitmapImageRep"> + <object class="NSData" key="NSTIFFRepresentation"> + <bytes key="NS.bytes">TU0AKgAAAVjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ +y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ +xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ +xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ +xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ +xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P8ADQEAAAMAAAABAFQAAAEB +AAMAAAABAAEAAAECAAMAAAAEAAAB+gEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABAAEAAAEXAAQAAAABAAABUAEcAAMAAAABAAEAAAFS +AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> + </object> + </object> + </object> + </object> + <object class="NSColor" key="NSColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MCAwAA</bytes> + </object> + </object> + <string key="IBUIColorCocoaTouchKeyPath">groupTableViewBackgroundColor</string> + </object> <bool key="IBUIOpaque">NO</bool> <bool key="IBUIClipsSubviews">YES</bool> <bool key="IBUIClearsContextBeforeDrawing">NO</bool> @@ -61,7 +93,7 @@ <int key="IBUIIndicatorStyle">1</int> <bool key="IBUIBouncesZoom">NO</bool> <int key="IBUIStyle">1</int> - <int key="IBUISeparatorStyle">1</int> + <int key="IBUISeparatorStyle">2</int> <int key="IBUISectionIndexMinimumDisplayRowCount">0</int> <bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool> <float key="IBUIRowHeight">44</float> @@ -137,7 +169,7 @@ <bool key="EncodedWithXMLCoder">YES</bool> <string>WelcomeScreenPhone</string> <string>UIResponder</string> - <string>{{423, 403}, {320, 480}}</string> + <string>{{423, 276}, {320, 480}}</string> <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> </object> </object> @@ -212,13 +244,6 @@ <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSObject.h</string> </object> </object> @@ -226,13 +251,6 @@ <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSPort.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string> </object> </object> @@ -240,35 +258,35 @@ <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSStream.h</string> + <string key="minorKey">Foundation.framework/Headers/NSThread.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSThread.h</string> + <string key="minorKey">Foundation.framework/Headers/NSURL.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSURL.h</string> + <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string> + <string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string> + <string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string> </object> </object> <object class="IBPartialClassDescription"> @@ -287,7 +305,7 @@ </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier" id="1034487622"> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="522469497"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string> </object> @@ -295,7 +313,7 @@ <object class="IBPartialClassDescription"> <string key="className">UIResponder</string> <string key="superclassName">NSObject</string> - <reference key="sourceIdentifier" ref="1034487622"/> + <reference key="sourceIdentifier" ref="522469497"/> </object> <object class="IBPartialClassDescription"> <string key="className">UIScrollView</string> @@ -341,6 +359,13 @@ <string key="className">UIView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">UIView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">UIKit.framework/Headers/UITextField.h</string> </object> </object> @@ -394,15 +419,15 @@ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string> - <integer value="800" key="NS.object.0"/> + <integer value="1056" key="NS.object.0"/> </object> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string> <integer value="3100" key="NS.object.0"/> </object> <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> - <string key="IBDocument.LastKnownRelativeProjectPath">Mumble.xcodeproj</string> + <string key="IBDocument.LastKnownRelativeProjectPath">../../Mumble.xcodeproj</string> <int key="IBDocument.defaultPropertyAccessControl">3</int> - <string key="IBCocoaTouchPluginVersion">87</string> + <string key="IBCocoaTouchPluginVersion">141</string> </data> </archive> |