This commit is contained in:
akkana%netscape.com 1998-09-01 19:09:28 +00:00
Родитель f95cd48bd3
Коммит 881ad6e58e
2 изменённых файлов: 90 добавлений и 2 удалений

Просмотреть файл

@ -22,7 +22,7 @@
* Should only be built for the editor.
* Created: David Williams <djw@netscape.com>, Mar-12-1996
*
* RCSID: "$Id: editordialogs.c,v 3.2 1998-07-21 02:14:16 akkana%netscape.com Exp $"
* RCSID: "$Id: editordialogs.c,v 3.3 1998-09-01 19:09:27 akkana%netscape.com Exp $"
*/
#include "mozilla.h"
@ -97,6 +97,8 @@ extern int XFE_EDITOR_TABLE_IMAGE_WIDTH_RANGE;
extern int XFE_EDITOR_TABLE_IMAGE_HEIGHT_RANGE;
extern int XFE_EDITOR_TABLE_IMAGE_SPACE_RANGE;
extern int XP_EDT_I18N_HAS_CHARSET;
#define IMAGE_MIN_WIDTH 1
#define IMAGE_MAX_WIDTH 10000
#define IMAGE_MIN_HEIGHT 1
@ -11543,7 +11545,7 @@ fe_HintDialog(MWContext* context, char* message)
XtManageChild(dialog);
done = XmDIALOG_NONE;
while (done == XmDIALOG_NONE) {
while (done == XmDIALOG_NONE) {
fe_EventLoop();
}
@ -11555,4 +11557,85 @@ fe_HintDialog(MWContext* context, char* message)
return FALSE;
}
ED_CharsetEncode FE_EncodingDialog(MWContext* pContext)
{
char* pMessage = XP_GetString(XP_EDT_I18N_HAS_CHARSET);
#if 1
XP_Bool bDoIt = FE_Confirm(pContext, pMessage);
if (bDoIt)
return ED_ENDCODE_CHANGE_CHARSET;
else
return ED_ENCODE_CANCEL;
#else
ED_CharsetEncode retval;
struct fe_confirm_data data;
Widget mainw = CONTEXT_WIDGET (context);
Widget dialog, toggle_row, toggle_button;
Arg av [20];
int ac;
Visual *v = 0;
Colormap cmap = 0;
Cardinal depth = 0;
XtVaGetValues (mainw, XtNvisual, &v, XtNcolormap, &cmap,
XtNdepth, &depth, 0);
xm_message = XmStringCreateLocalized(message);
ac = 0;
XtSetArg(av[ac], XmNvisual, v); ac++;
XtSetArg(av[ac], XmNdepth, depth); ac++;
XtSetArg(av[ac], XmNcolormap, cmap); ac++;
XtSetArg(av[ac], XmNtransientFor, mainw); ac++;
XtSetArg(av[ac], XmNdefaultButtonType, XmDIALOG_OK_BUTTON); ac++;
XtSetArg(av[ac], XmNmessageString, xm_message); ac++;
dialog = XmCreateInformationDialog(mainw, "changeEncoding", av, ac);
ac = 0;
toggle_radio = XmCreateRadioBox(dialog, "_radio", ac, av);
XtManageChild(toggle_radio);
ac = 0;
XtSetArg(av[ac], XmNindicatorType, XmN_OF_MANY); ac++;
toggle_button = XmCreateToggleButtonGadget(toggle_radio, "encodeContent",
args, n);
XtManageChild(toggle_button);
toggle_button = XmCreateToggleButtonGadget(toggle_radio,
"dontEncodeContent", args, n);
XtManageChild(toggle_button);
fe_UnmanageChild_safe(XmSelectionBoxGetChild(dialog,
XmDIALOG_APPLY_BUTTON));
#ifdef NO_HELP
fe_UnmanageChild_safe (XmSelectionBoxGetChild (dialog, XmDIALOG_HELP_BUTTON));
#endif
XtManageChild (dialog);
XtAddCallback(dialog, XmNokCallback, fe_hrule_ok_cb, &done);
XtAddCallback(dialog, XmNdestroyCallback, fe_hrule_destroy_cb, &done);
data.context = context;
data.widget = dialog;
data.answer = Answer_Invalid;
while (data.answer == Answer_Invalid)
fe_EventLoop();
if (data.answer == Answer_Cancel || data.answer == Answer_Destroy)
return ED_ENCODE_CANCEL;
else if (data.answer == Answer_OK)
{
if (XmToggleButtonGetState(toggle_button))
retval = ED_ENCODE_CHANGE_METATAG;
else
retval = ED_ENDCODE_CHANGE_CHARSET;
XtDestroyWidget(dialog);
return retval;
}
#endif
}
#endif

Просмотреть файл

@ -3222,6 +3222,11 @@ dialog_cancel_button
*dontDisplayAgain.labelString: Don't display this message again.
*hintDialog.dontDisplayAgainRow.marginWidth: 9
! The Editor encoding dialog
*changeEncoding_popup.title: @NAME@: Change Encoding
*encodeContent.labelString: Change Encoding for content
*dontEncodeContent.labelString: Change encoding but leave content untouched
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Editor popups.
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~