Prevent using Find in files for unnamed files

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@599 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2006-07-21 19:35:33 +00:00
parent 978a6fee93
commit b625529c8b
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2006-07-21 Nick Treleaven <nick.treleaven@btinternet.com>
* src/dialogs.c: Prevent using Find in files for unnamed files.
2006-07-21 Enrico Tröger <enrico.troeger@uvena.de>
* src/geany.h, src/main.c, src/callbacks.c:

View File

@ -1032,6 +1032,13 @@ void dialogs_show_find_in_files(void)
if (idx == -1 || ! doc_list[idx].is_valid) return;
cur_dir = utils_get_current_file_dir();
if (cur_dir == NULL)
{
utils_set_statusbar(_("Invalid directory for find in files."), FALSE);
return;
}
if (app->find_in_files_dialog == NULL)
{
GtkWidget *label;
@ -1086,10 +1093,9 @@ void dialogs_show_find_in_files(void)
g_free(sel);
gtk_widget_grab_focus(entry);
cur_dir = utils_get_current_file_dir();
dirtext = g_strdup_printf(_("Current directory: %s"), cur_dir);
g_free(cur_dir);
gtk_label_set_text(GTK_LABEL(dirlabel), dirtext);
g_free(cur_dir);
g_free(dirtext);
gtk_widget_show(app->find_in_files_dialog);