mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 01:49:42 +02:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1da62ef414 | |||
| 4b5c36030d |
@@ -12,6 +12,7 @@ from PySide6.QtWidgets import (
|
|||||||
QHBoxLayout,
|
QHBoxLayout,
|
||||||
QSpinBox,
|
QSpinBox,
|
||||||
QCheckBox,
|
QCheckBox,
|
||||||
|
QFileDialog,
|
||||||
)
|
)
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
@@ -114,6 +115,15 @@ def settings_dialog(self):
|
|||||||
download_path.setText(state.download_path)
|
download_path.setText(state.download_path)
|
||||||
dialog.layout().addWidget(download_path_container)
|
dialog.layout().addWidget(download_path_container)
|
||||||
|
|
||||||
|
def browse_download_path():
|
||||||
|
dir_path = QFileDialog.getExistingDirectory(dialog, "Select Download Directory", state.download_path)
|
||||||
|
if dir_path:
|
||||||
|
download_path.setText(dir_path)
|
||||||
|
|
||||||
|
browse_button = QPushButton("📁")
|
||||||
|
download_path_layout.addWidget(browse_button)
|
||||||
|
browse_button.clicked.connect(browse_download_path)
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# SPEED LIMITING #
|
# SPEED LIMITING #
|
||||||
##################
|
##################
|
||||||
@@ -147,6 +157,15 @@ def settings_dialog(self):
|
|||||||
image_path.setText(state.image_path)
|
image_path.setText(state.image_path)
|
||||||
dialog.layout().addWidget(image_path_container)
|
dialog.layout().addWidget(image_path_container)
|
||||||
|
|
||||||
|
def browse_image_path():
|
||||||
|
file_path = QFileDialog.getOpenFileName(dialog, "Select Image File", state.image_path, "Image Files (*.png *.jpg)")[0]
|
||||||
|
if file_path:
|
||||||
|
image_path.setText(file_path)
|
||||||
|
|
||||||
|
browse_button = QPushButton("📁")
|
||||||
|
image_path_layout.addWidget(browse_button)
|
||||||
|
browse_button.clicked.connect(browse_image_path)
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# SAVE/CANCEL #
|
# SAVE/CANCEL #
|
||||||
###############
|
###############
|
||||||
|
|||||||
@@ -229,11 +229,15 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
os.startfile(os.path.normpath(state.download_path))
|
os.startfile(os.path.normpath(state.download_path))
|
||||||
elif platform.system() == "Linux":
|
elif platform.system() == "Linux":
|
||||||
subprocess.Popen(["xdg-open", state.download_path])
|
subprocess.Popen(["xdg-open", state.download_path])
|
||||||
|
elif platform.system() == "Darwin":
|
||||||
|
subprocess.Popen(["open", state.download_path])
|
||||||
else:
|
else:
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
os.startfile(os.path.normpath(os.getcwd()))
|
os.startfile(os.path.normpath(os.getcwd()))
|
||||||
elif platform.system() == "Linux":
|
elif platform.system() == "Linux":
|
||||||
subprocess.Popen(["xdg-open", os.getcwd()])
|
subprocess.Popen(["xdg-open", os.getcwd()])
|
||||||
|
elif platform.system() == "Darwin":
|
||||||
|
subprocess.Popen(["open", os.getcwd()])
|
||||||
return
|
return
|
||||||
|
|
||||||
if download.is_paused:
|
if download.is_paused:
|
||||||
|
|||||||
Reference in New Issue
Block a user