Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit 39cd807

Browse files
committed
✨ Format, add icon
1 parent 1b12695 commit 39cd807

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ include = [
1717
]
1818

1919
[tool.poetry.dependencies]
20-
python = ">=3.8.1,<=3.11.1"
20+
python = ">=3.8.1,<3.12"
2121
requests = "^2.28.2"
2222
tomli = "^2.0.1"
2323
darkdetect = "^0.8.0"

vanilla_installer/assets/icon.png

10.3 KB
Loading

vanilla_installer/gui.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""Runs the GUI for VanillaInstaller."""
44
# IMPORTS
55
import pathlib
6+
import platform
67
import sys
78
import webbrowser
89
from time import sleep
@@ -25,13 +26,12 @@
2526
QTextEdit,
2627
QWidget,
2728
)
28-
import platform
29+
2930
# LOCAL
3031
from vanilla_installer import config, main, theme
3132
from vanilla_installer.log import logger
3233

3334

34-
3535
def run() -> None:
3636
"""Runs the GUI."""
3737
global global_font
@@ -186,6 +186,9 @@ def setupUi(self, MainWindow: QMainWindow) -> None:
186186
)
187187
self.settingsButtonIcon.setGeometry(70, 0, 24, 24)
188188

189+
self.windowIcon = Ui_MainWindow.getAsset("icon.png")
190+
MainWindow.setWindowIcon(QIcon(self.windowIcon))
191+
189192
self.reloadTheme()
190193

191194
MainWindow.setCentralWidget(self.centralwidget)
@@ -305,7 +308,7 @@ def addVersions(self) -> None:
305308
self.versionSelector.addItem(version)
306309
self.versionSelector.setCurrentIndex(0)
307310

308-
def getAsset(asset) -> str:
311+
def getAsset(asset: str) -> str:
309312
"""Get the path to a given asset.
310313
311314
Args:
@@ -334,7 +337,9 @@ def selectDirectory(self, parent) -> None:
334337
dialog.setFileMode(QFileDialog.FileMode.Directory)
335338
current_path = pathlib.Path(self.selectedLocation.toPlainText()).absolute()
336339
if not current_path.exists():
337-
current_path = pathlib.Path(mll.utils.get_minecraft_directory()).absolute().mkdir()
340+
current_path = (
341+
pathlib.Path(mll.utils.get_minecraft_directory()).absolute().mkdir()
342+
)
338343
dialog.setDirectory(str(current_path))
339344
config.write("path", str(current_path))
340345
if dialog.exec():

vanilla_installer/main.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def get_dir() -> str:
5151
return path["config"]["path"]
5252

5353

54-
5554
def newest_version() -> str:
5655
"""Returns the latest version of Minecraft that FO supports.
5756
@@ -381,7 +380,9 @@ def get_pack_mc_versions() -> dict:
381380
# For this to work, you need to be in the root directory of the repository running this, otherwise the files will not be found.
382381
logger.warning("GitHub failed, falling back to local...")
383382
try:
384-
local_path = Path("vanilla_installer/assets").resolve() / "versions.json"
383+
local_path = (
384+
Path("vanilla_installer/assets").resolve() / "versions.json"
385+
)
385386
except:
386387
local_path = Path("assets").resolve() / "versions.json"
387388
response = json.loads(local_path.read_bytes())

vanilla_installer/theme.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
"""
66

77
import pathlib
8-
from vanilla_installer import config
9-
from vanilla_installer.log import logger
108
from typing import Optional
119

1210
import darkdetect
1311

12+
from vanilla_installer import config
13+
from vanilla_installer.log import logger
14+
1415
FILE = str(pathlib.Path("data/theme.txt").resolve())
1516

1617

0 commit comments

Comments
 (0)