diff options
| author | Sebastien Braun | 2010-10-10 22:09:29 +0200 |
|---|---|---|
| committer | Sebastien Braun | 2010-10-11 00:56:10 +0200 |
| commit | d75d1a3e507e6a4cc01367df4d7a77012819b95b (patch) | |
| tree | 56cadbc332d336c7689304991dcd347fc16230f4 /src/gui/frame.cpp | |
| parent | Fix broken formatting of InputEvent::toString() (diff) | |
| download | pvs-d75d1a3e507e6a4cc01367df4d7a77012819b95b.tar.gz pvs-d75d1a3e507e6a4cc01367df4d7a77012819b95b.tar.xz pvs-d75d1a3e507e6a4cc01367df4d7a77012819b95b.zip | |
Fix bug where pressing the closeUp-button sometimes results in no action.
Diffstat (limited to 'src/gui/frame.cpp')
| -rw-r--r-- | src/gui/frame.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/gui/frame.cpp b/src/gui/frame.cpp index 12ce6b5..b9899d8 100644 --- a/src/gui/frame.cpp +++ b/src/gui/frame.cpp @@ -47,10 +47,12 @@ Frame::Frame(const QString & text, QWidget * parent) : _isLocked = false; _dozent = false; _uy = _ux = 0; + _isCloseUp = false; //QIcon icon; //icon.addFile(QString::fromUtf8(), QSize(), QIcon::Normal, QIcon::Off); button_closeUp = createToolButton(tr("View"), QIcon(":/restore"),SLOT(closeUp())); + button_closeUp->setCheckable(true); button_foto = createToolButton(tr("Foto"), QIcon(":/photos"),SLOT(foto())); button_lock = createToolButton(tr("Lock this client"), QIcon(":/lock"),SLOT(setLock())); //button_unlock = createToolButton(tr("Unlock this client"), QIcon(":/lock"),SLOT(setLock())); @@ -333,7 +335,11 @@ QImage Frame::getImageForFoto() void Frame::closeUp() { emit clicked(); - MainWindow::getWindow()->closeUp(); + + if(_isCloseUp) + MainWindow::getWindow()->unCloseUp(getConFrame()); + else + MainWindow::getWindow()->closeUp(getConFrame()); } void Frame::foto() @@ -377,6 +383,12 @@ void Frame::setDozent() } } +void Frame::setCloseUp(bool value) +{ + _isCloseUp = value; + button_closeUp->setChecked(value); +} + void Frame::remoteControlClicked() { if(_remoteControlEnabled) @@ -517,7 +529,20 @@ void Frame::keyPressEvent(QKeyEvent* event) { // The action of the keyboard may depend on the position of the pointer sendMouseMotionEvent(); - sendInputEvent(InputEvent::keyboardPress(event->key(), event->modifiers())); + + int key = event->key(); + + if(key >= ' ' && key < 0x100) + { + // the key is a Latin1 key. We need to find out the correct code to send. + QString text = event->text(); + if(text.length() == 1 && text.at(0).row() == 0) + { + // We found a Latin1 char and pray it is the correct case. + key = text.at(0).cell(); + } + } + sendInputEvent(InputEvent::keyboardPress(key, event->modifiers())); } } else |
