Ignore:
Timestamp:
08/23/07 22:15:34 (5 years ago)
Author:
saua
Message:

add logging to text file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bbtracker/trunk/src/org/bbtracker/mobile/gui/AboutForm.java

    r61 r88  
    2727 
    2828public class AboutForm extends Form implements CommandListener { 
     29        private final Command backCommand; 
     30 
     31        private final Command activeDebugCommand; 
     32 
     33        private final Command deactiveDebugCommand; 
     34 
    2935        public AboutForm() { 
    3036                super("About " + BBTracker.getName()); 
     
    3339                                "bbTracker is released under the GNU General Public License v2. See http://www.gnu.org/licenses/.")); 
    3440                append("Icons have been taken (and sometimes modified) from the Tango Project (http://tango-project.org/) and the Human Icon Theme (Copyright 2004-2006 Canonical Ltd.). Both projects release their icons under the Creative Commons Attribution-ShareAlike 2.5 license. Any modifications I did on those icons are released under the same license."); 
    35                 addCommand(new Command("Back", Command.BACK, 0)); 
     41                backCommand = new Command("Back", Command.BACK, 0); 
     42                activeDebugCommand = new Command("Activate Debug Log", Command.SCREEN, 1); 
     43                deactiveDebugCommand = new Command("Deactivate Debug Log", Command.SCREEN, 1); 
     44                addCommand(backCommand); 
     45                updateDebugCommands(); 
    3646                setCommandListener(this); 
    3747        } 
    3848 
     49        private void updateDebugCommands() { 
     50                removeCommand(activeDebugCommand); 
     51                removeCommand(deactiveDebugCommand); 
     52                addCommand(BBTracker.isLogActive() ? deactiveDebugCommand : activeDebugCommand); 
     53        } 
     54 
    3955        public void commandAction(final Command command, final Displayable source) { 
    40                 BBTracker.getInstance().showMainCanvas(); 
     56                if (command == backCommand) { 
     57                        BBTracker.getInstance().showMainCanvas(); 
     58                } else if (command == deactiveDebugCommand) { 
     59                        BBTracker.setLogActive(false); 
     60                        updateDebugCommands(); 
     61                } else if (command == activeDebugCommand) { 
     62                        BBTracker.setLogActive(true); 
     63                        updateDebugCommands(); 
     64                } 
    4165        } 
    4266 
Note: See TracChangeset for help on using the changeset viewer.