Compare commits
2 Commits
v0.1.0-bet
...
v0.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc8deb0440 | ||
|
|
42f4985812 |
25
gui.py
25
gui.py
@@ -168,31 +168,6 @@ class VideoConverterGUI:
|
|||||||
pass
|
pass
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
self.status_var.set("Converting video...")
|
|
||||||
success = converter.convert_video(input_path, output_dir, quality)
|
|
||||||
|
|
||||||
if success:
|
|
||||||
self.status_var.set("Conversion successful!")
|
|
||||||
messagebox.showinfo("Success", "Conversion completed successfully!")
|
|
||||||
else:
|
|
||||||
raise Exception("Conversion failed. Check logs for details.")
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
self.status_var.set(f"Error: {e}")
|
|
||||||
try:
|
|
||||||
with open(config.FFMPEG_LOG_FILE_PATH, "r") as f:
|
|
||||||
log_lines = f.readlines()
|
|
||||||
last_10_lines = "".join(log_lines[-10:])
|
|
||||||
messagebox.showerror("Error", f"An error occurred: {e}\n\nLast 10 lines of log:\n{last_10_lines}")
|
|
||||||
except FileNotFoundError:
|
|
||||||
messagebox.showerror("Error", f"An error occurred: {e}\n\nCould not find log file.")
|
|
||||||
except Exception as log_e:
|
|
||||||
messagebox.showerror("Error", f"An error occurred: {e}\n\nCould not read log file: {log_e}")
|
|
||||||
|
|
||||||
finally:
|
|
||||||
self.convert_button.config(state=tk.NORMAL)
|
|
||||||
self.cancel_button.config(state=tk.DISABLED)
|
|
||||||
|
|
||||||
def cancel_conversion(self):
|
def cancel_conversion(self):
|
||||||
# This is a bit tricky, as we can't easily kill the thread.
|
# This is a bit tricky, as we can't easily kill the thread.
|
||||||
# For now, we'll just show a message.
|
# For now, we'll just show a message.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ block_cipher = None
|
|||||||
a = Analysis(['main.py'],
|
a = Analysis(['main.py'],
|
||||||
pathex=['/home/joe/Cloud9/Documents/Obisdian/projects/Video Converter'],
|
pathex=['/home/joe/Cloud9/Documents/Obisdian/projects/Video Converter'],
|
||||||
binaries=[],
|
binaries=[],
|
||||||
datas=[],
|
datas=[('gui.py', '.')],
|
||||||
hiddenimports=[],
|
hiddenimports=[],
|
||||||
hookspath=[],
|
hookspath=[],
|
||||||
hooksconfig={},
|
hooksconfig={},
|
||||||
|
|||||||
Reference in New Issue
Block a user