Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #36

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/_pyqt.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
pg.setConfigOption("foreground", "k")


QT_KEY_BACKTAB = QtCore.Qt.Key.Key_Backtab if USE_PYQT6 else QtCore.Qt.Key_Backtab
QT_KEY_TAB = QtCore.Qt.Key.Key_Tab if USE_PYQT6 else QtCore.Qt.Key_Tab
QT_KEY_SPACE = QtCore.Qt.Key.Key_Space if USE_PYQT6 else QtCore.Qt.Key_Space
QT_KEY_PRESS = QtCore.QEvent.Type.KeyPress if USE_PYQT6 else QtCore.QEvent.KeyPress
QT_KEY_RELEASE = (
Expand Down
6 changes: 4 additions & 2 deletions modules/gui_pyqt.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
QT_KEY_RELEASE,
QT_KEY_SPACE,
QT_KEY_PRESS,
QT_KEY_BACKTAB,
QT_KEY_TAB,
QT_NO_MODIFIER,
QT_FORMAT_MONO,
QT_FORMAT_RGB888,
Expand Down Expand Up @@ -500,11 +502,11 @@ def press_key(self, key):
)

def press_shift_tab(self):
self.press_key(QtCore.Qt.Key_Backtab)
self.press_key(QT_KEY_BACKTAB)
# self.stack_widget.currentWidget().focusPreviousChild()

def press_tab(self):
self.press_key(QtCore.Qt.Key_Tab)
self.press_key(QT_KEY_TAB)
# self.stack_widget.currentWidget().focusNextChild()

def press_space(self):
Expand Down
14 changes: 8 additions & 6 deletions modules/pyqt/menu/pyqt_course_menu_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def receive_route(self):
"-d",
"-n",
"-r",
self.config.G_COURSE_DIR,
os.path.abspath(self.config.G_COURSE_DIR),
"-l",
"-a",
stdout=asyncio.subprocess.PIPE,
Expand Down Expand Up @@ -134,7 +134,9 @@ async def load_file(self, filename):
# HTML from GoogleMap App
if filename == self.config.G_RECEIVE_COURSE_FILE:
await self.load_html_route(
self.config.G_COURSE_DIR + self.config.G_RECEIVE_COURSE_FILE
os.path.join(
self.config.G_COURSE_DIR, self.config.G_RECEIVE_COURSE_FILE
)
)
self.onoff_course_cancel_button()
# tcx file
Expand Down Expand Up @@ -162,10 +164,10 @@ async def load_html_route(self, html_file):

async def load_tcx_route(self, filename):
self.cancel_course()
course_file = (
self.config.G_COURSE_DIR + filename[: filename.lower().find(".tcx") + 4]
course_file = os.path.join(
self.config.G_COURSE_DIR, filename[: filename.lower().find(".tcx") + 4]
)
shutil.move(self.config.G_COURSE_DIR + filename, course_file)
shutil.move(os.path.join(self.config.G_COURSE_DIR, filename), course_file)
self.set_new_course(course_file)
self.config.gui.show_forced_message("Loading succeeded!")

Expand Down Expand Up @@ -369,7 +371,7 @@ def preprocess(self, course_info):
self.elevation_label.setText("{:.0f}m up".format(course_info["elevation_gain"]))
self.locality_label.setText(self.address_format.format(**course_info))

self.list_id = course_info["name"]
self.list_id = course_info["id"]

self.timer.start(self.config.G_DRAW_INTERVAL)

Expand Down