Skip to content

Commit

Permalink
Dedicated “browser” class
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgio Calderolla committed May 4, 2014
1 parent 7a1df65 commit e0a881f
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 46 deletions.
13 changes: 7 additions & 6 deletions Base.lproj/UI.xib
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@
<outlet property="window" destination="552" id="Y5a-sh-KWH"/>
</connections>
</customObject>
<customObject id="0bd-Z3-ggh" userLabel="Browser" customClass="CTCBrowser"/>
<customObject id="599" customClass="SUUpdater"/>
<userDefaultsController representsSharedInstance="YES" id="658"/>
<menu autoenablesItems="NO" id="523">
<items>
<menuItem title="Launch ShowRSS website" id="524">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="browseService:" target="-3" id="Hxz-fq-N6b"/>
<action selector="browseService:" target="0bd-Z3-ggh" id="pwn-oH-6nE"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="531"/>
Expand Down Expand Up @@ -81,25 +82,25 @@
<menuItem title="Visit Catch's website" id="535">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="browseWebsite:" target="-3" id="0PC-io-xer"/>
<action selector="browseWebsite:" target="0bd-Z3-ggh" id="81M-az-HxY"/>
</connections>
</menuItem>
<menuItem title="Help me configure Catch" id="542">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="browseHelp:" target="-3" id="uiX-hE-Fwt"/>
<action selector="browseHelp:" target="0bd-Z3-ggh" id="xMW-QJ-68b"/>
</connections>
</menuItem>
<menuItem title="Request a feature" id="543">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="browseFeatureRequest:" target="-3" id="bQx-K5-9e8"/>
<action selector="browseFeatureRequest:" target="0bd-Z3-ggh" id="wvP-CT-Gzl"/>
</connections>
</menuItem>
<menuItem title="Report a problem with Catch" id="544">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="browseBugReport:" target="-3" id="CP2-Ao-TkC"/>
<action selector="browseBugReport:" target="0bd-Z3-ggh" id="BdU-90-Wwd"/>
</connections>
</menuItem>
<menuItem title="&lt;name and version>" enabled="NO" id="545">
Expand Down Expand Up @@ -402,7 +403,7 @@
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="browseHelp:" target="-3" id="Lx8-Td-NRe"/>
<action selector="browseHelp:" target="0bd-Z3-ggh" id="fCa-SF-aMY"/>
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="554">
Expand Down
26 changes: 0 additions & 26 deletions CTCApplication.m
Original file line number Diff line number Diff line change
@@ -1,34 +1,8 @@
#import "CTCApplication.h"
#import "CTCDefaults.h"


@implementation CTCApplication

- (IBAction)browseService:(id)sender {
// Launch the system browser, open the service (ShowRSS)
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:kCTCDefaultsServiceURL]];
}

- (IBAction)browseWebsite:(id)sender {
// Launch the system browser, open the applications's website
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:kCTCDefaultsApplicationWebsiteURL]];
}

- (IBAction)browseHelp:(id)sender {
// Launch the system browser, open the applications's on-line help
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:kCTCDefaultsApplicationHelpURL]];
}

- (IBAction)browseFeatureRequest:(id)sender {
// Launch the system browser, open the applications's feature request page
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:kCTCDefaultsApplicationFeatureRequestURL]];
}

- (IBAction)browseBugReport:(id)sender {
// Launch the system browser, open the applications's bug report page
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:kCTCDefaultsApplicationBugReportURL]];
}

