Changeset 462


Ignore:
Timestamp:
04/10/08 01:55:12 (17 years ago)
Author:
Nicholas Riley
Message:

Copy URL to clipboard as link support.

Location:
trunk/ICeCoffEE/ICeCoffEE
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEAction.c

    r181 r462  
    1212#include "ICeCoffEEShared.h"
    1313#include "ICeCoffEEBookmarks.h"
     14#include "ICeCoffEESharing.h"
    1415
    1516#define THROW_ERR(e) { err = e; goto END; }
     
    111112    if (appItemTitle == NULL) return fnfErr;
    112113   
    113     err = AppendMenuItemTextWithCFString(ctx->menu, appItemTitle, 0, 0, &menuItemIndex);
     114    err = AppendMenuItemTextWithCFString(ctx->menu, appItemTitle, 0, menuCommand, &menuItemIndex);
    114115    if (err != noErr) return err;
    115116
     
    119120
    120121    SetMenuItemIconHandle(ctx->menu, menuItemIndex, kMenuIconRefType, (Handle)appIcon);
    121     SetMenuItemCommandID(ctx->menu, menuItemIndex, menuCommand);
    122122    SetMenuItemRefCon(ctx->menu, menuItemIndex, (UInt32)appURL);
    123123    ReleaseIconRef(appIcon);
     
    146146enum {
    147147    kICURLActionOpenWith = 'OpnW',
    148     kICURLActionAddBookmark = 'AddB'
     148    kICURLActionAddBookmark = 'AddB',
     149    kICURLActionCopy = 'Copy'
    149150};
    150151
     
    227228            THROW_ERR(err);
    228229    }
    229    
     230
     231    if ( (err = AppendMenuItemTextWithCFString(ctx.menu, CFSTR(""), kMenuItemAttrSeparator, 0, NULL)) != noErr)
     232        THROW_ERR(err);
     233    if ( (err = AppendMenuItemTextWithCFString(ctx.menu, ICCF_CopyLocalizedString(CFSTR("Copy Link")), 0, kICURLActionCopy, NULL)) != noErr)
     234        THROW_ERR(err);
     235
    230236    InsertMenu(ctx.menu, -1);
    231237    Point mousePoint;
     
    246252                } else if (menuCommand == kICURLActionAddBookmark) {
    247253                    err = ICCF_DoBookmarkDialog(inst, CFURLGetString(url));
    248                 }
     254                } else if (menuCommand == kICURLActionCopy) {
     255                    err = ICCF_CopyLink(CFURLGetString(url));
     256                }
    249257            }
    250258        }
Note: See TracChangeset for help on using the changeset viewer.