Skip to content

Commit

Permalink
Minor updates to subscribe window UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
GetToSet committed Mar 12, 2022
1 parent 926f4d8 commit fb58f26
Show file tree
Hide file tree
Showing 17 changed files with 792 additions and 4 deletions.
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug Report
about: Report a bug to help us improve Doughnut.
title: ""
labels: ""
assignees: ""
---

<!-- Thank you for using Doughnut!
If you encounter crashes, use the dedicated template for crash reports:
* https://github.com/dyerc/Doughnut/issues/new?template=crash_report.md
-->

## Steps to Reproduce:

<!-- Please include full steps so that we can reproduce your problem. -->

1. ... <!-- Describe steps to demonstrate bug -->
2. ...
3. ...

**Expected results:** <!-- What did you expect to see? -->

**Actual results:** <!-- What did you see? -->

## Additional Information:

<!-- Please complete the following information -->

- Doughnut Version: [e.g. 1.1.1 (58)]
- macOS Version: [e.g. 12.3 (21E230)]
- Safari Version: [e.g. 15.4 (17613.1.17.1.6)]

<!--
Consider also attaching screenshots and/or videos to better illustrate the issue.
You can drag to upload them directly on GitHub.
-->
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/crash_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Crash Report
about: Report a crash problem.
title: "Crash: "
labels: ""
assignees: ""
---

<!-- Thank you for using Doughnut! -->

## Steps to Reproduce:

<!-- Please include full steps so that we can reproduce your problem. -->

1. ... <!-- Describe steps to reproduce the crash -->
2. ...
3. ...

**Crash Report:**

<details>
<summary>Crash Report</summary>
<!-- Paste the crash report here, between the backticks -->
```
```
</details>

## Additional Information:

<!-- Please complete the following information -->

- Safari Version: [e.g. 15.4 (17613.1.17.1.6)]

<!--
Consider also attaching screenshots and/or videos to better illustrate the issue.
You can drag to upload them directly on GitHub.
-->
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Feature Request
about: Suggest a new feature for Doughnut.
title: "FR: "
labels: ""
assignees: ""
---

