From 257b71ebd284bdc03467e92f5d11cb1f5b126b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Wed, 22 Feb 2006 00:41:57 +0000 Subject: [PATCH] several improvements git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@209 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- src/win32.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/win32.c b/src/win32.c index 2521677b..e190800b 100644 --- a/src/win32.c +++ b/src/win32.c @@ -1,7 +1,7 @@ /* * win32.c - this file is part of Geany, a fast and lightweight IDE * - * Copyright 2005 Enrico Troeger + * Copyright 2006 Enrico Troeger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -132,7 +132,7 @@ void try_to_get_windows_font (void) } */ -gchar *win32_get_filters(gboolean exe) +static gchar *win32_get_filters(gboolean exe) { gchar *string = ""; gint i, len; @@ -171,6 +171,7 @@ void win32_show_file_dialog(gboolean file_open) OPENFILENAME of; gint retval; gchar *fname = g_malloc(2048); + gchar *current_dir = utils_get_current_file_dir(); fname[0] = '\0'; @@ -187,12 +188,11 @@ void win32_show_file_dialog(gboolean file_open) of.lpstrFilter = filters; of.lpstrCustomFilter = NULL; - of.nFilterIndex = 1; + of.nFilterIndex = GEANY_FILETYPES_ALL + 1; of.lpstrFile = fname; + of.lpstrInitialDir = current_dir; of.nMaxFile = 2048; of.lpstrFileTitle = NULL; - //of.lpstrInitialDir = g_get_home_dir(); - of.lpstrInitialDir = NULL; of.lpstrTitle = NULL; of.lpstrDefExt = "c"; if (file_open) @@ -206,6 +206,8 @@ void win32_show_file_dialog(gboolean file_open) retval = GetSaveFileName(&of); } + g_free(current_dir); + if (!retval) { if (CommDlgExtendedError()) @@ -232,8 +234,7 @@ void win32_show_file_dialog(gboolean file_open) } else { - document_open_file(-1, fname, 0, of.Flags & OFN_READONLY); - dialogs_show_info("%s", utils_btoa(of.Flags & OFN_READONLY)); + document_open_file(-1, fname, 0, of.Flags & OFN_READONLY, NULL); } } else @@ -247,7 +248,7 @@ void win32_show_file_dialog(gboolean file_open) break; g_snprintf(file_name, 254, "%s\\%s", fname, fname + x + 1); - document_open_file(-1, file_name, 0, of.Flags & OFN_READONLY); + document_open_file(-1, file_name, 0, of.Flags & OFN_READONLY, NULL); } x++; } @@ -255,7 +256,6 @@ void win32_show_file_dialog(gboolean file_open) } else { - //dialogs_show_info(fname); gint idx = document_get_cur_idx(); doc_list[idx].file_name = g_strdup(fname); document_save_file(idx); @@ -386,7 +386,7 @@ void win32_show_pref_file_dialog(GtkEntry *item) { tmp = g_strdup(fname); if (g_strv_length(field) > 1) - // haha, pfad- und dateinamen miz leerzeichen?? + // haha, pfad- und dateinamen mit leerzeichen?? filename = g_strconcat(tmp, " ", field[1], NULL); else {