Esme Povirk (@madewokherd) commented about dlls/sane.ds/ui.c:
> + if (changed)
> + {
> + save_cfg_data(NULL, path, SINGLE, opt.optno);
> + InitializeDialog(hwnd);
> + }
> free( value );
> }
>
> +LRESULT CALLBACK SaveWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
> +{
> + switch (uMsg)
> + {
> + case WM_CREATE:
> + {
> + RECT rcClient;
> + HWND tag, edit, btnSave, btnLoad;
This seems like unnecessarily complicated UI to me. Why not just have Save and Load buttons in the main window that bring up standard Open/Save dialogs? (And maybe a "Save Defaults" that writes it to the default location. That could be added first, with the extra dialogs added in a later commit.)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8778#note_113179
Esme Povirk (@madewokherd) commented about dlls/sane.ds/ui.c:
> return FALSE;
> }
>
> +static void set_value(struct option_descriptor* opt, ScannerOption* option)
This is called `set_value` but it gets the value?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8778#note_113174
Esme Povirk (@madewokherd) commented about dlls/sane.ds/cfg.h:
> +{
> + int type;
> + CHAR name[64];
> + int optno;
> + union
> + {
> + int int_val;
> + BOOL bool_val;
> + CHAR str_val[255];
> + int fixed_val;
> + } value;
> + BOOL is_enabled;
> +} ScannerOption;
> +
> +BOOL save_to_file(WCHAR* path, ScannerOption *option);
> +BOOL load_from_file(WCHAR* path, int type, CHAR* name, void* value);
This interface seems like it would be inefficient - each setting saved is a complete read and write of the file, and each setting loaded is a complete read.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8778#note_113173