fixed bug with file name when creating new file

This commit is contained in:
bancika
2011-01-26 23:57:09 +00:00
parent be7ab3412d
commit 5de6caf073
3 changed files with 11 additions and 5 deletions
@@ -1,15 +1,15 @@
<map> <map>
<entry> <entry>
<string>metric</string> <string>lastPath</string>
<boolean>true</boolean> <string>C:\Documents and Settings\Branislav Stojkovic\Desktop</string>
</entry> </entry>
<entry> <entry>
<string>zoom</string> <string>zoom</string>
<double>1.0</double> <double>1.0</double>
</entry> </entry>
<entry> <entry>
<string>lastPath</string> <string>metric</string>
<string>C:\Documents and Settings\Branislav Stojkovic\Desktop</string> <boolean>true</boolean>
</entry> </entry>
<entry> <entry>
<string>default.org.diylc.components.misc.Label:Color</string> <string>default.org.diylc.components.misc.Label:Color</string>
@@ -193,7 +193,7 @@ public class Presenter implements IPlugInPort {
Project project = new Project(); Project project = new Project();
instantiationManager.fillWithDefaultProperties(project); instantiationManager.fillWithDefaultProperties(project);
loadProject(project, true); loadProject(project, true);
projectFileManager.fireFileStatusChanged(); projectFileManager.startNewFile();
} catch (Exception e) { } catch (Exception e) {
LOG.error("Could not create new file", e); LOG.error("Could not create new file", e);
view.showMessage("Could not create a new file. Check the log for details.", "Error", view.showMessage("Could not create a new file. Check the log for details.", "Error",
@@ -78,6 +78,12 @@ public class ProjectFileManager {
this.messageDispatcher = messageDispatcher; this.messageDispatcher = messageDispatcher;
} }
public void startNewFile() {
currentFileName = null;
modified = false;
fireFileStatusChanged();
}
public void serializeProjectToFile(Project project, String fileName) throws IOException { public void serializeProjectToFile(Project project, String fileName) throws IOException {
LOG.info(String.format("saveProjectToFile(%s)", fileName)); LOG.info(String.format("saveProjectToFile(%s)", fileName));
FileOutputStream fos; FileOutputStream fos;