diff --git a/app/actions/dashboard-commands.c b/app/actions/dashboard-commands.c index f4a995a3ea..c6ae92e264 100644 --- a/app/actions/dashboard-commands.c +++ b/app/actions/dashboard-commands.c @@ -111,6 +111,9 @@ dashboard_log_record_cmd_callback (GimpAction *action, GtkWidget *label; GtkWidget *spinbutton; GtkWidget *toggle; + GDateTime *datetime; + gchar *timestamp; + gchar *default_filename; dialog = gtk_file_chooser_dialog_new ( "Record Performance Log", NULL, GTK_FILE_CHOOSER_ACTION_SAVE, @@ -168,8 +171,19 @@ dashboard_log_record_cmd_callback (GimpAction *action, GTK_FILE_CHOOSER (dialog), info->folder, NULL); } + datetime = g_date_time_new_now_local (); + + /* Since Windows doesn't allow colons in filenames, + * we use ISO 8601 basic format for the timestamp */ + timestamp = g_date_time_format (datetime, "%Y%m%dT%H%M%SZ"); + default_filename = g_strdup_printf ("gimp-performance-%s.log", + timestamp); + g_date_time_unref (datetime); + g_free (timestamp); + gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), - "gimp-performance.log"); + default_filename); + g_free (default_filename); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), hbox);