Skip to content

Commit

Permalink
~ Bug reporting only for bought version
Browse files Browse the repository at this point in the history
  • Loading branch information
buresdv committed Jul 12, 2024
1 parent b608da4 commit e928c2d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 28 deletions.
58 changes: 30 additions & 28 deletions Cork/CorkApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ struct CorkApp: App
do
{
let temporaryOutdatedPackageTracker: OutdatedPackageTracker = .init()

try await temporaryOutdatedPackageTracker.getOutdatedPackages(brewData: brewData)

var newOutdatedPackages = temporaryOutdatedPackageTracker.outdatedPackages

AppConstants.logger.debug("Outdated packages checker output: \(newOutdatedPackages, privacy: .public)")
Expand Down Expand Up @@ -421,41 +421,43 @@ struct CorkApp: App
@ViewBuilder
var bugReportingMenuBarSection: some View
{
Menu
{
Button
#if !SELF_COMPILED
Menu
{
NSWorkspace.shared.open(URL(string: "https://github.com/buresdv/Cork/issues/new?assignees=&labels=Bug&projects=&template=bug_report.md")!)
Button
{
NSWorkspace.shared.open(URL(string: "https://github.com/buresdv/Cork/issues/new?assignees=&labels=Bug&projects=&template=bug_report.md")!)
} label: {
Text("action.report-bugs.git-hub")
}

Button
{
let emailSubject = "Cork Error Report: v\(NSApplication.appVersion!)-\(NSApplication.buildVersion!)"
let emailBody = "This is what went wrong:\n\nThis is what I expected to happen:\n\nDid Cork crash?"

let emailService = NSSharingService(named: NSSharingService.Name.composeEmail)
emailService?.recipients = ["[email protected]"]
emailService?.subject = emailSubject
emailService?.perform(withItems: [emailBody])

} label: {
Text("action.report-bugs.email")
}

} label: {
Text("action.report-bugs.git-hub")
Text("action.report-bugs.menu-category")
}

Button
{
let emailSubject = "Cork Error Report: v\(NSApplication.appVersion!)-\(NSApplication.buildVersion!)"
let emailBody = "This is what went wrong:\n\nThis is what I expected to happen:\n\nDid Cork crash?"

let emailService = NSSharingService(named: NSSharingService.Name.composeEmail)
emailService?.recipients = ["[email protected]"]
emailService?.subject = emailSubject
emailService?.perform(withItems: [emailBody])

NSWorkspace.shared.open(URL(string: "https://forum.corkmac.app/t/cork")!)
} label: {
Text("action.report-bugs.email")
Text("action.submit-feedback")
}

} label: {
Text("action.report-bugs.menu-category")
}

Button
{
NSWorkspace.shared.open(URL(string: "https://forum.corkmac.app/t/cork")!)
} label: {
Text("action.submit-feedback")
}

Divider()
Divider()
#endif
}

@ViewBuilder
Expand Down
4 changes: 4 additions & 0 deletions Cork/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -4335,6 +4335,7 @@
}
},
"action.report-bugs.email" : {
"extractionState" : "stale",
"localizations" : {
"cs" : {
"stringUnit" : {
Expand Down Expand Up @@ -4399,6 +4400,7 @@
}
},
"action.report-bugs.git-hub" : {
"extractionState" : "stale",
"localizations" : {
"cs" : {
"stringUnit" : {
Expand Down Expand Up @@ -4464,6 +4466,7 @@
},
"action.report-bugs.menu-category" : {
"comment" : "MARK: - Bug Reporting",
"extractionState" : "stale",
"localizations" : {
"cs" : {
"stringUnit" : {
Expand Down Expand Up @@ -4846,6 +4849,7 @@
}
},
"action.submit-feedback" : {
"extractionState" : "stale",
"localizations" : {
"cs" : {
"stringUnit" : {
Expand Down

0 comments on commit e928c2d

Please sign in to comment.