Пример #1
0
    def test_visibility(self):

        if not QtWidgets.qApp:
            QtWidgets.QApplication([])

        d = NOAAS57Dialog(lib_info=LibInfo(), app_info=AppInfo())
        d.show()
Пример #2
0
    def test_visibility(self):

        if not QtWidgets.QApplication.instance():
            QtWidgets.QApplication([])

        d = ExceptionDialog(lib_info=LibInfo(), app_info=AppInfo())
        d.show()
Пример #3
0
    def test_visibility(self):

        if not qApp:
            QApplication([])

        d = ExceptionDialog(lib_info=LibInfo(), app_info=AppInfo())
        d.show()
Пример #4
0
    def test_visibility(self):

        if not QtWidgets.qApp:
            QtWidgets.QApplication([])

        t = LicenseTab(app_info=AppInfo())
        t.show()
Пример #5
0
    def test_init(self):

        noaa_support = NOAASupport(lib_info=LibInfo(), app_info=AppInfo())

        self.assertTrue("v" in noaa_support.v_version())
        self.assertTrue(os.path.exists(noaa_support.internal_zip_path()))
        self.assertTrue(noaa_support.internal_zip_path_exists())
Пример #6
0
    def test_with_all_tabs(self):

        if not QtWidgets.qApp:
            QtWidgets.QApplication([])

        d = AboutDialog(lib_info=LibInfo(), app_info=AppInfo(),
                        with_gdal_tab=True, with_locale_tab=True)
        d.show()
Пример #7
0
    def test_visibility(self):

        if not QtWidgets.qApp:
            QtWidgets.QApplication([])

        d = AboutDialog(lib_info=LibInfo(), app_info=AppInfo())
        d.show()
        d.switch_visible()
        d.switch_visible()
Пример #8
0
        def print_page_template():
            """Internal helper function that print borders, logo, time stamp, etc."""
            # external border
            painter.setPen(gray_pen)
            border_area = QtCore.QRect(doc_margin, doc_margin,
                                       doc_width - 2 * doc_margin,
                                       doc_height - 2 * doc_margin)
            painter.drawRect(border_area)

            # make top-area
            top_area = QtCore.QRect(doc_margin, doc_margin,
                                    doc_width - 2 * doc_margin, row_height * 2)
            painter.drawRect(top_area)
            # logo
            hyo_logo_path = os.path.join(AppInfo().app_media_path,
                                         'poweredby.png')
            if not os.path.exists(hyo_logo_path):
                raise RuntimeError("Unable to find logo: %s" % hyo_logo_path)
            hyo_logo = QtGui.QPixmap(hyo_logo_path)
            # print("logo size: %sx%s" % (hyo_logo.width(), hyo_logo.height()))
            logo_area = QtCore.QRect(
                doc_width / 2 - hyo_logo.width() / 2,
                doc_margin + (row_height * 2 - hyo_logo.height()) / 2,
                hyo_logo.width(), hyo_logo.height())
            painter.drawPixmap(logo_area, hyo_logo)

            # make bottom-area
            bottom_area = QtCore.QRect(doc_margin,
                                       doc_height - doc_margin - row_height,
                                       doc_width - 2 * doc_margin, row_height)
            painter.drawRect(bottom_area)
            # time-stamp
            now_time = datetime.datetime.now()
            painter.setFont(small_font)
            painter.drawText(
                bottom_area, cc_flags, "time-stamp: %s, %s v.%s" %
                (now_time.strftime("%a, %d %b %Y %H:%M:%S"), self.lib_name,
                 self.lib_version))
            # page number
            page_area = QtCore.QRect(doc_width - doc_margin - 2 * row_height,
                                     doc_height - doc_margin - row_height,
                                     2 * row_height, row_height)
            # painter.drawRect(page_area)
            painter.drawText(page_area, lc_flags, "Page %s" % page_nr)

            # set back to 'normal' font
            painter.setPen(black_pen)
            painter.setFont(normal_font)
            return True
Пример #9
0
    def test_show(self):

        if not QtWidgets.QApplication.instance():
            QtWidgets.QApplication([])

        mw = QtWidgets.QMainWindow()

        t = InfoTab(main_win=mw,
                    lib_info=LibInfo(),
                    app_info=AppInfo(),
                    with_online_manual=True,
                    with_offline_manual=True,
                    with_bug_report=True,
                    with_hydroffice_link=True,
                    with_ccom_link=True,
                    with_noaa_link=True,
                    with_unh_link=True,
                    with_license=True)
        t.show()
