Skip to content

Commit

Permalink
SE-2732 added doubleclick
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-martin committed Mar 1, 2024
1 parent b349518 commit b0e5919
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions utility/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def run(self):


class BottlenoseSelector(QDialog):
def __init__(self, title, parent=None):
def __init__(self, title, parent=None):
super().__init__(parent=parent)
form = QFormLayout(self)
self.listView = QListView(self)
Expand All @@ -81,6 +81,8 @@ def __init__(self, title, parent=None):
button_box.rejected.connect(self.reject)
self.finished.connect(self.terminate_worker)

self.listView.doubleClicked.connect(self.accept)

def terminate_worker(self, arg):
self.worker.halt()

Expand Down Expand Up @@ -139,9 +141,9 @@ def __init__(self):
def dragEnterEvent(self, e):
if e.mimeData().hasUrls:
if e.mimeData().urls()[0].toLocalFile().endswith(".tar") or \
e.mimeData().urls()[0].toLocalFile().endswith(".yaml") or \
e.mimeData().urls()[0].toLocalFile().endswith(".yml") or \
e.mimeData().urls()[0].toLocalFile().endswith(".json"):
e.mimeData().urls()[0].toLocalFile().endswith(".yaml") or \
e.mimeData().urls()[0].toLocalFile().endswith(".yml") or \
e.mimeData().urls()[0].toLocalFile().endswith(".json"):
e.accept()
else:
e.ignore()
Expand Down Expand Up @@ -229,7 +231,6 @@ def validate_transfer(fname, ftype):
if ftype in {"Firmware", "DNN Weights"}:
return fname.lower().endswith(".tar")
return fname.lower().endswith(".json") or fname.lower().endswith(".yml") or fname.lower().endswith(".yaml")


def handle_upload(self):
fname = self.ui.txtFile.text()
Expand Down Expand Up @@ -297,6 +298,7 @@ def handle_upload_finished(self, state):
# Instantiate import here
import eBUS as eb
from uploader import Uploader

window = MainWindow()
window.setWindowIcon(QIcon(":/labforge.ico"))
window.show()
Expand Down

0 comments on commit b0e5919

Please sign in to comment.