[longomatch] Enable exportation to file from the tools menu
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Enable exportation to file from the tools menu
- Date: Mon, 19 Dec 2011 23:48:08 +0000 (UTC)
commit bf002c3ad794b88936c3cd683e78ddc140f13eb9
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Tue Dec 20 00:46:08 2011 +0100
Enable exportation to file from the tools menu
LongoMatch.Services/Services/ProjectsManager.cs | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/LongoMatch.Services/Services/ProjectsManager.cs b/LongoMatch.Services/Services/ProjectsManager.cs
index 0ca7259..0e1b491 100644
--- a/LongoMatch.Services/Services/ProjectsManager.cs
+++ b/LongoMatch.Services/Services/ProjectsManager.cs
@@ -351,9 +351,25 @@ namespace LongoMatch.Services
}
protected void ExportProject() {
- /* FIXME:
- * ExportToCSV(this, openedProject);
- * */
+ if (OpenedProject == null) {
+ Log.Warning("Opened project is null and can't be exported");
+ }
+
+ string filename = guiToolkit.SaveFile(Catalog.GetString("Save project"), null,
+ Config.HomeDir(), Constants.PROJECT_NAME, Constants.PROJECT_EXT);
+
+ if (filename == null)
+ return;
+
+ System.IO.Path.ChangeExtension(filename, Constants.PROJECT_EXT);
+
+ try {
+ Project.Export(OpenedProject, filename);
+ guiToolkit.InfoMessage(Catalog.GetString("Project exported successfully"));
+ }catch (Exception ex) {
+ guiToolkit.ErrorMessage(Catalog.GetString("Error exporting project"));
+ Log.Exception(ex);
+ }
}
protected void OpenCategoriesTemplatesManager()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]