diff --git a/NUSGet.py b/NUSGet.py index 70b190c..ec0ff68 100644 --- a/NUSGet.py +++ b/NUSGet.py @@ -39,7 +39,7 @@ from modules.download_batch import run_nus_download_batch from modules.download_wii import run_nus_download_wii from modules.download_dsi import run_nus_download_dsi -nusget_version = "1.4.3" +nusget_version = "1.5.0" regions = {"World": ["41"], "USA/NTSC": ["45"], "Europe/PAL": ["50"], "Japan": ["4A"], "Korea": ["4B"], "China": ["43"], "Australia/NZ": ["55"]} @@ -82,6 +82,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.ui.setupUi(self) self.threadpool = QThreadPool() self.ui.download_btn.clicked.connect(self.download_btn_pressed) + self.ui.open_output_btn.clicked.connect(self.open_output_dir) self.ui.script_btn.clicked.connect(self.script_btn_pressed) self.ui.custom_out_dir_btn.clicked.connect(self.choose_output_dir) self.ui.pack_archive_checkbox.toggled.connect( @@ -191,6 +192,16 @@ class MainWindow(QMainWindow, Ui_MainWindow): dsi_model = NUSGetTreeModel(dsi_database, root_name="DSi Titles") self.tree_models = [wii_model, vwii_model, dsi_model] self.trees = [self.ui.wii_title_tree, self.ui.vwii_title_tree, self.ui.dsi_title_tree] + # --------- + # UI Tweaks + # --------- + # Any misc UI tweaks that need to be done when the UI loads. + # Set the appropriate folder icon for the open output folder button depending on the theme. + if is_dark_theme(config_data): + icon = QIcon(os.path.join(os.path.dirname(__file__), "resources", "folder_white.svg")) + else: + icon = QIcon(os.path.join(os.path.dirname(__file__), "resources", "folder_black.svg")) + self.ui.open_output_btn.setIcon(icon) # Build proxy models required for searching self.proxy_models = [TIDFilterProxyModel(self.ui.wii_title_tree), TIDFilterProxyModel(self.ui.vwii_title_tree), TIDFilterProxyModel(self.ui.dsi_title_tree)] @@ -613,6 +624,16 @@ class MainWindow(QMainWindow, Ui_MainWindow): worker.signals.progress.connect(self.download_progress_update) self.threadpool.start(worker) + def open_output_dir(self): + # Like all good things in life, this is a platform-dependent procedure. Did I say good? I meant annoying. + system = platform.system() + if system == "Windows": + subprocess.run(["explorer.exe", out_folder]) + elif system == "Darwin": + subprocess.run(["open", out_folder]) + else: + subprocess.run(["xdg-open", out_folder]) + def choose_output_dir(self): # Use this handy convenience method to prompt the user to select a directory. Then we just need to validate # that the directory does indeed exist and is a directory, and we can save it as the output directory. diff --git a/qt/py/ui_MainMenu.py b/qt/py/ui_MainMenu.py index 0e53182..3b97aa9 100644 --- a/qt/py/ui_MainMenu.py +++ b/qt/py/ui_MainMenu.py @@ -3,7 +3,7 @@ ################################################################################ ## Form generated from reading UI file 'MainMenu.ui' ## -## Created by: Qt User Interface Compiler version 6.9.0 +## Created by: Qt User Interface Compiler version 6.10.1 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ @@ -210,6 +210,13 @@ class Ui_MainWindow(object): self.horizontalLayout.addWidget(self.download_btn) + self.open_output_btn = QPushButton(self.centralwidget) + self.open_output_btn.setObjectName(u"open_output_btn") + icon1 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.FolderOpen)) + self.open_output_btn.setIcon(icon1) + + self.horizontalLayout.addWidget(self.open_output_btn) + self.script_btn = QPushButton(self.centralwidget) self.script_btn.setObjectName(u"script_btn") sizePolicy.setHeightForWidth(self.script_btn.sizePolicy().hasHeightForWidth()) @@ -371,7 +378,7 @@ class Ui_MainWindow(object): MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") - self.menubar.setGeometry(QRect(0, 0, 1010, 21)) + self.menubar.setGeometry(QRect(0, 0, 1010, 30)) self.menu_help = QMenu(self.menubar) self.menu_help.setObjectName(u"menu_help") self.menu_options = QMenu(self.menubar) @@ -431,6 +438,7 @@ class Ui_MainWindow(object): self.label_5.setText(QCoreApplication.translate("MainWindow", u"Console:", None)) self.console_select_dropdown.setCurrentText("") self.download_btn.setText(QCoreApplication.translate("MainWindow", u"Start Download", None)) + self.open_output_btn.setText("") self.script_btn.setText(QCoreApplication.translate("MainWindow", u"Run Script", None)) self.label_3.setText(QCoreApplication.translate("MainWindow", u"General Settings", None)) self.archive_file_entry.setPlaceholderText(QCoreApplication.translate("MainWindow", u"File Name", None)) @@ -445,7 +453,7 @@ class Ui_MainWindow(object): "hr { height: 1px; border-width: 0; }\n" "li.unchecked::marker { content: \"\\2610\"; }\n" "li.checked::marker { content: \"\\2612\"; }\n" -"
\n" +"\n" "