changeset 374:1115f7cae9a3

Editor: * The editor will now force filenames to be lowercase, as VFS does not like uppercase path names. * If a map filename does not have a .xml extension on save, it will be automatically added. * Log modules set to "all" by default. Only new users will be affected by this without having to modify or remove their configuration file. * Log level set to LOGLEVEL_WARN
author cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 21 Nov 2009 13:11:56 +0000
parents 20fa29f376c7
children 91e352f81f63
files clients/editor/scripts/editor.py clients/editor/scripts/gui/filemanager.py clients/editor/settings-dist.xml
diffstat 3 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/clients/editor/scripts/editor.py	Fri Nov 20 02:04:39 2009 +0000
+++ b/clients/editor/scripts/editor.py	Sat Nov 21 13:11:56 2009 +0000
@@ -129,9 +129,21 @@
 		import fifelog
 		
 		logModules = self._settings.get("FIFE", "LogModules")
+		loglevel = self._settings.get("FIFE", "LogLevel", "Warn");
+			
 		self.log = fifelog.LogManager(self.engine, self._settings.get("FIFE", "LogToPrompt"), self._settings.get("FIFE", "LogToFile"))
 		if logModules:
 			self.log.setVisibleModules(*logModules)
+			
+		if loglevel == "Debug":
+			loglevel = fife.LogManager.LEVEL_DEBUG
+		elif loglevel == "Log":
+			loglevel = fife.LogManager.LEVEL_LOG
+		elif loglevel == "Error":
+			loglevel = fife.LogManager.LEVEL_ERROR
+		else:
+			loglevel = fife.LogManager.LEVEL_WARN
+		self.log.lm.setLevelFilter(loglevel)
 		
 	def _initTools(self):
 		""" Initializes tools """
@@ -402,7 +414,7 @@
 		if path in self._open_files:
 			# Map is already open, ask user if he wants to reload the map
 			mapview = self.getMapviewByPath(path)
-			YesNoDialog("Map is already open. Do you want to reload it?", cbwa(self.reloadMapview, mapview=mapview))
+			YesNoDialog(u"Map is already open. Do you want to reload it?", cbwa(self.reloadMapview, mapview=mapview))
 			return
 	
 		""" Opens a file """
--- a/clients/editor/scripts/gui/filemanager.py	Fri Nov 20 02:04:39 2009 +0000
+++ b/clients/editor/scripts/gui/filemanager.py	Sat Nov 21 13:11:56 2009 +0000
@@ -136,6 +136,9 @@
 			return
 			
 		fname = '/'.join([path, filename])
+		fname = fname.lower()
+		if os.path.splitext(fname)[1] != ".xml":
+			fname = fname + ".xml"
 		mapview.saveAs(fname)
 		
 	def saveAs(self):
--- a/clients/editor/settings-dist.xml	Fri Nov 20 02:04:39 2009 +0000
+++ b/clients/editor/settings-dist.xml	Sat Nov 21 13:11:56 2009 +0000
@@ -14,10 +14,11 @@
 		<Setting name="MapFile" type="str"> maps/shrine.xml </Setting>
 		<Setting name="Font" type="str"> fonts/FreeSans.ttf </Setting>
 		<Setting name="FontGlyphs" strip="0" type="str"> abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&amp;`'*#=[]\"</Setting>
-		<Setting name="LogModules" type="list"> controller</Setting>
+		<Setting name="LogModules" type="list"> all </Setting>
 		<Setting name="PychanDebug" type="bool"> False </Setting>
 		<Setting name="LogToPrompt" type="int"> 1 </Setting>
 		<Setting name="LogToFile" type="int"> 0 </Setting>
+		<Setting name="LogLevel" type="string"> Warn </Setting>
 	</Module>
 	<Module name="Plugins">
 		<Setting name="HistoryManager" type="bool">True</Setting>