-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index e327098..7021fae 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -183,97 +183,97 @@ static char * vmemo_xpm[] = { | |||
183 | " { ] ^ / ( _ : ", | 183 | " { ] ^ / ( _ : ", |
184 | " < [ } | 1 2 3 ", | 184 | " < [ } | 1 2 3 ", |
185 | " 4 5 6 7 8 9 0 a b c ", | 185 | " 4 5 6 7 8 9 0 a b c ", |
186 | " d e f g h i j 3 k l m n ", | 186 | " d e f g h i j 3 k l m n ", |
187 | " o p q r s t u v w n ", | 187 | " o p q r s t u v w n ", |
188 | " o x y z A B C D E n ", | 188 | " o x y z A B C D E n ", |
189 | " F G H I J K L M N O ", | 189 | " F G H I J K L M N O ", |
190 | " P Q R S T U V W X ", | 190 | " P Q R S T U V W X ", |
191 | " Y Z ` b ...+. ", | 191 | " Y Z ` b ...+. ", |
192 | " @.#.$.%.&. ", | 192 | " @.#.$.%.&. ", |
193 | " *.B =. ", | 193 | " *.B =. ", |
194 | " n n n n n n n n n "}; | 194 | " n n n n n n n n n "}; |
195 | 195 | ||
196 | 196 | ||
197 | VMemo::VMemo( QWidget *parent, const char *_name ) | 197 | VMemo::VMemo( QWidget *parent, const char *_name ) |
198 | : QWidget( parent, _name ) | 198 | : QWidget( parent, _name ) |
199 | { | 199 | { |
200 | setFixedHeight( 18 ); | 200 | setFixedHeight( 18 ); |
201 | setFixedWidth( 14 ); | 201 | setFixedWidth( 14 ); |
202 | 202 | ||
203 | recording = FALSE; | 203 | recording = FALSE; |
204 | 204 | ||
205 | struct utsname name; /* check for embedix kernel running on the zaurus*/ | 205 | struct utsname name; /* check for embedix kernel running on the zaurus*/ |
206 | if (uname(&name) != -1) { | 206 | if (uname(&name) != -1) { |
207 | QString release=name.release; | 207 | QString release=name.release; |
208 | Config vmCfg("Vmemo"); | 208 | Config vmCfg("Vmemo"); |
209 | vmCfg.setGroup("Defaults"); | 209 | vmCfg.setGroup("Defaults"); |
210 | int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); | 210 | int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); |
211 | 211 | ||
212 | qDebug("toggleKey %d", toggleKey); | 212 | qDebug("toggleKey %d", toggleKey); |
213 | 213 | ||
214 | if(release.find("embedix",0,TRUE) !=-1) | 214 | if(release.find("embedix",0,TRUE) !=-1) |
215 | systemZaurus=TRUE; | 215 | systemZaurus=TRUE; |
216 | else | 216 | else |
217 | systemZaurus=FALSE; | 217 | systemZaurus=FALSE; |
218 | 218 | ||
219 | myChannel = new QCopChannel( "QPE/VMemo", this ); | 219 | myChannel = new QCopChannel( "QPE/VMemo", this ); |
220 | connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)), | 220 | connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)), |
221 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 221 | this, SLOT(receive(const QCString&, const QByteArray&)) ); |
222 | 222 | ||
223 | if( toggleKey != -1 ) { | 223 | if( toggleKey != -1 ) { |
224 | QCopEnvelope e("QPE/Desktop", "keyRegister(int key, QString channel, QString message)"); | 224 | QCopEnvelope e("QPE/Desktop", "keyRegister(int key, QString channel, QString message)"); |
225 | // e << 4096; // Key_Escape | 225 | // e << 4096; // Key_Escape |
226 | // e << Key_F5; //4148 | 226 | // e << Key_F5; //4148 |
227 | e << toggleKey; | 227 | e << toggleKey; |
228 | e << QString("QPE/VMemo"); | 228 | e << QString("QPE/VMemo"); |
229 | e << QString("toggleRecord()"); | 229 | e << QString("toggleRecord()"); |
230 | } | 230 | } |
231 | if( vmCfg.readNumEntry("hideIcon",0) == 1) | 231 | if( vmCfg.readNumEntry("hideIcon",0) == 1 || toggleKey > 0) |
232 | hide(); | 232 | hide(); |
233 | } | 233 | } |
234 | } | 234 | } |
235 | 235 | ||
236 | VMemo::~VMemo() | 236 | VMemo::~VMemo() |
237 | { | 237 | { |
238 | } | 238 | } |
239 | 239 | ||
240 | void VMemo::receive( const QCString &msg, const QByteArray &data ) | 240 | void VMemo::receive( const QCString &msg, const QByteArray &data ) |
241 | { | 241 | { |
242 | QDataStream stream( data, IO_ReadOnly ); | 242 | QDataStream stream( data, IO_ReadOnly ); |
243 | if (msg == "toggleRecord()") { | 243 | if (msg == "toggleRecord()") { |
244 | if (recording) { | 244 | if (recording) { |
245 | fromToggle = TRUE; | 245 | fromToggle = TRUE; |
246 | stopRecording(); | 246 | stopRecording(); |
247 | } else { | 247 | } else { |
248 | fromToggle = TRUE; | 248 | fromToggle = TRUE; |
249 | startRecording(); | 249 | startRecording(); |
250 | } | 250 | } |
251 | } | 251 | } |
252 | } | 252 | } |
253 | 253 | ||
254 | void VMemo::paintEvent( QPaintEvent* ) | 254 | void VMemo::paintEvent( QPaintEvent* ) |
255 | { | 255 | { |
256 | QPainter p(this); | 256 | QPainter p(this); |
257 | p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); | 257 | p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); |
258 | } | 258 | } |
259 | 259 | ||
260 | void VMemo::mousePressEvent( QMouseEvent * ) | 260 | void VMemo::mousePressEvent( QMouseEvent * ) |
261 | { | 261 | { |
262 | startRecording(); | 262 | startRecording(); |
263 | } | 263 | } |
264 | 264 | ||
265 | void VMemo::mouseReleaseEvent( QMouseEvent * ) | 265 | void VMemo::mouseReleaseEvent( QMouseEvent * ) |
266 | { | 266 | { |
267 | stopRecording(); | 267 | stopRecording(); |
268 | } | 268 | } |
269 | 269 | ||
270 | bool VMemo::startRecording() { | 270 | bool VMemo::startRecording() { |
271 | 271 | ||
272 | if ( recording) | 272 | if ( recording) |
273 | return FALSE;; | 273 | return FALSE;; |
274 | 274 | ||
275 | Config config( "Vmemo" ); | 275 | Config config( "Vmemo" ); |
276 | config.setGroup( "System" ); | 276 | config.setGroup( "System" ); |
277 | 277 | ||
278 | useAlerts = config.readBoolEntry("Alert"); | 278 | useAlerts = config.readBoolEntry("Alert"); |
279 | if(useAlerts) { | 279 | if(useAlerts) { |