Set filename in Save As dialog

master
Yevgen Muntyan 2006-04-13 03:19:51 -05:00
parent 1660032c2b
commit 8a61f27a4b
3 changed files with 8 additions and 3 deletions

View File

@ -67,7 +67,8 @@ moo_edit_open_dialog (GtkWidget *widget,
MooEditFileInfo* MooEditFileInfo*
moo_edit_save_as_dialog (MooEdit *edit, moo_edit_save_as_dialog (MooEdit *edit,
MooFilterMgr *mgr) MooFilterMgr *mgr,
const char *display_basename)
{ {
const char *title = "Save File"; const char *title = "Save File";
const char *start = NULL; const char *start = NULL;
@ -86,6 +87,8 @@ moo_edit_save_as_dialog (MooEdit *edit,
dialog = moo_file_dialog_create (GTK_WIDGET (edit), MOO_DIALOG_FILE_SAVE, dialog = moo_file_dialog_create (GTK_WIDGET (edit), MOO_DIALOG_FILE_SAVE,
FALSE, title, start); FALSE, title, start);
if (display_basename)
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), display_basename);
if (mgr) if (mgr)
moo_filter_mgr_attach (mgr, GTK_FILE_CHOOSER (dialog), "MooEdit"); moo_filter_mgr_attach (mgr, GTK_FILE_CHOOSER (dialog), "MooEdit");

View File

@ -29,7 +29,8 @@ typedef enum {
MooEditFileInfo *moo_edit_save_as_dialog (MooEdit *edit, MooEditFileInfo *moo_edit_save_as_dialog (MooEdit *edit,
MooFilterMgr *mgr); MooFilterMgr *mgr,
const char *display_basename);
GSList *moo_edit_open_dialog (GtkWidget *widget, GSList *moo_edit_open_dialog (GtkWidget *widget,
MooFilterMgr *mgr); MooFilterMgr *mgr);

View File

@ -1703,7 +1703,8 @@ _moo_editor_save_as (MooEditor *editor,
if (!filename) if (!filename)
{ {
file_info = moo_edit_save_as_dialog (doc, editor->priv->filter_mgr); file_info = moo_edit_save_as_dialog (doc, editor->priv->filter_mgr,
moo_edit_get_display_basename (doc));
if (!file_info) if (!file_info)
goto out; goto out;