Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto fill the selected folder's name in the Name/AppID field #64

Closed
wants to merge 4 commits into from
Closed

Auto fill the selected folder's name in the Name/AppID field #64

wants to merge 4 commits into from

Conversation

lolinator53
Copy link

Added functionality mentionend in #63


PS: might've messed up commits, not sure

@@ -71,6 +72,7 @@ def DoRequest(self):
def select_folder():
global folder_path
folder_path = filedialog.askdirectory()
folder_name = re.sub(r".*(\\|/)?([^\\]+)(\\|/)", "", folder_path)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using os.path.basename would probably be better

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, regex was more intuitive for me tho

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice regex though haha, I hope it was found only or ChatGPT x)
They're always so hard to make

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, i made it together with https://regex101.com

They're alright when u get used to it

@@ -84,8 +86,12 @@ def select_folder():
selectedFolderLabel.config(text=f"Selected folder:\n{folder_path}")
selectedFolderLabel.pack()
frameGame2.pack()
gameNameEntry.delete(0, last=len(gameNameEntry.get()))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tk.END would probably fit better :)

Comment on lines +93 to +94
gameNameEntry.delete(0, last=len(gameNameEntry.get()))
gameNameEntry.insert(0, folder_name)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate? Doesn't seem required

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you have two cases one of which when the folder already got selected. If the duplicate doesn‘t stay, it wouldn‘t auto-fill in that case

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not true? It's not an if else, just a simple if. The delete & insert functions are called BEFORE the IF, so that wouldn't matter

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh shoot true, yeah than nevermind probably

wouldn't the whole if clause be useless in this case?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IF close is meant to re-display the whole "Selected crack:" section if you decide to change the selected directory AFTER doing the App search (select a folder, search for the app, then unselect/change folder); at least from what I remember

@BigBoiCJ
Copy link
Owner

BigBoiCJ commented Apr 28, 2024

Thanks for your PR, after some research, I found a better solution than regex for this job

I do appreciate the time you took for this. Since I want to change the code a bit and there's a merge conflict, I'll just close this PR and commit the changes. You'll be credited of course :)

I hope you don't mind. I know PRs are good for stats & all

@lolinator53
Copy link
Author

I hope you don't mind. I know PRs are good for stats & all

I couldn't care less for stats hahah, i just want to contribute since this tool is really awesome

@BigBoiCJ
Copy link
Owner

I couldn't care less for stats hahah, i just want to contribute since this tool is really awesome

Cool :) - thanks ❤️

Currently working on v2.1.0 with an opt-in autoupdater & minor improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants