|
|
|
@ -14,9 +14,10 @@ from PyQt5.QtGui import QDesktopServices, QIcon |
|
|
|
|
from PyQt5.QtCore import Qt, QUrl, QMargins, pyqtSlot, QVariant |
|
|
|
|
|
|
|
|
|
from vasl_templates.webapp.config.constants import APP_NAME, APP_VERSION, IS_FROZEN |
|
|
|
|
from vasl_templates.webapp import globvars |
|
|
|
|
from vasl_templates.main import app_settings |
|
|
|
|
from vasl_templates.web_channel import WebChannelHandler |
|
|
|
|
from vasl_templates.utils import catch_exceptions |
|
|
|
|
from vasl_templates.utils import catch_exceptions, launch_file |
|
|
|
|
|
|
|
|
|
_CONSOLE_SOURCE_REGEX = re.compile( r"^http://.+?/static/(.*)$" ) |
|
|
|
|
|
|
|
|
@ -44,7 +45,7 @@ class AppWebPage( QWebEnginePage ): |
|
|
|
|
mo = _CONSOLE_SOURCE_REGEX.search( source_id ) |
|
|
|
|
source = mo.group(1) if mo else source_id |
|
|
|
|
logger = logging.getLogger( "javascript" ) |
|
|
|
|
logger.info( "%s:%d - %s", source, line_no, msg ) |
|
|
|
|
logger.warning( "%s:%d - %s", source, line_no, msg ) |
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
@ -80,6 +81,7 @@ class MainWindow( QWidget ): |
|
|
|
|
action.triggered.connect( handler ) |
|
|
|
|
file_menu.addAction( action ) |
|
|
|
|
add_action( "&Settings", "settings.png", self.on_settings ) |
|
|
|
|
add_action( "&Log file", "log.png", self.on_log_file ) |
|
|
|
|
add_action( "&About", "info.png", self.on_about ) |
|
|
|
|
file_menu.addSeparator() |
|
|
|
|
add_action( "E&xit", "exit.png", self.on_exit ) |
|
|
|
@ -219,6 +221,10 @@ class MainWindow( QWidget ): |
|
|
|
|
dlg = ServerSettingsDialog( self ) |
|
|
|
|
dlg.exec_() |
|
|
|
|
|
|
|
|
|
def on_log_file( self ): |
|
|
|
|
"""Menu action handler.""" |
|
|
|
|
launch_file( globvars.user_profile.default_log_fname ) |
|
|
|
|
|
|
|
|
|
def on_about( self ): |
|
|
|
|
"""Menu action handler.""" |
|
|
|
|
from vasl_templates.about import AboutDialog #pylint: disable=cyclic-import |
|
|
|
|