#import "LFApp.h"
static NSMutableArray *khash;
+static NSMutableArray *check_at_save;
static LFApp *app;
static NSString *roman[] = {@"I", @"II", @"III", @"IV", @"V", @"VI", @"VII", @"VIII", @"IX", @"X"};
static NSString *dep[] = {@"ミリ", @"キロ", @"センチ", @"メートル", @"グラム", @"トン", @"アール", @"ヘクタール",
void _LF_IMP_send_(id self, SEL _cmd, id arg1)
{
- //NSLog(@"_send: %llx", backendGetPreferredEncoding([self backEnd]));
- backendSetPreferredEncoding([self backEnd], LF_Encoding_ISO2022JP); // 念のため
+ if ([app isActive] == NO) {
+ [self _LF_send: arg1];
+ return;
+ }
- if (([app isActive] != NO) && (0 < fixLetter(self, [self webView], TRUE, FALSE))) {
+ backendSetPreferredEncoding([self backEnd], LF_Encoding_ISO2022JP);
+ if (0 < fixLetter(self, [self webView], TRUE, FALSE)) {
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert addButtonWithTitle:@"変換して送信"];
[alert addButtonWithTitle:@"キャンセル"];
[alert addButtonWithTitle:@"変換せずに送信"];
[alert addButtonWithTitle:@"変換のみ"];
[alert setMessageText:@"メッセージを変換して送信しますか?"];
- [alert setInformativeText:@"送信しようとしているメッセージには ISO 2022-JP に変換できない文字が含まれています。"
- @"ISO 2022-JP で送信するためには、これらの文字を変換可能なものに置き換える必要があります。\n"
- @"変換せずに送信する場合、エンコーディング設定を「自動」に設定の上送信します。"];
+ [alert setInformativeText:@"送信しようとしているメッセージには ISO 2022-JP に変換できない文字が含まれています。"];
[alert setAlertStyle:NSInformationalAlertStyle];
[alert beginSheetModalForWindow:[self window]
modalDelegate:self
didEndSelector:@selector(_LF_alert1DidEnd:returnCode:contextInfo:)
contextInfo:arg1];
- } else if (([app isActive] != NO) && ([app isCheckSubject] != NO) && checkSubject(self)) {
+ } else if (([app isCheckSubject] != NO) && checkSubject(self)) {
_LF_alertSubject(self, _cmd, arg1);
} else {
[self _LF_send: arg1];
void _LF_IMP_saveDocument_(id self, SEL _cmd, id arg1)
{
- if (([app isActive] != NO) && (0 < fixLetter(self, [self webView], TRUE, FALSE)) && (backendGetPreferredEncoding([self backEnd]) == LF_Encoding_ISO2022JP)) {
+ if (([app isActive] != NO) && ([check_at_save containsObject:self]==NO) &&(0 < fixLetter(self, [self webView], TRUE, FALSE)) && (backendGetPreferredEncoding([self backEnd]) == LF_Encoding_ISO2022JP)) {
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert addButtonWithTitle:@"変換"];
[alert addButtonWithTitle:@"変換しない"];
[alert setMessageText:@"保存前にメッセージを変換しますか?"];
- [alert setInformativeText:@"このメッセージには ISO 2022-JP エンコーディングに変換できない文字が含まれています。"];
+ [alert setInformativeText:@"このメッセージには ISO 2022-JP エンコーディングに変換できない文字が含まれています。\n"
+ @"変換しないを選択した場合、メールの送信またはウインドウを開き直すまでエンコーディングの確認を行いません。"];
[alert setAlertStyle:NSWarningAlertStyle];
[alert beginSheetModalForWindow:[self window] modalDelegate:self didEndSelector:@selector(_LF_alert2DidEnd:returnCode:contextInfo:) contextInfo:arg1];
} else {
if (returnCode == NSAlertFirstButtonReturn) {
fixLetter(self, [self webView], FALSE, FALSE);
} else if (returnCode == NSAlertSecondButtonReturn) {
+ [check_at_save addObject:self];
}
[[alert window] orderOut:arg1];
[self _LF_saveDocument: (id)arg1];
[self registerBundle];
khash = [[NSMutableArray alloc] initWithCapacity:1];
+ check_at_save = [[NSMutableArray alloc] initWithCapacity:1];
app = [[LFApp alloc] init];