Skip to content

GUI Toggle option and Adding config option#129

Open
Raihan93-coder wants to merge 6 commits into
BusKill:devfrom
Raihan93-coder:GUI-toggle-option
Open

GUI Toggle option and Adding config option#129
Raihan93-coder wants to merge 6 commits into
BusKill:devfrom
Raihan93-coder:GUI-toggle-option

Conversation

@Raihan93-coder

Copy link
Copy Markdown

1) Adding persistent log variable to the config file ( easier user understanding )

I have made the small change of adding the config option persistent log to config.ini
The implementation is using just string concatenation in line

contents = "[buskill]\npersistent_log = False\n" # Updating the config option

As I didn't find any existing architecture that writes to the config file. This works for both GUI and CLI
In the past when we run CLI only

[buskill]

option will be available ( The rest of the config was actually of kivy )
I hope this implementation is fine

2) GUI toggle option in setting

I have a question about the expected behavior.

Since logging is initialized very early in main.py before the GUI is launched, should changing the persistent_log setting in the GUI only affect future launches of BusKill?

Or would you like the logging destination to be reconfigured immediately when the user toggles the option in Settings? ( Which I think will be really hard to implement )

Same Question

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

INFO: No unicode characters found in PR's commits

(source)

@maltfield

Copy link
Copy Markdown
Member

Since logging is initialized very early in main.py before the GUI is launched, should changing the persistent_log setting in the GUI only affect future launches of BusKill?

Or would you like the logging destination to be reconfigured immediately when the user toggles the option in Settings? ( Which I think will be really hard to implement )

Excellent question. I think having it apply on the next app start is fine. Because, you're right, otherwise it would be a very complicated implementation. And it's not worth the effort.

We should just notify the user that, when they change this setting, it won't apply until the app is restarted.

For this, you might want to implement the option as a BusKillSettingsComplexOption, defined in settings_buskill.json -- making use of the "confirmation" key in the json, where you can add a notice to the user that a restart is required before they confirm. For more info, see this json file how I've implemented the trigger option

@github-actions

Copy link
Copy Markdown

INFO: No unicode characters found in PR's commits

(source)

@Raihan93-coder

Copy link
Copy Markdown
Author

Should I change the wordings used ?

@maltfield

maltfield commented Jun 14, 2026

Copy link
Copy Markdown
Member

somewhat related: I broke the builds by signing the dependencies with the wrong key when trying to work on another ticket. But I just fixed it.

@maltfield

Copy link
Copy Markdown
Member

@Raihan93-coder did you test clicking the "Reset" button on the top-right of the Settings screen? I'm getting some crashes when I try

