[longomatch] Add sane filename proposition for the various file save dialogs



commit 5636132240adf78fb1c629f7ea65dc02a77781aa
Author: Julien Moutte <julien fluendo com>
Date:   Mon Dec 1 17:54:27 2014 +0100

    Add sane filename proposition for the various file save dialogs

 LongoMatch.GUI/Gui/Dialog/DrawingTool.cs     |    8 ++++----
 LongoMatch.Plugins/CSVExporter.cs            |    3 ++-
 LongoMatch.Services/Services/ToolsManager.cs |    4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Dialog/DrawingTool.cs b/LongoMatch.GUI/Gui/Dialog/DrawingTool.cs
index e82825b..67cc3b7 100644
--- a/LongoMatch.GUI/Gui/Dialog/DrawingTool.cs
+++ b/LongoMatch.GUI/Gui/Dialog/DrawingTool.cs
@@ -378,10 +378,10 @@ namespace LongoMatch.Gui.Dialog
 
                void OnSavebuttonClicked (object sender, System.EventArgs e)
                {
-                       string filename;
-                       
-                       filename = FileChooserHelper.SaveFile (this, Catalog.GetString ("Save File as..."),
-                                                              null, Config.SnapshotsDir, "PNG Images", new 
string[] { "*.png" });
+                       string proposed_filename = String.Format ("LongoMatch-{0}.png",
+                               DateTime.Now.ToShortDateString ().Replace ('/', '-'));
+                       string filename = FileChooserHelper.SaveFile (this, Catalog.GetString ("Save File 
as..."),
+                               proposed_filename, Config.SnapshotsDir, "PNG Images", new string[] { "*.png" 
});
                        if (filename != null) {
                                System.IO.Path.ChangeExtension (filename, ".png");
                                blackboard.Save (filename);
diff --git a/LongoMatch.Plugins/CSVExporter.cs b/LongoMatch.Plugins/CSVExporter.cs
index 448a93f..6ad9ef8 100644
--- a/LongoMatch.Plugins/CSVExporter.cs
+++ b/LongoMatch.Plugins/CSVExporter.cs
@@ -56,7 +56,8 @@ namespace LongoMatch.Plugins
 
                public void ExportProject (Project project, IGUIToolkit guiToolkit)
                {
-                       string filename = guiToolkit.SaveFile (Catalog.GetString ("Output file"), null,
+                       string proposed_filename = project.Description.Title + ".csv";
+                       string filename = guiToolkit.SaveFile (Catalog.GetString ("Output file"), 
proposed_filename,
                                                               Config.HomeDir, "CSV",
                                                               new string[] { ".csv" });
                        
diff --git a/LongoMatch.Services/Services/ToolsManager.cs b/LongoMatch.Services/Services/ToolsManager.cs
index 970f33f..b8b1832 100644
--- a/LongoMatch.Services/Services/ToolsManager.cs
+++ b/LongoMatch.Services/Services/ToolsManager.cs
@@ -106,8 +106,8 @@ namespace LongoMatch.Services
                        if (project == null) {
                                Log.Warning ("Opened project is null and can't be exported");
                        }
-                       
-                       string filename = guiToolkit.SaveFile (Catalog.GetString ("Save project"), null,
+                       string proposed_filename = project.Description.Title + Constants.PROJECT_EXT;
+                       string filename = guiToolkit.SaveFile (Catalog.GetString ("Save project"), 
proposed_filename,
                                                               Config.HomeDir, Constants.PROJECT_NAME, new 
string[] { Constants.PROJECT_EXT });
                        
                        if (filename == null)


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