|
Lines 30-35
Link Here
|
| 30 |
#include <kiconloader.h> |
30 |
#include <kiconloader.h> |
| 31 |
#include <qlabel.h> |
31 |
#include <qlabel.h> |
| 32 |
#include <qdesktopwidget.h> |
32 |
#include <qdesktopwidget.h> |
|
|
33 |
#include <kprocess.h> |
| 34 |
#include <kstandarddirs.h> |
| 33 |
|
35 |
|
| 34 |
#include "ktimerdialog.h" |
36 |
#include "ktimerdialog.h" |
| 35 |
#include "legacyrandrscreen.h" |
37 |
#include "legacyrandrscreen.h" |
|
Lines 103-114
bool LegacyRandRScreen::applyProposed()
Link Here
|
| 103 |
m_currentSize = m_proposedSize; |
105 |
m_currentSize = m_proposedSize; |
| 104 |
m_currentRotation = m_proposedRotation; |
106 |
m_currentRotation = m_proposedRotation; |
| 105 |
m_currentRefreshRate = m_proposedRefreshRate; |
107 |
m_currentRefreshRate = m_proposedRefreshRate; |
|
|
108 |
|
| 109 |
// search wacom utility and set orientation for available wacom pointers |
| 110 |
QString xsetwacom = KStandardDirs::findExe("xsetwacom"); |
| 111 |
if (!xsetwacom.isEmpty()) { |
| 112 |
m_wacomPointers.clear(); |
| 113 |
KProcess *proc = new KProcess; |
| 114 |
connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), SLOT(gotAvailablePointers(KProcess *, char *, int))); |
| 115 |
*proc << "xsetwacom" << "list"; |
| 116 |
if (!proc->start(KProcess::Block,KProcess::Stdout)) |
| 117 |
kdError("Could not ask xsetwacom for available pointers."); |
| 118 |
else { |
| 119 |
for ( QStringList::Iterator it = m_wacomPointers.begin(); it != m_wacomPointers.end(); ++it ) { |
| 120 |
KProcess *set = new KProcess; |
| 121 |
*set << "xsetwacom" << "set" << (*it) << "Rotate"; |
| 122 |
switch (m_currentRotation) { |
| 123 |
case RR_Rotate_90: |
| 124 |
*set << "CW"; |
| 125 |
break; |
| 126 |
case RR_Rotate_180: |
| 127 |
*set << "HALF"; |
| 128 |
break; |
| 129 |
case RR_Rotate_270: |
| 130 |
*set << "CCW"; |
| 131 |
break; |
| 132 |
default: |
| 133 |
*set << "NONE"; |
| 134 |
} |
| 135 |
if (!set->start()) |
| 136 |
kdError("Could not set orientation for wacom pointers."); |
| 137 |
} |
| 138 |
} |
| 139 |
} |
| 140 |
|
| 106 |
return true; |
141 |
return true; |
| 107 |
} |
142 |
} |
| 108 |
|
143 |
|
| 109 |
return false; |
144 |
return false; |
| 110 |
} |
145 |
} |
| 111 |
|
146 |
|
|
|
147 |
void LegacyRandRScreen::gotAvailablePointers(KProcess*, char *buffer, int len) |
| 148 |
{ |
| 149 |
QString myBuf = QString::fromLatin1(buffer, len); |
| 150 |
QStringList lines = QStringList::split('\n', myBuf); |
| 151 |
for ( QStringList::Iterator it = lines.begin(); it != lines.end(); it++) { |
| 152 |
QStringList split = QStringList::split(' ', (*it)); |
| 153 |
m_wacomPointers+=split.first(); |
| 154 |
} |
| 155 |
} |
| 156 |
|
| 112 |
bool LegacyRandRScreen::applyProposedAndConfirm() |
157 |
bool LegacyRandRScreen::applyProposedAndConfirm() |
| 113 |
{ |
158 |
{ |
| 114 |
if (proposedChanged()) { |
159 |
if (proposedChanged()) { |