robiot / xclicker

XClicker - Fast gui autoclicker for x11 linux desktops
https://xclicker.xyz
GNU General Public License v3.0
457 stars 43 forks source link

Remember all options after restart and add button to reset in settings #81

Closed koutoftimer closed 11 months ago

koutoftimer commented 1 year ago

Closes #57 I have added 2 buttons to save and load options to ~/.config/xclicker.conf. It can be extended with file dialog to choose file location.

It is nowhere near perfect solution but it works for me.

Related to #57

robiot commented 1 year ago

Cool, will take a look asap

koutoftimer commented 1 year ago

@robiot I have decided to spend more time to figure out better solution. Right now I'm reusing GKeyFile from the settings.c.

At this stage, maybe it is good idea to save all options by default as in settings window and just add "delete/reset settings" button to it. But my initial idea with presets is that there may be multiple of them and you can switch between them with ease. Well, it feels like a lot of work to implement both scenarios.

Sorry for not marking pull request as a draft, I was not about to make this change yesterday.

robiot commented 1 year ago

From what I have seen it looks like you did some amazing work. Tell me whenever you think its ready for review :)

koutoftimer commented 1 year ago

@robiot well, I guess you can review it now. I do not feel like adding more changes.

robiot commented 1 year ago

Cool, I will take a look.

koutoftimer commented 1 year ago

@robiot

I'm just going to test it as soon as possible

Do you have some ideas about setting up unittests?

UPD: I have reviewed ui file, can't see any more issues.

robiot commented 1 year ago

Hm I couldn't get the load and save to work. I also think the most optimal would be to have a just a save main window settings button in the Settings window, and then autoload. Also maybe have a reset main window settings button there.

If you don't feel like fixing that, I could do it whenever I have time, which means it will take some time for me to get to it.

koutoftimer commented 1 year ago

@robiot my bad, I have broken it by trying to tidy up the code.

(xclicker:97278): Gtk-WARNING **: 06:54:50.253: Could not find signal handler 'load_preset_clicked'.  Did you compile with -rdynamic?

(xclicker:97278): Gtk-WARNING **: 06:54:50.253: Could not find signal handler 'save_preset_clicked'.  Did you compile with -rdynamic?

I have added those handers back.

koutoftimer commented 1 year ago

UPD: having an ability to select which preset to use is a one way to go. Automatic saving with no user interference is second. In order to satisfy both use cases I would have to implement both and UI should change according to which way user prefers. That is why I told that it is too much work for me. I have implemented the way that fits me best. We can discuss what and how to improve in the new issue, IMHO.

robiot commented 11 months ago

Closes #57

robiot commented 11 months ago

Thank you for your help starting this off, I slightly modified it to auto save instead and added a preset reset button to the settings window, This is so the window wouldn't be so cluttered with buttons and for ease of use.