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

[WIP] GUI #43

Draft
wants to merge 43 commits into
base: main
Choose a base branch
from
Draft

[WIP] GUI #43

wants to merge 43 commits into from

Conversation

Thinkseal
Copy link
Collaborator

No description provided.

@Thinkseal
Copy link
Collaborator Author

before I spend a long time making a copy function for every single text translation option is there any more effective way to do that where it will still work?

@KTrain5169
Copy link
Collaborator

before I spend a long time making a copy function for every single text translation option is there any more effective way to do that where it will still work?

why do you need to create a copy function for every single option tf

@KTrain5169
Copy link
Collaborator

also why are you doing this on your fork

@Thinkseal
Copy link
Collaborator Author

Thinkseal commented Oct 4, 2024

also why are you doing this on your fork

Because it took last steps for me to figure out (remember I don't know how to use GitHub property)

why do you need to create a copy function for every single option tf

Because I if I try and get the variable within the button and not in a function then it doesn't work and will just give me nothing

@Thinkseal
Copy link
Collaborator Author

Thinkseal commented Nov 13, 2024

I believe that this is getting to the point where it's usable now (other than the fact that it won't build)

@KTrain5169
Copy link
Collaborator

lemme go fix the workflow rq

adding to release workflow later
@KTrain5169 KTrain5169 self-assigned this Nov 16, 2024
@blryface blryface changed the title added gui (not fully functional yet) [WIP] GUI Nov 17, 2024
@Thinkseal
Copy link
Collaborator Author

I believe this works now

Copy link
Collaborator

@KTrain5169 KTrain5169 left a comment

Choose a reason for hiding this comment

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

You could probably shorten this code down drastically but it's not a hard requirement to merge the PR, after all a bit of spaghetti code was done myself in the early days of translator, plus we can always refactor it later if need be.

If you would like to improve the code before merging, examples are below. Otherwise, feel free to undraft the PR and merge it after giving the artifacts built by GitHub Actions a test.

input_widget = ttk.Entry(root, textvariable=translate_text)
input_widget.grid(row=0, column=0, columnspan=2)

ttk.Label(text="Reversed:").grid(row=1,column=text_lable_column)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Starting from this line, you're copy pasting a lot over per label, which is unnecessary. You could put this in a while loop since they seem to all be the same except for variable names, text labels and rows

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So how would I get it to change the variable name?

emoticons_text['text'] = converter.text_to_emoticons(new_text)

def add_copy_buttons():
ttk.Button(root, command=partial(copy_to_clipboard, reversed_text), image = copy_icon).grid(sticky = W, row=1, column=copy_button_column)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could simplify this using loops, arguably simpler than later in the code to do so.

new_text = translate_text.get()
x_size=int(8.5*len(new_text)+240)
root.geometry(f"{x_size}x{350}")
reversed_text['text'] = converter.reverse_text(new_text)
Copy link
Collaborator

Choose a reason for hiding this comment

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

these could all be done using dictionary probably but I'm not sure about capitalized and lowercase text

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I currently do not know how to use a Dictionary in python

Copy link
Member

Choose a reason for hiding this comment

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

learn

.github/workflows/build.yml Show resolved Hide resolved
@KTrain5169
Copy link
Collaborator

I think I selected the wrong lines to demonstrate what I mean because I'll be honest I don't review PRs that much, if you need some clarifications or pointers feel free to ask on Discord :)

In the meantime I'll be testing the files built by CI

@KTrain5169
Copy link
Collaborator

change of plans: do NOT merge this PR yet

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.

3 participants