3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-26 21:55:25 +02:00

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();
}
void RunningScriptsWidget::keyPressEvent(QKeyEvent* event)
{
int loadScriptNumber = -1;
switch(event->key()) {
case Qt::Key_Escape:
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;
void RunningScriptsWidget::keyPressEvent(QKeyEvent *keyEvent) {
if (keyEvent->key() == Qt::Key_Escape) {
return;
} else {
FramelessDialog::keyPressEvent(keyEvent);
}
if (loadScriptNumber >= 0) {
if (_recentlyLoadedScripts.size() > loadScriptNumber) {
Application::getInstance()->loadScript(_recentlyLoadedScripts.at(loadScriptNumber));
}
}
FramelessDialog::keyPressEvent(event);
}
void RunningScriptsWidget::paintEvent(QPaintEvent* event) {

View file

@ -143,7 +143,7 @@ font: bold 14pt;</string>
font-size: 14pt;</string>
</property>
<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 name="wordWrap">
<bool>true</bool>