prevent the same error to popup again and again if something went wrong while trying to open the virtual keyboard

preferencesAboutTextFull
Clément Fauconnier 3 years ago
parent e9eeffd807
commit 333b2eb322
  1. 4
      src/board/UBBoardController.cpp
  2. 4
      src/frameworks/UBPlatformUtils.cpp
  3. 2
      src/frameworks/UBPlatformUtils.h
  4. 7
      src/frameworks/UBPlatformUtils_mac.mm

@ -875,7 +875,6 @@ void UBBoardController::showKeyboard(bool show)
UBPlatformUtils::showOSK(show); UBPlatformUtils::showOSK(show);
else else
mPaletteManager->showVirtualKeyboard(show); mPaletteManager->showVirtualKeyboard(show);
} }
@ -2171,9 +2170,12 @@ void UBBoardController::stylusToolChanged(int tool)
if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text) if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text)
{ {
if(mPaletteManager->mKeyboardPalette->m_isVisible) if(mPaletteManager->mKeyboardPalette->m_isVisible)
{
if (!UBPlatformUtils::errorOpeningVirtualKeyboard)
UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger); UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger);
} }
} }
}
} }

@ -66,7 +66,9 @@ UBKeyboardLocale::~UBKeyboardLocale()
int UBPlatformUtils::nKeyboardLayouts; int UBPlatformUtils::nKeyboardLayouts;
UBKeyboardLocale** UBPlatformUtils::keyboardLayouts; UBKeyboardLocale** UBPlatformUtils::keyboardLayouts;
#ifdef Q_OS_OSX
bool UBPlatformUtils::errorOpeningVirtualKeyboard = false;
#endif
UBKeyboardLocale** UBPlatformUtils::getKeyboardLayouts(int& nCount) UBKeyboardLocale** UBPlatformUtils::getKeyboardLayouts(int& nCount)
{ {
nCount = nKeyboardLayouts; nCount = nKeyboardLayouts;

@ -213,6 +213,8 @@ public:
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
static void SetMacLocaleByIdentifier(const QString& id); static void SetMacLocaleByIdentifier(const QString& id);
static void toggleFinder(const bool on); static void toggleFinder(const bool on);
static bool errorOpeningVirtualKeyboard;
#endif #endif
}; };

@ -684,6 +684,7 @@ void UBPlatformUtils::showOSK(bool show)
tell application \"System Events\"\n\ tell application \"System Events\"\n\
tell application process \"TextInputMenuAgent\"\n\ tell application process \"TextInputMenuAgent\"\n\
tell menu 1 of menu bar item 1 of menu bar 2\n\ tell menu 1 of menu bar item 1 of menu bar 2\n\
delay 0.2\n\
click menu item 2\n\ click menu item 2\n\
end tell\n\ end tell\n\
end tell\n\ end tell\n\
@ -696,6 +697,8 @@ void UBPlatformUtils::showOSK(bool show)
if(errorInfo!=nil) if(errorInfo!=nil)
{ {
errorOpeningVirtualKeyboard = true;
NSAlert *alert = [[NSAlert alloc] init]; NSAlert *alert = [[NSAlert alloc] init];
if (alert != nil) if (alert != nil)
@ -711,5 +714,9 @@ void UBPlatformUtils::showOSK(bool show)
UBApplication::mainWindow->actionVirtualKeyboard->setChecked(true); UBApplication::mainWindow->actionVirtualKeyboard->setChecked(true);
} }
} }
else
{
errorOpeningVirtualKeyboard = false;
}
} }
} }

Loading…
Cancel
Save