PaulCombal / SamRewritten

Steam Achievement Manager For Linux. Rewritten in C++.
GNU General Public License v3.0
340 stars 32 forks source link

add / link about_dialog to gui #22

Closed telans closed 4 years ago

telans commented 4 years ago

Well I've managed to call the dialog when "About" is clicked, and not destroy it when closed so it can be re-opened. Though do I need to make stop_about_dialog() for this?, and is gtk_widget_set_visible FALSE what I should be using? I think I'll use gtk_widget_hide_on_delete

As for actually using the Screenshot_20191024_095449(Close) button on the dialog, I'm having a little trouble linking a signal-handler to it. Any suggestions? I can add another button next to it with a signal but not the default button as it seems to be a part of the dialog itself. Perhaps using GtkAboutDialog isn't the best idea?

Thanks for the help

Closes #21

wgpierce commented 4 years ago

Left some comments above.

Any suggestions? I can add another button next to it with a signal but not the default button as it seems to be a part of the dialog itself. Perhaps using GtkAboutDialog isn't the best idea?

Looks like dialogs are a little special with their signals. What you want is to connect the response signal to the same handler as the close handler: https://developer.gnome.org/gtk3/stable/GtkDialog.html#GtkDialog-response. You don't even have to determine what signal it is since the about dialog only gives off one signal - close.

Take care of those and I'll accept it!

wgpierce commented 4 years ago

Also - update the original commit instead of creating a separate one on top of the old one (git commit --amend or git merge --squash if you already have multiple)

telans commented 4 years ago

Looks like dialogs are a little special with their signals. What you want is to connect the response signal to the same handler as the close handler: https://developer.gnome.org/gtk3/stable/GtkDialog.html#GtkDialog-response. You don't even have to determine what signal it is since the about dialog only gives off one signal - close.

I'm really not getting anywhere with this one, it's flying a little over my head. I think I'll need to see it in action before it clicks. Pushed the other changes though

Thanks for your help.

wgpierce commented 4 years ago

GtkAboutDialog inherits properties from GtkDialog. One of those properties is the signal for the "response" from user input. That's where the signal from the button ends up. Check the signals tab in glade and hook the same close function up to that signal.

telans commented 4 years ago

Well that was awfully simple, didn't realise that was there. Thanks.

Should all be working now

wgpierce commented 4 years ago

You got it! Sorry, I left one more comment above. Revert that and I'll accept it.

telans commented 4 years ago

Should all be taken care of. Any idea why Glade is changing them around? I'm sure I didn't do it but I may have clicked something wrong

wgpierce commented 4 years ago

Any idea why Glade is changing them around?

Not sure why :/

Anyway looks good!