Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
added support for enter key
Browse files Browse the repository at this point in the history
  • Loading branch information
Mte90 committed Mar 23, 2019
1 parent cecc61b commit 99e457f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion manageterms-gui.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python3
import os, signal, sys, glob
from PyQt5 import QtCore
from PyQt5.QtWidgets import QMainWindow, QApplication, QErrorMessage
from PyQt5.QtWidgets import QMainWindow, QApplication, QErrorMessage, QShortcut
from PyQt5.QtGui import QKeySequence
from utils.data_handlers import open_typo_file, save_typo_data
from ui_manageterms import Ui_MainWindow

Expand All @@ -22,6 +23,8 @@ def __init__(self, parent=None):
for filepath in sorted(glob.glob(os.path.join(self.script_path, '*.json'))):
language = os.path.splitext(os.path.basename(filepath))[0]
self.ui.languages.addItem(language)
enter = QShortcut(QKeySequence(QtCore.Qt.Key_Return), self)
enter.activated.connect(self.save_close)
self.show()

def store_new_argument(self):
Expand Down

0 comments on commit 99e457f

Please sign in to comment.