mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
Merge pull request #359 from guredora403/configration_invalid
add: configration invalid error dialog
This commit is contained in:
commit
8b50f3138c
@ -4,6 +4,7 @@ from validate import Validator, ValidateError
|
|||||||
import os
|
import os
|
||||||
import string
|
import string
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
from wxUI import commonMessageDialogs
|
||||||
log = getLogger("config_utils")
|
log = getLogger("config_utils")
|
||||||
|
|
||||||
class ConfigLoadError(Exception): pass
|
class ConfigLoadError(Exception): pass
|
||||||
@ -21,6 +22,7 @@ def load_config(config_path, configspec_path=None, copy=True, *args, **kwargs):
|
|||||||
return config
|
return config
|
||||||
else:
|
else:
|
||||||
log.exception("Error in config file: {0}".format(validated,))
|
log.exception("Error in config file: {0}".format(validated,))
|
||||||
|
commonMessageDialogs.invalid_configuration()
|
||||||
|
|
||||||
def is_blank(arg):
|
def is_blank(arg):
|
||||||
"Check if a line is blank."
|
"Check if a line is blank."
|
||||||
|
@ -91,5 +91,9 @@ def existing_filter():
|
|||||||
def common_error(reason):
|
def common_error(reason):
|
||||||
return wx.MessageDialog(None, reason, _(u"Error"), wx.OK).ShowModal()
|
return wx.MessageDialog(None, reason, _(u"Error"), wx.OK).ShowModal()
|
||||||
|
|
||||||
|
def invalid_configuration():
|
||||||
|
return wx.MessageDialog(None, _("The configuration file is invalid."), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def dead_pid():
|
def dead_pid():
|
||||||
return wx.MessageDialog(None, _(u"{0} quit unexpectedly the last time it was run. If the problem persists, please report it to the {0} developers.").format(application.name), _(u"Warning"), wx.OK).ShowModal()
|
return wx.MessageDialog(None, _(u"{0} quit unexpectedly the last time it was run. If the problem persists, please report it to the {0} developers.").format(application.name), _(u"Warning"), wx.OK).ShowModal()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user