Commit 5670ff1d authored by Jan Möbius's avatar Jan Möbius

Alt/Meta key for easier view mode switching?

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5939 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 073dde69
......@@ -464,6 +464,13 @@ void CoreWidget::registerCoreKeys() {
emit registerKey(Qt::Key_Escape , Qt::NoModifier, "Switch to last action mode ( Move,Picking,Light or Info Mode)");
emit registerKey(Qt::Key_Space , Qt::NoModifier, "Toggle between multiview and single view");
if ( OpenFlipper::Options::isLinux() ) {
emit registerKey(Qt::Key_Meta , Qt::MetaModifier, "Use Navigation mode while key is pressed");
emit registerKey(Qt::Key_Meta , Qt::NoModifier, "Use Navigation mode while key is pressed");
} else {
emit registerKey(Qt::Key_Alt , Qt::AltModifier, "Use Navigation mode while key is pressed");
}
emit registerKey(Qt::Key_Shift , Qt::ShiftModifier, "Apply context menu action to all Viewers", true);
emit registerKey(Qt::Key_Shift , Qt::NoModifier, "Apply context menu action to all Viewers", true);
}
......@@ -471,6 +478,19 @@ void CoreWidget::registerCoreKeys() {
/// if a keyPressEvent belongs to the core this functions is called
void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){
if ( ( _e->key() == Qt::Key_Meta ) && OpenFlipper::Options::isLinux() ) {
if ( _e->type() == QEvent::KeyPress ) {
setActionMode( Viewer::ExamineMode );
}
}
if ( ( _e->key() == Qt::Key_Alt ) && ! OpenFlipper::Options::isLinux() ) {
if ( _e->type() == QEvent::KeyPress ) {
setActionMode( Viewer::ExamineMode );
}
}
if (_e->modifiers() & Qt::ControlModifier ) {
switch (_e->key()) {
case Qt::Key_F :
......@@ -539,6 +559,20 @@ void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){
/// if a keyReleaseEvent belongs to the core this functions is called
void CoreWidget::coreKeyReleaseEvent(QKeyEvent* _e){
if ( ( _e->key() == Qt::Key_Meta ) && OpenFlipper::Options::isLinux() ) {
if ( _e->type() == QEvent::KeyRelease ) {
setActionMode( lastActionMode() );
}
}
if ( ( _e->key() == Qt::Key_Alt ) && ! OpenFlipper::Options::isLinux() ) {
if ( _e->type() == QEvent::KeyRelease ) {
setActionMode( lastActionMode() );
}
}
switch (_e->key()) {
case Qt::Key_Shift :
shiftPressed_ = false;
......
......@@ -267,7 +267,12 @@ void CoreWidget::applicationSnapshotDialog() {
dialog.setAcceptMode(QFileDialog::AcceptSave);
dialog.setWindowTitle("Save Snapshot");
if (dialog.exec()){
bool ok = dialog.exec();
std::cerr << "1" << std::endl;
dialog.hide();
if ( ok ){
QString newName = dialog.selectedFiles()[0];
if (newName != fi.path() + OpenFlipper::Options::dirSeparator() + suggest){
......
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