Skip to content

Commit

Permalink
fixed issues with SSM SIS
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed Jan 28, 2024
1 parent 707b8e1 commit 53b9459
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion hyo2/ssm2/app/gui/soundspeedsettings/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from PySide6 import QtCore, QtWidgets

from hyo2.abc2.app.app_style import AppStyle
from hyo2.abc2.app.app_style.app_style import AppStyle
from hyo2.abc2.lib.logging import set_logging

set_logging(ns_list=["hyo2.abc2", "hyo2.ssm2", "hyo2.sdm2"])
Expand Down
28 changes: 14 additions & 14 deletions hyo2/ssm2/app/gui/ssm_sis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import logging
import os

from hyo2.abc2.app.app_info import AppInfo
from hyo2.abc2.lib.lib_info import LibInfo


name = "SSM-SIS"
__version__ = "1.2.0"
from hyo2.ssm2 import pkg_info

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

app_info = AppInfo()
app_path = os.path.abspath(os.path.dirname(__file__))
app_media_path = os.path.join(app_path, "media")

app_info.app_name = name
app_info.app_version = __version__
app_info.app_url = "https://www.hydroffice.org/ssm_sis/"
app_info.app_latest_url = "https://www.hydroffice.org/latest/ssm_sis.txt"
app_info.app_path = os.path.abspath(os.path.dirname(__file__))
app_info.app_media_path = os.path.join(app_info.app_path, "media")
app_info.app_icon_path = os.path.join(app_info.app_media_path, "ssm_sis.png")
app_info = pkg_info.app_info(
app_name="SSM-SIS",
app_version="1.2.0",
app_beta=True,
app_url="https://www.hydroffice.org/ssm_sis/",
app_latest_url="https://www.hydroffice.org/latest/ssm_sis.txt",
app_path=app_path,
app_media_path=app_media_path,
app_license_path=os.path.join(app_media_path, "LICENSE"),
app_icon_path=os.path.join(app_media_path, "ssm_sis.png")
)
2 changes: 1 addition & 1 deletion hyo2/ssm2/app/gui/ssm_sis/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from PySide6 import QtCore, QtWidgets

from hyo2.abc2.lib.logging import set_logging
from hyo2.abc2.app.app_style import AppStyle
from hyo2.abc2.app.app_style.app_style import AppStyle

set_logging(ns_list=["hyo2.abc2", "hyo2.ssm2", "hyo2.sdm2"])
logger = logging.getLogger(__name__)
Expand Down
11 changes: 6 additions & 5 deletions hyo2/ssm2/app/gui/ssm_sis/mainwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from urllib.request import urlopen

from hyo2.abc2.lib.package.pkg_helper import PkgHelper
from hyo2.abc2.app.web_renderer import WebRenderer
from hyo2.abc2.app.browser.web_renderer import WebRenderer
from hyo2.ssm2.app.gui.ssm_sis import app_info
from hyo2.ssm2.app.gui.ssm_sis.controlpanel import ControlPanel

Expand Down Expand Up @@ -45,9 +45,9 @@ def __init__(self):
def _check_web_page(self, token: str = ""):
try:
if len(token) > 0:
url = "%s_%s" % (PkgHelper(lib_info=app_info).web_url(), token)
url = "%s_%s" % (PkgHelper(pkg_info=app_info).web_url(), token)
else:
url = "%s" % PkgHelper(lib_info=app_info).web_url()
url = "%s" % PkgHelper(pkg_info=app_info).web_url()
self._web.open(url=url)
# logger.debug('check %s' % url)

Expand All @@ -57,7 +57,7 @@ def _check_web_page(self, token: str = ""):
@classmethod
def _check_latest_release(cls):
try:
response = urlopen(app_info.lib_latest_url, timeout=1)
response = urlopen(app_info.app_latest_url, timeout=1)
latest_version = response.read().split()[0].decode()
cur_maj, cur_min, cur_fix = app_info.app_version.split('.')
lat_maj, lat_min, lat_fix = latest_version.split('.')
Expand All @@ -72,14 +72,15 @@ def _check_latest_release(cls):
logger.info("new bugfix available: %s" % latest_version)

except Exception as e:
logger.warning(e)
logger.warning(e, exc_info=True)

def _do_you_really_want(self, title="Quit", text="quit"):
"""helper function that show to the user a message windows asking to confirm an action"""
msg_box = QtWidgets.QMessageBox(self)
msg_box.setWindowTitle(title)
msg_box.setIconPixmap(QtGui.QPixmap(app_info.app_icon_path).scaled(QtCore.QSize(36, 36)))
msg_box.setText('Do you really want to %s?' % text)
# noinspection PyUnresolvedReferences
msg_box.setStandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
msg_box.setDefaultButton(QtWidgets.QMessageBox.No)
return msg_box.exec_()
Expand Down

0 comments on commit 53b9459

Please sign in to comment.