Skip to content

Commit

Permalink
some updates to the window and templates
Browse files Browse the repository at this point in the history
  • Loading branch information
tposejank committed May 25, 2024
1 parent e4eb048 commit a724ed0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/error.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ body:

- type: textarea
attributes:
label: What are the contents of the latest .log file? You can find them in your logs folder, next to the EXE.
label: What are the contents of the latest .log file? (If you don't know what the last log file was, open the ".defaults" file, where you will find the name of the log file in the third line.)

- type: textarea
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/incomplete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ body:

- type: textarea
attributes:
label: What are the contents of the latest .log file? (if applicable)
label: What are the contents of the latest .log file? (if applicable) (If you don't know what the last log file was, open the ".defaults" file, where you will find the name of the log file in the third line.)

- type: textarea
attributes:
Expand Down
8 changes: 4 additions & 4 deletions psychtobase/src/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def emit(self, record):
print(log_entry)
window.window.logsLabel.append(log_entry)

class RetainLog():
class LogMem():
def __init__(self, log):
self.log = log
self.current_log_file = log

logRetain = RetainLog('Dunno')
logMemory = LogMem('No file yet recorded')

def setup() -> logging.RootLogger:
"""instance of Logger module, will be used for logging operations"""
Expand All @@ -37,7 +37,7 @@ def setup() -> logging.RootLogger:
file_handler = logging.FileHandler(log_file)
file_handler.setFormatter(log_format)

logRetain.log = log_file
logMemory.current_log_file = log_file

# console handler
console_handler = CustomHandler()
Expand Down
17 changes: 13 additions & 4 deletions psychtobase/src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def __init__(self):

self.icons = QCheckBox("Health Icons", self)
self.icons.move(sSX, 290)
self.icons.setToolTip("Copies over all of your character icon .png files from the \"/images/icons/\" directory of your mod.")
self.icons.setToolTip("Copies over all of your character icon .png files from the \"/images/icons/\" directory of your mod. This also includes the Freeplay Icons.")

self.jsons = QCheckBox(".json files", self)
self.jsons.move(sSX, 310)
Expand Down Expand Up @@ -409,7 +409,8 @@ def convertCallback(self, what):
options['images'] = self.images.isChecked()

try:
open(_defaultsFile, 'w').write(f'{psych_mod_folder_path}\n{result_path}')
# Now writing the last log file, which we can query to the user
open(_defaultsFile, 'w').write(f'{psych_mod_folder_path}\n{result_path}\n{log.logMemory.current_log_file}')
except Exception as e:
logging.error(f'Problems with your save file: {e}')

Expand All @@ -425,10 +426,18 @@ def goToGB(self):
webbrowser.open(f'https://gamebanana.com/tools/{_GB_ToolID}')

def openLogFile(self):
file = log.logRetain.log
file = log.logMemory.current_log_file
realLogPath = Path(file).resolve()
print(realLogPath)
logging.info(f'Attempting to open file: {realLogPath}')
subprocess.Popen(['open', str(realLogPath)])

currentPlatform = platform.system()

if currentPlatform == 'Windows':
subprocess.Popen(['notepad.exe', str(realLogPath)])
elif currentPlatform == 'Darwin':
subprocess.Popen(['open', str(realLogPath)])

def open_dialog(self, title, inputs, button, body):
self.dialog = SimpleDialog(title, inputs, button, body)
self.dialog.show()
Expand Down

0 comments on commit a724ed0

Please sign in to comment.