Skip to content

Commit

Permalink
Merge pull request #26 from someoneAnyone/dev
Browse files Browse the repository at this point in the history
Updating to current Test Flight Release
  • Loading branch information
someoneAnyone committed Nov 10, 2015
2 parents 5a14c19 + 5c44b45 commit df117a7
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 38 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
language: objective-c

branches:
only:
- master

osx_image: xcode7
language: objective-c
7 changes: 4 additions & 3 deletions Nightscouter/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

completionHandler(.NewData)
}
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {

func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
print(">>> Entering \(__FUNCTION__) <<<")
print("Recieved URL: \(url) from sourceApplication: \(sourceApplication) annotation: \(annotation))")

print("Recieved URL: \(url) with options: \(options)")

let schemes = AppDataManager.sharedInstance.supportedSchemes!
if (!schemes.contains((url.scheme))) { // If the incoming scheme is not contained within the array of supported schemes return false.
Expand Down
75 changes: 55 additions & 20 deletions Nightscouter/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Nightscouter/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>135</string>
<string>138</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSUserActivityTypes</key>
Expand Down
25 changes: 21 additions & 4 deletions Nightscouter/SiteDetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,8 @@ extension SiteDetailViewController {

@IBAction func gotoSiteSettings(sender: UIBarButtonItem) {

let alertController = UIAlertController(title: Constants.LocalizedString.uiAlertScreenOverrideTitle.localized, message: Constants.LocalizedString.uiAlertScreenOverrideMessage.localized, preferredStyle: UIAlertControllerStyle.ActionSheet)
let alertController = UIAlertController(title: Constants.LocalizedString.uiAlertScreenOverrideTitle.localized, message: Constants.LocalizedString.uiAlertScreenOverrideMessage.localized, preferredStyle: .ActionSheet)

alertController.view.tintColor = NSAssetKit.darkNavColor

let cancelAction = UIAlertAction(title: Constants.LocalizedString.generalCancelLabel.localized, style: .Cancel) { (action) in
#if DEBUG
Expand All @@ -273,26 +272,44 @@ extension SiteDetailViewController {
if site!.overrideScreenLock == true {
yesString = checkEmoji
}
let yesAction = UIAlertAction(title: "\(yesString)\(Constants.LocalizedString.generalYesLabel.localized)", style: UIAlertActionStyle.Default) { (action) -> Void in

let yesAction = UIAlertAction(title: "\(yesString)\(Constants.LocalizedString.generalYesLabel.localized)", style: .Default) { (action) -> Void in
self.updateScreenOverride(true)
#if DEBUG
print("Yes action: \(action)")
#endif
}

alertController.addAction(yesAction)

if #available(iOS 9.0, *) {
alertController.preferredAction = yesAction
}


var noString = " "
if (site!.overrideScreenLock == false) {
noString = checkEmoji
}
let noAction = UIAlertAction(title: "\(noString)\(Constants.LocalizedString.generalNoLabel.localized)", style: UIAlertActionStyle.Default) { (action) -> Void in

let noAction = UIAlertAction(title: "\(noString)\(Constants.LocalizedString.generalNoLabel.localized)", style: .Destructive) { (action) -> Void in
self.updateScreenOverride(false)
#if DEBUG
print("No action: \(action)")
#endif
}
alertController.addAction(noAction)

alertController.view.tintColor = NSAssetKit.darkNavColor

self.view.window?.tintColor = nil

// Resolving Incident with Identifier: 1169918A-77AC-4D15-8610-E62C1D74E386
// Crash in UIPopoverPresentationController
if let popoverController = alertController.popoverPresentationController {
popoverController.barButtonItem = sender
}

self.presentViewController(alertController, animated: true) {
#if DEBUG
print("presentViewController: \(alertController.debugDescription)")
Expand Down
5 changes: 4 additions & 1 deletion Nightscouter/SiteListTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ class SiteListTableViewController: UITableViewController, NightscoutAPIClientDel
func presentAlertDialog(siteURL:NSURL, index: Int, error: NSError) {

let alertController = UIAlertController(title: Constants.LocalizedString.uiAlertBadSiteTitle.localized, message: String(format: Constants.LocalizedString.uiAlertBadSiteMessage.localized, siteURL, error.localizedDescription), preferredStyle: .Alert)
alertController.view.tintColor = NSAssetKit.darkNavColor

let cancelAction = UIAlertAction(title: Constants.LocalizedString.generalCancelLabel.localized, style: .Cancel) { (action) in
// ...
Expand Down Expand Up @@ -414,6 +413,10 @@ class SiteListTableViewController: UITableViewController, NightscoutAPIClientDel
}
alertController.addAction(removeAction)

alertController.view.tintColor = NSAssetKit.darkNavColor

self.view.window?.tintColor = nil

self.navigationController?.popToRootViewControllerAnimated(true)

self.presentViewController(alertController, animated: true) {
Expand Down
15 changes: 14 additions & 1 deletion NightscouterKit/Models/ServerConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,20 @@ public extension ServerConfiguration {

if let settingsDictionary = root[ConfigurationPropertyKey.settingsKey] as? [String: AnyObject] {
let units = Units(rawValue: (settingsDictionary[ConfigurationPropertyKey.unitsKey] as! String).lowercaseString)!
let timeFormat = Int((settingsDictionary[ConfigurationPropertyKey.timeFormatKey] as! String))!


var timeFormat: Int = 12

if let stringTimeFormat = settingsDictionary[ConfigurationPropertyKey.timeFormatKey] as? String {
timeFormat = Int(stringTimeFormat)!
}


if let intTimeFormat = settingsDictionary[ConfigurationPropertyKey.timeFormatKey] as? Int {
timeFormat = intTimeFormat
}


let nightMode = settingsDictionary[ConfigurationPropertyKey.nightModeKey] as! Bool
let showRawbg = RawBGMode(rawValue: settingsDictionary[ConfigurationPropertyKey.showRawbgKey] as! String)!
let customTitle = settingsDictionary[ConfigurationPropertyKey.customTitleKey] as! String
Expand Down
2 changes: 1 addition & 1 deletion NightscouterToday/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>135</string>
<string>138</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionMainStoryboard</key>
Expand Down

0 comments on commit df117a7

Please sign in to comment.