Skip to content

Commit

Permalink
quit app when closing the window
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenjust committed Sep 29, 2015
1 parent 5b06dfe commit 19207bd
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 2 deletions.
Binary file added .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions PocketCast.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Developer ID Application";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = PocketCast/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "PocketCast/PocketCast-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
Expand All @@ -378,10 +380,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Developer ID Application";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = PocketCast/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "PocketCast/PocketCast-Bridging-Header.h";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>D46A4259-B41E-4732-8B4B-5C19B794942D</string>
<key>IDESourceControlProjectName</key>
<string>PocketCast</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>FB35BDA47E01C0344BEBE5194DBEDEA161342D8C</key>
<string>https://github.com/mortenjust/PocketCastsOSX.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>PocketCast.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>FB35BDA47E01C0344BEBE5194DBEDEA161342D8C</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/mortenjust/PocketCastsOSX.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>FB35BDA47E01C0344BEBE5194DBEDEA161342D8C</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>FB35BDA47E01C0344BEBE5194DBEDEA161342D8C</string>
<key>IDESourceControlWCCName</key>
<string>PocketCastsOSX</string>
</dict>
</array>
</dict>
</plist>
Binary file not shown.
4 changes: 4 additions & 0 deletions PocketCast/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}

func applicationShouldTerminateAfterLastWindowClosed(sender: NSApplication) -> Bool {
return true;

This comment has been minimized.

Copy link
@stuartjmoore

stuartjmoore Oct 23, 2015

If I close the window to do other things while I listen, the app will quit and stop playing? That seems user hostile.

A better option may be to reopen the window when clicking on the app icon: stuartjmoore@0ddca28#diff-2bc9946b23e63f4280ca7434016e9517R42

This comment has been minimized.

Copy link
@mortenjust

mortenjust Oct 25, 2015

Author Owner

You can still minimize or just unfocus the window and it will keep playing. I think it makes sense to follow the norm for non-documents based apps here

}

func gotNotification(notification : NSNotification){
let u = notification.userInfo as! Dictionary<String,String>

Expand Down
4 changes: 2 additions & 2 deletions PocketCast/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<string>1.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>10</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
Expand Down

0 comments on commit 19207bd

Please sign in to comment.