Пример #10
0
import sys
import logging

from PySide2 import QtWidgets

from hyo2.abc.app.dialogs.about.about_dialog import AboutDialog
from hyo2.abc.lib.lib_info import LibInfo
from hyo2.abc.app.app_info import AppInfo
from hyo2.abc.lib.logging import set_logging

logger = logging.getLogger(__name__)
set_logging(ns_list=["hyo2.abc"])

app = QtWidgets.QApplication([])

d = AboutDialog(lib_info=LibInfo(), app_info=AppInfo(),
                with_locale_tab=True, with_gdal_tab=True)
d.show()

sys.exit(app.exec_())
Пример #11
0
import os
from hyo2.openbst.lib.products.product_plotting import ProductPlotting  # on Linux, this must be imported first
from hyo2.abc.app.app_info import AppInfo
from hyo2.openbst import name
from hyo2.openbst import __version__

app_info = AppInfo()

app_info.app_name = name
app_info.app_version = __version__
app_info.app_author = "G.Masetti (CCOM/JHC); Jean-Marie Augustin (IFREMER); Cyrille Poncelet (IFREMER)"
app_info.app_author_email = "[email protected]; [email protected]; [email protected]"

app_info.app_license = "LGPL v3"
app_info.app_license_url = "https://www.hydroffice.org/license/"

app_info.app_path = os.path.abspath(os.path.dirname(__file__))

app_info.app_url = "https://www.hydroffice.org/openbst/"
app_info.app_manual_url = "https://www.hydroffice.org/manuals/openbst/index.html"
app_info.app_support_email = "*****@*****.**"
app_info.app_latest_url = "https://www.hydroffice.org/latest/openbst.txt"

app_info.app_media_path = os.path.join(app_info.app_path, "media")
app_info.app_main_window_object_name = "MainWindow"
app_info.app_license_path = os.path.join(app_info.app_media_path, "LICENSE")
app_info.app_icon_path = os.path.join(app_info.app_media_path, "app_icon.png")

# icon size
app_info.app_tabs_icon_size = 36
app_info.app_toolbars_icon_size = 24
Пример #12
0
import os
from hyo2.abc.app.app_info import AppInfo
from hyo2.qax import name
from hyo2.qax import __version__

app_info = AppInfo()

app_info.app_name = name
app_info.app_version = __version__
app_info.app_author = "Giuseppe Masetti(UNH,CCOM); Tyanne Faulkes(NOAA,OCS)"
app_info.app_author_email = "[email protected]; [email protected]"

app_info.app_license = "LGPL v3"
app_info.app_license_url = "https://www.hydroffice.org/license/"

app_info.app_path = os.path.abspath(os.path.dirname(__file__))

app_info.app_url = "https://www.hydroffice.org/qax/"
app_info.app_manual_url = "https://www.hydroffice.org/manuals/qax/index.html"
app_info.app_support_email = "*****@*****.**"
app_info.app_latest_url = "https://www.hydroffice.org/latest/qax.txt"

app_info.app_media_path = os.path.join(app_info.app_path, "media")
app_info.app_main_window_object_name = "MainWindow"
app_info.app_license_path = os.path.join(app_info.app_media_path, "LICENSE")
app_info.app_icon_path = os.path.join(app_info.app_media_path, "app_icon.png")

# icon size
app_info.app_tabs_icon_size = 36
app_info.app_toolbars_icon_size = 24
Пример #13
0
import logging
import os

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

name = "SSM-SIS"
__version__ = '1.0.2'

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

app_info = AppInfo()

app_info.app_name = name
app_info.app_version = __version__

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")

lib_info = AppInfo()

