diff options
| author | Jan Djärv | 2006-09-02 18:10:15 +0000 |
|---|---|---|
| committer | Jan Djärv | 2006-09-02 18:10:15 +0000 |
| commit | 4f3097d8bcc4faa2abda36177161e3d6caf3b433 (patch) | |
| tree | cca3fd3b2a7a9ad0cc3f75997f8f8288377ecb9f | |
| parent | 655ea21ca38fc769588027b2e8097c1edda6f19d (diff) | |
| download | emacs-4f3097d8bcc4faa2abda36177161e3d6caf3b433.tar.gz emacs-4f3097d8bcc4faa2abda36177161e3d6caf3b433.zip | |
* gtkutil.c (xg_get_file_with_chooser): Change file chooser message
for writing files. Call gtk_file_chooser_set_current_name to keep
default filename.
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/gtkutil.c | 27 |
2 files changed, 23 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 76a292d43bf..3e93d014a16 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2006-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 1 | 2006-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 2 | ||
| 3 | * gtkutil.c (xg_get_file_with_chooser): Change file chooser message | ||
| 4 | for writing files. Call gtk_file_chooser_set_current_name to keep | ||
| 5 | default filename. | ||
| 6 | |||
| 3 | * minibuf.c (Finternal_complete_buffer): Move after DEFUN:s it calls | 7 | * minibuf.c (Finternal_complete_buffer): Move after DEFUN:s it calls |
| 4 | 8 | ||
| 5 | 2006-09-02 Jindrich Makovicka <makovick@gmail.com> (tiny change) | 9 | 2006-09-02 Jindrich Makovicka <makovick@gmail.com> (tiny change) |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 2a6ed9d1524..172c7b94a64 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -1327,8 +1327,12 @@ xg_get_file_with_chooser (f, prompt, default_filename, | |||
| 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, customize " |
| 1330 | "use-file-dialog\nto turn it off, or type C-x C-f to visit files."); | 1330 | "use-file-dialog\nto turn it off, or type "); |
| 1331 | 1331 | if (action != GTK_FILE_CHOOSER_ACTION_SAVE) | |
| 1332 | strcat (message, "C-x C-f to visit files."); | ||
| 1333 | else | ||
| 1334 | strcat (message, "C-x C-w to write files."); | ||
| 1335 | |||
| 1332 | wmessage = gtk_label_new (message); | 1336 | wmessage = gtk_label_new (message); |
| 1333 | gtk_widget_show (wmessage); | 1337 | gtk_widget_show (wmessage); |
| 1334 | gtk_box_pack_start (GTK_BOX (wbox), wtoggle, FALSE, FALSE, 0); | 1338 | gtk_box_pack_start (GTK_BOX (wbox), wtoggle, FALSE, FALSE, 0); |
| @@ -1340,6 +1344,7 @@ xg_get_file_with_chooser (f, prompt, default_filename, | |||
| 1340 | Lisp_Object file; | 1344 | Lisp_Object file; |
| 1341 | struct gcpro gcpro1; | 1345 | struct gcpro gcpro1; |
| 1342 | GCPRO1 (file); | 1346 | GCPRO1 (file); |
| 1347 | char *utf8_filename; | ||
| 1343 | 1348 | ||
| 1344 | file = build_string (default_filename); | 1349 | file = build_string (default_filename); |
| 1345 | 1350 | ||
| @@ -1347,14 +1352,20 @@ xg_get_file_with_chooser (f, prompt, default_filename, | |||
| 1347 | an absolute name starting with /. */ | 1352 | an absolute name starting with /. */ |
| 1348 | if (default_filename[0] != '/') | 1353 | if (default_filename[0] != '/') |
| 1349 | file = Fexpand_file_name (file, Qnil); | 1354 | file = Fexpand_file_name (file, Qnil); |
| 1350 | 1355 | ||
| 1351 | default_filename = SSDATA (file); | 1356 | utf8_filename = SSDATA (ENCODE_UTF_8 (file)); |
| 1352 | if (Ffile_directory_p (file)) | 1357 | if (! NILP (Ffile_directory_p (file))) |
| 1353 | gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filewin), | 1358 | gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filewin), |
| 1354 | default_filename); | 1359 | utf8_filename); |
| 1355 | else | 1360 | else |
| 1356 | gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin), | 1361 | { |
| 1357 | default_filename); | 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), | ||
| 1366 | utf8_filename); | ||
| 1367 | gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (filewin), cp); | ||
| 1368 | } | ||
| 1358 | 1369 | ||
| 1359 | UNGCPRO; | 1370 | UNGCPRO; |
| 1360 | } | 1371 | } |