home *** CD-ROM | disk | FTP | other *** search
- /*
- ** PGP5GUI - A GUI using Magic User Interface v3.8
- **
- ** Copyright 23-JUNE-1998 by Stefan Zakarias, All Rights Reserved.
- **
- ** This source code is released as FREEWARE - Use it for whatever you like,
- ** as long as NO financial reward is gained by you for such usage.
- **
- ** If you use any parts of the this source code for anything, give ME credit
- ** wherever credit is due, please ;-)
- */
-
- /*
- ** Functions to handle the interface between the PGP5 programs and the GUI
- */
-
- /* Library stuff */
- #include <libraries/asl.h>
- #include <libraries/mui.h>
- #include <dos/dostags.h>
- #include <exec/memory.h>
-
- /* Prototypes */
- #ifdef __GNUC__
- #include <proto/alib.h>
- #endif
-
- #include <proto/muimaster.h>
- #include <proto/exec.h>
- #include <clib/alib_protos.h>
- #include <clib/alib_stdio_protos.h>
- #include <proto/dos.h>
- #include <proto/asl.h>
-
- /* Ansi */
- #include <string.h>
-
- /* Include GUI stuff */
- #include "PGP5GUI.h"
-
- #define EXEC_BUFF_SIZE ((256 * 16) + 320)
- #define TEMPFILE "T:pgp5keys"
-
- static ULONG systags[] =
- {
- /* Make SYS_Input always the first tag. It's altered later on! */
- SYS_Input, 0,
- SYS_Output, NULL,
- TAG_DONE, TAG_DONE
- };
-
- LONG EncClipMode, DecClipMode, SigClipMode, AddKeysClipMode;
- LONG prev_EncClipMode, prev_DecClipMode, prev_SigClipMode, prev_AddKeysClipMode;
-
- /* Array of pointers to blocks of the 'keyselbuff' */
- char *keyselection[256];
- extern char *keystable[];
-
- char *tempfile = TEMPFILE;
- char *PGP_path = "PGP:";
- char *PGP5Key_asc = "PGP5Key.asc";
-
- char *warning_str = "WARNING...";
- char *OK_str = "OK";
-
- /*
- ** Array to hold keys selected by the user.
- ** NOTE: The indices of 'keyselection[]' point to chunks of this array
- */
- char *keyselbuff = NULL;
-
- /* Used for assembling multiple keyids to send to PGPx */
- char *keyidsbuff = NULL;
-
- /* Array to hold the command line we send to DOS */
- char *exec_buff = NULL;
-
- /* Memory to hold args. for encryption */
- char *enc_args_mem = NULL;
-
- char *enc_mode; /* Becomes: enc_args_mem */
- char *enc_options; /* Becomes: enc_mode + 28 */
- char *enc_files; /* Becomes: enc_options + 28 */
-
- /* Memory to hold args. for decryption */
- char *dec_args_mem = NULL;
-
- char *dec_outtype; /* Becomes: dec_args_mem */
- char *dec_files; /* Becomes: dec_outtype + 28 */
-
- /* Memory to hold args. for signing */
- char *sig_args_mem = NULL;
-
- char *sig_mode; /* Becomes: sig_args_mem */
- char *sig_options; /* Becomes: sig_mode + 28 */
- char *sig_files; /* Becomes: sig_options + 28 */
-
- /* Memory to hold file name for encryption from file */
- char *enc_name_mem = NULL;
-
- char *encpath; /* Becomes: enc_name_mem */
- char *encfile; /* Becomes: encpath + 256 */
- char *encfilename; /* Becomes: encfile + 256 */
-
- /* Memory to hold file name for encryption from clip to file */
- char *encclip_name_mem = NULL;
-
- char *encclippath; /* Becomes: encclip_name_mem */
- char *encclipfile; /* Becomes: encclippath + 256 */
- char *encclipfilename; /* Becomes: encclipfile + 256 */
-
- /* Memory to hold file name for decryption from file */
- char *dec_name_mem = NULL;
-
- char *decpath; /* Becomes: dec_name_mem */
- char *decfile; /* Becomes: decpath + 256 */
- char *decfilename; /* Becomes: decfile + 256 */
-
- /* Memory to hold file name for decryption from clip to file */
- char *decclip_name_mem = NULL;
-
- char *decclippath; /* Becomes: decclip_name_mem */
- char *decclipfile; /* Becomes: decclippath + 256 */
- char *decclipfilename; /* Becomes: decclipfile + 256 */
-
- /* Memory to hold file name for signing from file */
- char *sig_name_mem = NULL;
-
- char *sigpath; /* Becomes: sig_name_mem */
- char *sigfile; /* Becomes: sigpath + 256 */
- char *sigfilename; /* Becomes: sigfile + 256 */
-
- /* Memory to hold file name for signing from clip to file */
- char *sigclip_name_mem = NULL;
-
- char *sigclippath; /* Becomes: sigclip_name_mem */
- char *sigclipfile; /* Becomes: sigclippath + 256 */
- char *sigclipfilename; /* Becomes: sigclipfile + 256 */
-
- /* Memory to hold file name for Add Keys */
- char *addkeys_name_mem = NULL;
-
- char *addkeyspath; /* Becomes: addkeys_name_mem */
- char *addkeysfile; /* Becomes: addkeyspath + 256 */
- char *addkeysfilename; /* Becomes: addkeysfile + 256 */
-
- /* Memory to hold file name for extracting key(s) to file */
- char *keys_extract_name_mem = NULL;
-
- char *keys_extractpath;
- char *keys_extractfile;
- char *keys_extractfilename;
-
- char *cwdscratch = NULL;
-
- char *wincfgname = "ENVARC:PGP5GUI.wcfg";
- char *ReadyMSG = "\33cReady!";
-
- extern BOOL listget;
-
- /* Pointer to hold address of our console */
- BPTR console = NULL;
-
- /* Array to hold the console specs. */
- UBYTE conspec[80];
-
- struct Window *win = NULL;
- struct FileRequester *filerequester = NULL;
-
- struct WinConfigs WinConfig =
- {
- 0, /* con_LeftEdge */
- 20, /* con_TopEdge */
- 640, /* con_Width */
- 180, /* con_Height */
- 0, /* blank */
- 10, /* asl_LeftEdge */
- 20, /* asl_TopEdge */
- 310, /* asl_Width */
- 180, /* asl_Height */
- 0 /* end */
- };
-
- extern ULONG frtags[];
-
- extern int GenerateKeyStrings(char *filename);
- extern void StringToPathFile(char *fullpath, char *pathbuff, char *filebuff);
- extern void JoinNameParts(char *fullpath, char *pathbuff, char *filebuff);
-
-
- BOOL
- InitASLStuff(struct ObjApp *App)
- {
- BOOL result = FALSE;
- char *enctest, *dectest, *sigtest, *addkeystest;
-
- /* Initialise an ASL FileRequester structure with our values */
- if (filerequester = (struct FileRequester *)
- AllocAslRequest(ASL_FileRequest, (struct TagItem *) frtags))
- {
- /* Get/Set the default paths for the various ASL Requesters */
- get(App->STR_PA_Encrypt_FROMFILE,MUIA_String_Contents,&enctest);
- StringToPathFile(enctest, encpath, encfile);
-
- get(App->STR_PA_Decrypt_TOFILE,MUIA_String_Contents,&dectest);
- StringToPathFile(dectest, decpath, decfile);
-
- get(App->STR_PA_Sign_POPFILE,MUIA_String_Contents,&sigtest);
- StringToPathFile(sigtest, sigpath, sigfile);
-
- get(App->STR_PA_Keys_ADD_KEYFILE,MUIA_String_Contents,&addkeystest);
- StringToPathFile(addkeystest, addkeyspath, addkeysfile);
-
- /* Set the return code to 'no error' */
- result = TRUE;
- }
-
- /* Return the result of our operation */
- return(result);
- }
-
- void
- GetWinConfigs(void)
- {
- int len, i, fnlen;
- char linebuff[2088]; /* Buffer for config file */
- char *bufptr;
- BPTR filelock, filehandle;
- char *WCfg;
-
- WCfg = (char *) &WinConfig;
-
- /* Quick-check to see if the file exists! */
- filelock = Lock(wincfgname, ACCESS_READ);
-
- /* Did we get a lock on that file? */
- if (filelock)
- {
- /* File was found... We can (have to?) unlock it now */
- UnLock(filelock);
-
- /* We have a record of previously saved window size data */
- filehandle = Open(wincfgname, MODE_OLDFILE);
-
- /* Did DOS give us the O.K. to read it? */
- if (filehandle)
- {
- /*
- ** DOS says it's OK to use!
- ** Read a string of up to 255 bytes from the record into 'linebuff'.
- */
- len = Read(filehandle, linebuff, 2600);
-
- Close(filehandle);
-
- /* Check length of record */
- if (len >= sizeof(struct WinConfigs))
- {
- /* Size of record is at least the size of WinConfigs... */
- for (i = 0; i < sizeof(struct WinConfigs); i++)
- {
- /* Copy linebuff to WinConfig structure (hope it's right ;-) */
- *(WCfg++) = linebuff[i];
- }
-
- /* If size of record is bigger than size of WinConfigs... */
- if (len > sizeof(struct WinConfigs))
- {
- /*
- ** Getting to here should mean we have default file paths
- ** for the various ASL file requesters...
- */
-
- /* Get position in the line buffer */
- bufptr = linebuff + sizeof(struct WinConfigs);
-
- for(i = 0; i < 4; i++)
- {
- /* Get length of string at bufptr's starting position */
- fnlen = strlen(bufptr);
-
- if (fnlen)
- {
- switch(i)
- {
- case 0:
- StringToPathFile(bufptr, encclippath, encclipfile);
- break;
-
- case 1:
- StringToPathFile(bufptr, decclippath, decclipfile);
- break;
-
- case 2:
- StringToPathFile(bufptr, sigclippath, sigclipfile);
- break;
-
- case 3:
- StringToPathFile(bufptr, keys_extractpath, keys_extractfile);
- break;
- }
- }
-
- bufptr += (fnlen + 1);
- }
- }
- }
- }
- }
- }
-
- /*
- ** Open a console window we can use for stdin/stdout
- */
- BOOL
- OpenConWin(struct ObjApp *App)
- {
- struct Screen *screen;
-
- get(App->WI_Main, MUIA_Window_Screen, &screen);
-
- if (win = OpenWindowTags(NULL,
- WA_Left, WinConfig.con_LeftEdge,
- WA_Top, WinConfig.con_TopEdge,
- WA_Width, WinConfig.con_Width,
- WA_Height, WinConfig.con_Height,
- WA_Flags, WFLG_SIZEGADGET | WFLG_DRAGBAR | WFLG_DEPTHGADGET |
- WFLG_SMART_REFRESH | WFLG_ACTIVATE | WFLG_RMBTRAP |
- WFLG_NOCAREREFRESH,
- WA_Title, "AmigaPGP5 Output Window...",
- WA_MinWidth, 319,
- WA_MinHeight, 39,
- WA_MaxWidth, -1,
- WA_MaxHeight, -1,
- WA_PubScreen, (ULONG) screen,
- TAG_DONE))
- {
- /* Create console spec. and add pointer to window */
- sprintf(conspec,"CON://///WINDOW0x%lx", win);
-
- if (console = Open(conspec, MODE_OLDFILE))
- {
- /* Set the 'SYS_Input' file tag */
- systags[1] = (ULONG) console;
-
- /* Return flag: No Error */
- return (TRUE);
- }
- }
-
- /* Error: Console or Window failed to open */
- return (FALSE);
- }
-
- void
- ShutDownConsole(void)
- {
- BPTR filehandle;
-
- WinConfig.con_LeftEdge = win->LeftEdge;
- WinConfig.con_TopEdge = win->TopEdge;
- WinConfig.con_Width = win->Width;
- WinConfig.con_Height = win->Height;
-
- WinConfig.blank = 0;
-
- WinConfig.asl_LeftEdge = frtags[13];
- WinConfig.asl_TopEdge = frtags[15];
- WinConfig.asl_Width = frtags[11];
- WinConfig.asl_Height = frtags[9];
-
- WinConfig.end = 0;
-
- /* Open the 'ENVARC:PGP5GUI.wcfg' file */
- filehandle = Open(wincfgname, MODE_READWRITE);
-
- /* Did DOS give us the O.K. to read it? */
- if (filehandle)
- {
- /*
- ** DOS says it's OK to use!
- ** Write a string of size 'struct Winconfigs' bytes from WinConfig.
- ** Disregard any errors... It isn't that important that this file
- ** is written to ;-)
- */
- Write(filehandle, &WinConfig, sizeof(struct WinConfigs));
-
- /* Write out the name of the last file we used for encrypt clip to file */
- JoinNameParts(encclipfilename, encclippath, encclipfile);
- Write(filehandle, encclipfilename, strlen(encclipfilename)+1);
-
- /* Write out the name of the last file we used for decrypt clip to file */
- JoinNameParts(decclipfilename, decclippath, decclipfile);
- Write(filehandle, decclipfilename, strlen(decclipfilename)+1);
-
- /* Write out the name of the last file we used for signing clip to file */
- JoinNameParts(sigclipfilename, sigclippath, sigclipfile);
- Write(filehandle, sigclipfilename, strlen(sigclipfilename)+1);
-
- /* Write out the name of the last file we used for extracting key to file */
- JoinNameParts(keys_extractfilename, keys_extractpath, keys_extractfile);
- Write(filehandle, keys_extractfilename, strlen(keys_extractfilename)+1);
-
- /* Finished with the file */
- Close(filehandle);
- }
-
- /* Close the console and it's window */
- Close(console);
- }
-
- /*
- ** Synchronous external command started with its own 'con:' Input/Output.
- ** Result will ONLY reflect whether System() call itself failed.
- ** If System() call fails, result will be -1L
- */
- void
- PGP5_Execute( UBYTE *command, struct ObjApp *App )
- {
- /* Make the parent window go to sleep */
- set(App->WI_Main,MUIA_Window_Sleep,TRUE);
-
- if (!listget)
- {
- set(App->TX_Status, MUIA_Text_Contents, "\33cProcessing...");
- }
- else
- {
- set(App->TX_Status, MUIA_Text_Contents, "\33cGetting key list...");
- }
-
- /* Make the console window 'active' */
- ActivateWindow(win);
-
- if (System(command, (struct TagItem *) systags))
- {
- MUI_Request(App->App, App->WI_Main, 0, warning_str, OK_str,
- "DOS command failed:\n%s", command);
- }
-
- if (!listget)
- {
- /* Wake up the parent window */
- set(App->WI_Main,MUIA_Window_Sleep,FALSE);
-
- /* Activate the parent window */
- set(App->WI_Main,MUIA_Window_Activate,TRUE);
-
- set(App->TX_Status, MUIA_Text_Contents, ReadyMSG);
- }
- }
-
- int
- init_resources(void)
- {
- int i;
-
- keyselbuff = AllocVec(256 * 16, MEMF_PUBLIC | MEMF_CLEAR);
- keyidsbuff = AllocVec(EXEC_BUFF_SIZE, MEMF_PUBLIC | MEMF_CLEAR);
-
- exec_buff = AllocVec(EXEC_BUFF_SIZE, MEMF_PUBLIC | MEMF_CLEAR);
-
- enc_args_mem = AllocVec(28+28+512, MEMF_PUBLIC | MEMF_CLEAR);
- enc_name_mem = AllocVec(256+256+512, MEMF_PUBLIC | MEMF_CLEAR);
- encclip_name_mem = AllocVec(256+256+528, MEMF_PUBLIC | MEMF_CLEAR);
-
- dec_args_mem = AllocVec(28+512, MEMF_PUBLIC | MEMF_CLEAR);
- dec_name_mem = AllocVec(256+256+512, MEMF_PUBLIC | MEMF_CLEAR);
- decclip_name_mem = AllocVec(256+256+528, MEMF_PUBLIC | MEMF_CLEAR);
-
- sig_args_mem = AllocVec(28+28+512, MEMF_PUBLIC | MEMF_CLEAR);
- sig_name_mem = AllocVec(256+256+512, MEMF_PUBLIC | MEMF_CLEAR);
- sigclip_name_mem = AllocVec(256+256+528, MEMF_PUBLIC | MEMF_CLEAR);
-
- keys_extract_name_mem = AllocVec(256+256+512, MEMF_PUBLIC | MEMF_CLEAR);
-
- addkeys_name_mem = AllocVec(256+256+512, MEMF_PUBLIC | MEMF_CLEAR);
-
- cwdscratch = AllocVec(512, MEMF_PUBLIC | MEMF_CLEAR);
-
- /* Make sure we got ALL our memory we requested */
- if (keyselbuff && keyidsbuff && exec_buff &&
- enc_args_mem && enc_name_mem && encclip_name_mem &&
- dec_args_mem && dec_name_mem && decclip_name_mem &&
- sig_args_mem && sig_name_mem && sigclip_name_mem &&
- keys_extract_name_mem && addkeys_name_mem && cwdscratch)
- {
- enc_mode = enc_args_mem;
- enc_options = enc_mode + 28;
- enc_files = enc_options + 28;
-
- encpath = enc_name_mem;
- encfile = encpath + 256;
- encfilename = encfile + 256;
-
- encclippath = encclip_name_mem;
-
- strcpy(encclippath, PGP_path);
- encclipfile = encclippath + 256;
- encclipfilename = encclipfile + 256;
-
- dec_outtype = dec_args_mem;
- dec_files = dec_outtype + 28;
-
- decpath = dec_name_mem;
- decfile = decpath + 256;
- decfilename = decfile + 256;
-
- decclippath = decclip_name_mem;
-
- strcpy(decclippath, PGP_path);
- decclipfile = decclippath + 256;
- decclipfilename = decclipfile + 256;
-
- sig_mode = sig_args_mem;
- sig_options = sig_mode + 28;
- sig_files = sig_options + 28;
-
- sigpath = sig_name_mem;
- sigfile = sigpath + 256;
- sigfilename = sigfile + 256;
-
- sigclippath = sigclip_name_mem;
-
- strcpy(sigclippath, PGP_path);
- sigclipfile = sigclippath + 256;
- sigclipfilename = sigclipfile + 256;
-
- addkeyspath = addkeys_name_mem;
- addkeysfile = addkeyspath + 256;
- addkeysfilename = addkeysfile + 256;
-
- keys_extractpath = keys_extract_name_mem;
-
- strcpy(keys_extractpath, PGP_path);
- keys_extractfile = keys_extractpath + 256;
- strcpy(keys_extractfile, PGP5Key_asc);
- keys_extractfilename = keys_extractfile + 256;
-
- /* Set the pointers to the chunks in our allocated memory */
- for(i = 0; i < 256; i++)
- keyselection[i] = keyselbuff + (i * 16);
-
- /* Init 'keystable[]' array */
- for (i = 0; i < 1024; i++)
- keystable[i] = 0;
-
- return(0);
- }
-
- /* O-Oh... Missed out on an allocation somewhere */
- return(RETURN_FAIL);
- }
-
- void
- free_resources(void)
- {
- int i;
-
- BPTR lock = Lock(tempfile, ACCESS_READ);
-
- if (lock)
- {
- UnLock(lock);
- DeleteFile(tempfile);
- }
-
- /* Free up any previously initialised 'keystable[]' memory */
- for (i = 0; i < 1024; i++)
- {
- if (keystable[i])
- {
- FreeVec(keystable[i]);
- keystable[i] = 0;
- }
- }
-
- if (cwdscratch)
- FreeVec(cwdscratch);
-
- if (filerequester)
- FreeAslRequest(filerequester);
-
- /* Save the window configs, close the console AND window */
- if (console)
- ShutDownConsole();
-
- if (addkeys_name_mem)
- FreeVec(addkeys_name_mem);
-
- if (keys_extractpath)
- FreeVec(keys_extractpath);
-
- if (sigclip_name_mem)
- FreeVec(sigclip_name_mem);
-
- if (sig_name_mem)
- FreeVec(sig_name_mem);
-
- if (sig_args_mem)
- FreeVec(sig_args_mem);
-
- if (decclip_name_mem)
- FreeVec(decclip_name_mem);
-
- if (dec_name_mem)
- FreeVec(dec_name_mem);
-
- if (dec_args_mem)
- FreeVec(dec_args_mem);
-
- if (encclip_name_mem)
- FreeVec(encclip_name_mem);
-
- if (enc_name_mem)
- FreeVec(enc_name_mem);
-
- if (enc_args_mem)
- FreeVec(enc_args_mem);
-
- if (exec_buff)
- FreeVec(exec_buff);
-
- if (keyidsbuff)
- FreeVec(keyidsbuff);
-
- if (keyselbuff)
- FreeVec(keyselbuff);
- }
-
- /*
- ** Gets the value (selection) of a Cycle Gadget.
- ** Returns: 0 to (numentries - 1)
- */
- LONG
- GetCycle(Object *obj)
- {
- LONG x;
-
- get(obj, MUIA_Cycle_Active, &x);
- return(x);
- }
-
- void
- EncFileOrClip(struct ObjApp *App)
- {
- /* What mode did we switch to? */
- EncClipMode = GetCycle(App->CY_Encrypt_CLIP);
-
- /* Did we change the setting? 'Coz we only want to toggle when necessary! */
- if (EncClipMode != prev_EncClipMode)
- {
- /* Reset flag */
- prev_EncClipMode = EncClipMode;
-
- if (EncClipMode < 2)
- {
- if (!EncClipMode)
- {
- /* Encrypt from a file to file - Turn on everything */
- DoMethod(App->CY_Encrypt_CLIP, MUIM_MultiSet, MUIA_Disabled, FALSE,
- App->GR_Enc_File,
- App->CY_Encrypt_USEARMOR, App->CY_Encrypt_TEXTMODE,
- NULL);
- }
- else
- {
- /* Encrypt from file to clipboard - Turn on file name group */
- set(App->GR_Enc_File, MUIA_Disabled, FALSE);
-
- /* Disable USEARMOR and TEXTMODE */
- DoMethod(App->CY_Encrypt_CLIP, MUIM_MultiSet, MUIA_Disabled, TRUE,
- App->CY_Encrypt_USEARMOR, App->CY_Encrypt_TEXTMODE,
- NULL);
- }
- }
- else
- {
- /*
- ** Encrypt from clipboard to file, or clipboard to clipboard...
- ** Turn off everything
- */
- DoMethod(App->CY_Encrypt_CLIP, MUIM_MultiSet, MUIA_Disabled, TRUE,
- App->GR_Enc_File,
- App->CY_Encrypt_USEARMOR, App->CY_Encrypt_TEXTMODE,
- NULL);
- }
- }
- }
-
- void
- DecFileOrClip(struct ObjApp *App)
- {
- /* What mode did we switch to? */
- DecClipMode = GetCycle(App->CY_Decrypt_OUTTYPE);
-
- /* Did we change the setting? 'Coz we only want to toggle when necessary! */
- if (DecClipMode != prev_DecClipMode)
- {
- /* Reset flag */
- prev_DecClipMode = DecClipMode;
-
- if (DecClipMode < 3)
- {
- /* Output from file to file, pager, or clip - Turn on file name group */
- set(App->GR_Dec_File, MUIA_Disabled, FALSE);
- }
- else
- {
- /* From clipboard - Turn off file name group */
- set(App->GR_Dec_File, MUIA_Disabled, TRUE);
- }
- }
- }
-
- void
- SigFileOrClip(struct ObjApp *App)
- {
- /* What mode did we switch to? */
- SigClipMode = GetCycle(App->CY_Sign_CLIP);
-
- /* Did we change the setting? 'Coz we only want to toggle when necessary! */
- if (SigClipMode != prev_SigClipMode)
- {
- /* Reset flag */
- prev_SigClipMode = SigClipMode;
-
- if (SigClipMode < 2)
- {
- if (!SigClipMode)
- {
- /* Sign from a file to file - Turn on everything */
- DoMethod(App->CY_Sign_CLIP, MUIM_MultiSet, MUIA_Disabled, FALSE,
- App->GR_Sig_File, App->CY_Sign_DETACH, App->CY_Sign_MODE,
- App->CY_Sign_TEXTMODE, NULL);
- }
- else
- {
- /* Sign from file to clipboard - Turn on file name group */
- set(App->GR_Sig_File, MUIA_Disabled, FALSE);
-
- /* Disable DETACH, ARMOR, TEXTMODE */
- DoMethod(App->CY_Sign_CLIP, MUIM_MultiSet, MUIA_Disabled, TRUE,
- App->CY_Sign_DETACH, App->CY_Sign_MODE, App->CY_Sign_TEXTMODE,
- NULL);
- }
- }
- else
- {
- /*
- ** Sign from clipboard to file, or clipboard to clipboard...
- ** Turn off everything
- */
- DoMethod(App->CY_Sign_CLIP, MUIM_MultiSet, MUIA_Disabled, TRUE,
- App->GR_Sig_File, App->CY_Sign_DETACH, App->CY_Sign_MODE,
- App->CY_Sign_TEXTMODE, NULL);
- }
- }
- }
-
- void
- AddKeysFileOrClip(struct ObjApp *App)
- {
- /* What mode did we switch to? */
- AddKeysClipMode = GetCycle(App->CY_KeysAdd_CLIP);
-
- /* Did we change the setting? 'Coz we only want to toggle when necessary! */
- if (AddKeysClipMode != prev_AddKeysClipMode)
- {
- /* Reset flag */
- prev_AddKeysClipMode = AddKeysClipMode;
-
- if (!AddKeysClipMode)
- {
- /* Add keys from file - Turn on file name group */
- set(App->GR_Keys_AddFile, MUIA_Disabled, FALSE);
- }
- else
- {
- /* Add keys from clipboard - Turn off file name group */
- set(App->GR_Keys_AddFile, MUIA_Disabled, TRUE);
- }
- }
- }
-