Permalink
Browse files

added about page in preferences

  • Loading branch information...
1 parent cce8955 commit c83bad73c8b8c7f98399429866c959ac441af74c @mackuba mackuba committed Sep 25, 2010
@@ -19,6 +19,7 @@
NSView *generalPreferencesView;
NSView *repositoriesPreferencesView;
NSView *aboutPreferencesView;
+ NSButton *websiteLabel;
}
@property IBOutlet RepositoryListController *repositoryListController;
@@ -28,10 +29,16 @@
@property IBOutlet NSView *generalPreferencesView;
@property IBOutlet NSView *repositoriesPreferencesView;
@property IBOutlet NSView *aboutPreferencesView;
+@property IBOutlet NSButton *websiteLabel;
@property (readonly) id gitClass;
+// public
- (IBAction) removeRepositories: (id) sender;
- (IBAction) openGitExecutableDialog: (id) sender;
+- (IBAction) openProjectWebsite: (id) sender;
+
+// private
+- (void) linkifyButton: (NSButton *) label;
- (void) updateUserEmailText: (NSString *) email;
@end
@@ -15,7 +15,7 @@
@implementation PreferencesWindowController
@synthesize repositoryListController, monitorIntervalField, ignoreOwnEmailsField, chooseGitPathButton,
- generalPreferencesView, repositoriesPreferencesView, aboutPreferencesView;
+ generalPreferencesView, repositoriesPreferencesView, aboutPreferencesView, websiteLabel;
- (id) gitClass {
return [Git class];
@@ -29,6 +29,7 @@ - (void) awakeFromNib {
numberFormatter = [[NSNumberFormatter alloc] init];
numberFormatter.numberStyle = NSNumberFormatterDecimalStyle;
+ [self linkifyButton: websiteLabel];
[self updateUserEmailText: [[NSApp delegate] userEmail]];
PSObserve(nil, UserEmailChangedNotification, userEmailChanged:);
@@ -38,6 +39,20 @@ - (void) awakeFromNib {
}
}
+- (void) linkifyButton: (NSButton *) label {
+ NSString *url = label.title;
+ NSDictionary *linkAttributes = PSDict(
+ [NSColor blueColor], NSForegroundColorAttributeName,
+ [NSCursor pointingHandCursor], NSCursorAttributeName
+ );
+ NSAttributedString *link = [[NSAttributedString alloc] initWithString: url attributes: linkAttributes];
+ websiteLabel.attributedTitle = link;
+}
+
+- (IBAction) openProjectWebsite: (id) sender {
+ [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString: [sender title]]];
+}
+
- (void) setupToolbar {
[self addView: generalPreferencesView
label: @"General"
View
@@ -83,9 +83,6 @@
<object class="NSCustomObject" id="710422944">
<string key="NSClassName">Monitor</string>
</object>
- <object class="NSCustomObject" id="590954411">
- <string key="NSClassName">PreferencesWindowController</string>
- </object>
<object class="NSMenu" id="70315801">
<string key="NSTitle">AMainMenu</string>
<object class="NSMutableArray" key="NSMenuItems">
@@ -430,14 +427,6 @@
<int key="connectionID">891</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">preferencesWindowController</string>
- <reference key="source" ref="976324537"/>
- <reference key="destination" ref="590954411"/>
- </object>
- <int key="connectionID">892</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">showPreferences:</string>
<reference key="source" ref="976324537"/>
@@ -524,11 +513,6 @@
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">621</int>
- <reference key="object" ref="590954411"/>
- <reference key="parent" ref="0"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">730</int>
<reference key="object" ref="70315801"/>
<object class="NSMutableArray" key="children">
@@ -689,7 +673,6 @@
<string>561.IBPluginDependency</string>
<string>604.IBPluginDependency</string>
<string>614.IBPluginDependency</string>
- <string>621.IBPluginDependency</string>
<string>730.IBEditorWindowLastContentRect</string>
<string>730.IBPluginDependency</string>
<string>730.ImportedFromIB2</string>
@@ -750,7 +733,6 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{380, 836}, {207, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
@@ -1000,6 +982,7 @@
<string>monitorIntervalField</string>
<string>repositoriesPreferencesView</string>
<string>repositoryListController</string>
+ <string>websiteLabel</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1010,6 +993,7 @@
<string>NSTextField</string>
<string>NSView</string>
<string>RepositoryListController</string>
+ <string>NSTextField</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
@@ -1023,6 +1007,7 @@
<string>monitorIntervalField</string>
<string>repositoriesPreferencesView</string>
<string>repositoryListController</string>
+ <string>websiteLabel</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1054,6 +1039,10 @@
<string key="name">repositoryListController</string>
<string key="candidateClassName">RepositoryListController</string>
</object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">websiteLabel</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
Oops, something went wrong.

0 comments on commit c83bad7

Please sign in to comment.