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

preferencesAboutTextFull
Clément Fauconnier 2 years ago
parent e9eeffd807
commit 333b2eb322
  1. 6
      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);
else
mPaletteManager->showVirtualKeyboard(show);
}
@ -2171,7 +2170,10 @@ void UBBoardController::stylusToolChanged(int tool)
if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text)
{
if(mPaletteManager->mKeyboardPalette->m_isVisible)
UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger);
{
if (!UBPlatformUtils::errorOpeningVirtualKeyboard)
UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger);
}
}
}

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

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

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

Loading…
Cancel
Save