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

Settings gui #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Settings gui #34

wants to merge 2 commits into from

Conversation

Shulqo
Copy link

@Shulqo Shulqo commented May 11, 2020

It's not finished, need to fix few mistakes and connect it to config

Comment on lines 18 to 24
width = 300
height = 220
font = 10
opaci_percent = 100
opaci = opaci_percent/100
frame = False
top = False
Copy link
Owner

Choose a reason for hiding this comment

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

What about importing setting instead?

from src.utils.config

Generally speaking if we want to introduce GUI based config. I'd suggest to create a class for the Config.

In the utils.config we could have module variable with Config instance.

You could then simply retrieve* and change configurable values and save them through Config methods :)

self.setText("Apply")


def Apply():
Copy link
Owner

Choose a reason for hiding this comment

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

Method names with small letters. Generally speaking it would be helpful if flake8 errors would be fixed :)

There's a tox environment for running flake8 to the project.

tox -e flake8

Comment on lines 82 to 83
WidthSlider.setMinimum(300)
WidthSlider.setMaximum(1920)
Copy link
Owner

Choose a reason for hiding this comment

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

I believe maximum value should be the maximum width available in user display

Copy link
Author

Choose a reason for hiding this comment

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

That's a great idea, I'll look for resolution check, it shouldn't be so hard

self.setLayout(self.layout)

def valuechange(self, value):
self.__init__(value) # FCK INIT CALLED TWICE, i was looking for solution but can't find anything ;_;
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure what you want achieve there ^.^?

Copy link
Author

Choose a reason for hiding this comment

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

I need to update the value on the screen every time the user move slider that is when the value changes.

Comment on lines 1 to 8
# problem with importing
# from ..gui.modules.settings import width, height, font, opaci, frame, top
import os
import sys
import toml

# i want to connect variables from settings to config file and make it update every time any of variables change
CFG_VERSION = '0.7'
Copy link
Owner

Choose a reason for hiding this comment

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

yeah, like I wrote in first comment.

I think it should be other way around. New class should be introduced and whole config management should be dome via it's instance.

Copy link
Author

Choose a reason for hiding this comment

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

Yea, I will try with this.

application/src/gui/modules/settings.py Outdated Show resolved Hide resolved
Comment on lines 41 to 44
self.setSingleStep(10)
self.setSuffix("%")
class FrameCheck(QCheckBox):
def __init__(self):
Copy link
Owner

Choose a reason for hiding this comment

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

There should be two empty lines between class definitions. flake8 should report that.

@Shulqo
Copy link
Author

Shulqo commented May 12, 2020

Thanks for the help, I will try to fix everything and make this compatible with linux.

@Shulqo
Copy link
Author

Shulqo commented May 19, 2020

Hi, I didn't have much time to work at this project but I made some changes but I encountered another problem with changing variables in functions. Idk how to make it works.

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