changeset 153:2934fcacbb97

Fixed a bug preventing log messages from being displayed. Added a Help->About menu (logs copyright info).
author Diggory Hardy <diggory.hardy@gmail.com>
date Fri, 10 Apr 2009 18:09:55 +0200
parents c67d074a7111
children 0520cc00c0cc
files codeDoc/jobs.txt data/L10n/en-GB.mtt mde/menus.d mde/setup/Init.d
diffstat 4 files changed, 17 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/codeDoc/jobs.txt	Fri Apr 10 15:19:46 2009 +0200
+++ b/codeDoc/jobs.txt	Fri Apr 10 18:09:55 2009 +0200
@@ -8,7 +8,9 @@
 
 To do (importance 0-5: 0 pointless, 1 no obvious impact now, 2 todo sometime, 3 useful, 4 important, 5 urgent):
 Also search for FIXME/NOTE/BUG/WARNING comment marks.
+4   Entering a hashmap tag like {0:"x","y"} causes an infinite loop.
 4   Revise widgets/functions available: remove TextLabel, add VoidContent creation
+3   GUI: up-clicks get passed as events and activate objects
 3   Too many redraws: mouse-over causes them
 3   Glyph 's' drawn incorrectly in release mode - ??
 3   Widget saving: how to deal with modifier functions, esp. when they discard parameters? Remove feature except for dimdata and handle gui editing separately?
--- a/data/L10n/en-GB.mtt	Fri Apr 10 15:19:46 2009 +0200
+++ b/data/L10n/en-GB.mtt	Fri Apr 10 18:09:55 2009 +0200
@@ -5,6 +5,8 @@
 <entry|main.quit={0:"Quit"}>
 <entry|debug={0:"Debug",1:"Debug-mode menu of debugging functions"}>
 <entry|debug.guiDemo={0:"GUI Demo"}>
+<entry|help={0:"Help"}>
+<entry|help.about={0:"About",1:"Show author and copyright information"}>
 {Font}
 <entry|lcdFilter={0:"LCD filtering",1:"Filtering used with LCD rendering."}>
 <entry|lcdFilter.none={0:"None",1:"Leaves big colour fringes."}>
--- a/mde/menus.d	Fri Apr 10 15:19:46 2009 +0200
+++ b/mde/menus.d	Fri Apr 10 18:09:55 2009 +0200
@@ -22,13 +22,11 @@
 
 import mde.content.miscContent;
 import mde.imde;
-debug {
     import tango.util.log.Log : Log, Logger;
     private Logger logger;
     static this () {
         logger = Log.getLogger ("mde.menus");
     }
-}
 
 static this () {
     auto quit = new EventContent("menus.main.quit");
@@ -36,4 +34,12 @@
         debug logger.trace ("Quit (from menu)");
         run = false;
     });
+    
+    auto about = new EventContent("menus.help.about");
+    about.addCallback ((Content){
+	//TODO: popup dialog box
+	logger.info ("MDE  Copyright (C) 2007-2009  Diggory Hardy");
+	logger.info ("This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.");
+	logger.info ("This is free software, and you are welcome to redistribute it under certain conditions; see COPYING for details.");
+    });
 }
--- a/mde/setup/Init.d	Fri Apr 10 15:19:46 2009 +0200
+++ b/mde/setup/Init.d	Fri Apr 10 18:09:55 2009 +0200
@@ -170,7 +170,6 @@
             }
             if (!(logOutput() & 1))
                 root.add(new AppendConsole);
-            logger.info ("Starting mde [no version] on " ~ TimeStamp.toString(WallClock.now));
         } catch (Exception e) {
             // Presumably it was only adding a file appender which failed; set up a new console
             // logger and if that fails let the exception kill the program.
@@ -178,7 +177,10 @@
             root.add (new AppendConsole);
             logger.error ("Exception while setting up the logger; logging to the console instead.");
         }
-        
+	
+	// Done enough init to know where and when to log messages now
+	logger.info ("Starting mde [no version] on " ~ TimeStamp.toString(WallClock.now));
+	
         // a debugging option:
         imde.run = imde.run && !exitImmediately();
         debug logger.trace ("Init: applied pre-init options");
@@ -411,7 +413,7 @@
 		Log.root.level (Level.Trace);
 		logger.trace ("Setting logging level {}", logLevel());
 	    }
-            Log.root.level (logOutput() == 0 ? Level.None : cast(Level) logLevel(), true);
+            Log.root.level (logOutput() == 3 ? Level.None : cast(Level) logLevel(), true);
         }
         
         void printUsage (char[] progName) {