remove all key bindings from running scripts dialog

This commit is contained in:
Mohammed Nafees 2014-05-28 23:19:15 +05:30
parent bf4b0707c0
commit 8b0212dc1e
2 changed files with 6 additions and 30 deletions

View file

@ -106,36 +106,12 @@ void RunningScriptsWidget::setRunningScripts(const QStringList& list) {
createRecentlyLoadedScriptsTable(); createRecentlyLoadedScriptsTable();
} }
void RunningScriptsWidget::keyPressEvent(QKeyEvent* event) void RunningScriptsWidget::keyPressEvent(QKeyEvent *keyEvent) {
{ if (keyEvent->key() == Qt::Key_Escape) {
int loadScriptNumber = -1; return;
switch(event->key()) { } else {
case Qt::Key_Escape: FramelessDialog::keyPressEvent(keyEvent);
Application::getInstance()->toggleRunningScriptsWidget();
break;
case Qt::Key_1:
case Qt::Key_2:
case Qt::Key_3:
case Qt::Key_4:
case Qt::Key_5:
case Qt::Key_6:
case Qt::Key_7:
case Qt::Key_8:
case Qt::Key_9:
loadScriptNumber = event->key() - Qt::Key_1;
break;
default:
break;
} }
if (loadScriptNumber >= 0) {
if (_recentlyLoadedScripts.size() > loadScriptNumber) {
Application::getInstance()->loadScript(_recentlyLoadedScripts.at(loadScriptNumber));
}
}
FramelessDialog::keyPressEvent(event);
} }
void RunningScriptsWidget::paintEvent(QPaintEvent* event) { void RunningScriptsWidget::paintEvent(QPaintEvent* event) {

View file

@ -143,7 +143,7 @@ font: bold 14pt;</string>
font-size: 14pt;</string> font-size: 14pt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>(click a script or use the 1-9 keys to load and run it)</string> <string>(click a script to load and run it)</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>