Skip to content

Commit

Permalink
Merge pull request #381 from OpenTrafficCam/feature/3393-clearify-war…
Browse files Browse the repository at this point in the history
…ning-message,-when-otconfig-should-be-saved-to-another-device-that-it-has-not-been-saved

feature/3393-clearify-warning-message,-when-otconfig-should-be-saved-to-another-device-that-it-has-not-been-saved
  • Loading branch information
randy-seng authored Oct 26, 2023
2 parents be38905 + 7db104b commit 9265717
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions OTAnalytics/plugin_ui/customtkinter_gui/dummy_viewmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
from OTAnalytics.plugin_ui.customtkinter_gui.toplevel_sections import ToplevelSections
from OTAnalytics.plugin_ui.customtkinter_gui.treeview_template import ColumnResource

MESSAGE_CONFIGURATION_NOT_SAVED = "The configuration has not been saved.\n"
SUPPORTED_VIDEO_FILE_TYPES = ["*.avi", "*.mkv", "*.mov", "*.mp4"]
TAG_SELECTED_SECTION: str = "selected_section"
LINE_SECTION: str = "line_section"
Expand Down Expand Up @@ -452,15 +453,24 @@ def _save_otconfig(self, otconfig_file: Path) -> None:
try:
self._application.save_otconfig(otconfig_file)
except NoSectionsToSave as cause:
message = "No sections to save, please add new sections first"
message = (
f"{MESSAGE_CONFIGURATION_NOT_SAVED}"
f"No sections to save, please add new sections first."
)
self.__show_error(cause, message)
return
except DifferentDrivesException as cause:
message = "Configuration and video files are located on different drives."
message = (
f"{MESSAGE_CONFIGURATION_NOT_SAVED}"
f"Configuration and video files are located on different drives."
)
self.__show_error(cause, message)
return
except MissingDate as cause:
message = "Start date is missing or invalid. Please add a valid start date."
message = (
f"{MESSAGE_CONFIGURATION_NOT_SAVED}"
f"Start date is missing or invalid. Please add a valid start date."
)
self.__show_error(cause, message)
return

Expand Down

0 comments on commit 9265717

Please sign in to comment.