[PATCH] gtk-gui.c: Move the download dialog related code to a new file

Dirk Hohndel dirk at hohndel.org
Wed Jan 9 10:56:17 PST 2013


"Lubomir I. Ivanov" <neolit123 at gmail.com> writes:

> this is sensitive stuff, so i may have messed up a little or at least things
> may be out of place here and there.
>
> the patch performs the move with minimal changes i.e. so that it compiles +
> runs, but not much else.
>
> brief notes:
> - new file is called download-dialog.c
> - display-gtk.h now exposes some more functions such as update_screen()
> and is_default_dive_computer()
> - display-gtk.h now includes the OPTIONCALLBACK and UNITCALLBACK macros, but
> renamed briefly with a SCREEN_ prefix, since these are related to
> update_screen(). the rename was required since OPTIONCALLBACK was also present
> in print.c. now..this may not be a good idea, but the only reason for them
> to be in the header is because download-dialog.c requires the same
> OPTIONCALLBACK and i've simply moved them both as a "couple of similar
> macros". this may require changes...

Should they go into their own header file then? One that isn't included
except in the two .c files that actually use them?

> - download_dialog_init() and download_dialog_exit() from download-dialog.c
> are used only to retrieve the default DC from the user config. can be
> approached differently if the declarations of default_dive_computer_*
> are simply made extern in display-gtk.h, which might be a better choice.

Yes, I think those could be globals.

> please comment on the patch + notes, so that i can improve on it (if required)
> and until the mod is acceptable, of course. it moves near 500 LOC from
> gtk-gui.c.

That's a good thing :-)

/D


More information about the subsurface mailing list