/**
@brief Reimplement basic cut/copy/paste/undo/select all events
@see http://stackoverflow.com/questions/970707/cocoa-keyboard-shortcuts-in-dialog-without-an-edit-menu
Expand Down
6 changes: 6 additions & 0 deletions CTCBrowser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#import <Foundation/Foundation.h>


@interface CTCBrowser : NSObject

@end
32 changes: 32 additions & 0 deletions CTCBrowser.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#import "CTCBrowser.h"
#import "CTCDefaults.h"


@implementation CTCBrowser

- (IBAction)browseService:(id)sender {
// Launch the system browser, open the service (ShowRSS)
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:kCTCDefaultsServiceURL]];
}

- (IBAction)browseWebsite:(id)sender {
// Launch the system browser, open the applications's website
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:kCTCDefaultsApplicationWebsiteURL]];
}

- (IBAction)browseHelp:(id)sender {
// Launch the system browser, open the applications's on-line help
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:kCTCDefaultsApplicationHelpURL]];
}

- (IBAction)browseFeatureRequest:(id)sender {
// Launch the system browser, open the applications's feature request page
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:kCTCDefaultsApplicationFeatureRequestURL]];
}

- (IBAction)browseBugReport:(id)sender {
// Launch the system browser, open the applications's bug report page
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:kCTCDefaultsApplicationBugReportURL]];
}

@end
58 changes: 44 additions & 14 deletions Catch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
4403ACF41914041C002F286C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4403ACF31914041C002F286C /* Assets.xcassets */; };
441297D417FE285500E9E21E /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 448CC7E617FE1F840063D3FD /* Sparkle.framework */; };
4456EE611916D20000B3FF1A /* NSDate+TimeOfDayMath.m in Sources */ = {isa = PBXBuildFile; fileRef = 4456EE601916D20000B3FF1A /* NSDate+TimeOfDayMath.m */; };
4456EE651916F17F00B3FF1A /* CTCBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 4456EE641916F17F00B3FF1A /* CTCBrowser.m */; };
445D97A6191579C7006CD77C /* UI.strings in Resources */ = {isa = PBXBuildFile; fileRef = 445D97A4191579C7006CD77C /* UI.strings */; };
446298EB191655080045EC72 /* CTCPreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 446298EA191655080045EC72 /* CTCPreferencesController.m */; };
44717AA4191300B300580054 /* CTCDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 44717AA3191300B300580054 /* CTCDefaults.m */; };
Expand Down Expand Up @@ -95,6 +96,8 @@
4419CF37180627A900C77432 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = "<group>"; };
4456EE5F1916D20000B3FF1A /* NSDate+TimeOfDayMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+TimeOfDayMath.h"; sourceTree = "<group>"; };
4456EE601916D20000B3FF1A /* NSDate+TimeOfDayMath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+TimeOfDayMath.m"; sourceTree = "<group>"; };
4456EE631916F17F00B3FF1A /* CTCBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CTCBrowser.h; sourceTree = "<group>"; };
4456EE641916F17F00B3FF1A /* CTCBrowser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CTCBrowser.m; sourceTree = "<group>"; };
445D97A319157955006CD77C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UI.xib; sourceTree = "<group>"; };
445D97A5191579C7006CD77C /* ca */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/UI.strings; sourceTree = "<group>"; };
445D97A719157A2C006CD77C /* de */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/UI.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -154,20 +157,9 @@
080E96DDFE201D6D7F000001 /* Catch */ = {
isa = PBXGroup;
children = (
44EAD12C1916682D002C7443 /* CTCApplication.h */,
44EAD12D1916682D002C7443 /* CTCApplication.m */,
3803C7AC11C3DA9300FC08DB /* CTCAppDelegate.h */,
3803C7AD11C3DA9300FC08DB /* CTCAppDelegate.m */,
38D39B5E11C3A6E100C17C80 /* CTCMenuController.h */,
38D39B5F11C3A6E100C17C80 /* CTCMenuController.m */,
446298E9191655080045EC72 /* CTCPreferencesController.h */,
446298EA191655080045EC72 /* CTCPreferencesController.m */,
3803C7EA11C3E7AD00FC08DB /* CTCScheduler.h */,
3803C7EB11C3E7AD00FC08DB /* CTCScheduler.m */,
44717AA2191300B300580054 /* CTCDefaults.h */,
44717AA3191300B300580054 /* CTCDefaults.m */,
44717AA51913072200580054 /* CTCLoginItems.h */,
44717AA61913072200580054 /* CTCLoginItems.m */,
4456EE681916F1BB00B3FF1A /* Application */,
4456EE661916F1A600B3FF1A /* Controllers */,
4456EE671916F1B100B3FF1A /* Libraries */,
4456EE621916D2E700B3FF1A /* Categories */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97315FDCFA39411CA2CEA /* Supporting Files */,
Expand Down Expand Up @@ -239,6 +231,43 @@
name = Categories;
sourceTree = "<group>";
};
4456EE661916F1A600B3FF1A /* Controllers */ = {
isa = PBXGroup;
children = (
38D39B5E11C3A6E100C17C80 /* CTCMenuController.h */,
38D39B5F11C3A6E100C17C80 /* CTCMenuController.m */,
446298E9191655080045EC72 /* CTCPreferencesController.h */,
446298EA191655080045EC72 /* CTCPreferencesController.m */,
);
name = Controllers;
sourceTree = "<group>";
};
4456EE671916F1B100B3FF1A /* Libraries */ = {
isa = PBXGroup;
children = (
3803C7EA11C3E7AD00FC08DB /* CTCScheduler.h */,
3803C7EB11C3E7AD00FC08DB /* CTCScheduler.m */,
44717AA2191300B300580054 /* CTCDefaults.h */,
44717AA3191300B300580054 /* CTCDefaults.m */,
44717AA51913072200580054 /* CTCLoginItems.h */,
44717AA61913072200580054 /* CTCLoginItems.m */,
4456EE631916F17F00B3FF1A /* CTCBrowser.h */,
4456EE641916F17F00B3FF1A /* CTCBrowser.m */,
);
name = Libraries;
sourceTree = "<group>";
};
4456EE681916F1BB00B3FF1A /* Application */ = {
isa = PBXGroup;
children = (
44EAD12C1916682D002C7443 /* CTCApplication.h */,
44EAD12D1916682D002C7443 /* CTCApplication.m */,
3803C7AC11C3DA9300FC08DB /* CTCAppDelegate.h */,
3803C7AD11C3DA9300FC08DB /* CTCAppDelegate.m */,
);
name = Application;
sourceTree = "<group>";
};
44717AC61913A08700580054 /* CatchFeedHelper */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -397,6 +426,7 @@
8D11072D0486CEB800E47090 /* main.m in Sources */,
4456EE611916D20000B3FF1A /* NSDate+TimeOfDayMath.m in Sources */,
44EAD12E1916682D002C7443 /* CTCApplication.m in Sources */,
4456EE651916F17F00B3FF1A /* CTCBrowser.m in Sources */,
44717AA4191300B300580054 /* CTCDefaults.m in Sources */,
38D39B6011C3A6E100C17C80 /* CTCMenuController.m in Sources */,
3803C7AE11C3DA9300FC08DB /* CTCAppDelegate.m in Sources */,
Expand Down

0 comments on commit e0a881f

Please sign in to comment.