Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cs2tracker/app/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ctypes
import tkinter as tk
from shutil import copy
from tkinter import messagebox, ttk
from tkinter import PhotoImage, messagebox, ttk
from tkinter.filedialog import askopenfilename, asksaveasfile

import sv_ttk
Expand Down Expand Up @@ -63,8 +63,10 @@ def _configure_window(self):
if OS == OSType.WINDOWS:
app_id = "cs2tracker.unique.id"
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(app_id)

window.iconbitmap(default=ICON_FILE)
window.iconbitmap(default=ICON_FILE)
else:
icon = PhotoImage(file=ICON_FILE)
window.iconphoto(True, icon)

main_frame = MainFrame(window, self.scraper)
main_frame.pack(expand=True, fill="both")
Expand Down
8 changes: 4 additions & 4 deletions cs2tracker/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ def copy_initial_files_with_popup():

else:
MODULE_DIR = os.path.dirname(os.path.abspath(__file__))
# The project directory doesn't really exist in this case
# (pip only installs contents of cs2tracker/cs2tracker in site-packages)
PROJECT_DIR = MODULE_DIR
# NOTE: The project directory doesn't really exist in this case when launched via pip
# (pip only installs contents of cs2tracker/cs2tracker in site-packages i.e. PROJECT_DIR = site-packages)
PROJECT_DIR = os.path.dirname(MODULE_DIR)
DATA_DIR = os.path.join(MODULE_DIR, "data")

CONFIG_FILE = os.path.join(DATA_DIR, "config.ini")
Expand All @@ -162,7 +162,7 @@ def copy_initial_files_with_popup():
INVENTORY_IMPORT_SCRIPT = os.path.join(DATA_DIR, "get_inventory.js")
NODE_MODULES = os.path.join(DATA_DIR, "node_modules")

ICON_FILE = os.path.join(DATA_DIR, "icon.ico")
ICON_FILE = os.path.join(DATA_DIR, "icon.ico" if OS == OSType.WINDOWS else "icon.png")
BATCH_FILE = os.path.join(DATA_DIR, "cs2tracker_scraper.bat")
INVENTORY_IMPORT_FILE = os.path.join(DATA_DIR, "inventory.json")
INVENTORY_IMPORT_SCRIPT_DEPENDENCIES = [
Expand Down
Binary file added cs2tracker/data/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.