|
|
@ -74,32 +74,35 @@ void SetMacLocaleByIdentifier(const QString& id) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBKeyboardPalette::onActivated(bool activated) |
|
|
|
|
|
|
|
|
|
|
|
void UBKeyboardPalette::checkLayout() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (activated) |
|
|
|
TISInputSourceRef selectedLocale = TISCopyCurrentKeyboardInputSource(); |
|
|
|
{ |
|
|
|
|
|
|
|
TISInputSourceRef selectedLocale = TISCopyCurrentKeyboardInputSource(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CFStringRef sr = (CFStringRef) TISGetInputSourceProperty(selectedLocale, |
|
|
|
|
|
|
|
kTISPropertyInputSourceID);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sr!=NULL) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
char tmp[1024]; |
|
|
|
|
|
|
|
CFStringGetCString(sr, tmp, 1024, 0); |
|
|
|
|
|
|
|
activeLocale = tmp;
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
activeLocale = ""; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onLocaleChanged(locales[nCurrentLocale]); |
|
|
|
CFStringRef sr = (CFStringRef) TISGetInputSourceProperty(selectedLocale, |
|
|
|
} |
|
|
|
kTISPropertyInputSourceID); |
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
if (sr!=NULL) |
|
|
|
if (activeLocale != "") |
|
|
|
{ |
|
|
|
SetMacLocaleByIdentifier(activeLocale); |
|
|
|
char clId[1024]; |
|
|
|
} |
|
|
|
CFStringGetCString(sr, clId, 1024, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(int i=0; i<nLocalesCount;i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (locales[i]->id == clId) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (nCurrentLocale!=i) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
setLocale(i); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBKeyboardPalette::onActivated(bool) |
|
|
|
|
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBKeyboardPalette::onLocaleChanged(UBKeyboardLocale* locale) |
|
|
|
void UBKeyboardPalette::onLocaleChanged(UBKeyboardLocale* locale) |
|
|
|