Commit a9db6c44 authored by Claudio Valerio's avatar Claudio Valerio

introduced the possibility to choose the wanted on screen keyboard

parent 4781a9bf
......@@ -88,6 +88,7 @@
#ifdef Q_WS_X11
#include <QProcess>
bool onboardIsAlreadyRunning = true;
#endif
UBBoardController::UBBoardController(UBMainWindow* mainWindow)
......@@ -165,8 +166,10 @@ void UBBoardController::init()
UBBoardController::~UBBoardController()
{
#ifdef Q_WS_X11
QProcess newProcess;
newProcess.startDetached("killall onboard");
if(!onboardIsAlreadyRunning){
QProcess newProcess;
newProcess.startDetached("killall onboard");
}
#endif
delete mDisplayView;
}
......@@ -826,8 +829,26 @@ void UBBoardController::showKeyboard(bool show)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
#ifdef Q_WS_X11
QProcess newProcess;
newProcess.startDetached("/usr/bin/onboard");
static bool isFirstTime = true;
if(isFirstTime){
QProcess isAlreadyRunningProcess;
QString psAuxGrepC = "ps aux";
isAlreadyRunningProcess.start(psAuxGrepC);
isAlreadyRunningProcess.waitForFinished();
QString output(isAlreadyRunningProcess.readAll());
if(output.count("onboard") != 0)
onboardIsAlreadyRunning = true;
else
onboardIsAlreadyRunning = false;
isFirstTime = false;
}
if(UBSettings::settings()->useSystemOnScreenKeybard->get().toBool()){
QProcess newProcess;
newProcess.startDetached("/usr/bin/onboard");
}
else
mPaletteManager->showVirtualKeyboard(show);
#else
mPaletteManager->showVirtualKeyboard(show);
#endif
......
......@@ -415,6 +415,8 @@ void UBSettings::init()
libIconSize = new UBSetting(this, "Library", "LibIconSize", defaultLibraryIconSize);
useSystemOnScreenKeybard = new UBSetting(this, "App", "UseSystemOnScreenKeybard", false);
cleanNonPersistentSettings();
}
......
......@@ -374,6 +374,8 @@ class UBSettings : public QObject
UBSetting* libIconSize;
UBSetting* useSystemOnScreenKeybard;
UBSetting* magnifierDrawingMode;
UBSetting* autoSaveInterval;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment