From 8a61f27a4bd9d15b629d5e3f895497ef4c34a8bb Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Thu, 13 Apr 2006 03:19:51 -0500 Subject: [PATCH] Set filename in Save As dialog --- moo/mooedit/mooeditdialogs.c | 5 ++++- moo/mooedit/mooeditdialogs.h | 3 ++- moo/mooedit/mooeditor.c | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/moo/mooedit/mooeditdialogs.c b/moo/mooedit/mooeditdialogs.c index 418bf844..be891e5c 100644 --- a/moo/mooedit/mooeditdialogs.c +++ b/moo/mooedit/mooeditdialogs.c @@ -67,7 +67,8 @@ moo_edit_open_dialog (GtkWidget *widget, MooEditFileInfo* moo_edit_save_as_dialog (MooEdit *edit, - MooFilterMgr *mgr) + MooFilterMgr *mgr, + const char *display_basename) { const char *title = "Save File"; 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, FALSE, title, start); + if (display_basename) + gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), display_basename); if (mgr) moo_filter_mgr_attach (mgr, GTK_FILE_CHOOSER (dialog), "MooEdit"); diff --git a/moo/mooedit/mooeditdialogs.h b/moo/mooedit/mooeditdialogs.h index 67ad8840..55d8641d 100644 --- a/moo/mooedit/mooeditdialogs.h +++ b/moo/mooedit/mooeditdialogs.h @@ -29,7 +29,8 @@ typedef enum { MooEditFileInfo *moo_edit_save_as_dialog (MooEdit *edit, - MooFilterMgr *mgr); + MooFilterMgr *mgr, + const char *display_basename); GSList *moo_edit_open_dialog (GtkWidget *widget, MooFilterMgr *mgr); diff --git a/moo/mooedit/mooeditor.c b/moo/mooedit/mooeditor.c index 1cbd81d1..fa363ad2 100644 --- a/moo/mooedit/mooeditor.c +++ b/moo/mooedit/mooeditor.c @@ -1703,7 +1703,8 @@ _moo_editor_save_as (MooEditor *editor, 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) goto out;