mirror of
https://github.com/relativemodder/aegnux.git
synced 2025-12-10 05:29:38 +05:00
.aep file argument support added
This commit is contained in:
2
run.sh
2
run.sh
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
python main.py
|
python main.py "$@"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
from ui.mainwindow import MainWindowUI
|
from ui.mainwindow import MainWindowUI
|
||||||
from translations import gls
|
from translations import gls
|
||||||
from PySide6.QtCore import Slot
|
from PySide6.QtCore import Slot
|
||||||
@@ -23,6 +24,8 @@ class MainWindow(MainWindowUI):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
|
self.ran_from_aep_file = False
|
||||||
|
|
||||||
self.setWindowTitle(gls('welcome_win_title'))
|
self.setWindowTitle(gls('welcome_win_title'))
|
||||||
self.install_button.clicked.connect(self.install_button_clicked)
|
self.install_button.clicked.connect(self.install_button_clicked)
|
||||||
self.run_button.clicked.connect(self.run_ae_button_clicked)
|
self.run_button.clicked.connect(self.run_ae_button_clicked)
|
||||||
@@ -71,6 +74,26 @@ class MainWindow(MainWindowUI):
|
|||||||
self.aed_action.triggered.connect(self.ae_folder_clicked)
|
self.aed_action.triggered.connect(self.ae_folder_clicked)
|
||||||
self.aeg_action.triggered.connect(self.aegnux_folder_clicked)
|
self.aeg_action.triggered.connect(self.aegnux_folder_clicked)
|
||||||
self.cep_action.triggered.connect(self.cep_folder_clicked)
|
self.cep_action.triggered.connect(self.cep_folder_clicked)
|
||||||
|
|
||||||
|
def try_autoopen_aep(self):
|
||||||
|
self.run_ae_thread.clear_aep_file_arg()
|
||||||
|
if self.ran_from_aep_file:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.ran_from_aep_file = True
|
||||||
|
|
||||||
|
aep_file = ''
|
||||||
|
|
||||||
|
for arg in sys.argv:
|
||||||
|
if '.aep' in arg:
|
||||||
|
aep_file = arg
|
||||||
|
break
|
||||||
|
|
||||||
|
if aep_file == '':
|
||||||
|
return
|
||||||
|
|
||||||
|
self.run_ae_thread.add_aep_file_arg(aep_file)
|
||||||
|
self.run_ae_button_clicked()
|
||||||
|
|
||||||
def init_installation(self):
|
def init_installation(self):
|
||||||
if check_aegnux_installed():
|
if check_aegnux_installed():
|
||||||
@@ -83,6 +106,7 @@ class MainWindow(MainWindowUI):
|
|||||||
self.kill_action.setEnabled(True)
|
self.kill_action.setEnabled(True)
|
||||||
self.plugininst_action.setEnabled(True)
|
self.plugininst_action.setEnabled(True)
|
||||||
self.term_action.setEnabled(True)
|
self.term_action.setEnabled(True)
|
||||||
|
self.try_autoopen_aep()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.install_button.show()
|
self.install_button.show()
|
||||||
|
|||||||
@@ -6,5 +6,13 @@ class RunAEThread(RunExeThread):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(['AfterFX.exe'])
|
super().__init__(['AfterFX.exe'])
|
||||||
|
|
||||||
|
def add_aep_file_arg(self, aep_file: str):
|
||||||
|
self.exe_args.append('Z:' + aep_file)
|
||||||
|
|
||||||
|
def clear_aep_file_arg(self):
|
||||||
|
for arg in self.exe_args:
|
||||||
|
if '.aep' in arg:
|
||||||
|
self.exe_args.remove(arg)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
super().run()
|
super().run()
|
||||||
Reference in New Issue
Block a user