Fill in this thing.

This commit is contained in:
Alcaro 2016-07-09 20:39:02 +02:00
parent 0bc4248084
commit 158e4614dd
1 changed files with 12 additions and 7 deletions

View File

@ -23,11 +23,9 @@
#include "../../ui_companion_driver.h" #include "../../ui_companion_driver.h"
static bool ui_browser_window_win32_open(ui_browser_window_state_t *state) static bool ui_browser_window_win32(ui_browser_window_state_t *state, bool save)
{ {
OPENFILENAME ofn; OPENFILENAME ofn = {};
memset((void*)&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME); ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = (HWND)state->window; ofn.hwndOwner = (HWND)state->window;
@ -39,15 +37,22 @@ static bool ui_browser_window_win32_open(ui_browser_window_state_t *state)
ofn.nMaxFile = PATH_MAX; ofn.nMaxFile = PATH_MAX;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR; ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR;
if (!GetOpenFileName(&ofn)) if ( save && !GetOpenFileName(&ofn))
return false; return false;
if (!save && !GetSaveFileName(&ofn))
return false;
return true; return true;
} }
static bool ui_browser_window_win32_open(ui_browser_window_state_t *state)
{
return ui_browser_window_win32(state, false);
}
static bool ui_browser_window_win32_save(ui_browser_window_state_t *state) static bool ui_browser_window_win32_save(ui_browser_window_state_t *state)
{ {
return false; return ui_browser_window_win32(state, true);
} }
const ui_browser_window_t ui_browser_window_win32 = { const ui_browser_window_t ui_browser_window_win32 = {