lib_info.lib_name = name
lib_info.lib_version = __version__
lib_info.lib_url = "https://www.hydroffice.org/ssm_sis/"
lib_info.lib_latest_url = "https://www.hydroffice.org/latest/ssm_sis.txt"
Пример #14
0
Hydro-Package
Sound Speed Manager
"""
import logging
import os

from hyo2.abc.app.app_info import AppInfo

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

name = "Sound Speed Manager"
__version__ = "2019.0.0"
__copyright__ = "Copyright 2019 University of New Hampshire, Center for Coastal and Ocean Mapping"

app_info = AppInfo()

app_info.app_name = name
app_info.app_version = __version__
app_info.app_author = "Giuseppe Masetti(UNH,CCOM); Barry Gallagher(NOAA,OCS); " \
                      "Chen Zhang(NOAA,OCS); Matthew Sharr(NOAA,OCS)"
app_info.app_author_email = "[email protected]; [email protected]; " \
                            "[email protected]; [email protected]"

app_info.app_license = "LGPLv2.1 or CCOM-UNH Industrial Associate license"
app_info.app_license_url = "https://www.hydroffice.org/license/"

app_info.app_path = os.path.abspath(os.path.dirname(__file__))

app_info.app_url = "https://www.hydroffice.org/soundspeed/"
app_info.app_manual_url = "https://www.hydroffice.org/manuals/soundspeed/index.html"
Пример #15
0
import os
from hyo2.openbst.lib.products.product_plotting import ProductPlotting  # on Linux, this must be imported first
from hyo2.abc.app.app_info import AppInfo
from hyo2.openbst import __version__


app_info = AppInfo()

app_info.app_name = "Arch"
app_info.app_version = __version__
app_info.app_author = "G.Masetti (CCOM/JHC); Jean-Marie Augustin (IFREMER); Cyrille Poncelet (IFREMER)"
app_info.app_author_email = "[email protected]; [email protected]; [email protected]"

app_info.app_license = "LGPL v3"
app_info.app_license_url = "https://www.hydroffice.org/license/"

app_info.app_path = os.path.abspath(os.path.join(os.path.abspath(os.path.dirname(__file__)), os.pardir))

app_info.app_url = "https://www.hydroffice.org/openbst/"
app_info.app_manual_url = "https://www.hydroffice.org/manuals/openbst/index.html"
app_info.app_support_email = "*****@*****.**"
app_info.app_latest_url = "https://www.hydroffice.org/latest/openbst.txt"

app_info.app_media_path = os.path.join(app_info.app_path, "media")
app_info.app_main_window_object_name = "MainWindow"
app_info.app_license_path = os.path.join(app_info.app_media_path, "LICENSE")
app_info.app_icon_path = os.path.join(app_info.app_media_path, "arch_icon.png")

# icon size
app_info.app_tabs_icon_size = 36
app_info.app_toolbars_icon_size = 24
Пример #16
0
import os
from hyo2.abc.app.app_info import AppInfo
from hyo2.qax import name
from hyo2.qax import __version__

app_info = AppInfo()

app_info.app_name = name
app_info.app_version = __version__
app_info.app_author = "Giuseppe Masetti(UNH,CCOM); Tyanne Faulkes(NOAA,OCS); Lachlan Hurst (FrontierSI); Matt Boyd (CSIRO)"
app_info.app_author_email = "[email protected]; [email protected]; [email protected]; [email protected]"

app_info.app_license = "LGPL v3"
app_info.app_license_url = "https://www.hydroffice.org/license/"

app_info.app_path = os.path.abspath(os.path.dirname(__file__))

app_info.app_url = "https://www.hydroffice.org/qax/"
app_info.app_manual_url = "https://www.hydroffice.org/manuals/qax/index.html"
app_info.app_support_email = "*****@*****.**"
app_info.app_support_link = "https://www.ausseabed.gov.au/QAX/feedback-form"
app_info.app_latest_url = "https://www.hydroffice.org/latest/qax.txt"

app_info.app_media_path = os.path.join(app_info.app_path, "media")
app_info.app_main_window_object_name = "MainWindow"
app_info.app_license_path = os.path.join(app_info.app_media_path, "LICENSE")
app_info.app_icon_path = os.path.join(app_info.app_media_path, "app_icon.png")

# icon size
app_info.app_tabs_icon_size = 36
app_info.app_toolbars_icon_size = 24
Пример #17
0
import os
from hyo2.abc.app.app_info import AppInfo
from hyo2.kng.top.top4kctrl import name, __version__

app_info = AppInfo()

app_info.app_name = name
app_info.app_version = __version__
app_info.app_author = "Giuseppe Masetti(UNH,CCOM)"
app_info.app_author_email = "*****@*****.**"

app_info.app_license = "LGPLv3"
app_info.app_license_url = "https://www.hydroffice.org/license/"

app_info.app_path = os.path.abspath(os.path.dirname(__file__))

app_info.app_url = "https://www.hydroffice.org/kng/"
app_info.app_manual_url = "https://www.hydroffice.org/manuals/kng/index.html"
app_info.app_support_email = "*****@*****.**"
app_info.app_latest_url = "https://www.hydroffice.org/latest/top4kctrl.txt"

app_info.app_media_path = os.path.join(app_info.app_path, "media")
app_info.app_main_window_object_name = "MainWindow"
app_info.app_license_path = os.path.join(app_info.app_media_path, "LICENSE")
app_info.app_icon_path = os.path.join(app_info.app_media_path, "app_icon.png")
Пример #18
0
from hyo2.abc.app.app_style import AppStyle

logger = logging.getLogger()


def set_logging(default_logging=logging.WARNING,
                hyo2_logging=logging.INFO,
                abc_logging=logging.DEBUG):
    logging.basicConfig(
        level=default_logging,
        format="%(levelname)-9s %(name)s.%(funcName)s:%(lineno)d > %(message)s"
    )
    logging.getLogger("hyo2").setLevel(hyo2_logging)
    logging.getLogger("hyo2.abc").setLevel(abc_logging)


set_logging()

app = QtWidgets.QApplication([])
app.setApplicationName('NOAA S57')
app.setOrganizationName("HydrOffice")
app.setOrganizationDomain("hydroffice.org")
app.setStyleSheet(AppStyle.load_stylesheet())

d = NOAAS57Dialog(lib_info=LibInfo(), app_info=AppInfo())
d.setWindowIcon(
    QtGui.QIcon(os.path.join(AppInfo().app_media_path, "noaa_support.png")))
d.show()

sys.exit(app.exec_())
Пример #19
0
import sys
import logging

from PySide2 import QtWidgets

from hyo2.abc.app.dialogs.noaa_s57.noaa_s57 import NOAAS57Dialog
from hyo2.abc.lib.lib_info import LibInfo
from hyo2.abc.app.app_info import AppInfo
from hyo2.abc.lib.logging import set_logging

logger = logging.getLogger(__name__)
set_logging(ns_list=["hyo2.abc"])

app = QtWidgets.QApplication([])

d = NOAAS57Dialog(lib_info=LibInfo(), app_info=AppInfo())
d.show()

sys.exit(app.exec_())
Пример #20
0
import sys
from PySide2 import QtWidgets, QtGui, QtCore

from hyo2.abc.lib.helper import Helper
from hyo2.abc.lib.lib_info import LibInfo
from hyo2.abc.app.app_style import AppStyle
from hyo2.abc.app.app_info import AppInfo
from hyo2.abc.app.tabs.info.info_tab import InfoTab
from hyo2.abc.lib.logging import set_logging

set_logging(ns_list=[
    "hyo2.abc",
])
app_info = AppInfo()
lib_info = LibInfo()

app = QtWidgets.QApplication([])
app.setApplicationName('%s' % app_info.app_name)
app.setOrganizationName("HydrOffice")
app.setOrganizationDomain("hydroffice.org")
app.setStyleSheet(AppStyle.load_stylesheet())

if Helper.is_script_already_running():
    txt = "The app is already running!"
    msg_box = QtWidgets.QMessageBox()
    msg_box.setWindowTitle("Multiple Instances of ABC")
    msg_box.setIconPixmap(
        QtGui.QPixmap(app_info.app_icon_path).scaled(QtCore.QSize(36, 36)))
    msg_box.setText(
        '%s\n\nDo you want to continue? This might create issues.' % txt)
    msg_box.setStandardButtons(QtWidgets.QMessageBox.Yes
Пример #21
0
import sys
import logging

from PySide2 import QtWidgets

from hyo2.abc.app.dialogs.exception.exception_dialog import ExceptionDialog
from hyo2.abc.lib.lib_info import LibInfo
from hyo2.abc.app.app_info import AppInfo
from hyo2.abc.lib.logging import set_logging

logger = logging.getLogger(__name__)
set_logging(ns_list=["hyo2.abc"])

app = QtWidgets.QApplication([])

d = ExceptionDialog(lib_info=LibInfo(), app_info=AppInfo())
d.show()

sys.exit(app.exec_())