Page 1 of 1

[WIP] new GUI for debug console

Posted: Mon Jan 06, 2020 1:18 am
by cag
Built using OoDebugConsole1.5 as a starting point, this version is functionally the same, just with less typing.

The one exception is the 'alias' function in Options menu. Basic-debug.oxp provides a few, eg. 'PS' for player.ship, but I wanted more (and in lower case!).

As with Basic-debug.oxp, these are just properties of the console script. I've added polling, so if you set one to something dynamic (eg. 'pt' for player.ship.target), it will be up to date. I've also had success adding functions, as long as I remember to type '()' after the alias :)

At present there is no documentation. What started as just my own hacked version has grown over time so I thought others may find it useful. I copied the Debug menu from the Mac OS version and tossed in anything else I could find in oolite-debug-console.js.

features:
  • menus for debug, options, font and once connected, a menu for options in debugConfig.plist
  • pop-up menus for frames (includes a search function) & scroll bars
  • command history search via the Tab key (Shift-Tab to search the other way)
    You can also remove a command from the history using the pop-up menu or Ctrl-Delete.
    (I load new functions a lot, even entire scripts, and my history file grew quite large!
    FYI: I also added a limit of 200 commands/2MB)

Python source: https://www.dropbox.com/s/junf73vkqibdn ... 2.zip?dl=0
- if not already present, will need to install the 'twisted' package

Windows exe: https://www.dropbox.com/s/x62r5gvp65yhe ... 2.exe?dl=0

Edited Jan. 7/20 @ 7:15 pm EST
- new versions uploaded to fix dialog window bug

requires:

Re: [WIP] new GUI for debug console

Posted: Tue Jan 07, 2020 11:50 am
by another_commander
Good job, thanks.

As a very minor observation, after building the application, I get the Tk icon on the console window rather than the "correct" one. Any idea why this would be?

Re: [WIP] new GUI for debug console

Posted: Wed Jan 08, 2020 12:45 am
by cag
after building the application, I get the Tk icon on the console window rather than the "correct" one
I'm unable to reproduce on my rig (Windows 10 Pro - 1809) either by running the .exe or the script via pythonw.exe. I see the provided icon on the console, taskbar and dialog windows (Tk's "feather" icon is just ugly imho)

What's your OS? What do you mean by "building the application"? It should be sufficient, assuming you have Python installed, to run the script as is, as Python will check the script's folder for the icon.

Speed is not a factor. I always just run the script and it can handle a dozen or more log messages/frame easily. The .exe was provided for those who don't have Python installed.

If you are building an executable for another OS, getting it to cooperate with Tk can require some fiddling. I built the .exe using pyinstaller, which has a handy --icon= arg.

Re: [WIP] new GUI for debug console

Posted: Wed Jan 08, 2020 6:43 am
by another_commander
I was using pyinstaller on Windows as well. When I talked about building the application I meant generating a stand-alone executable.

It turns out I had omitted adding the icon in the list of files that pyinstaller packs. Without the icon, it was defaulting to the Tk one. I have now managed to build a stand-alone console exe that runs correctly using this command line in the folder where the console source was copied to:

C:\OoDebugConsole2> pyinstaller --onefile --add-data="OoJSC.ico;." --windowed DebugConsole.py -i OoJSC.ico

Thanks again for the help.

Re: [WIP] new GUI for debug console

Posted: Wed Mar 25, 2020 6:21 pm
by Svengali
Nice work, a_c!!!! Thanks a lot. :D