<!-- Thank you for using Doughnut!
Please briefly describe what you would like Doughnut to be able to do.
-->
34 changes: 33 additions & 1 deletion Doughnut.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@
5E0288D17E6858855545E02E /* Pods_DoughnutTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BE29F62CFF7B122D5C39998 /* Pods_DoughnutTests.framework */; };
6B0233BD27B2CA6500500E28 /* ControlMenuProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B0233BC27B2CA6500500E28 /* ControlMenuProvider.swift */; };
6B0605C52788627D00A8A91E /* NSMenu+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B0605C42788627D00A8A91E /* NSMenu+Extensions.swift */; };
6B193AA427A286B800DB1379 /* ModalSheetSegue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B193AA327A286B800DB1379 /* ModalSheetSegue.swift */; };
6B36624627CFB339008E1CA5 /* NSImage+Tint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B36624527CFB339008E1CA5 /* NSImage+Tint.swift */; };
6B3A75F8278F44F500F25578 /* NSView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B3A75F7278F44F500F25578 /* NSView+Extensions.swift */; };
6B5B39A327A448BF00234D82 /* NSButton+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B5B39A227A448BF00234D82 /* NSButton+Extensions.swift */; };
6B94DF4C278968F500BCB149 /* NSTableView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B94DF4B278968F500BCB149 /* NSTableView+Extensions.swift */; };
6B96F45D27CE6F10001941BA /* PodcastSearchField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B96F45C27CE6F10001941BA /* PodcastSearchField.swift */; };
6B9C30BB27B5708300D462BE /* BaseTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B9C30BA27B5708300D462BE /* BaseTableView.swift */; };
6B9E154727C9EA5F00C919D5 /* AppIcon_Big_Sur.icns in Resources */ = {isa = PBXBuildFile; fileRef = 6B9E154627C9EA5F00C919D5 /* AppIcon_Big_Sur.icns */; };
6BA21C4F279D690700CD3672 /* WindowController+Toolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BA21C4E279D690700CD3672 /* WindowController+Toolbar.swift */; };
6BA21C57279D74D400CD3672 /* CrashReportViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BA21C56279D74D400CD3672 /* CrashReportViewController.swift */; };
6BA21C59279D74DC00CD3672 /* CrashReport.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6BA21C58279D74DC00CD3672 /* CrashReport.storyboard */; };
6BA21C5C279D7A1100CD3672 /* CrashReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BA21C5B279D7A1100CD3672 /* CrashReporter.swift */; };
6BB11F9C27A29B6E009CBAF8 /* CrashReportWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BB11F9B27A29B6E009CBAF8 /* CrashReportWindowController.swift */; };
6BB5771E278602B400DFF99F /* MainMenu.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6BB5771C278602B400DFF99F /* MainMenu.storyboard */; };
6BC6395F27A6800500535897 /* Player+RemoteCommandCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC6395E27A6800500535897 /* Player+RemoteCommandCenter.swift */; };
6BC6396127A687E400535897 /* Player+NowPlayingInfoCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC6396027A687E400535897 /* Player+NowPlayingInfoCenter.swift */; };
Expand Down Expand Up @@ -103,15 +109,21 @@
5E1DC050EEE121FD033C44DF /* Pods-Doughnut.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Doughnut.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Doughnut/Pods-Doughnut.debug.xcconfig"; sourceTree = "<group>"; };
6B0233BC27B2CA6500500E28 /* ControlMenuProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ControlMenuProvider.swift; sourceTree = "<group>"; };
6B0605C42788627D00A8A91E /* NSMenu+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSMenu+Extensions.swift"; sourceTree = "<group>"; };
6B193AA327A286B800DB1379 /* ModalSheetSegue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalSheetSegue.swift; sourceTree = "<group>"; };
6B36624527CFB339008E1CA5 /* NSImage+Tint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSImage+Tint.swift"; sourceTree = "<group>"; };
6B3A75F7278F44F500F25578 /* NSView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSView+Extensions.swift"; sourceTree = "<group>"; };
6B3ACC982773555700CF1EF1 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = "<group>"; };
6B5B39A227A448BF00234D82 /* NSButton+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSButton+Extensions.swift"; sourceTree = "<group>"; };
6B730B732767A90900FB5F84 /* Doughnut-Release.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Doughnut-Release.entitlements"; sourceTree = "<group>"; };
6B94DF4B278968F500BCB149 /* NSTableView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSTableView+Extensions.swift"; sourceTree = "<group>"; };
6B96F45C27CE6F10001941BA /* PodcastSearchField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PodcastSearchField.swift; sourceTree = "<group>"; };
6B9C30BA27B5708300D462BE /* BaseTableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTableView.swift; sourceTree = "<group>"; };
6B9E154627C9EA5F00C919D5 /* AppIcon_Big_Sur.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = AppIcon_Big_Sur.icns; sourceTree = "<group>"; };
6BA21C4E279D690700CD3672 /* WindowController+Toolbar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WindowController+Toolbar.swift"; sourceTree = "<group>"; };
6BA21C56279D74D400CD3672 /* CrashReportViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrashReportViewController.swift; sourceTree = "<group>"; };
6BA21C58279D74DC00CD3672 /* CrashReport.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = CrashReport.storyboard; sourceTree = "<group>"; };
6BA21C5B279D7A1100CD3672 /* CrashReporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrashReporter.swift; sourceTree = "<group>"; };
6BB11F9B27A29B6E009CBAF8 /* CrashReportWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrashReportWindowController.swift; sourceTree = "<group>"; };
6BB5771D278602B400DFF99F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainMenu.storyboard; sourceTree = "<group>"; };
6BC6395E27A6800500535897 /* Player+RemoteCommandCenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Player+RemoteCommandCenter.swift"; sourceTree = "<group>"; };
6BC6396027A687E400535897 /* Player+NowPlayingInfoCenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Player+NowPlayingInfoCenter.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -221,6 +233,7 @@
6B0605BF2788624B00A8A91E /* Utilities */ = {
isa = PBXGroup;
children = (
6B193AA327A286B800DB1379 /* ModalSheetSegue.swift */,
6B0605C22788626600A8A91E /* Extensions */,
);
path = Utilities;
Expand All @@ -238,6 +251,7 @@
6B0605C32788626F00A8A91E /* AppKit */ = {
isa = PBXGroup;
children = (
6B5B39A227A448BF00234D82 /* NSButton+Extensions.swift */,
6B0605C42788627D00A8A91E /* NSMenu+Extensions.swift */,
6B94DF4B278968F500BCB149 /* NSTableView+Extensions.swift */,
6B3A75F7278F44F500F25578 /* NSView+Extensions.swift */,
Expand All @@ -246,6 +260,17 @@
name = AppKit;
sourceTree = "<group>";
};
6BB11F9A27A292A3009CBAF8 /* CrashReport */ = {
isa = PBXGroup;
children = (
6BA21C5B279D7A1100CD3672 /* CrashReporter.swift */,
6BB11F9B27A29B6E009CBAF8 /* CrashReportWindowController.swift */,
6BA21C56279D74D400CD3672 /* CrashReportViewController.swift */,
6BA21C58279D74DC00CD3672 /* CrashReport.storyboard */,
);
path = CrashReport;
sourceTree = "<group>";
};
6BC6396227A68E0C00535897 /* CoreMedia */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -370,10 +395,11 @@
83FB4EB61F7BD996001CD842 /* Library */,
831EBAD427CC0DA500F212B4 /* Player */,
83235BF5200945D900BC356F /* Preference */,
6B0605BF2788624B00A8A91E /* Utilities */,
830B15991F7B97250086C121 /* Views */,
83667DEE1F76D1F300F1ABC0 /* View Controllers */,
839DBDA51FEEE872007610EF /* Windows */,
6BB11F9A27A292A3009CBAF8 /* CrashReport */,
6B0605BF2788624B00A8A91E /* Utilities */,
838257CD1F759F6F00DB4FD1 /* AppDelegate.swift */,
83BA22E21F994EA6006BF58A /* DoughnutApp.swift */,
6B0233BC27B2CA6500500E28 /* ControlMenuProvider.swift */,
Expand Down Expand Up @@ -606,6 +632,7 @@
files = (
838257D21F759F6F00DB4FD1 /* Assets.xcassets in Resources */,
6BB5771E278602B400DFF99F /* MainMenu.storyboard in Resources */,
6BA21C59279D74DC00CD3672 /* CrashReport.storyboard in Resources */,
6BF126D12780727100D840A4 /* EpisodeInfo.storyboard in Resources */,
831EBADA27CC120000F212B4 /* Credits.rtf in Resources */,
6B9E154727C9EA5F00C919D5 /* AppIcon_Big_Sur.icns in Resources */,
Expand Down Expand Up @@ -783,8 +810,10 @@
buildActionMask = 2147483647;
files = (
8343426A1F802C1400913C0B /* EpisodeFilterViewController.swift in Sources */,
6B193AA427A286B800DB1379 /* ModalSheetSegue.swift in Sources */,
839A32811FF9831B002D2023 /* ShowEpisodeWindow.swift in Sources */,
8389709C20069D720094795D /* SortingMenuProvider.swift in Sources */,
6BA21C5C279D7A1100CD3672 /* CrashReporter.swift in Sources */,
83E95A5E1FFBCA3C00C6AABF /* Storage.swift in Sources */,
8341B83B1F7BEB0500B50A5D /* Migrations.swift in Sources */,
6B9C30BB27B5708300D462BE /* BaseTableView.swift in Sources */,
Expand All @@ -793,17 +822,20 @@
6BC6395F27A6800500535897 /* Player+RemoteCommandCenter.swift in Sources */,
83D9710C1F812E910091822A /* PlayerView.swift in Sources */,
83235C042009473200BC356F /* PrefLibraryViewController.swift in Sources */,
6B5B39A327A448BF00234D82 /* NSButton+Extensions.swift in Sources */,
6B0605C52788627D00A8A91E /* NSMenu+Extensions.swift in Sources */,
6BA21C4F279D690700CD3672 /* WindowController+Toolbar.swift in Sources */,
839DBDA41FEEE658007610EF /* ShowPodcastWindow.swift in Sources */,
6B0233BD27B2CA6500500E28 /* ControlMenuProvider.swift in Sources */,
83D9710A1F812B270091822A /* Player.swift in Sources */,
6BA21C57279D74D400CD3672 /* CrashReportViewController.swift in Sources */,
837D52C01F8E683200C17514 /* DownloadCellView.swift in Sources */,
83DB16E11F93FB460062B266 /* SubscribeViewController.swift in Sources */,
83504DD61FFC377700375BA0 /* EpisodeDownloadTask.swift in Sources */,
83BA22E31F994EA6006BF58A /* DoughnutApp.swift in Sources */,
832A04341F76EBDC00C92D25 /* WindowController.swift in Sources */,
6B94DF4C278968F500BCB149 /* NSTableView+Extensions.swift in Sources */,
6BB11F9C27A29B6E009CBAF8 /* CrashReportWindowController.swift in Sources */,
830B159B1F7B97910086C121 /* PodcastCellView.swift in Sources */,
83235C072009473500BC356F /* PrefPlaybackViewController.swift in Sources */,
830E99BD1FF50DD000B728BE /* ActivityIndicator.swift in Sources */,
Expand Down
42 changes: 40 additions & 2 deletions Doughnut/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import MASPreferences

private extension NSUserInterfaceItemIdentifier {

static let doughnutMainMenuDebug = Self("NSDoughnutMainMenuDebug")

static let doughnutViewMenuSortPodcasts = Self("NSDoughnutViewMenuSortPodcastsItem")
static let doughnutViewMenuSortEpisodes = Self("NSDoughnutViewMenuSortEpisodesItem")
static let doughnutControlMenu = Self("NSDoughnutControlMenuItem")
Expand All @@ -41,14 +43,23 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
], title: nil)
}()

private lazy var crashReportWindowController: CrashReportWindowController? = {
return CrashReportWindowController.instantiateFromMainStoryboard()
}()

override init() {
NSWindow.allowsAutomaticWindowTabbing = false
}

func applicationDidFinishLaunching(_ aNotification: Notification) {
// Register NSMenuDelegate for all main menu items
NSApp.mainMenu?.items.forEach {
$0.submenu?.delegate = self
NSApp.mainMenu?.items.forEach { item in
if item.identifier == .doughnutMainMenuDebug {
#if !DEBUG
item.isHidden = !Preference.bool(for: .debugMenuEnabled)
#endif
}
item.submenu?.delegate = self
}

UserDefaults.standard.register(defaults: Preference.defaultPreference)
Expand All @@ -61,6 +72,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate {

createAndShowMainWindow()

showCrashReportWindowIfNeeded()

let connected = Library.global.connect()

if !connected {
Expand Down Expand Up @@ -142,6 +155,31 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
assert(false, "This menu item is to be implemented: \(#function)")
}

@IBAction func forceCrash(_ sender: AnyObject) {
CrashReporter.shared.forceCrash()
}

}

extension AppDelegate {

@discardableResult
private func showCrashReportWindowIfNeeded() -> Bool {
guard
let crashContent = CrashReporter.shared.getPendingCrashReport(),
let crashReportWindowController = crashReportWindowController,
let crashReportWindow = crashReportWindowController.window
else {
return false
}

crashReportWindowController.setCrashContent(crashContent)

NSApp.runModal(for: crashReportWindow)

return true
}

}

extension AppDelegate: NSMenuDelegate {
Expand Down
13 changes: 13 additions & 0 deletions Doughnut/Base.lproj/MainMenu.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,19 @@ CA
</items>
</menu>
</menuItem>
<menuItem title="Debug" id="Hwi-3h-UUh">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Debug" identifier="NSDoughnutMainMenuDebug" id="G8T-am-4h4">
<items>
<menuItem title="Force Crash" id="3HW-XB-yuZ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="forceCrash:" target="Voe-Tx-rLC" id="Rdo-Iq-6uW"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="wpr-3q-Mcd">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
Expand Down
Loading

0 comments on commit fb58f26

Please sign in to comment.