[ease/themes: 2/3] Fix saving new Documents.



commit 6b1597f0182dbed284e40b7a10d5eeef7553c64f
Author: Nate Stedman <natesm gmail com>
Date:   Mon Jun 7 17:45:04 2010 -0400

    Fix saving new Documents.

 src/EditorWindow.vala  |    6 +++---
 src/WelcomeWindow.vala |    3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/EditorWindow.vala b/src/EditorWindow.vala
index 8a24aa4..b9cf2d2 100644
--- a/src/EditorWindow.vala
+++ b/src/EditorWindow.vala
@@ -156,12 +156,12 @@ public class Ease.EditorWindow : Gtk.Window
 		
 		// save file
 		main_toolbar.save.clicked.connect(() => {
-			if (document.path == null)
+			if (document.filename == null)
 			{
 				var dialog =
 					new Gtk.FileChooserDialog(_("Save Document"),
 		        	                          null,
-		        	                          Gtk.FileChooserAction.SELECT_FOLDER,
+		        	                          Gtk.FileChooserAction.SAVE,
 		        	                          "gtk-cancel",
 		        	                          Gtk.ResponseType.CANCEL,
 		        	                          "gtk-open",
@@ -169,7 +169,7 @@ public class Ease.EditorWindow : Gtk.Window
 
 				if (dialog.run() == Gtk.ResponseType.ACCEPT)
 				{
-					document.path = dialog.get_filename();
+					document.filename = dialog.get_filename();
 				}
 				else
 				{
diff --git a/src/WelcomeWindow.vala b/src/WelcomeWindow.vala
index 17269ac..fcce850 100644
--- a/src/WelcomeWindow.vala
+++ b/src/WelcomeWindow.vala
@@ -202,6 +202,9 @@ public class Ease.WelcomeWindow : Gtk.Window
 			document.height = (int)y_res.get_value();
 			document.theme = selected_theme;
 			
+			// allocate a temp directory for the new document
+			document.path = Temp.request();
+			
 			// get the master
 			var master = selected_theme.slide_by_title(PREVIEW_ID);
 			



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