Mercurial > emacs
comparison src/gtkutil.c @ 72637:9db8c9a68f0f
* gtkutil.c (xg_get_file_with_chooser): Don't mention specific keys in
the file chooser message. Only call gtk_file_chooser_set_current_name
when action is SAVE.
author | Jan Djärv <jan.h.d@swipnet.se> |
---|---|
date | Mon, 04 Sep 2006 14:47:52 +0000 |
parents | af91ff74c754 |
children | ab6be05ddfb1 c358d0861b16 |
comparison
equal
deleted
inserted
replaced
72636:cbdca6c6638d | 72637:9db8c9a68f0f |
---|---|
1324 G_CALLBACK (xg_toggle_notify_cb), wtoggle); | 1324 G_CALLBACK (xg_toggle_notify_cb), wtoggle); |
1325 | 1325 |
1326 message[0] = '\0'; | 1326 message[0] = '\0'; |
1327 if (action != GTK_FILE_CHOOSER_ACTION_SAVE) | 1327 if (action != GTK_FILE_CHOOSER_ACTION_SAVE) |
1328 strcat (message, "\nType C-l to display a file name text entry box.\n"); | 1328 strcat (message, "\nType C-l to display a file name text entry box.\n"); |
1329 strcat (message, "\nIf you don't like this file selector, customize " | 1329 strcat (message, "\nIf you don't like this file selector, use the " |
1330 "use-file-dialog\nto turn it off, or type "); | 1330 "corresponding\nkey binding or customize " |
1331 if (action != GTK_FILE_CHOOSER_ACTION_SAVE) | 1331 "use-file-dialog to turn it off."); |
1332 strcat (message, "C-x C-f to visit files."); | |
1333 else | |
1334 strcat (message, "C-x C-w to write files."); | |
1335 | 1332 |
1336 wmessage = gtk_label_new (message); | 1333 wmessage = gtk_label_new (message); |
1337 gtk_widget_show (wmessage); | 1334 gtk_widget_show (wmessage); |
1338 gtk_box_pack_start (GTK_BOX (wbox), wtoggle, FALSE, FALSE, 0); | 1335 gtk_box_pack_start (GTK_BOX (wbox), wtoggle, FALSE, FALSE, 0); |
1339 gtk_box_pack_start (GTK_BOX (wbox), wmessage, FALSE, FALSE, 0); | 1336 gtk_box_pack_start (GTK_BOX (wbox), wmessage, FALSE, FALSE, 0); |
1357 if (! NILP (Ffile_directory_p (file))) | 1354 if (! NILP (Ffile_directory_p (file))) |
1358 gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filewin), | 1355 gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filewin), |
1359 utf8_filename); | 1356 utf8_filename); |
1360 else | 1357 else |
1361 { | 1358 { |
1362 char *cp = strrchr (utf8_filename, '/'); | |
1363 if (cp) ++cp; | |
1364 else cp = utf8_filename; | |
1365 gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin), | 1359 gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin), |
1366 utf8_filename); | 1360 utf8_filename); |
1367 gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (filewin), cp); | 1361 if (action == GTK_FILE_CHOOSER_ACTION_SAVE) |
1362 { | |
1363 char *cp = strrchr (utf8_filename, '/'); | |
1364 if (cp) ++cp; | |
1365 else cp = utf8_filename; | |
1366 gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (filewin), cp); | |
1367 } | |
1368 } | 1368 } |
1369 | 1369 |
1370 UNGCPRO; | 1370 UNGCPRO; |
1371 } | 1371 } |
1372 | 1372 |