[gnome-text-editor] page: suggest filename based on document contents



commit 6d6ffedd014b7f2c7bc450eb543df0a193dff6fe
Author: Christian Hergert <chergert redhat com>
Date:   Tue May 17 12:13:59 2022 -0700

    page: suggest filename based on document contents
    
    Related #375

 src/editor-page.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/editor-page.c b/src/editor-page.c
index 9eb24a3..0f2e02b 100644
--- a/src/editor-page.c
+++ b/src/editor-page.c
@@ -1194,6 +1194,12 @@ _editor_page_save_as (EditorPage *self,
       gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (native), directory, NULL);
     }
 
+  if (filename == NULL)
+    {
+      g_autofree char *suggestion = _editor_document_suggest_filename (self->document);
+      gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (native), suggestion);
+    }
+
   g_signal_connect_object (native,
                            "response",
                            G_CALLBACK (editor_page_save_as_cb),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]