Changeset View
Changeset View
Standalone View
Standalone View
krita/main.cc
Context not available. | |||||
55 | #include <kis_tablet_support_win8.h> | 55 | #include <kis_tablet_support_win8.h> | ||
---|---|---|---|---|---|
56 | #include <kis_config.h> | 56 | #include <kis_config.h> | ||
57 | #include <QLibrary> | 57 | #include <QLibrary> | ||
58 | #include <QMessageBox> | ||||
58 | 59 | | |||
59 | #elif defined HAVE_X11 | 60 | #elif defined HAVE_X11 | ||
60 | #include <kis_xi2_event_filter.h> | 61 | #include <kis_xi2_event_filter.h> | ||
Context not available. | |||||
321 | #if defined Q_OS_WIN | 322 | #if defined Q_OS_WIN | ||
322 | { | 323 | { | ||
323 | KisConfig cfg; | 324 | KisConfig cfg; | ||
324 | bool isUsingWin8PointerInput = false; | 325 | if (cfg.useWin8PointerInput() && !KisTabletSupportWin8::isAvailable()) { | ||
326 | cfg.setUseWin8PointerInput(false); | ||||
327 | } | ||||
328 | if (!cfg.useWin8PointerInput()) { | ||||
329 | bool hasWinTab = KisTabletSupportWin::init(); | ||||
330 | if (!hasWinTab) { | ||||
331 | if (KisTabletSupportWin8::isPenDeviceAvailable()) { | ||||
332 | // Use WinInk automatically | ||||
333 | cfg.setUseWin8PointerInput(true); | ||||
334 | } else if (!cfg.readEntry("WarnedAboutMissingWinTab", false)) { | ||||
335 | if (KisTabletSupportWin8::isAvailable()) { | ||||
336 | QMessageBox::information(nullptr, | ||||
337 | i18n("Krita Tablet Support"), | ||||
338 | i18n("Cannot load WinTab driver and no Windows Ink pen devices are found. If you have a drawing tablet, please make sure the tablet driver is properly installed."), | ||||
339 | QMessageBox::Ok, QMessageBox::Ok); | ||||
340 | } else { | ||||
341 | QMessageBox::information(nullptr, | ||||
342 | i18n("Krita Tablet Support"), | ||||
343 | i18n("Cannot load WinTab driver. If you have a drawing tablet, please make sure the tablet driver is properly installed."), | ||||
344 | QMessageBox::Ok, QMessageBox::Ok); | ||||
345 | } | ||||
346 | cfg.writeEntry("WarnedAboutMissingWinTab", true); | ||||
347 | } | ||||
348 | } | ||||
349 | } | ||||
325 | if (cfg.useWin8PointerInput()) { | 350 | if (cfg.useWin8PointerInput()) { | ||
326 | KisTabletSupportWin8 *penFilter = new KisTabletSupportWin8(); | 351 | KisTabletSupportWin8 *penFilter = new KisTabletSupportWin8(); | ||
327 | if (penFilter->init()) { | 352 | if (penFilter->init()) { | ||
328 | // penFilter.registerPointerDeviceNotifications(); | 353 | // penFilter.registerPointerDeviceNotifications(); | ||
329 | app.installNativeEventFilter(penFilter); | 354 | app.installNativeEventFilter(penFilter); | ||
330 | isUsingWin8PointerInput = true; | | |||
331 | qDebug() << "Using Win8 Pointer Input for tablet support"; | 355 | qDebug() << "Using Win8 Pointer Input for tablet support"; | ||
332 | } else { | 356 | } else { | ||
333 | qDebug() << "No Win8 Pointer Input available"; | 357 | qDebug() << "No Win8 Pointer Input available"; | ||
334 | delete penFilter; | 358 | delete penFilter; | ||
335 | } | 359 | } | ||
336 | } | 360 | } | ||
337 | if (!isUsingWin8PointerInput) { | | |||
338 | KisTabletSupportWin::init(); | | |||
339 | // app.installNativeEventFilter(new KisTabletSupportWin()); | | |||
340 | } | | |||
341 | } | 361 | } | ||
342 | #endif | 362 | #endif | ||
343 | 363 | | |||
Context not available. | |||||
365 | 385 | | |||
366 | return state; | 386 | return state; | ||
367 | } | 387 | } | ||
368 | | ||||
Context not available. |