diff --git a/mozilla/cmd/macfe/Composer/meditdlg.cp b/mozilla/cmd/macfe/Composer/meditdlg.cp index 5bc761f6e45..0547894c072 100644 --- a/mozilla/cmd/macfe/Composer/meditdlg.cp +++ b/mozilla/cmd/macfe/Composer/meditdlg.cp @@ -3331,8 +3331,8 @@ void CEDParagraphContain::PrefsFromControls() switch (fListStylePopup->GetValue()) { case 1: list->iTagType = P_UNUM_LIST; break; case 2: list->iTagType = P_NUM_LIST; break; - case 3: list->iTagType = P_DIRECTORY; break; - case 4: list->iTagType = P_MENU; break; +// case 3: list->iTagType = P_DIRECTORY; break; +// case 4: list->iTagType = P_MENU; break; case 5: list->iTagType = P_DESC_LIST; break; } @@ -3410,8 +3410,8 @@ void CEDParagraphContain::ControlsFromPref() switch (list->iTagType) { case P_UNUM_LIST: fListStylePopup->SetValue(1); break; case P_NUM_LIST: fListStylePopup->SetValue(2); break; - case P_DIRECTORY: fListStylePopup->SetValue(3); break; - case P_MENU: fListStylePopup->SetValue(4); break; +// case P_DIRECTORY: fListStylePopup->SetValue(3); break; +// case P_MENU: fListStylePopup->SetValue(4); break; case P_DESC_LIST: fListStylePopup->SetValue(5); break; default: fListStylePopup->SetValue(1); break; // assert? } @@ -3643,9 +3643,11 @@ void CEDLinkContain::Show() void CEDLinkContain::Hide() { - if ( *fLinkName ) - XP_FREE( *fLinkName ); - *fLinkName = fLinkedTextEdit->GetLongDescriptor(); + if ( fLinkName ) + { + XP_FREEIF( *fLinkName ); + *fLinkName = fLinkedTextEdit->GetLongDescriptor(); + } CEditContain::Hide(); } diff --git a/mozilla/cmd/macfe/Composer/meditdlg.h b/mozilla/cmd/macfe/Composer/meditdlg.h index 5f67b20fb0c..ad29ad7e054 100644 --- a/mozilla/cmd/macfe/Composer/meditdlg.h +++ b/mozilla/cmd/macfe/Composer/meditdlg.h @@ -376,7 +376,8 @@ public: class CEditContain: public CEditorPrefContain, public LBroadcaster { public: - CEditContain(LStream* inStream): CEditorPrefContain( inStream ){ pExtra = NULL; } + CEditContain(LStream* inStream): CEditorPrefContain( inStream ) + { fContext = NULL; fLinkName = NULL; pExtra = NULL; } // initialize everything to NULL ~CEditContain(){ XP_FREEIF(pExtra); } void SetContext(MWContext* context) {fContext = context;} diff --git a/mozilla/cmd/macfe/Composer/meditor.cp b/mozilla/cmd/macfe/Composer/meditor.cp index d247a5afd27..746a4ae424c 100644 --- a/mozilla/cmd/macfe/Composer/meditor.cp +++ b/mozilla/cmd/macfe/Composer/meditor.cp @@ -248,18 +248,47 @@ void FE_FinishedSave( MWContext * /* pMWContext */, int /* status */, char * /* { } -ED_CharsetEncode FE_EncodingDialog( MWContext* pContext ) +ED_CharsetEncode FE_EncodingDialog( MWContext* pContext, char *pCharset ) { -#if 0 - switch (HandleModalDialog( EDITDLG_ENCODING, NULL, NULL )) - { - case ED_ENCODE_CANCEL: return ED_ENCODE_CANCEL; - case ED_ENCODE_CHANGE_CHARSET: return ED_ENCODE_CHANGE_CHARSET; - case ED_ENCODE_CHANGE_METATAG: return ED_ENCODE_CHANGE_METATAG; - } -#endif + StPrepareForDialog prepare; + + StBlockingDialogHandler handler( EDITDLG_ENCODING, NULL ); + LDialogBox* dialog = (LDialogBox *)handler.GetDialog(); + LGARadioButton *change_charset = (LGARadioButton *)dialog->FindPaneByID( 'ccst' ); //radio button for Change Charset + LGARadioButton *change_metatag = (LGARadioButton *)dialog->FindPaneByID( 'cmta' ); //radio button for Change Meta-tag + LCaption *charset_capt = (LCaption *)dialog->FindPaneByID( 'cap1' ); + LCaption *metatag_capt = (LCaption *)dialog->FindPaneByID( 'cap2' ); + + int iBufLen = 255; + char buf[256]; + char *pCharsetMsg = NULL; + char *pMetatagMsg = NULL; + PR_snprintf(buf, iBufLen, "Convert the Current Page to \"%s\"", pCharset); + pCharsetMsg = PR_sprintf_append(pCharsetMsg, buf); + PR_snprintf(buf, iBufLen, "Change the Character Set Label to \"%s\"", pCharset); + pMetatagMsg = PR_sprintf_append(pMetatagMsg, buf); + + change_charset->SetDescriptor ( (CStr255) pCharsetMsg ); + change_metatag->SetDescriptor ( (CStr255) pMetatagMsg ); + charset_capt->SetDescriptor ( (CStr255) XP_GetString(XP_EDT_CHARSET_CONVERT_PAGE) ); + metatag_capt->SetDescriptor ( (CStr255) XP_GetString(XP_EDT_CHARSET_SET_METATAG) ); + + MessageT message; + do { + dialog->Show(); + message = handler.DoDialog(); + } while ( message == 0 || message == msg_ControlClicked ); + // doesn't matter if the user merely switches between radio buttons (msg_ControlClicked) + // stop only when the message is msg_OK or msg_Cancel - return ED_ENCODE_CANCEL; // shouldn't get here... + switch (message) + { + case msg_OK: + if ( change_charset->GetValue() ) return ED_ENCODE_CHANGE_CHARSET; + else if ( change_metatag->GetValue() ) return ED_ENCODE_CHANGE_METATAG; + default: // only msg_Cancel should get here, since there is always one radio button selected at any given time + return ED_ENCODE_CANCEL; + } } // in xp_file.h diff --git a/mozilla/cmd/macfe/include/resgui.h b/mozilla/cmd/macfe/include/resgui.h index af2443345dc..acf63be84e5 100644 --- a/mozilla/cmd/macfe/include/resgui.h +++ b/mozilla/cmd/macfe/include/resgui.h @@ -828,6 +828,7 @@ #define EDITDLG_SAVE_BEFORE_QUIT 5109 #define EDITDLG_COPYRIGHT_WARNING 5110 #define EDITDLG_SAVE_BEFORE_BROWSE 5111 +#define EDITDLG_ENCODING 5112 #define EDITDLG_UNKNOWN_TAG 5113 #define EDITDLG_TABLE 5116 #define EDITDLG_PUBLISH 5117 diff --git a/mozilla/cmd/macfe/rsrc/navigator/MenusRat.cnst b/mozilla/cmd/macfe/rsrc/navigator/MenusRat.cnst index b2046f91e74..42d88a8154b 100644 Binary files a/mozilla/cmd/macfe/rsrc/navigator/MenusRat.cnst and b/mozilla/cmd/macfe/rsrc/navigator/MenusRat.cnst differ