-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
base: master
Are you sure you want to change the base?
Settings gui #34
Conversation
width = 300 | ||
height = 220 | ||
font = 10 | ||
opaci_percent = 100 | ||
opaci = opaci_percent/100 | ||
frame = False | ||
top = False |
There was a problem hiding this comment.
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(): |
There was a problem hiding this comment.
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
WidthSlider.setMinimum(300) | ||
WidthSlider.setMaximum(1920) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ;_; |
There was a problem hiding this comment.
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 ^.^?
There was a problem hiding this comment.
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.
application/src/utils/config.py
Outdated
# 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' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
self.setSingleStep(10) | ||
self.setSuffix("%") | ||
class FrameCheck(QCheckBox): | ||
def __init__(self): |
There was a problem hiding this comment.
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.
Thanks for the help, I will try to fix everything and make this compatible with linux. |
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. |
It's not finished, need to fix few mistakes and connect it to config