Changeset 11405


Ignore:
Timestamp:
Nov 13, 2010, 10:07:19 PM (11 years ago)
Author:
charles
Message:

(trunk qt) #3738 "make file download flag and priority setting settable via the keyboard" -- done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/file-tree.cc

    r11306 r11405  
    696696    }
    697697
     698    // handle using the keyboard to toggle the
     699    // wanted/unwanted state or the file priority
     700    else if( event->type() == QEvent::KeyPress )
     701    {
     702        switch( dynamic_cast<QKeyEvent*>(event)->key() )
     703        {
     704            case Qt::Key_Space:
     705                foreach( QModelIndex i, selectionModel()->selectedRows(COL_WANTED) )
     706                    clicked( i );
     707                return false;
     708
     709            case Qt::Key_Enter:
     710            case Qt::Key_Return:
     711                foreach( QModelIndex i, selectionModel()->selectedRows(COL_PRIORITY) )
     712                    clicked( i );
     713                return false;
     714        }
     715    }
     716
    698717    return false;
    699718}
Note: See TracChangeset for help on using the changeset viewer.