Index: trunk/ICeCoffEE/ICeCoffEE/ICeCoffEETextEdit.c
===================================================================
--- trunk/ICeCoffEE/ICeCoffEE/ICeCoffEETextEdit.c	(revision 79)
+++ trunk/ICeCoffEE/ICeCoffEE/ICeCoffEETextEdit.c	(revision 106)
@@ -13,5 +13,4 @@
 #include "ICeCoffEEConfig.h"
 #include "ICeCoffEEShared.h"
-#include "ICeCoffEEActionMenu.h"
 #include <ApplicationEnhancer/ApplicationEnhancer.h>
 
@@ -24,11 +23,11 @@
 //		Private function prototypes
 //-----------------------------------------------------------------------------
-void	ICCF_LaunchURLFromTEClick(TEHandle teH, short oldSelStart, short oldSelEnd, Boolean optionKey);
-OSStatus ICCF_DoCommandClick(TEHandle teH, long selStart, long selEnd, Boolean optionKey);
+void	ICCF_LaunchURLFromTEClick(TEHandle teH, short oldSelStart, short oldSelEnd, iccfURLAction action);
+OSStatus ICCF_DoCommandClick(TEHandle teH, long selStart, long selEnd, iccfURLAction action);
 
 //=============================================================================
 //		ICCF_LaunchURLFromTEClick : TEClick addition.
 //-----------------------------------------------------------------------------
-void	ICCF_LaunchURLFromTEClick(TEHandle teH, short oldSelStart, short oldSelEnd, Boolean optionKey)
+void	ICCF_LaunchURLFromTEClick(TEHandle teH, short oldSelStart, short oldSelEnd, iccfURLAction action)
 {
     OSStatus			err;
@@ -40,5 +39,5 @@
             oldSelEnd = (**teH).selEnd;
         }
-        err = ICCF_DoCommandClick(teH, oldSelStart, oldSelEnd, optionKey);
+        err = ICCF_DoCommandClick(teH, oldSelStart, oldSelEnd, action);
         if (err != noErr && err != userCanceledErr) {
             ICapeprintf("ICCF_DoCommandClick failed: %ld\n", err);
@@ -106,5 +105,5 @@
 //		ICCF_DoCommandClick : Handle the click.
 //-----------------------------------------------------------------------------
-OSStatus	ICCF_DoCommandClick(TEHandle teH, long selStart, long selEnd, Boolean optionKey)
+OSStatus	ICCF_DoCommandClick(TEHandle teH, long selStart, long selEnd, iccfURLAction action)
 {
     ICInstance inst = NULL;
@@ -130,30 +129,14 @@
         if (thePort != NULL) QDFlushPortBuffer(thePort, NULL);
 
-        if (optionKey) {
-            Handle urlH = NewHandle(0);
-            if (urlH == NULL) {
-                err = MemError();
-            } else {
-                err = ICParseURL(inst, hint, *textH, GetHandleSize(textH), &selStart, &selEnd, urlH);
-                if (err == noErr) {
-                    if (needsSlashes) ICCF_AddSlashes(urlH, hint);
-                    err = ICCF_DoURLActionMenu(inst, hint, *urlH, 0, GetHandleSize(urlH));
-                }
-                DisposeHandle(urlH);
+        Handle urlH = NewHandle(0);
+        if (urlH == NULL) {
+            err = MemError();
+        } else {
+            err = ICParseURL(inst, hint, *textH, GetHandleSize(textH), &selStart, &selEnd, urlH);
+            if (err == noErr) {
+                if (needsSlashes) ICCF_AddSlashes(urlH, hint);
+                err = ICCF_DoURLAction(inst, hint, *urlH, 0, GetHandleSize(urlH), action);
             }
-        } else {
-            if (needsSlashes) {
-                Handle urlH = NewHandle(0);
-                err = ICParseURL(inst, hint, *textH, GetHandleSize(textH), &selStart, &selEnd, urlH);
-                if (err == noErr) {
-                    ICCF_AddSlashes(urlH, hint);
-                    // don't want to disturb text selection
-                    long tmpEnd = GetHandleSize(urlH);
-                    long tmpStart = 0;
-                    err = ICLaunchURL(inst, hint, *urlH, GetHandleSize(urlH), &tmpStart, &tmpEnd);
-                }
-            } else {
-                err = ICLaunchURL(inst, hint, *textH, GetHandleSize(textH), &selStart, &selEnd);
-            }
+            DisposeHandle(urlH);
         }
         
@@ -196,5 +179,8 @@
     // Do our thing
     if (modifiers & cmdKey) {
-        ICCF_LaunchURLFromTEClick(teH, oldSelStart, oldSelEnd, (modifiers & optionKey) != 0);
+        iccfURLAction action;
+        action.presentMenu = (modifiers & optionKey) != 0;
+        action.launchInBackground = (modifiers & shiftKey) != 0;
+        ICCF_LaunchURLFromTEClick(teH, oldSelStart, oldSelEnd, action);
     }
     ICapeprintf("ICCF_TEClick exited\n");
