comparison src/gtkutil.c @ 67761:5b8799d65159

* xfns.c (Fx_uses_old_gtk_dialog): New function. * gtkutil.c (xg_uses_old_file_dialog): New function. (xg_get_file_name): Use xg_uses_old_file_dialog. * gtkutil.h: Declare xg_uses_old_file_dialog.
author Jan Djärv <jan.h.d@swipnet.se>
date Fri, 23 Dec 2005 11:34:13 +0000
parents c5c00342184b
children 6cf5dc28bd1e
comparison
equal deleted inserted replaced
67760:9c3504ae6060 67761:5b8799d65159
1153 1153
1154 1154
1155 /*********************************************************************** 1155 /***********************************************************************
1156 File dialog functions 1156 File dialog functions
1157 ***********************************************************************/ 1157 ***********************************************************************/
1158 /* Return non-zero if the old file selection dialog is being used.
1159 Return zero if not. */
1160
1161 int
1162 xg_uses_old_file_dialog ()
1163 {
1164 #ifdef HAVE_GTK_FILE_BOTH
1165 extern int x_use_old_gtk_file_dialog;
1166 return x_use_old_gtk_file_dialog;
1167 #else /* ! HAVE_GTK_FILE_BOTH */
1168
1169 #ifdef HAVE_GTK_FILE_SELECTION_NEW
1170 return 1;
1171 #else
1172 return 0;
1173 #endif
1174
1175 #endif /* ! HAVE_GTK_FILE_BOTH */
1176 }
1177
1178
1158 /* Function that is called when the file dialog pops down. 1179 /* Function that is called when the file dialog pops down.
1159 W is the dialog widget, RESPONSE is the response code. 1180 W is the dialog widget, RESPONSE is the response code.
1160 USER_DATA is what we passed in to g_signal_connect (pointer to int). */ 1181 USER_DATA is what we passed in to g_signal_connect (pointer to int). */
1161 1182
1162 static void 1183 static void
1341 GtkWidget *w = 0; 1362 GtkWidget *w = 0;
1342 int count = SPECPDL_INDEX (); 1363 int count = SPECPDL_INDEX ();
1343 char *fn = 0; 1364 char *fn = 0;
1344 int filesel_done = 0; 1365 int filesel_done = 0;
1345 xg_get_file_func func; 1366 xg_get_file_func func;
1346 extern int x_use_old_gtk_file_dialog;
1347 1367
1348 #if defined (HAVE_GTK_AND_PTHREAD) && defined (__SIGRTMIN) 1368 #if defined (HAVE_GTK_AND_PTHREAD) && defined (__SIGRTMIN)
1349 /* I really don't know why this is needed, but without this the GLIBC add on 1369 /* I really don't know why this is needed, but without this the GLIBC add on
1350 library linuxthreads hangs when the Gnome file chooser backend creates 1370 library linuxthreads hangs when the Gnome file chooser backend creates
1351 threads. */ 1371 threads. */
1352 sigblock (sigmask (__SIGRTMIN)); 1372 sigblock (sigmask (__SIGRTMIN));
1353 #endif /* HAVE_GTK_AND_PTHREAD */ 1373 #endif /* HAVE_GTK_AND_PTHREAD */
1354 1374
1355 #ifdef HAVE_GTK_FILE_BOTH 1375 #ifdef HAVE_GTK_FILE_BOTH
1356 1376
1357 if (x_use_old_gtk_file_dialog) 1377 if (xg_uses_old_file_dialog ())
1358 w = xg_get_file_with_selection (f, prompt, default_filename, 1378 w = xg_get_file_with_selection (f, prompt, default_filename,
1359 mustmatch_p, only_dir_p, &func); 1379 mustmatch_p, only_dir_p, &func);
1360 else 1380 else
1361 w = xg_get_file_with_chooser (f, prompt, default_filename, 1381 w = xg_get_file_with_chooser (f, prompt, default_filename,
1362 mustmatch_p, only_dir_p, &func); 1382 mustmatch_p, only_dir_p, &func);