mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
gtk-gui.c: Move the download dialog related code to a new file
A new file download-dialog.c now contains all code related to the download dialog, which was previously defined in gtk-gui.c. Also, a new file callbacks-gtk.h now has two macros OPTIONCALLBACK, UNITCALLBACK shared only between download-dialog.c and gtk-gui.c. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ac376ea379
commit
c4ae58d589
5 changed files with 505 additions and 485 deletions
17
callbacks-gtk.h
Normal file
17
callbacks-gtk.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#define UNITCALLBACK(name, type, value) \
|
||||
static void name(GtkWidget *w, gpointer data) \
|
||||
{ \
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) \
|
||||
prefs.units.type = value; \
|
||||
update_screen(); \
|
||||
}
|
||||
|
||||
#define OPTIONCALLBACK(name, option) \
|
||||
static void name(GtkWidget *w, gpointer data) \
|
||||
{ \
|
||||
GtkWidget **entry = data; \
|
||||
option = GTK_TOGGLE_BUTTON(w)->active; \
|
||||
update_screen(); \
|
||||
if (entry) \
|
||||
gtk_widget_set_sensitive(*entry, option);\
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue