AppDelegate // Make Debug Print Function Global, etc.
This commit is contained in:
parent
4d71c58d03
commit
72b7b757b0
|
@ -24,6 +24,7 @@ private let kCheckUpdateAutomatically = "CheckUpdateAutomatically"
|
||||||
private let kNextUpdateCheckDateKey = "NextUpdateCheckDate"
|
private let kNextUpdateCheckDateKey = "NextUpdateCheckDate"
|
||||||
private let kUpdateInfoEndpointKey = "UpdateInfoEndpoint"
|
private let kUpdateInfoEndpointKey = "UpdateInfoEndpoint"
|
||||||
private let kUpdateInfoSiteKey = "UpdateInfoSite"
|
private let kUpdateInfoSiteKey = "UpdateInfoSite"
|
||||||
|
private let kVersionDescription = "VersionDescription"
|
||||||
private let kNextCheckInterval: TimeInterval = 86400.0
|
private let kNextCheckInterval: TimeInterval = 86400.0
|
||||||
private let kTimeoutInterval: TimeInterval = 60.0
|
private let kTimeoutInterval: TimeInterval = 60.0
|
||||||
|
|
||||||
|
@ -93,21 +94,23 @@ struct VersionUpdateApi {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
forced ? callback(.success(.noNeedToUpdate)) : callback(.success(.ignored))
|
forced ? callback(.success(.noNeedToUpdate)) : callback(.success(.ignored))
|
||||||
}
|
}
|
||||||
|
IME.prtDebugIntel("vChewingDebug: Update // Order is not Ascending, assuming that there's no new version available.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
IME.prtDebugIntel("vChewingDebug: Update // New version detected, proceeding to the next phase.")
|
||||||
guard let siteInfoURLString = plist[kUpdateInfoSiteKey] as? String,
|
guard let siteInfoURLString = plist[kUpdateInfoSiteKey] as? String,
|
||||||
let siteInfoURL = URL(string: siteInfoURLString)
|
let siteInfoURL = URL(string: siteInfoURLString)
|
||||||
else {
|
else {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
forced ? callback(.success(.noNeedToUpdate)) : callback(.success(.ignored))
|
forced ? callback(.success(.noNeedToUpdate)) : callback(.success(.ignored))
|
||||||
}
|
}
|
||||||
|
IME.prtDebugIntel("vChewingDebug: Update // Failed from retrieving / parsing URL intel.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
IME.prtDebugIntel("vChewingDebug: Update // URL intel retrieved, proceeding to the next phase.")
|
||||||
var report = VersionUpdateReport(siteUrl: siteInfoURL)
|
var report = VersionUpdateReport(siteUrl: siteInfoURL)
|
||||||
var versionDescription = ""
|
var versionDescription = ""
|
||||||
let versionDescriptions = plist["Description"] as? [AnyHashable: Any]
|
let versionDescriptions = plist[kVersionDescription] as? [AnyHashable: Any]
|
||||||
if let versionDescriptions = versionDescriptions {
|
if let versionDescriptions = versionDescriptions {
|
||||||
var locale = "en"
|
var locale = "en"
|
||||||
let supportedLocales = ["en", "zh-Hant", "zh-Hans", "ja"]
|
let supportedLocales = ["en", "zh-Hant", "zh-Hans", "ja"]
|
||||||
|
@ -128,6 +131,7 @@ struct VersionUpdateApi {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
callback(.success(.shouldUpdate(report: report)))
|
callback(.success(.shouldUpdate(report: report)))
|
||||||
}
|
}
|
||||||
|
IME.prtDebugIntel("vChewingDebug: Update // Callbck Complete.")
|
||||||
} catch {
|
} catch {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
forced ? callback(.success(.noNeedToUpdate)) : callback(.success(.ignored))
|
forced ? callback(.success(.noNeedToUpdate)) : callback(.success(.ignored))
|
||||||
|
@ -248,6 +252,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, ctlNonModalAlertWindowDelega
|
||||||
report.remoteShortVersion,
|
report.remoteShortVersion,
|
||||||
report.remoteVersion,
|
report.remoteVersion,
|
||||||
report.versionDescription)
|
report.versionDescription)
|
||||||
|
IME.prtDebugIntel("vChewingDebug: \(content)")
|
||||||
ctlNonModalAlertWindow.shared.show(title: NSLocalizedString("New Version Available", comment: ""), content: content, confirmButtonTitle: NSLocalizedString("Visit Website", comment: ""), cancelButtonTitle: NSLocalizedString("Not Now", comment: ""), cancelAsDefault: false, delegate: self)
|
ctlNonModalAlertWindow.shared.show(title: NSLocalizedString("New Version Available", comment: ""), content: content, confirmButtonTitle: NSLocalizedString("Visit Website", comment: ""), cancelButtonTitle: NSLocalizedString("Not Now", comment: ""), cancelAsDefault: false, delegate: self)
|
||||||
case .noNeedToUpdate, .ignored:
|
case .noNeedToUpdate, .ignored:
|
||||||
break
|
break
|
||||||
|
@ -258,6 +263,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, ctlNonModalAlertWindowDelega
|
||||||
let title = NSLocalizedString("Update Check Failed", comment: "")
|
let title = NSLocalizedString("Update Check Failed", comment: "")
|
||||||
let content = String(format: NSLocalizedString("There may be no internet connection or the server failed to respond.\n\nError message: %@", comment: ""), message)
|
let content = String(format: NSLocalizedString("There may be no internet connection or the server failed to respond.\n\nError message: %@", comment: ""), message)
|
||||||
let buttonTitle = NSLocalizedString("Dismiss", comment: "")
|
let buttonTitle = NSLocalizedString("Dismiss", comment: "")
|
||||||
|
IME.prtDebugIntel("vChewingDebug: \(content)")
|
||||||
ctlNonModalAlertWindow.shared.show(title: title, content: content, confirmButtonTitle: buttonTitle, cancelButtonTitle: nil, cancelAsDefault: false, delegate: nil)
|
ctlNonModalAlertWindow.shared.show(title: title, content: content, confirmButtonTitle: buttonTitle, cancelButtonTitle: nil, cancelAsDefault: false, delegate: nil)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
|
@ -276,10 +282,19 @@ class AppDelegate: NSObject, NSApplicationDelegate, ctlNonModalAlertWindowDelega
|
||||||
func ctlNonModalAlertWindowDidCancel(_ controller: ctlNonModalAlertWindow) {
|
func ctlNonModalAlertWindowDidCancel(_ controller: ctlNonModalAlertWindow) {
|
||||||
updateNextStepURL = nil
|
updateNextStepURL = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// New About Window
|
// New About Window
|
||||||
@IBAction func about(_ sender: Any) {
|
@IBAction func about(_ sender: Any) {
|
||||||
(NSApp.delegate as? AppDelegate)?.showAbout()
|
(NSApp.delegate as? AppDelegate)?.showAbout()
|
||||||
NSApplication.shared.activate(ignoringOtherApps: true)
|
NSApplication.shared.activate(ignoringOtherApps: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc public class IME: NSObject {
|
||||||
|
// Print debug information to the console.
|
||||||
|
@objc static func prtDebugIntel(_ strPrint: String) {
|
||||||
|
if Preferences.isDebugModeEnabled {
|
||||||
|
NSLog("vChewingErrorCallback: %@", strPrint)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -354,7 +354,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
|
|
||||||
// see if we have a unigram for this
|
// see if we have a unigram for this
|
||||||
if (!_languageModel->hasUnigramsForKey(reading)) {
|
if (!_languageModel->hasUnigramsForKey(reading)) {
|
||||||
[self errorCallbackConsolePrint:@"B49C0979"];
|
[IME prtDebugIntel:@"B49C0979"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
||||||
stateCallback(inputting);
|
stateCallback(inputting);
|
||||||
|
@ -578,7 +578,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
// strange behavior if we don't do this, "thinking" the key is not
|
// strange behavior if we don't do this, "thinking" the key is not
|
||||||
// actually consumed)
|
// actually consumed)
|
||||||
if ([state isKindOfClass:[InputStateNotEmpty class]] || !_bpmfReadingBuffer->isEmpty()) {
|
if ([state isKindOfClass:[InputStateNotEmpty class]] || !_bpmfReadingBuffer->isEmpty()) {
|
||||||
[self errorCallbackConsolePrint:@"A9BFF20E"];
|
[IME prtDebugIntel:@"A9BFF20E"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -629,7 +629,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_bpmfReadingBuffer->isEmpty()) {
|
if (!_bpmfReadingBuffer->isEmpty()) {
|
||||||
[self errorCallbackConsolePrint:@"6ED95318"];
|
[IME prtDebugIntel:@"6ED95318"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -645,7 +645,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
marking.tooltipForInputting = currentState.tooltip;
|
marking.tooltipForInputting = currentState.tooltip;
|
||||||
stateCallback(marking);
|
stateCallback(marking);
|
||||||
} else {
|
} else {
|
||||||
[self errorCallbackConsolePrint:@"D326DEA3"];
|
[IME prtDebugIntel:@"D326DEA3"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
}
|
}
|
||||||
|
@ -655,7 +655,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
||||||
stateCallback(inputting);
|
stateCallback(inputting);
|
||||||
} else {
|
} else {
|
||||||
[self errorCallbackConsolePrint:@"7045E6F3"];
|
[IME prtDebugIntel:@"7045E6F3"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
}
|
}
|
||||||
|
@ -670,7 +670,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_bpmfReadingBuffer->isEmpty()) {
|
if (!_bpmfReadingBuffer->isEmpty()) {
|
||||||
[self errorCallbackConsolePrint:@"B3BA5257"];
|
[IME prtDebugIntel:@"B3BA5257"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -686,7 +686,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
marking.tooltipForInputting = currentState.tooltip;
|
marking.tooltipForInputting = currentState.tooltip;
|
||||||
stateCallback(marking);
|
stateCallback(marking);
|
||||||
} else {
|
} else {
|
||||||
[self errorCallbackConsolePrint:@"BB7F6DB9"];
|
[IME prtDebugIntel:@"BB7F6DB9"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
}
|
}
|
||||||
|
@ -696,7 +696,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
||||||
stateCallback(inputting);
|
stateCallback(inputting);
|
||||||
} else {
|
} else {
|
||||||
[self errorCallbackConsolePrint:@"A96AAD58"];
|
[IME prtDebugIntel:@"A96AAD58"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
}
|
}
|
||||||
|
@ -712,7 +712,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_bpmfReadingBuffer->isEmpty()) {
|
if (!_bpmfReadingBuffer->isEmpty()) {
|
||||||
[self errorCallbackConsolePrint:@"ABC44080"];
|
[IME prtDebugIntel:@"ABC44080"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -723,7 +723,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
||||||
stateCallback(inputting);
|
stateCallback(inputting);
|
||||||
} else {
|
} else {
|
||||||
[self errorCallbackConsolePrint:@"66D97F90"];
|
[IME prtDebugIntel:@"66D97F90"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
}
|
}
|
||||||
|
@ -738,7 +738,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_bpmfReadingBuffer->isEmpty()) {
|
if (!_bpmfReadingBuffer->isEmpty()) {
|
||||||
[self errorCallbackConsolePrint:@"9B69908D"];
|
[IME prtDebugIntel:@"9B69908D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -749,7 +749,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
||||||
stateCallback(inputting);
|
stateCallback(inputting);
|
||||||
} else {
|
} else {
|
||||||
[self errorCallbackConsolePrint:@"9B69908E"];
|
[IME prtDebugIntel:@"9B69908E"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
}
|
}
|
||||||
|
@ -764,7 +764,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_bpmfReadingBuffer->isEmpty()) {
|
if (!_bpmfReadingBuffer->isEmpty()) {
|
||||||
[self errorCallbackConsolePrint:@"9B6F908D"];
|
[IME prtDebugIntel:@"9B6F908D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
|
@ -782,7 +782,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
_builder->deleteReadingBeforeCursor();
|
_builder->deleteReadingBeforeCursor();
|
||||||
[self _walk];
|
[self _walk];
|
||||||
} else {
|
} else {
|
||||||
[self errorCallbackConsolePrint:@"9D69908D"];
|
[IME prtDebugIntel:@"9D69908D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -819,12 +819,12 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
stateCallback(inputting);
|
stateCallback(inputting);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
[self errorCallbackConsolePrint:@"9B69938D"];
|
[IME prtDebugIntel:@"9B69938D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
[self errorCallbackConsolePrint:@"9C69908D"];
|
[IME prtDebugIntel:@"9C69908D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
}
|
}
|
||||||
|
@ -878,7 +878,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
_builder->insertReadingAtCursor(customPunctuation);
|
_builder->insertReadingAtCursor(customPunctuation);
|
||||||
poppedText = [self _popOverflowComposingTextAndWalk];
|
poppedText = [self _popOverflowComposingTextAndWalk];
|
||||||
} else { // If there is still unfinished bpmf reading, ignore the punctuation
|
} else { // If there is still unfinished bpmf reading, ignore the punctuation
|
||||||
[self errorCallbackConsolePrint:@"A9B69908D"];
|
[IME prtDebugIntel:@"A9B69908D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -920,7 +920,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
// Enter
|
// Enter
|
||||||
if ([input isEnter]) {
|
if ([input isEnter]) {
|
||||||
if (![self.delegate keyHandler:self didRequestWriteUserPhraseWithState:state]) {
|
if (![self.delegate keyHandler:self didRequestWriteUserPhraseWithState:state]) {
|
||||||
[self errorCallbackConsolePrint:@"5B69CC8D"];
|
[IME prtDebugIntel:@"5B69CC8D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
@ -945,7 +945,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
stateCallback(marking);
|
stateCallback(marking);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
[self errorCallbackConsolePrint:@"1149908D"];
|
[IME prtDebugIntel:@"1149908D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
}
|
}
|
||||||
|
@ -967,7 +967,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
stateCallback(marking);
|
stateCallback(marking);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
[self errorCallbackConsolePrint:@"9B51408D"];
|
[IME prtDebugIntel:@"9B51408D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
stateCallback(state);
|
stateCallback(state);
|
||||||
}
|
}
|
||||||
|
@ -984,8 +984,6 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
{
|
{
|
||||||
NSString *inputText = input.inputText;
|
NSString *inputText = input.inputText;
|
||||||
UniChar charCode = input.charCode;
|
UniChar charCode = input.charCode;
|
||||||
NSString *char2Print = [NSString stringWithCharacters:&charCode length:1];
|
|
||||||
NSLog(@"vChewingCandidateKeyDebug: %@", char2Print);
|
|
||||||
VTCandidateController *gCurrentCandidateController = [self.delegate candidateControllerForKeyHandler:self];
|
VTCandidateController *gCurrentCandidateController = [self.delegate candidateControllerForKeyHandler:self];
|
||||||
|
|
||||||
BOOL cancelCandidateKey = [input isBackSpace] || [input isESC] || [input isDelete];
|
BOOL cancelCandidateKey = [input isBackSpace] || [input isESC] || [input isDelete];
|
||||||
|
@ -1032,7 +1030,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
([input isShiftHold] ? [gCurrentCandidateController highlightPreviousCandidate] : [gCurrentCandidateController highlightNextCandidate])
|
([input isShiftHold] ? [gCurrentCandidateController highlightPreviousCandidate] : [gCurrentCandidateController highlightNextCandidate])
|
||||||
;
|
;
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"9B691919"];
|
[IME prtDebugIntel:@"9B691919"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -1041,7 +1039,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
if ([input isSpace] || [input isPageDown] || input.emacsKey == vChewingEmacsKeyNextPage) {
|
if ([input isSpace] || [input isPageDown] || input.emacsKey == vChewingEmacsKeyNextPage) {
|
||||||
BOOL updated = [gCurrentCandidateController showNextPage];
|
BOOL updated = [gCurrentCandidateController showNextPage];
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"9B691919"];
|
[IME prtDebugIntel:@"9B691919"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -1050,7 +1048,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
if ([input isPageUp]) {
|
if ([input isPageUp]) {
|
||||||
BOOL updated = [gCurrentCandidateController showPreviousPage];
|
BOOL updated = [gCurrentCandidateController showPreviousPage];
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"9569955D"];
|
[IME prtDebugIntel:@"9569955D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -1060,13 +1058,13 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
if ([gCurrentCandidateController isKindOfClass:[VTHorizontalCandidateController class]]) {
|
if ([gCurrentCandidateController isKindOfClass:[VTHorizontalCandidateController class]]) {
|
||||||
BOOL updated = [gCurrentCandidateController highlightPreviousCandidate];
|
BOOL updated = [gCurrentCandidateController highlightPreviousCandidate];
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"1145148D"];
|
[IME prtDebugIntel:@"1145148D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BOOL updated = [gCurrentCandidateController showPreviousPage];
|
BOOL updated = [gCurrentCandidateController showPreviousPage];
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"1919810D"];
|
[IME prtDebugIntel:@"1919810D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1076,7 +1074,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
if (input.emacsKey == vChewingEmacsKeyBackward) {
|
if (input.emacsKey == vChewingEmacsKeyBackward) {
|
||||||
BOOL updated = [gCurrentCandidateController highlightPreviousCandidate];
|
BOOL updated = [gCurrentCandidateController highlightPreviousCandidate];
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"9B89308D"];
|
[IME prtDebugIntel:@"9B89308D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -1086,13 +1084,13 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
if ([gCurrentCandidateController isKindOfClass:[VTHorizontalCandidateController class]]) {
|
if ([gCurrentCandidateController isKindOfClass:[VTHorizontalCandidateController class]]) {
|
||||||
BOOL updated = [gCurrentCandidateController highlightNextCandidate];
|
BOOL updated = [gCurrentCandidateController highlightNextCandidate];
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"9B65138D"];
|
[IME prtDebugIntel:@"9B65138D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BOOL updated = [gCurrentCandidateController showNextPage];
|
BOOL updated = [gCurrentCandidateController showNextPage];
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"9244908D"];
|
[IME prtDebugIntel:@"9244908D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1102,7 +1100,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
if (input.emacsKey == vChewingEmacsKeyForward) {
|
if (input.emacsKey == vChewingEmacsKeyForward) {
|
||||||
BOOL updated = [gCurrentCandidateController highlightNextCandidate];
|
BOOL updated = [gCurrentCandidateController highlightNextCandidate];
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"9B2428D"];
|
[IME prtDebugIntel:@"9B2428D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -1112,13 +1110,13 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
if ([gCurrentCandidateController isKindOfClass:[VTHorizontalCandidateController class]]) {
|
if ([gCurrentCandidateController isKindOfClass:[VTHorizontalCandidateController class]]) {
|
||||||
BOOL updated = [gCurrentCandidateController showPreviousPage];
|
BOOL updated = [gCurrentCandidateController showPreviousPage];
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"9B614524"];
|
[IME prtDebugIntel:@"9B614524"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BOOL updated = [gCurrentCandidateController highlightPreviousCandidate];
|
BOOL updated = [gCurrentCandidateController highlightPreviousCandidate];
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"ASD9908D"];
|
[IME prtDebugIntel:@"ASD9908D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1129,13 +1127,13 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
if ([gCurrentCandidateController isKindOfClass:[VTHorizontalCandidateController class]]) {
|
if ([gCurrentCandidateController isKindOfClass:[VTHorizontalCandidateController class]]) {
|
||||||
BOOL updated = [gCurrentCandidateController showNextPage];
|
BOOL updated = [gCurrentCandidateController showNextPage];
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"92B990DD"];
|
[IME prtDebugIntel:@"92B990DD"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BOOL updated = [gCurrentCandidateController highlightNextCandidate];
|
BOOL updated = [gCurrentCandidateController highlightNextCandidate];
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
[self errorCallbackConsolePrint:@"6B99908D"];
|
[IME prtDebugIntel:@"6B99908D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1144,7 +1142,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
|
|
||||||
if ([input isHome] || input.emacsKey == vChewingEmacsKeyHome) {
|
if ([input isHome] || input.emacsKey == vChewingEmacsKeyHome) {
|
||||||
if (gCurrentCandidateController.selectedCandidateIndex == 0) {
|
if (gCurrentCandidateController.selectedCandidateIndex == 0) {
|
||||||
[self errorCallbackConsolePrint:@"9B6EDE8D"];
|
[IME prtDebugIntel:@"9B6EDE8D"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
} else {
|
} else {
|
||||||
gCurrentCandidateController.selectedCandidateIndex = 0;
|
gCurrentCandidateController.selectedCandidateIndex = 0;
|
||||||
|
@ -1167,7 +1165,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
|
|
||||||
if (([input isEnd] || input.emacsKey == vChewingEmacsKeyEnd) && candidates.count > 0) {
|
if (([input isEnd] || input.emacsKey == vChewingEmacsKeyEnd) && candidates.count > 0) {
|
||||||
if (gCurrentCandidateController.selectedCandidateIndex == candidates.count - 1) {
|
if (gCurrentCandidateController.selectedCandidateIndex == candidates.count - 1) {
|
||||||
[self errorCallbackConsolePrint:@"9B69AAAD"];
|
[IME prtDebugIntel:@"9B69AAAD"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
} else {
|
} else {
|
||||||
gCurrentCandidateController.selectedCandidateIndex = candidates.count - 1;
|
gCurrentCandidateController.selectedCandidateIndex = candidates.count - 1;
|
||||||
|
@ -1245,7 +1243,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[self errorCallbackConsolePrint:@"172A0F81"];
|
[IME prtDebugIntel:@"172A0F81"];
|
||||||
errorCallback();
|
errorCallback();
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
@ -1443,11 +1441,4 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)errorCallbackConsolePrint:(NSString *)strPrint
|
|
||||||
{
|
|
||||||
if (Preferences.isDebugModeEnabled) {
|
|
||||||
NSLog(@"vChewingErrorCallback: %@", strPrint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in New Issue