DaisyDisk Feedback Component
Objective-C Shell
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Demo Added Polish localization Jan 9, 2014
Design Updated screenshot stub Dec 15, 2014
Google Toolbox
Helpers Updated email validation regexp pattern Apr 9, 2018
Resources
Views Fixed leaks and compiler warnings Feb 12, 2017
.gitignore Ignore xccheckout file Aug 27, 2013
DFApplication.h
DFApplication.m
DFCrashReportWindowController.h
DFCrashReportWindowController.m Replaced dictionary literals with function that allows nil values Jan 29, 2017
DFFeedbackWindowController.h
DFFeedbackWindowController.m Added external default user email Sep 29, 2017
DFRelaunch.sh Minor renaming Dec 14, 2017
DFStyleSheet.h Tweaked the bounce icon Apr 16, 2013
DFStyleSheet.m Replaced dictionary literals with function that allows nil values Jan 29, 2017
DFSystemProfileDataType.h Tweaked Chinese Traditional locale Nov 14, 2016
MIT License.txt Added the crash reporter component Jun 26, 2012
ReadMe.markdown Updated reference images Dec 15, 2014

ReadMe.markdown

What's the buzz?

DFeedback (DaisyDisk Feedback) is a two-in-one component for providing user feedback:

It allows the user to send feedback and request support from within your app. Along with the message, the component can optionally send the user's e-mail and system configuration profile. Screenshot

It automatically catches all unhandled exceptions and shows a crash report window suggesting the user to send an anonymous crash report, along with the stack trace, system configuration profile and optional user comments. Screenshot

Usage

DFeedback is a package of source code files (Cocoa, Obj-C) that you need to add to your project.

The feedback window

First, call DFFeedbackWindowController initializeWithFeedbackUrl:systemProfileDataTypes: once to initialize the component and provide a URL for sending the feedback. (For example, in your NSApplicationDelegate applicationWillFinishLaunching:) Call one of DFFeedbackWindowController show* methods to display the feedback dialog.

The systemProfileDataTypes parameter allows to filter the system profile string, to remove long unnecessary parts, such as Printer Software. There is a hidden feature: if you hold OPT key when calling DFFeedbackWindowController showBugReport or DFFeedbackWindowController showFeatureRequest, or switching to Bug Report or Feature Request tabs, in other words, whenever the system profile begins fetching, you can gather the entire unfiltered profile. You can tell the user to do so if you happen to need the full profile instead of the filtered one.

The crash reporter

First, call DFCrashReporterWindowController initializeWithFeedbackUrl:updateUrl:icon:systemProfileDataTypes: once to initialize the component and provide a URL for sending the feedback. (For example, in your -NSApplicationDelegate applicationWillFinishLaunching:) Specify DFApplication class as the principle class in your application's Info.plist file. Or, if you already use your own application principal class subclassed from NSApplication, subclass it from the DFApplication class instead.

Use DFApplication isPortmortem flag: In your NSApplicationDelegate applicationShouldTerminateAfterLastWindowClosed:, if your app should normally quit on last window closed, but not so after a crash, when the crash reporter will forcedly close all windows and show the report window, like this:

(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)application
            {
                // don't quit at this point and allow the crash reporter to show first
                return ![(DFApplication*)NSApp isPostmortem];
            }

In your application delegate's NSUserInterfaceValidations validateUserInterfaceItem:, in order to disable all (or some) menu items while the app is being terminated due to an uncaught exception (no need to do the same in window delegates, because all windows will be forcedly closed by the crash reporter), like this:

            (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item
            {
                // disable all menu items while showing the crash reporter
                if ([(DFApplication*)NSApp isPostmortem])
                {
                    return NO;
                }
                …
            }

Note the +[DFApplication ignoreExceptionsWhoseStackTraceContains:] method. You can use it to absorb certain exceptions in case if their stack trace contains either of the specified strings. This is useful to avoid crashing on exceptions in third-party components.

The two above components are independent on each other, you can use any or both of them.

If you want to do some fine-tuning, there is DFStyleSheet.m file containing some appearance/behavior constants.

Don't forget to link to the following frameworks:

  • QuatzCore
  • AddressBook

Origin, credits and legal stuff

DFeedback was inspired by JRFeedbackProvider and FeedbackReporter, but totally rewritten from scratch (except maybe some tiny portions of code) to provide better experience.

The component is available under the terms of non-restrictive MIT license.

The stack trace for the crash reporter is obtained using the Google Toolbox for Mac.

Portions of the software may contain third party code distributed under other non-restrictive licenses.

Love DFeedback and use it in your own projects? Feel free to send us a link/screenshot.