DEBUG: User switched to 'Settings' screen
[DEBUG  ] [DEBUG       ] User switched to 'Settings' screen
DEBUG: User initiated settings reset
[DEBUG  ] [DEBUG       ] User initiated settings reset
[WARNING] [Config      ] Older configuration version detected (0 instead of 27)
[WARNING] [Config      ] Upgrading configuration in progress.
[INFO   ] [Logger      ] Record log in /root/buskill-app/dist/.buskill/logs/kivy_26-06-14_9.txt
[INFO   ] [Logger      ] Record log in /root/buskill-app/dist/.buskill/logs/kivy_26-06-14_10.txt
[INFO   ] [Base        ] Leaving application in progress...
 Traceback (most recent call last):
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/configparser.py", line 767, in get
     value = d[option]
             ~^^^^^^^^
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/collections/__init__.py", line 1014, in __getitem__
     return self.__missing__(key)            # support subclasses that define __missing__
            ^^^^^^^^^^^^^^^^^^^^^
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/collections/__init__.py", line 1006, in __missing__
     raise KeyError(key)
 KeyError: 'persistent_log'
 
 During handling of the above exception, another exception occurred:
 
 Traceback (most recent call last):
   File "/tmp/.mount_buskilrzQkfG/opt/src/main.py", line 187, in <module>
     BusKillApp( bk ).run()
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/site-packages/kivy/app.py", line 956, in run
     runTouchApp()
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/site-packages/kivy/base.py", line 574, in runTouchApp
     EventLoop.mainloop()
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/site-packages/kivy/base.py", line 339, in mainloop
     self.idle()
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/site-packages/kivy/base.py", line 383, in idle
     self.dispatch_input()
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/site-packages/kivy/base.py", line 334, in dispatch_input
     post_dispatch_input(*pop(0))
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/site-packages/kivy/base.py", line 302, in post_dispatch_input
     wid.dispatch('on_touch_up', me)
   File "kivy/_event.pyx", line 731, in kivy._event.EventDispatcher.dispatch
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/site-packages/kivy/uix/behaviors/button.py", line 179, in on_touch_up
     self.dispatch('on_release')
   File "kivy/_event.pyx", line 727, in kivy._event.EventDispatcher.dispatch
   File "kivy/_event.pyx", line 1307, in kivy._event.EventObservers.dispatch
   File "kivy/_event.pyx", line 1191, in kivy._event.EventObservers._dispatch
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/site-packages/kivy/lang/builder.py", line 60, in custom_callback
     exec(__kvlang__.co_value, idmap)
   File "/tmp/.mount_buskilrzQkfG/opt/src/buskill.kv", line 236, in <module>
     on_release: root.continue_function()
 ^^^^^^^^^^^^^^^^^^^^^^^^
   File "/tmp/.mount_buskilrzQkfG/opt/src/buskill_gui.py", line 1052, in reset_defaults2
     self.refresh_values()
   File "/tmp/.mount_buskilrzQkfG/opt/src/buskill_gui.py", line 1075, in refresh_values
     set_value = Config.get(widget.section, key)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/site-packages/kivy/config.py", line 541, in get
     value = PythonConfigParser.get(self, section, option, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/tmp/.mount_buskilrzQkfG/opt/python3.12/lib/python3.12/configparser.py", line 770, in get
     raise NoOptionError(option, section)
 configparser.NoOptionError: No option 'persistent_log' in section: 'buskill'
 [INFO/MainProcess] process shutting down
 [DEBUG/MainProcess] running all "atexit" finalizers with priority >= 0
 [DEBUG/MainProcess] running the remaining "atexit" finalizers
root@disp7809:~/buskill-app# 

Comment thread src/packages/buskill/settings_buskill.json Outdated
Comment thread src/packages/buskill/settings_buskill.json Outdated
Comment thread src/packages/buskill/settings_buskill.json Outdated
@maltfield

maltfield commented Jun 14, 2026

Copy link
Copy Markdown
Member

Also, we should add some icons to the json. You can view the available material design icons here:

In the browser, you can click on an icon to view its code point. Then you type that (with \u prepended) into the json.

Perhaps you could use article (ef42) or description (e873) for the main logo of this option, for example. But feel free to browse the site above to find one that you think fits best for a log file.

@github-actions

Copy link
Copy Markdown

INFO: No unicode characters found in PR's commits

(source)

@Raihan93-coder

Copy link
Copy Markdown
Author

I’ve made the changes you requested.

Also, I didn’t test the reset button earlier (my bad 😅), but the issue is resolved now. The crash was happening because the new Kivy config setting for persistent_log didn’t have a default value defined. So when the user clicked Reset, Kivy tried to restore a default value that didn’t exist, which caused the crash.

I've fixed it by adding persistent_log to the default settings in the GUI, and the reset functionality is working as expected now.

Comment thread src/packages/buskill/__init__.py Outdated
Comment thread src/packages/buskill/settings_buskill.json Outdated
@github-actions

Copy link
Copy Markdown

INFO: No unicode characters found in PR's commits

(source)

@github-actions

Copy link
Copy Markdown

INFO: No unicode characters found in PR's commits

(source)

@Raihan93-coder Raihan93-coder requested a review from maltfield June 17, 2026 10:05
@github-actions

Copy link
Copy Markdown

INFO: No unicode characters found in PR's commits

(source)

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