Skip to content

Commit

Permalink
Add an Info preference tab to show feedback, faqs and rate on store b…
Browse files Browse the repository at this point in the history
…uttons
  • Loading branch information
ashchan committed Oct 8, 2014
1 parent b3c611d commit a1abbbe
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 14 deletions.
8 changes: 8 additions & 0 deletions Classes/GNApplicationController.m
Expand Up @@ -84,6 +84,14 @@ - (IBAction)rateOnAppStore:(id)sender {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://itunes.apple.com/app/gmail-notifr/id808154494?ls=1&mt=12"]];
}

- (void)showFAQs:(id)sender {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://assets.ashchan.com/gmailnotifr/faq.html"]];
}

- (void)showFeedback:(id)sender {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://blog.ashchan.com/archive/2008/10/29/gmail-notifr-changelog/"]];
}

- (void)checkAccount:(id)sender {
GNAccount *account = [self accountForGuid:[sender representedObject]];
[[self checkerForAccount:account] reset];
Expand Down
1 change: 1 addition & 0 deletions Classes/GNPreferences.m
Expand Up @@ -13,6 +13,7 @@

NSString *const PrefsToolbarItemAccounts = @"prefsToolbarItemAccounts";
NSString *const PrefsToolbarItemSettings = @"prefsToolbarItemSettings";
NSString *const PrefsToolbarItemInfo = @"prefsToolbarItemInfo";
NSString *const GNPreferencesSelection = @"PreferencesSelection";
NSString *const GNShowUnreadCountChangedNotification = @"GNShowUnreadCountChangedNotification";
NSString *const GNAccountAddedNotification = @"GNAccountAddedNotification";
Expand Down
4 changes: 3 additions & 1 deletion Classes/GNPreferencesController.m
Expand Up @@ -10,6 +10,7 @@
#import "GNPreferencesController.h"
#import "PrefsAccountsViewController.h"
#import "PrefsSettingsViewController.h"
#import "PrefsInfoViewController.h"
#import "GNPreferences.h"

@interface GNPreferencesController () <NSToolbarDelegate, NSWindowDelegate>
Expand All @@ -29,7 +30,8 @@ + (GNPreferencesController *)sharedController {
controller = [[GNPreferencesController alloc] init];
controller.modules = @[
[[PrefsAccountsViewController alloc] init],
[[PrefsSettingsViewController alloc] init]
[[PrefsSettingsViewController alloc] init],
[[PrefsInfoViewController alloc] init]
];
});

Expand Down
16 changes: 16 additions & 0 deletions Classes/PrefsInfoViewController.h
@@ -0,0 +1,16 @@
//
// PrefsInfoViewController.h
// Mail Notifr
//
// Created by James Chen on 10/8/14.
// Copyright (c) 2014 ashchan.com. All rights reserved.
//

@import Cocoa;

@interface PrefsInfoViewController : NSViewController

- (NSString *)identifier;
- (NSImage *)image;

@end
36 changes: 36 additions & 0 deletions Classes/PrefsInfoViewController.m
@@ -0,0 +1,36 @@
//
// PrefsInfoViewController.m
// Mail Notifr
//
// Created by James Chen on 10/8/14.
// Copyright (c) 2014 ashchan.com. All rights reserved.
//

#import "PrefsInfoViewController.h"

@interface PrefsInfoViewController ()

@end

@implementation PrefsInfoViewController

- (id)init {
if (self = [super initWithNibName:@"PreferencesInfo" bundle:nil]) {
}

return self;
}

- (NSString *)title {
return NSLocalizedString(@"Info", nil);
}

- (NSString *)identifier {
return PrefsToolbarItemInfo;
}

- (NSImage *)image {
return [NSImage imageNamed:NSImageNameInfo];
}

@end
1 change: 1 addition & 0 deletions GmailNotifr_Prefix.pch
Expand Up @@ -12,6 +12,7 @@

