From ba4f5faa65e5e47078c433d9297e9e231e06df5a Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Sat, 17 Dec 2016 17:07:09 +0200 Subject: [PATCH] Check if logger is enabled on 'View Log' action --- youtube_dl_gui/mainframe.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/youtube_dl_gui/mainframe.py b/youtube_dl_gui/mainframe.py index 9876b6b..a6abe99 100644 --- a/youtube_dl_gui/mainframe.py +++ b/youtube_dl_gui/mainframe.py @@ -707,9 +707,14 @@ class MainFrame(wx.Frame): self.PopupMenu(self._settings_menu, event_object_pos) def _on_viewlog(self, event): - log_window = LogGUI(self) - log_window.load(self.log_manager.log_file) - log_window.Show() + if self.log_manager is None: + self._create_popup(_("Logging is disabled"), + self.WARNING_LABEL, + wx.OK | wx.ICON_EXCLAMATION) + else: + log_window = LogGUI(self) + log_window.load(self.log_manager.log_file) + log_window.Show() def _on_about(self, event): info = wx.AboutDialogInfo()