From 9ef40a1964c047862f9e2a80c7b416a1bb508d09 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Sun, 25 Apr 2010 18:14:53 +0000 Subject: [PATCH] allow to show custom activity text --- CocoaTouch/include/BTstack/BTDiscoveryViewController.h | 2 ++ CocoaTouch/src/BTDiscoveryViewController.m | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CocoaTouch/include/BTstack/BTDiscoveryViewController.h b/CocoaTouch/include/BTstack/BTDiscoveryViewController.h index 05e729633..de712aece 100644 --- a/CocoaTouch/include/BTstack/BTDiscoveryViewController.h +++ b/CocoaTouch/include/BTstack/BTDiscoveryViewController.h @@ -52,10 +52,12 @@ typedef enum { int remoteNameIndex; BOOL showIcons; int connectingIndex; + NSString *customActivityText; } -(void) markConnecting:(int)index; // use -1 for no connection active @property (nonatomic, assign) NSObject * delegate; @property (nonatomic, assign) BOOL showIcons; +@property (nonatomic, retain) NSString *customActivityText; @end @protocol BTDiscoveryDelegate diff --git a/CocoaTouch/src/BTDiscoveryViewController.m b/CocoaTouch/src/BTDiscoveryViewController.m index 56f201628..43bd4e7c1 100644 --- a/CocoaTouch/src/BTDiscoveryViewController.m +++ b/CocoaTouch/src/BTDiscoveryViewController.m @@ -47,6 +47,7 @@ @implementation BTDiscoveryViewController @synthesize showIcons; @synthesize delegate = _delegate; +@synthesize customActivityText; - (id) init { self = [super initWithStyle:UITableViewStyleGrouped]; @@ -195,7 +196,10 @@ int idx = [indexPath indexAtPosition:1]; if (idx >= [bt numberOfDevicesFound]) { - if ([bt isActivating]){ + if (customActivityText) { + theLabel = customActivityText; + cell.accessoryView = bluetoothActivity; + } else if ([bt isActivating]){ theLabel = @"Activating BTstack..."; cell.accessoryView = bluetoothActivity; } else if (![bt isActive]){