From ded37a128c44145072ee4e9579e1b355d0052a11 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Wed, 1 May 2013 10:03:51 +0700 Subject: [PATCH] =?UTF-8?q?Add=20link=20arrows=20to=20Preferences=20?= =?UTF-8?q?=E2=86=92=20Bundles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This takes the user to the bundle’s home (generally a GitHub page) which should make it easier to clone the source repository or report issues via the bundle’s issue tracker. --- .../English.lproj/BundlesPreferences.xib | 131 +++++++++++++++--- .../Preferences/src/BundlesPreferences.h | 1 + .../Preferences/src/BundlesPreferences.mm | 8 ++ 3 files changed, 120 insertions(+), 20 deletions(-) diff --git a/Frameworks/Preferences/resources/English.lproj/BundlesPreferences.xib b/Frameworks/Preferences/resources/English.lproj/BundlesPreferences.xib index 6ac5d2a7..4b7fd775 100644 --- a/Frameworks/Preferences/resources/English.lproj/BundlesPreferences.xib +++ b/Frameworks/Preferences/resources/English.lproj/BundlesPreferences.xib @@ -110,17 +110,20 @@ 256 - {438, 165} + + YES + + {439, 165} - + YES NO YES 256 - {438, 17} + {439, 17} @@ -183,7 +186,7 @@ name - 200 + 128 40 1000 @@ -212,15 +215,15 @@ YES - - date - 100 - 10 - 3.4028234663852886e+38 + + link + 16 + 16 + 16 75497536 2048 - Updated + 6 @@ -233,6 +236,46 @@ + + 67108864 + 134217728 + + + LucidaGrande-Bold + 11 + 3357 + + _NS:9 + + 138952704 + 39 + + NSImage + NSFollowLinkFreestandingTemplate + + + + 200 + 25 + + 3 + YES + YES + + + + date + 100 + 100 + 100 + + 75497536 + 2048 + Updated + + + + 337641536 2048 @@ -249,7 +292,7 @@ description - 110 + 164 10 3.4028234663852886e+38 @@ -313,7 +356,7 @@ {{424, 17}, {15, 175}} - + NO _doScroller: @@ -321,16 +364,17 @@ - -2147483392 - {{1, 192}, {438, 15}} + 256 + {{1, 166}, {438, 16}} - + + YES NO 1 _doScroller: - 0.82954545454545459 + 0.99772209567198178 @@ -352,7 +396,7 @@ - 133682 + 133810 @@ -414,6 +458,14 @@ 35 + + + didClickBundleLink: + + + + 72 + dataSource @@ -601,6 +653,7 @@ + @@ -690,6 +743,20 @@ + + 48 + + + YES + + + + + + 71 + + + @@ -712,9 +779,11 @@ 32.IBPluginDependency 33.IBPluginDependency 4.IBPluginDependency + 48.IBPluginDependency 5.IBPluginDependency 6.IBPluginDependency 7.IBPluginDependency + 71.IBPluginDependency 8.IBPluginDependency 9.IBPluginDependency @@ -741,6 +810,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -755,7 +826,7 @@ - 47 + 72 @@ -763,6 +834,17 @@ BundlesPreferences NSViewController + + didClickBundleLink: + id + + + didClickBundleLink: + + didClickBundleLink: + id + + YES @@ -841,8 +923,17 @@ YES 3 - NSSwitch - {15, 15} + YES + + YES + NSFollowLinkFreestandingTemplate + NSSwitch + + + YES + {10, 10} + {15, 15} + diff --git a/Frameworks/Preferences/src/BundlesPreferences.h b/Frameworks/Preferences/src/BundlesPreferences.h index 3b8c4000..d4c2c95b 100644 --- a/Frameworks/Preferences/src/BundlesPreferences.h +++ b/Frameworks/Preferences/src/BundlesPreferences.h @@ -17,4 +17,5 @@ @property (nonatomic, readonly) NSString* identifier; @property (nonatomic, readonly) NSImage* toolbarItemImage; @property (nonatomic, readonly) NSString* toolbarItemLabel; +- (IBAction)didClickBundleLink:(id)sender; @end diff --git a/Frameworks/Preferences/src/BundlesPreferences.mm b/Frameworks/Preferences/src/BundlesPreferences.mm index 44268b35..05c82bad 100644 --- a/Frameworks/Preferences/src/BundlesPreferences.mm +++ b/Frameworks/Preferences/src/BundlesPreferences.mm @@ -205,4 +205,12 @@ static std::string textify (std::string str) else [_bundlesManager uninstallBundle:bundle]; } } + +- (IBAction)didClickBundleLink:(NSTableView*)aTableView +{ + NSInteger rowIndex = [aTableView clickedRow]; + bundles_db::bundle_ptr bundle = bundles[rowIndex]; + if(bundle->html_url() != NULL_STR) + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithCxxString:bundle->html_url()]]]; +} @end