diff options
| -rw-r--r-- | CopyMailto/AppDelegate.h | 1 | ||||
| -rw-r--r-- | CopyMailto/AppDelegate.m | 9 | ||||
| -rw-r--r-- | CopyMailto/Base.lproj/MainMenu.xib | 14 | 
3 files changed, 24 insertions, 0 deletions
| diff --git a/CopyMailto/AppDelegate.h b/CopyMailto/AppDelegate.h index 321d100..7ba86b3 100644 --- a/CopyMailto/AppDelegate.h +++ b/CopyMailto/AppDelegate.h @@ -15,5 +15,6 @@  - (void)handleURLEvent:(NSAppleEventDescriptor *)event      withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (IBAction)copyEmailToClipboard:(id)sender;  @end diff --git a/CopyMailto/AppDelegate.m b/CopyMailto/AppDelegate.m index 6f3477d..5eb04c5 100644 --- a/CopyMailto/AppDelegate.m +++ b/CopyMailto/AppDelegate.m @@ -33,4 +33,13 @@ const NSUInteger MAILTO_INDEX = 7;      [_email_address setStringValue:[url substringFromIndex:MAILTO_INDEX]];  } +- (IBAction)copyEmailToClipboard:(id)sender +{ +    NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; +    [pasteboard clearContents]; +    [pasteboard writeObjects: +        [NSArray arrayWithObject: +            [_email_address stringValue]]]; +} +  @end diff --git a/CopyMailto/Base.lproj/MainMenu.xib b/CopyMailto/Base.lproj/MainMenu.xib index e3f79a2..ce6197b 100644 --- a/CopyMailto/Base.lproj/MainMenu.xib +++ b/CopyMailto/Base.lproj/MainMenu.xib @@ -108,6 +108,20 @@ Gw                              <action selector="terminate:" target="-1" id="M3t-iK-CjQ"/>                          </connections>                      </button> +                    <button verticalHuggingPriority="750" misplaced="YES" id="kh0-Tv-Cj9"> +                        <rect key="frame" x="394" y="13" width="72" height="32"/> +                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> +                        <buttonCell key="cell" type="push" title="Copy" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="ujL-03-vyZ"> +                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> +                            <font key="font" metaFont="system"/> +                            <string key="keyEquivalent" base64-UTF8="YES"> +DQ +</string> +                        </buttonCell> +                        <connections> +                            <action selector="copyEmailToClipboard:" target="Voe-Tx-rLC" id="uX1-7A-IwJ"/> +                        </connections> +                    </button>                  </subviews>              </view>              <point key="canvasLocation" x="132" y="42.5"/> | 
