aboutsummaryrefslogtreecommitdiffstats
path: root/iBean
diff options
context:
space:
mode:
authorEddie Ehlin <eddiex@eddiex.se>2013-02-03 14:45:35 +0100
committerEddie Ehlin <eddiex@eddiex.se>2013-02-03 14:45:35 +0100
commit27645b2ae5560b503ef9d956b89e52887fe29b16 (patch)
tree3167158a6b770d1d9f3aea736bf2549606a414a1 /iBean
parent0464611a929f181146c55f64bb42829e0e28ff7c (diff)
downloadiBean-27645b2ae5560b503ef9d956b89e52887fe29b16.tar.gz
iBean-27645b2ae5560b503ef9d956b89e52887fe29b16.zip
Added "Extraction complete" dialog and also bug fix for the extraction view for iBean, which caused the app to crash upon rotating in that view.
Diffstat (limited to 'iBean')
-rw-r--r--iBean/iBean.xcodeproj/project.pbxproj4
-rw-r--r--iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstatebin43024 -> 41820 bytes
-rw-r--r--iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist14
-rw-r--r--iBean/iBean/BeanCollectionExtractionScrollView.m2
-rw-r--r--iBean/iBean/BeanCollectionExtractionViewController.h2
-rw-r--r--iBean/iBean/BeanCollectionExtractionViewController.m17
-rw-r--r--iBean/iBean/InstantExtractionViewController.h2
-rw-r--r--iBean/iBean/InstantExtractionViewController.m20
-rw-r--r--iBean/iBean/SettingsViewController.h2
-rw-r--r--iBean/iBean/SettingsViewController.m51
-rw-r--r--iBean/iBean/iPhoneStoryboard.storyboard6
11 files changed, 85 insertions, 35 deletions
diff --git a/iBean/iBean.xcodeproj/project.pbxproj b/iBean/iBean.xcodeproj/project.pbxproj
index 1bbb776..e2c40a3 100644
--- a/iBean/iBean.xcodeproj/project.pbxproj
+++ b/iBean/iBean.xcodeproj/project.pbxproj
@@ -31,6 +31,7 @@
020C568F16A1CE0E00D8224C /* EditBeanViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 020C568E16A1CE0E00D8224C /* EditBeanViewController.m */; };
020C569316A1E55600D8224C /* ExtractionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 020C569216A1E55600D8224C /* ExtractionViewController.m */; };
020C569C16A49C8300D8224C /* Configuration+Interface.m in Sources */ = {isa = PBXBuildFile; fileRef = 020C569B16A49C8300D8224C /* Configuration+Interface.m */; };
+ 022A9C6B16BE9CA300DB3A4A /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 022A9C6A16BE9CA300DB3A4A /* AudioToolbox.framework */; };
024F676D16A4A61D004A1201 /* InstantExtractionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 024F676C16A4A61D004A1201 /* InstantExtractionViewController.m */; };
0276253916B58D6000EE2F4E /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0276253816B58D6000EE2F4E /* SettingsViewController.m */; };
0276253C16B59E4C00EE2F4E /* Configuration.m in Sources */ = {isa = PBXBuildFile; fileRef = 0276253B16B59E4C00EE2F4E /* Configuration.m */; };
@@ -84,6 +85,7 @@
020C569216A1E55600D8224C /* ExtractionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExtractionViewController.m; sourceTree = "<group>"; };
020C569A16A49C8300D8224C /* Configuration+Interface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Configuration+Interface.h"; sourceTree = "<group>"; };
020C569B16A49C8300D8224C /* Configuration+Interface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Configuration+Interface.m"; sourceTree = "<group>"; };
+ 022A9C6A16BE9CA300DB3A4A /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
024F676B16A4A61D004A1201 /* InstantExtractionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InstantExtractionViewController.h; sourceTree = "<group>"; };
024F676C16A4A61D004A1201 /* InstantExtractionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstantExtractionViewController.m; sourceTree = "<group>"; };
0276253716B58D6000EE2F4E /* SettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsViewController.h; sourceTree = "<group>"; };
@@ -111,6 +113,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 022A9C6B16BE9CA300DB3A4A /* AudioToolbox.framework in Frameworks */,
020C55981691014E00D8224C /* UIKit.framework in Frameworks */,
020C559A1691014E00D8224C /* Foundation.framework in Frameworks */,
020C559C1691014E00D8224C /* CoreGraphics.framework in Frameworks */,
@@ -141,6 +144,7 @@
020C55961691014E00D8224C /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 022A9C6A16BE9CA300DB3A4A /* AudioToolbox.framework */,
020C55971691014E00D8224C /* UIKit.framework */,
020C55991691014E00D8224C /* Foundation.framework */,
020C559B1691014E00D8224C /* CoreGraphics.framework */,
diff --git a/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate b/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate
index c87b20a..57a6226 100644
--- a/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate
+++ b/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate
Binary files differ
diff --git a/iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
index e4eeaa6..d3ee32a 100644
--- a/iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
+++ b/iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
@@ -8,11 +8,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "iBean/InstantExtractionViewController.m"
- timestampString = "380990419.117278"
+ timestampString = "381591502.753324"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "80"
- endingLineNumber = "80"
+ startingLineNumber = "87"
+ endingLineNumber = "87"
landmarkName = "-haltExtractionTimer"
landmarkType = "5">
</FileBreakpoint>
@@ -21,11 +21,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "iBean/InstantExtractionViewController.m"
- timestampString = "380990419.117278"
+ timestampString = "381591502.753324"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "88"
- endingLineNumber = "88"
+ startingLineNumber = "95"
+ endingLineNumber = "95"
landmarkName = "-timerInterrupted"
landmarkType = "5">
</FileBreakpoint>
@@ -43,7 +43,7 @@
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
- shouldBeEnabled = "Yes"
+ shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "iBean/ThresholdListViewController.m"
diff --git a/iBean/iBean/BeanCollectionExtractionScrollView.m b/iBean/iBean/BeanCollectionExtractionScrollView.m
index ea42000..4833814 100644
--- a/iBean/iBean/BeanCollectionExtractionScrollView.m
+++ b/iBean/iBean/BeanCollectionExtractionScrollView.m
@@ -39,6 +39,8 @@
UIEdgeInsets insets = UIEdgeInsetsMake(0, 0, /*padding@bottom*/50, 0);
[self setContentInset:insets];
[self setScrollIndicatorInsets:insets];
+
+ [super layoutSubviews];
}
/*
diff --git a/iBean/iBean/BeanCollectionExtractionViewController.h b/iBean/iBean/BeanCollectionExtractionViewController.h
index 449642a..88c8e92 100644
--- a/iBean/iBean/BeanCollectionExtractionViewController.h
+++ b/iBean/iBean/BeanCollectionExtractionViewController.h
@@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>
@class BeanCollection;
-@interface BeanCollectionExtractionViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
+@interface BeanCollectionExtractionViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UIAlertViewDelegate>
@property (nonatomic, strong) BeanCollection *beanCollection;
@property (nonatomic, assign) double extractionProgress;
diff --git a/iBean/iBean/BeanCollectionExtractionViewController.m b/iBean/iBean/BeanCollectionExtractionViewController.m
index dea550d..b1be270 100644
--- a/iBean/iBean/BeanCollectionExtractionViewController.m
+++ b/iBean/iBean/BeanCollectionExtractionViewController.m
@@ -6,6 +6,7 @@
// Copyright (c) 2013 Eddie Ehlin. All rights reserved.
//
+#import <AudioToolbox/AudioToolbox.h>
#import "BeanCollectionExtractionViewController.h"
#import "BeanCollectionInfoViewController.h"
#import "BeanCollection+Interface.h"
@@ -99,7 +100,14 @@
{
NSLog(@"Timer reached its limit!");
[self haltExtractionTimer];
- NSLog(@"Extraction count = %@", [(AppDelegate*) [[UIApplication sharedApplication] delegate] incrementExtractionCount]);
+
+ UIAlertView *extractionCompleteAlert = [[UIAlertView alloc]
+ initWithTitle:@"Coffee time!"
+ message:@"Extraction completed."
+ delegate:self
+ cancelButtonTitle:@"OK" otherButtonTitles: nil];
+ AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
+ [extractionCompleteAlert show];
}
}
@@ -173,4 +181,11 @@
return cell;
}
+#pragma mark - UIAlertView delegate
+- (void) alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
+{
+ //This will process thresholds etc.
+ NSLog(@"Extraction count = %@", [(AppDelegate*) [[UIApplication sharedApplication] delegate] incrementExtractionCount]);
+}
+
@end
diff --git a/iBean/iBean/InstantExtractionViewController.h b/iBean/iBean/InstantExtractionViewController.h
index f988197..10b387a 100644
--- a/iBean/iBean/InstantExtractionViewController.h
+++ b/iBean/iBean/InstantExtractionViewController.h
@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
-@interface InstantExtractionViewController : UIViewController
+@interface InstantExtractionViewController : UIViewController <UIAlertViewDelegate>
@property (nonatomic, assign) double extractionProgress;
@property (nonatomic, assign) BOOL extractionInProgress;
diff --git a/iBean/iBean/InstantExtractionViewController.m b/iBean/iBean/InstantExtractionViewController.m
index 4c02b62..b2e1372 100644
--- a/iBean/iBean/InstantExtractionViewController.m
+++ b/iBean/iBean/InstantExtractionViewController.m
@@ -5,7 +5,7 @@
// Created by Eddie Ehlin on 2012-12-31.
// Copyright (c) 2012 Eddie Ehlin. All rights reserved.
//
-
+#import <AudioToolbox/AudioToolbox.h>
#import "InstantExtractionViewController.h"
#import "AppDelegate+Storage.h"
@@ -66,7 +66,14 @@
{
NSLog(@"Timer reached its limit!");
[self haltExtractionTimer];
- NSLog(@"Extraction count = %@", [(AppDelegate*) [[UIApplication sharedApplication] delegate] incrementExtractionCount]);
+
+ UIAlertView *extractionCompleteAlert = [[UIAlertView alloc]
+ initWithTitle:@"Coffee time!"
+ message:@"Extraction completed."
+ delegate:self
+ cancelButtonTitle:@"OK" otherButtonTitles: nil];
+ AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
+ [extractionCompleteAlert show];
}
}
@@ -120,4 +127,13 @@
if (error == nil)
[self updateExtractionSettingLabel];
}
+
+/*****************************************************
+ Delegates
+ *****************************************************/
+#pragma mark - UIAlertView delegate
+- (void) alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex
+{
+ NSLog(@"Extraction count = %@", [(AppDelegate*) [[UIApplication sharedApplication] delegate] incrementExtractionCount]);
+}
@end
diff --git a/iBean/iBean/SettingsViewController.h b/iBean/iBean/SettingsViewController.h
index bfee4f8..efddfb2 100644
--- a/iBean/iBean/SettingsViewController.h
+++ b/iBean/iBean/SettingsViewController.h
@@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>
@class Configuration;
-@interface SettingsViewController : UITableViewController
+@interface SettingsViewController : UITableViewController <UIAlertViewDelegate>
@property (nonatomic, strong) Configuration *configuration;
diff --git a/iBean/iBean/SettingsViewController.m b/iBean/iBean/SettingsViewController.m
index 7290f6d..b3dfb46 100644
--- a/iBean/iBean/SettingsViewController.m
+++ b/iBean/iBean/SettingsViewController.m
@@ -147,30 +147,43 @@
- (void) resetExtractionCount:(id)sender
{
- if (self.configuration != nil)
+ UIAlertView *resetConfirmAlert = [[UIAlertView alloc]
+ initWithTitle:@"Reset extraction count?"
+ message:@"Are you sure about resetting extraction count?"
+ delegate:self
+ cancelButtonTitle:@"Yes"
+ otherButtonTitles:@"No", nil];
+ [resetConfirmAlert show];
+}
+
+/*****************************************************
+ Delegates
+ *****************************************************/
+#pragma mark - UIAlertView delegate
+- (void) alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
+{
+ if (buttonIndex == 0)
{
- NSError *error = [(AppDelegate*) [[UIApplication sharedApplication] delegate] setExtractionCount:[NSNumber numberWithInt:0]];
- self.extractionCountLabel.text = [self.configuration.extractionCount stringValue];
- self.extractionCountStepper.value = [self.configuration.extractionCount doubleValue];
- if (error != nil)
- {
- UIAlertView *setExtractionCountAlert = [[UIAlertView alloc]
- initWithTitle:@"Configuration error!"
- message:@"iBean was not able to save configuration attribute for \"Extraction count\"."
- delegate:nil
- cancelButtonTitle:@"OK" otherButtonTitles: nil];
- [setExtractionCountAlert show];
- }
- else
+ if (self.configuration != nil)
{
+ NSError *error = [(AppDelegate*) [[UIApplication sharedApplication] delegate] setExtractionCount:[NSNumber numberWithInt:0]];
self.extractionCountLabel.text = [self.configuration.extractionCount stringValue];
self.extractionCountStepper.value = [self.configuration.extractionCount doubleValue];
+ if (error != nil)
+ {
+ UIAlertView *setExtractionCountAlert = [[UIAlertView alloc]
+ initWithTitle:@"Configuration error!"
+ message:@"iBean was not able to save configuration attribute for \"Extraction count\"."
+ delegate:nil
+ cancelButtonTitle:@"OK" otherButtonTitles: nil];
+ [setExtractionCountAlert show];
+ }
+ else
+ {
+ self.extractionCountLabel.text = [self.configuration.extractionCount stringValue];
+ self.extractionCountStepper.value = [self.configuration.extractionCount doubleValue];
+ }
}
}
}
-
-/*****************************************************
- Delegates
- *****************************************************/
-
@end
diff --git a/iBean/iBean/iPhoneStoryboard.storyboard b/iBean/iBean/iPhoneStoryboard.storyboard
index 0244142..22975ba 100644
--- a/iBean/iBean/iPhoneStoryboard.storyboard
+++ b/iBean/iBean/iPhoneStoryboard.storyboard
@@ -471,7 +471,7 @@
<rect key="frame" x="10" y="1" width="300" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
- <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Value" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uLA-H4-Ds7">
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Extractions" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uLA-H4-Ds7">
<constraints>
<constraint firstAttribute="width" constant="158" id="hTo-AL-kb1"/>
</constraints>
@@ -600,7 +600,7 @@
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
- <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" text="0.25dl milk (red)" translatesAutoresizingMaskIntoConstraints="NO" id="JHg-Fk-IL0">
+ <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JHg-Fk-IL0">
<color key="backgroundColor" red="0.6845703125" green="0.58594199899999999" blue="0.51132836960000005" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="368" id="eyQ-2Q-yaW"/>
@@ -1364,7 +1364,7 @@
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="utz-eo-nc3"/>
- <segue reference="CyX-df-8ge"/>
+ <segue reference="OPZ-Pj-2Dz"/>
<segue reference="qk2-F5-M1s"/>
</inferredMetricsTieBreakers>
</document> \ No newline at end of file