eudora-mac/prefs.c

1 line
106 KiB
C
Raw Permalink Normal View History

2018-05-23 09:59:15 +00:00
/* Copyright (c) 2017, Computer History Museum All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Computer History Museum nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "prefs.h" #include "myssl.h" // for "esslUseAltPort" #define FILE_NUM 31 /* Copyright (c) 1990-1992 by the University of Illinois Board of Trustees */ #include <LaunchServices.h> #include <CFPreferences.h> #pragma segment SetPrefs void NewCreator(short item); void FontHasChanged(void); int BadPrefItem(DialogPtr dialog); void GetPrefParms(short pref, short *id, short *num); OSErr SetPrefWithError(short pref, PStr value); OSErr CheckPrefSpecial(short pref, PStr value); void GetIndHString(PStr string,short id,short index); void PrefHelpAlert(short pref); void SettingsHelp(MyWindowPtr dlogWin); OSErr SetStrnFromDlog(MyWindowPtr dlog,short item,short resId); OSErr FillWithStrn(MyWindowPtr dlogWin,short item,short resId); void SetPOPAccount(PStr user,PStr host); OSErr SavePersItem(short which,short item,Handle itemH); OSErr BuildPersItem(short which,short item,Handle itemH,Boolean *enabled); OSErr HitPersItem(short which,short item); #ifdef SETTINGSLISTKEY Boolean SettingsKey (MyWindowPtr dlogWin, EventRecord *event); void SettingsActivate(MyWindowPtr win); void SettingsTEActivate(MyWindowPtr dlogWin,Boolean activate); Boolean SettingsListKey (MyWindowPtr win, EventRecord *event); pascal short SettingsSearchProc (Ptr cellDataPtr, Ptr searchDataPtr,short cellDataLen, short searchDataLen); #endif SETTINGSLISTKEY OSErr HesiodPOPInfo(PStr user,PStr host); void ResetSettings(void); OSErr SaveSacredSettings(AccuPtr a); OSErr RestoreSacredSettings(AccuPtr a); #define NEED_TO_SAVE (Dlog->isDirty || (Pers && Pers!=PersList)) #define PrefIsOverride(pref) (pref>399) short PrefNormalize(short pref); // Here's a sordid tale. When building the settings dialogs, // we have to set any pref we get, just to make sure that // settings that appear in dialogs are reflected in the settings // file and not just inherited from dominant, which makes // them tricky to change. Sigh. PStr GetSetPref(PStr val,short pref); long GetSetPrefLong(short pref); Boolean PrefIsSetSet(short pref); extern PStr GetResNameAndStripFeature(PStr into,ResType type,short id,Boolean *hasFeature); pascal void NullUserDraw(DialogPtr dlog, short item); long GetSubmissionPort(void); int ShowSimpleModalDialog ( int resID ); OSErr SetDefaultMailClient ( ICInstance icp, OSType creator, ConstStr255Param theName ); OSErr GetDefaultMailClient ( ICInstance icp, OSType *creator, StringPtr theName ); Boolean IsEudoraTheDefaultMailClie