From: Darren S. <ds...@us...> - 2004-11-23 02:34:12
|
Update of /cvsroot/xine/gnome-xine/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32463/src Modified Files: utils.c utils.h Log Message: (Post-0.4.0) Allow extra buttons in the file dialogue box. Index: utils.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/utils.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- utils.c 15 Nov 2004 18:31:48 -0000 1.27 +++ utils.c 23 Nov 2004 02:34:03 -0000 1.28 @@ -26,6 +26,7 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include <errno.h> #include <sys/stat.h> #include <sys/types.h> @@ -79,6 +80,12 @@ return NULL; } + if (S_ISDIR (statb.st_mode)) + { + errno = EISDIR; + return NULL; + } + *file_size = statb.st_size; fd = open (mrl, O_RDONLY); @@ -313,6 +320,30 @@ return NULL; } +gchar *modal_file_dialog_with_buttons (const char *title, + const gchar *pattern, ...) +{ + va_list ap, del; + GtkWidget *widget; + gchar *ret; + + va_start (ap, pattern); + va_copy (del, ap); + while ((widget = va_arg (ap, GtkWidget *)) != NULL) + gtk_box_pack_end (GTK_BOX(GTK_FILE_SELECTION(file_dlg)->main_vbox), + widget, FALSE, FALSE, 2); + va_end (ap); + + ret = modal_file_dialog (title, pattern); + + while ((widget = va_arg (del, GtkWidget *)) != NULL) + gtk_container_remove + (GTK_CONTAINER(GTK_FILE_SELECTION(file_dlg)->main_vbox), widget); + va_end (del); + + return ret; +} + gchar **modal_multi_file_dialog (const char *title, const gchar *pattern) { int was_modal; Index: utils.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/utils.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- utils.h 18 Nov 2004 20:19:54 -0000 1.17 +++ utils.h 23 Nov 2004 02:34:03 -0000 1.18 @@ -58,6 +58,8 @@ int parse_timestring (const char *string_time); gchar *modal_file_dialog (const char *title, const char *pattern); +gchar *modal_file_dialog_with_buttons (const char *title, + const gchar *pattern, ...); /* use g_strfreev() to freethe return value of this one: */ gchar **modal_multi_file_dialog (const char *title, const char *pattern); |