-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add Date and Time.app #188
base: master
Are you sure you want to change the base?
Conversation
Thanks @Hierosme. Getting this error: Can we ship a private copy of this file? Or do we need to install some package in the system? |
I have cleaned up the Markdown in Resources/docs/README.md a bit, but it is pointing to non-existing images. Either we should remove those links, or we need to add the images. Note to self: When this gets merged, the Markdown needs to go to https://hellosystem.github.io/docs/ |
Here that my bad, i need more time for make it work. i have to code wrapper for take the Environement Variable $TZ with precedence of "/etc/timezone" and permit the case where both is not present. The "etc/timezone" is the default file of ntpd, because ntpdaate is consider deprecated by FreeBSD and will be not aviable on next major. Yes helloSytem should consider to migrate to ntpd , the Fronted target a /etc/ntpd.conf and /etc/timezone or $TZ. The TZ env var is a good way to have TimeZone with a live CD. |
About Documentation, That is worng mannipulation, due to the split of the original pull request, screenshoot is not here because i waiting for finished product before take any screenshoot. What you have inside the README is my documentation plan , the publication of that file is a error. |
Can you help me with that? |
Certainly, i'll not let you like that, and the Date and Time.app have it step as requirement. |
Let's open a new issue for the migration in https://github.com/helloSystem/ISO. |
Let have fun ! |
@probonopd It look impossible to use systemTrayIcon class for write digital clock. It have many cause: Brief it have no way to display Text or only with a very bad workarround it consist to create one systemtrayIcon object by letter. (That is clear not acceptable) A good way is to use the Filer.app (Global Menu) Clock, and use a plain text configuration file. In summary the systemTrayIcon from Qt is really a bad, and not permit to create widget like, Battery percentage, CPU Percentage, Digital clock. |
I don't understand what you want to change regarding systemTray, but I am happy with how it is: This is by the way part of https://github.com/helloSystem/Menu and has nothing to do with this repository (Utilities) or this pull request (#188). |
Yes i speacking about The DateTime of Menu.app The plugin is a True widget. class DateTimeWidget : public QWidget and it have no way to inform that widget about the date string format, then by exemple match with the setting of Date and Time.app My first approch was to think about provide the digital clock with Date and time.app , but QSystemtrayIcon simply cant act like a widget. I have look the source code on Menu Datetime plugin, https://github.com/helloSystem/Menu/tree/main/plugin-datetime but it havent any percitent setting, or DBus connection. Then that is impossible to have any type of user preferences. Do i delete the Tab about Digital clock setting ? |
By the Way: We can respect the POSIX about date string format where for date CLI use TZ and LC_TIME env var: The percistence can be obtein by just write in /etc/profile That is a good option for live CD, but the actual Menu.app dont have entry point for change date string format. |
Menu.app uses the format defined by the system via environment variables. E.g., when you set the language to German you get different formatting (e.g., no AM/PM) than if you set it to US English. So it is already working "automagically" (Qt handles it for us). So, we do not need (and don't support) the tab "Clock" in "Date and Time". Please let me know once you think this PR is ready for merging. Let's not overengineer it ;-) |
LOL @pyqtProperty(str)
def TimeZone(self):
return self.__timezone
@TimeZone.setter
def TimeZone(self, value):
if value is None:
info1 = QFileInfo(self.__timezone_default_path)
if os.getenv("TZ"):
value = os.environ.get("TZ")
elif info1.exists() and (info1.isFile() or info1.isSymLink()):
if info1.isSymLink():
info1 = QFileInfo(info1.symLinkTarget())
if info1.isFile() and info1.isReadable():
try:
file_handle = QFile(info1.absoluteFilePath())
file_handle.open(QFile.ReadOnly)
data = file_handle.readAll()
codec = QTextCodec.codecForUtfText(data)
value = codec.toUnicode(data).strip("\n")
except (Exception, BaseException):
raise IOError("Problem reading file %s" % info1.absoluteFilePath())
if self.__timezone != value:
self.__timezone = value
self.TimeZoneChanged.emit()
I still have work to do but i'll resume it to reach soon a frist testable version |
In fact everything is finish except the security arround sudo usage. I'll pass it PR as Ready for Review soon, but i'll let comment the sudo usage part. The GUI hard work have been done, now it just require a permission escallation Backend. Without it Permission escalation backend that will be the last preference tool i touch. I havent any security hole to merge on the main branch .... |
Using helper applications with |
Frist Second. We have all ready speack about, that a big NO from my part, The usage of sudo inside helloSystem is worng, that is write many timewrite inside sudo manual, the env var heritage is sommething hard to secure. Security is more complicated, if it was so simple everyone will use sudo. From Dev point of view: Arctuallyt he only way to secure the "Date and Time.app" i have make is to start them with sudo. life is like that, my skill not permit both security couple with nice GUI. Here i can only limited the impact of a worng usage of sudo. Apologize again if my english look rude, that clealy because i'm limited for explain me. Regards |
Hi @Hierosme, I appreciate your constructive dialog. Maybe I am having a hard time understanding your points due to the language barrier. To me, frameworks like polkit are insecure by design because they are complex and most people don't understand what is going on. When calling something with Now, for a GUI application, there are 2 possible ways:
Can you elaborate how/why this would be less secure than using a more complicated system?
What do you mean by this? Can you give an example? I am really trying to understand your point. Feel free to answer in your native language if it is easier for you. I will find a way to translate. Thanks! |
Sorry for the delay i was in travel for my job... I'm back and tak a moment for response. From my point i know how it should do, but that just my point, if consider helloSystem my point is just a point like other one. Thanks to trust my motivation. Actually i'm busy with a CI/CD migration for a other project, but i come soon (from now i'm near, next travel i few mouths) last time i have rush on Grab.app it still have work but i'll switch back to the sudo trouble. Normally the code is OK everthing is finish, it just have sudo to enable.... regards cher... |
Fix for #165