annotate mde/menus.d @ 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 6f69a9c111eb
children e45226d3deae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
132
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
1 /* LICENSE BLOCK
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
2 Part of mde: a Modular D game-oriented Engine
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
3 Copyright © 2007-2008 Diggory Hardy
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
4
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
5 This program is free software: you can redistribute it and/or modify it under
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
6 the terms of the GNU General Public License as published by the Free Software
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
7 Foundation, either version 2 of the License, or (at your option) any later version.
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
8
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful, but WITHOUT ANY
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
11 PARTICULAR PURPOSE. See the GNU General Public License for more details.
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
12
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
13 You should have received a copy of the GNU General Public License
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
15
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
16 /******************************************************************************
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
17 * Import this module to add some standard menus to imde.menus.
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
18 *
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
19 * Note that the widget manager also adds menu items in debug mode.
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
20 *****************************************************************************/
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
21 module mde.menus;
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
22
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
23 import mde.content.miscContent;
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
24 import mde.imde;
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
25 import tango.util.log.Log : Log, Logger;
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
26 private Logger logger;
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
27 static this () {
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
28 logger = Log.getLogger ("mde.menus");
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
29 }
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
30
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
31 static this () {
137
9f035cd139c6 BIG commit. Major change: old Options class is gone, all content values are loaded and saved automatically. All options updated to reflect this, some changed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 133
diff changeset
32 auto quit = new EventContent("menus.main.quit");
132
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
33 quit.addCallback ((Content){
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
34 debug logger.trace ("Quit (from menu)");
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
35 run = false;
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
36 });
153
2934fcacbb97 Fixed a bug preventing log messages from being displayed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 141
diff changeset
37
2934fcacbb97 Fixed a bug preventing log messages from being displayed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 141
diff changeset
38 auto about = new EventContent("menus.help.about");
2934fcacbb97 Fixed a bug preventing log messages from being displayed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 141
diff changeset
39 about.addCallback ((Content){
2934fcacbb97 Fixed a bug preventing log messages from being displayed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 141
diff changeset
40 //TODO: popup dialog box
2934fcacbb97 Fixed a bug preventing log messages from being displayed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 141
diff changeset
41 logger.info ("MDE Copyright (C) 2007-2009 Diggory Hardy");
2934fcacbb97 Fixed a bug preventing log messages from being displayed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 141
diff changeset
42 logger.info ("This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.");
2934fcacbb97 Fixed a bug preventing log messages from being displayed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 141
diff changeset
43 logger.info ("This is free software, and you are welcome to redistribute it under certain conditions; see COPYING for details.");
2934fcacbb97 Fixed a bug preventing log messages from being displayed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 141
diff changeset
44 });
132
264028f4115a Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
45 }