extern NSString *const PrefsToolbarItemAccounts;
extern NSString *const PrefsToolbarItemSettings;
extern NSString *const PrefsToolbarItemInfo;
extern NSString *const GNPreferencesSelection;
extern NSString *const GNShowUnreadCountChangedNotification;
extern NSString *const GNAccountAddedNotification;
Expand Down
14 changes: 12 additions & 2 deletions Mail Notifr.xcodeproj/project.pbxproj
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
1A05D19319E55C85002698B7 /* PrefsInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A05D19219E55C85002698B7 /* PrefsInfoViewController.m */; };
1A05D19819E55DAB002698B7 /* PreferencesInfo.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1A05D19719E55DAB002698B7 /* PreferencesInfo.xib */; };
1A69C08A18DEED8700047BD0 /* GNAccountMenuController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A69C08918DEED8700047BD0 /* GNAccountMenuController.m */; };
1A8F667016B5817000396E44 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A8F666F16B5817000396E44 /* main.m */; };
1A8F66A516B5FBB400396E44 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1A8F66A316B5FBB400396E44 /* MainMenu.xib */; };
Expand Down Expand Up @@ -59,6 +61,9 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
1A05D19119E55C85002698B7 /* PrefsInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PrefsInfoViewController.h; path = Classes/PrefsInfoViewController.h; sourceTree = "<group>"; };
1A05D19219E55C85002698B7 /* PrefsInfoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PrefsInfoViewController.m; path = Classes/PrefsInfoViewController.m; sourceTree = "<group>"; };
1A05D19719E55DAB002698B7 /* PreferencesInfo.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = PreferencesInfo.xib; path = Resources/PreferencesInfo.xib; sourceTree = "<group>"; };
1A3A772718FCB020002F61E6 /* Finnish */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = Finnish; path = Resources/Finnish.lproj/Localizable.strings; sourceTree = "<group>"; };
1A69C08818DEED8700047BD0 /* GNAccountMenuController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GNAccountMenuController.h; path = Classes/GNAccountMenuController.h; sourceTree = "<group>"; };
1A69C08918DEED8700047BD0 /* GNAccountMenuController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GNAccountMenuController.m; path = Classes/GNAccountMenuController.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -202,6 +207,8 @@
1AB7FE4616B57B9C0040BBCE /* PrefsAccountsViewController.m */,
1AB7FE4716B57B9C0040BBCE /* PrefsSettingsViewController.h */,
1AB7FE4816B57B9C0040BBCE /* PrefsSettingsViewController.m */,
1A05D19119E55C85002698B7 /* PrefsInfoViewController.h */,
1A05D19219E55C85002698B7 /* PrefsInfoViewController.m */,
);
name = Controllers;
sourceTree = "<group>";
Expand All @@ -213,6 +220,7 @@
1AB7FE3816B57B630040BBCE /* AccountDetail.xib */,
1AB7FE3916B57B630040BBCE /* PreferencesAccounts.xib */,
1AB7FE3A16B57B630040BBCE /* PreferencesSettings.xib */,
1A05D19719E55DAB002698B7 /* PreferencesInfo.xib */,
1AAB5C9418FFF04C0020A73E /* GNSecureTextField.h */,
1AAB5C9518FFF04C0020A73E /* GNSecureTextField.m */,
);
Expand Down Expand Up @@ -356,6 +364,7 @@
1AB7FE3B16B57B630040BBCE /* AccountDetail.xib in Resources */,
1ACD6FF01897FE3C00103E15 /* Images.xcassets in Resources */,
1AB7FE3C16B57B630040BBCE /* PreferencesAccounts.xib in Resources */,
1A05D19819E55DAB002698B7 /* PreferencesInfo.xib in Resources */,
1AB7FE3D16B57B630040BBCE /* PreferencesSettings.xib in Resources */,
1AB7FF0116B57D280040BBCE /* Credits.html in Resources */,
1AB7FF0616B57D510040BBCE /* InfoPlist.strings in Resources */,
Expand Down Expand Up @@ -428,6 +437,7 @@
1A69C08A18DEED8700047BD0 /* GNAccountMenuController.m in Sources */,
1AB7FE5A16B57BAD0040BBCE /* GNChecker.m in Sources */,
1AB7FE5B16B57BAD0040BBCE /* GNPreferences.m in Sources */,
1A05D19319E55C85002698B7 /* PrefsInfoViewController.m in Sources */,
1AB7FE5C16B57BAD0040BBCE /* GNSound.m in Sources */,
1A8F667016B5817000396E44 /* main.m in Sources */,
);
Expand Down Expand Up @@ -546,7 +556,7 @@
INFOPLIST_FILE = Info.plist;
MACOSX_DEPLOYMENT_TARGET = 10.8;
PRODUCT_NAME = "Mail Notifr";
PROVISIONING_PROFILE = "894D18E5-48D0-482D-AB82-F7C20068F474";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
};
name = Debug;
Expand All @@ -568,7 +578,7 @@
INFOPLIST_FILE = Info.plist;
MACOSX_DEPLOYMENT_TARGET = 10.8;
PRODUCT_NAME = "Mail Notifr";
PROVISIONING_PROFILE = "058C6811-ADA3-4534-8A4C-13CE925C78CF";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
};
name = Release;
Expand Down
15 changes: 4 additions & 11 deletions Resources/English.lproj/MainMenu.xib
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5053" systemVersion="13D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6249" systemVersion="14A386a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1070" defaultVersion="1080" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5053"/>
<deployment version="1070" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6249"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication"/>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application">
<customObject id="-3" userLabel="Application" customClass="NSObject">
<connections>
<outlet property="delegate" destination="381" id="535"/>
</connections>
Expand All @@ -28,12 +28,6 @@
<action selector="showPreferencesWindow:" target="381" id="461"/>
</connections>
</menuItem>
<menuItem title="Rate on App Store" id="nWA-5p-u1X">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="rateOnAppStore:" target="381" id="lVa-SA-Oo6"/>
</connections>
</menuItem>
<menuItem title="About Mail Notifr" id="378">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
Expand All @@ -56,7 +50,6 @@
<outlet property="menuItemCheckAll" destination="384" id="537"/>
<outlet property="menuItemPreferences" destination="385" id="540"/>
<outlet property="menuItemQuit" destination="376" id="541"/>
<outlet property="menuItemRate" destination="nWA-5p-u1X" id="T9q-yg-63w"/>
</connections>
</customObject>
<userDefaultsController representsSharedInstance="YES" id="404" userLabel="Shared User Defaults Controller"/>
Expand Down
52 changes: 52 additions & 0 deletions Resources/PreferencesInfo.xib
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6249" systemVersion="14A386a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6249"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="PrefsInfoViewController">
<connections>
<outlet property="view" destination="c22-O7-iKe" id="NSQ-FW-1eM"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="c22-O7-iKe" userLabel="Info">
<rect key="frame" x="0.0" y="0.0" width="450" height="143"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="j2o-4S-Bto">
<rect key="frame" x="14" y="54" width="180" height="32"/>
<buttonCell key="cell" type="push" title="Help &amp; FAQs" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Iil-Lq-cti">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="showFAQs:" target="-1" id="xGB-CB-M7V"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Jmb-qT-h67">
<rect key="frame" x="14" y="95" width="180" height="32"/>
<buttonCell key="cell" type="push" title="Feedback" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="hzA-y9-Me0">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="showFeedback:" target="-1" id="Bfo-dA-LXc"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rtg-nQ-Xk6">
<rect key="frame" x="14" y="13" width="180" height="32"/>
<buttonCell key="cell" type="push" title="Rate on App Store" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="FaP-9a-HPl">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="rateOnAppStore:" target="-1" id="EsH-b0-emg"/>
</connections>
</button>
</subviews>
</customView>
</objects>
</document>

0 comments on commit a1abbbe

Please sign in to comment.