diff --git a/MobileTrailer/PocketTrailer-Info.plist b/MobileTrailer/PocketTrailer-Info.plist index e194c299..01222b0b 100644 --- a/MobileTrailer/PocketTrailer-Info.plist +++ b/MobileTrailer/PocketTrailer-Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.2.2 + 1.2.3 CFBundleSignature ???? CFBundleVersion - 1187 + 1188 LSRequiresIPhoneOS UIBackgroundModes diff --git a/Shared/DataManager.swift b/Shared/DataManager.swift index e8ad5564..dc3d410a 100644 --- a/Shared/DataManager.swift +++ b/Shared/DataManager.swift @@ -109,22 +109,32 @@ class DataManager : NSObject { c.postSyncAction = PostSyncAction.DoNothing.rawValue } + var latestStatuses = PRStatus.newItemsOfType("PRStatus", inMoc: mainObjectContext) as [PRStatus] if(Settings.notifyOnStatusUpdates) { - var latestStatuses = PRStatus.newItemsOfType("PRStatus", inMoc: mainObjectContext) as [PRStatus] let coveredPrs = NSMutableSet() for s in latestStatuses { if Settings.notifyOnStatusUpdatesForAllPrs || s.pullRequest.isMine() { let pr = s.pullRequest if !coveredPrs.containsObject(pr) { if let s = pr.displayedStatuses().first { - app.postNotificationOfType(PRNotificationType.NewStatus, forItem: s) - } + let displayText = s.displayText() + if pr.lastStatusNotified != displayText && pr.postSyncAction?.integerValue != PostSyncAction.NoteNew.rawValue { + app.postNotificationOfType(PRNotificationType.NewStatus, forItem: s) + pr.lastStatusNotified = displayText + } + } else { + pr.lastStatusNotified = nil + } coveredPrs.addObject(pr) } } } } + for s in latestStatuses { + s.postSyncAction = PostSyncAction.DoNothing.rawValue + } + for p in allTouchedPrs { p.postSyncAction = PostSyncAction.DoNothing.rawValue } diff --git a/Shared/PullRequest.swift b/Shared/PullRequest.swift index f767953b..d0f35e73 100644 --- a/Shared/PullRequest.swift +++ b/Shared/PullRequest.swift @@ -38,6 +38,7 @@ class PullRequest: DataItem { @NSManaged var userId: NSNumber? @NSManaged var userLogin: String? @NSManaged var webUrl: String? + @NSManaged var lastStatusNotified: String? @NSManaged var comments: NSSet @NSManaged var labels: NSSet diff --git a/Shared/Trailer.xcdatamodeld/.xccurrentversion b/Shared/Trailer.xcdatamodeld/.xccurrentversion index f8eb6211..09100195 100644 --- a/Shared/Trailer.xcdatamodeld/.xccurrentversion +++ b/Shared/Trailer.xcdatamodeld/.xccurrentversion @@ -3,6 +3,6 @@ _XCCurrentVersionName - Trailer 19.xcdatamodel + Trailer 20.xcdatamodel diff --git a/Shared/Trailer.xcdatamodeld/Trailer 19.xcdatamodel/contents b/Shared/Trailer.xcdatamodeld/Trailer 19.xcdatamodel/contents index c7bb80ca..c87bf2e0 100644 --- a/Shared/Trailer.xcdatamodeld/Trailer 19.xcdatamodel/contents +++ b/Shared/Trailer.xcdatamodeld/Trailer 19.xcdatamodel/contents @@ -1,5 +1,5 @@ - + @@ -134,7 +134,7 @@ - + \ No newline at end of file diff --git a/Shared/Trailer.xcdatamodeld/Trailer 20.xcdatamodel/contents b/Shared/Trailer.xcdatamodeld/Trailer 20.xcdatamodel/contents new file mode 100644 index 00000000..5878dbff --- /dev/null +++ b/Shared/Trailer.xcdatamodeld/Trailer 20.xcdatamodel/contents @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Trailer.xcodeproj/project.pbxproj b/Trailer.xcodeproj/project.pbxproj index 18949f91..37732a4a 100644 --- a/Trailer.xcodeproj/project.pbxproj +++ b/Trailer.xcodeproj/project.pbxproj @@ -121,6 +121,7 @@ 1628A6CA18789E73005EDA69 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 1628A6D518789E73005EDA69 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 162A29D81A4085FD008F41A9 /* API.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; name = API.swift; path = Shared/API.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; + 163D1F7F1AAFA54800E080D7 /* Trailer 20.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Trailer 20.xcdatamodel"; sourceTree = ""; }; 164785A91A2CE7BD00297764 /* Globals.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; name = Globals.swift; path = Shared/Globals.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 164785AC1A2CE7CD00297764 /* NSDictionaryExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NSDictionaryExtensions.swift; path = Shared/NSDictionaryExtensions.swift; sourceTree = ""; }; 164785AD1A2CE7CD00297764 /* NSStringExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NSStringExtensions.swift; path = Shared/NSStringExtensions.swift; sourceTree = ""; }; @@ -814,6 +815,7 @@ 16B3B33B1A34E990000BE6CC /* Trailer.xcdatamodeld */ = { isa = XCVersionGroup; children = ( + 163D1F7F1AAFA54800E080D7 /* Trailer 20.xcdatamodel */, 16B3B33C1A34E990000BE6CC /* Trailer 10.xcdatamodel */, 16B3B33D1A34E990000BE6CC /* Trailer 11.xcdatamodel */, 16B3B33E1A34E990000BE6CC /* Trailer 12.xcdatamodel */, @@ -834,7 +836,7 @@ 16B3B34D1A34E990000BE6CC /* Trailer 9.xcdatamodel */, 16B3B34E1A34E990000BE6CC /* Trailer.xcdatamodel */, ); - currentVersion = 16B3B3451A34E990000BE6CC /* Trailer 19.xcdatamodel */; + currentVersion = 163D1F7F1AAFA54800E080D7 /* Trailer 20.xcdatamodel */; name = Trailer.xcdatamodeld; path = ../Shared/Trailer.xcdatamodeld; sourceTree = ""; diff --git a/Trailer/Base.lproj/MainMenu.xib b/Trailer/Base.lproj/MainMenu.xib index efa64919..dd592ba6 100644 --- a/Trailer/Base.lproj/MainMenu.xib +++ b/Trailer/Base.lproj/MainMenu.xib @@ -1,8 +1,8 @@ - + - + @@ -934,7 +934,7 @@ user you can add more servers from the left. - + @@ -1311,7 +1311,6 @@ Enter to select and ⌘, for preferences. - diff --git a/Trailer/OSX_AppDelegate.swift b/Trailer/OSX_AppDelegate.swift index 96db1260..f708c8c0 100644 --- a/Trailer/OSX_AppDelegate.swift +++ b/Trailer/OSX_AppDelegate.swift @@ -272,7 +272,7 @@ class OSX_AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate, NSUser Settings.disableAllCommentNotifications = (sender.integerValue==1) } - @IBAction func notifyOnStatusUpdates(sender: NSButton) { + @IBAction func notifyOnStatusUpdatesSelected(sender: NSButton) { Settings.notifyOnStatusUpdates = (sender.integerValue==1) } diff --git a/Trailer/Trailer-Info.plist b/Trailer/Trailer-Info.plist index 61bc844d..663dbe29 100644 --- a/Trailer/Trailer-Info.plist +++ b/Trailer/Trailer-Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.2.2 + 1.2.3 CFBundleSignature ???? CFBundleVersion - 1187 + 1188 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion