Add warning about settings
This commit is contained in:
parent
e7f937ecd2
commit
e5f6a7d1d6
@ -145,7 +145,17 @@ def ctmain() -> None:
|
||||
format="%(asctime)s | %(name)s | %(levelname)s | %(message)s",
|
||||
datefmt="%Y-%m-%dT%H:%M:%S",
|
||||
)
|
||||
# Need to load setting before anything else
|
||||
|
||||
if settings.settings_warning < 4:
|
||||
print( # noqa: T201
|
||||
"""
|
||||
!!!Warning!!!
|
||||
The next release will save settings in a different format
|
||||
NO SETTINGS WILL BE TRANSFERED to the new version.
|
||||
See https://github.com/comictagger/comictagger/releases/1.5.5 for more information.
|
||||
""",
|
||||
file=sys.stderr,
|
||||
)
|
||||
|
||||
# manage the CV API key
|
||||
# None comparison is used so that the empty string can unset the value
|
||||
|
@ -70,6 +70,7 @@ class ComicTaggerSettings:
|
||||
# Show/ask dialog flags
|
||||
self.ask_about_cbi_in_rar = True
|
||||
self.show_disclaimer = True
|
||||
self.settings_warning = 0
|
||||
self.dont_notify_about_this_version = ""
|
||||
self.ask_about_usage_stats = True
|
||||
|
||||
@ -223,6 +224,8 @@ class ComicTaggerSettings:
|
||||
self.ask_about_cbi_in_rar = self.config.getboolean("dialogflags", "ask_about_cbi_in_rar")
|
||||
if self.config.has_option("dialogflags", "show_disclaimer"):
|
||||
self.show_disclaimer = self.config.getboolean("dialogflags", "show_disclaimer")
|
||||
if self.config.has_option("dialogflags", "settings_warning"):
|
||||
self.settings_warning = self.config.getint("dialogflags", "settings_warning")
|
||||
if self.config.has_option("dialogflags", "dont_notify_about_this_version"):
|
||||
self.dont_notify_about_this_version = self.config.get("dialogflags", "dont_notify_about_this_version")
|
||||
if self.config.has_option("dialogflags", "ask_about_usage_stats"):
|
||||
@ -349,6 +352,7 @@ class ComicTaggerSettings:
|
||||
|
||||
self.config.set("dialogflags", "ask_about_cbi_in_rar", self.ask_about_cbi_in_rar)
|
||||
self.config.set("dialogflags", "show_disclaimer", self.show_disclaimer)
|
||||
self.config.set("dialogflags", "settings_warning", self.settings_warning)
|
||||
self.config.set("dialogflags", "dont_notify_about_this_version", self.dont_notify_about_this_version)
|
||||
self.config.set("dialogflags", "ask_about_usage_stats", self.ask_about_usage_stats)
|
||||
|
||||
|
@ -261,6 +261,23 @@ Have fun!
|
||||
)
|
||||
self.settings.show_disclaimer = not checked
|
||||
|
||||
if self.settings.settings_warning < 4:
|
||||
checked = OptionalMessageDialog.msg(
|
||||
self,
|
||||
"Warning!",
|
||||
f"""<span style="font-size:15px">
|
||||
{" "*100}
|
||||
The next release will save settings in a different format
|
||||
<span style="font-weight: bold;font-size:19px">no settings will be transfered</span> to the new version.<br/>
|
||||
See <a href="https://github.com/comictagger/comictagger/releases/1.5.5">https://github.com/comictagger/comictagger/releases/1.5.5</a>
|
||||
for more information
|
||||
<br/><br/>
|
||||
You have {4-self.settings.settings_warning} warnings left.
|
||||
</span>""",
|
||||
)
|
||||
if checked:
|
||||
self.settings.settings_warning += 1
|
||||
|
||||
if self.settings.check_for_new_version:
|
||||
self.check_latest_version_online()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user