A GUI for wmllint

Discussion of all aspects of the game engine, including development of new and existing features.

Moderators: Forum Moderators, Developers

Re: A GUI for wmllint

Postby Elvish_Hunter » February 27th, 2015, 8:13 pm

vultraz wrote:Ok, another weird bug found: if you double click a folder in the file browser, it doesn't expand; it only does if you click the little arrow. Double clicking just results in a 'waiting' cursor.

I'm not sure this is a gui.pyw bug, though. Sounds like a problem with the widget library or something else.
In this case, whatever the cause may be, unfortunately it doesn't depend on my code. I'm just using Tkinter's askdirectory() function, and Tkinter in turn is a thin Python wrapper upon Tcl/Tk. So, I fear that this may be an upstream bug with Windows 8.1 and Tcl/Tk :(
vultraz wrote:EDIT: possible second issue. I installed python 2.7.9 32 bit, and gui.pyw wouldn't start. It worked when I installed 64 bit, though. Can you confirm?
I just tested. With Windows 7 @ 64 bit and Python 2.7.9 @ 32 bit it works perfectly. It works perfectly even with Python 3.4.3 @ 32 bit! 8)
Did you, by any chance, install Python 2.7.9-32 over version 2.7.8-64? If so, there's the chance that some 64-bit component is still around. Try completely uninstalling and then reinstalling Python.
User avatar
Elvish_Hunter
Developer
 
Posts: 1360
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby vultraz » February 28th, 2015, 3:12 am

Elvish_Hunter wrote:Did you, by any chance, install Python 2.7.9-32 over version 2.7.8-64? If so, there's the chance that some 64-bit component is still around. Try completely uninstalling and then reinstalling Python.

'
I did. Tried uninstalling completely, then reinstalling, and it works. Thanks. I can now run pyenchant! :D
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
vultraz
Community Manager
 
Posts: 817
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Postby vultraz » March 2nd, 2015, 11:59 pm

Ok, small issue:

If you have a subdirectory of core selected and 'Skip Core Directory', the warning about no dir selected doesn't appear, for some reason, but the warning about it only running on core since you have a subdirectory selected does. The result is the command with no target.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
vultraz
Community Manager
 
Posts: 817
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Postby Elvish_Hunter » March 3rd, 2015, 4:25 pm

vultraz wrote:Ok, small issue:

If you have a subdirectory of core selected and 'Skip Core Directory', the warning about no dir selected doesn't appear, for some reason, but the warning about it only running on core since you have a subdirectory selected does. The result is the command with no target.
Yeah, I'm aware of it. But I didn't fix it yet because I was undecided of what should be the best behavior here: since the core directory is disabled, should I halt the run? Or should I issue a warning and run wmllint on the selected directory anyway? Or should I use the selected directory and issue no warning at all? :hmm:
The funny thing of this situation is that wmllint itself doesn't have any of these checks to avoid being fooled... :P
User avatar
Elvish_Hunter
Developer
 
Posts: 1360
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby mattsc » May 21st, 2015, 4:01 am

Hi Elvish_Hunter,

As per our discussion, here's a screenshot of how the GUI looks on my Mac. This is with OS X 10.9.5, Wesnoth 1.12.2+dev and python 2.7.9. As I said, it worked for me right out of the box without any problems and is so easy to use that I might actually switch away from my CL habits for this in the future. :shock:

Thanks!
mattsc
Attachments
wmllint_gui.png
mattsc
 
Posts: 951
Joined: October 13th, 2010, 6:14 pm
Location: Canada

Re: A GUI for wmllint

Postby Elvish_Hunter » May 21st, 2015, 12:42 pm

Thanks for the screenshot ;)
However, I can't help but notice that the look seems somehow "off" - for example, the MacOs buttons that I always seen in screenshots are more rounded. So, can you please open a Python prompt (IDLE is fine as well), type the following lines and tell me their output?
Code: Select all
from Tkinter import *
from ttk import *
print Style().theme_use()
print Style().theme_names()
I'm suspecting that I'll need to explicitly set the Aqua theme on Mac...
User avatar
Elvish_Hunter
Developer
 
Posts: 1360
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby mattsc » May 21st, 2015, 3:40 pm

It looks like it does default to aqua:
Code: Select all
Python 2.7.9 (default, Dec 11 2014, 02:36:08)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from Tkinter import *
>>> from ttk import *
>>> print Style().theme_use()
aqua
>>> print Style().theme_names()
('aqua', 'clam', 'alt', 'default', 'classic')
>>>

Unfortunately, I can't tell you much about whether I might have some settings that change this on the system level -- mostly because I stopped caring about these things many years ago and just don't pay attention to them; I just use whatever the default and/or migrated settings are... :| As for rounded buttons, the browse, clear and tool selection buttons are rounded, while the top row of buttons is not. Both types appear in other applications for me as well, although I cannot quickly find one where they appear next to each other like that.
mattsc
 
Posts: 951
Joined: October 13th, 2010, 6:14 pm
Location: Canada

Re: A GUI for wmllint

Postby Elvish_Hunter » May 24th, 2015, 7:45 pm

mattsc wrote:As for rounded buttons, the browse, clear and tool selection buttons are rounded, while the top row of buttons is not. Both types appear in other applications for me as well, although I cannot quickly find one where they appear next to each other like that.
Thanks anyway :) . At least, now I know that it isn't something that I can fix. Perhaps it's a bug in Tcl/Tk, perhaps it's some inconsistency in MacOS, perhaps it's a combination of both, but for sure It's Not My Fault™ :P
User avatar
Elvish_Hunter
Developer
 
Posts: 1360
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby Celtic_Minstrel » August 15th, 2015, 1:06 am

I tried this out in 1.12.4 and have two suggestions for improvement:

  1. Would it be a lot of work to support dragging a folder into the text box? I can drag it into the file select dialog already, but this would be slightly more convenient.
  2. I suggest setting the current working directory to the provided directory - I think this should result in shorter messages. (Or possibly the parent of the provided directory.)

Also, belated response to the other thread on this topic - if tooltips are too difficult, couldn't you instead have a text label that updates with further info as you move the mouse over things? Kind of like the browser status bar.

Elvish_Hunter wrote:Yeah, I'm aware of it. But I didn't fix it yet because I was undecided of what should be the best behavior here: since the core directory is disabled, should I halt the run? Or should I issue a warning and run wmllint on the selected directory anyway? Or should I use the selected directory and issue no warning at all? :hmm:
The funny thing of this situation is that wmllint itself doesn't have any of these checks to avoid being fooled... :P
Here's my view:
  • If they select the core directory (ie, "data/core"), then just parse core once, thus ignoring the setting of whether or not to include core.
  • If they disable core but then select a subdirectory of core, then just parse that subdirectory.
  • If they enable core but then select a subdirectory of core, ignore their subdirectory and just parse core.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.
User avatar
Celtic_Minstrel
Developer
 
Posts: 753
Joined: August 3rd, 2012, 11:26 pm

Re: A GUI for wmllint

Postby vultraz » August 15th, 2015, 1:31 am

Small issue I think I found: the file chooser box seems to be constantly refreshing - the cursor stutters between normal and 'waiting', and the folder overlays (such as from tgit) flicker. Not sure if this is a problem with the app or something else, but I thought I'd point it out.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
vultraz
Community Manager
 
Posts: 817
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Postby Elvish_Hunter » August 15th, 2015, 1:23 pm

Celtic_Minstrel wrote:Would it be a lot of work to support dragging a folder into the text box? I can drag it into the file select dialog already, but this would be slightly more convenient.
OK, let me get this straight: Tkinter doesn't support drag and drop. There are some extensions around to enable it, but this will mean adding a dependency that not everyone may know how to install, and that may not be redistributed with Wesnoth, depending on the license.
Whatever D'n'D support you got, it's caused by Tkinter using the OS' native widgets; since Linux doesn't have native widgets, on Xubuntu I have no support at all for it.
EDIT: I just found out that the Python Standard Library includes a module, called Tkdnd, which can be used to add d'n'd' support. However, it's marked as experimental and in future it should be replaced with TkDND. Also, it seems like it doesn't work on MacOS. Hmmm... I'll have to investigate.
Celtic_Minstrel wrote:I suggest setting the current working directory to the provided directory - I think this should result in shorter messages. (Or possibly the parent of the provided directory.)
This script doesn't rely on the current working directory (os.getcwd()). But it should be easy to implement, by using os.chdir() and supplying the selected folder as argument. I'll have to try it.
Celtic_Minstrel wrote:if tooltips are too difficult, couldn't you instead have a text label that updates with further info as you move the mouse over things? Kind of like the browser status bar.
Either that, or I'll have to find some time to study some Tcl/Tk and write a wrapper to the Tklib Tooltip library - I never managed to do it so far. Anyway, thanks for the idea: even if I won't implement it here (most stuff is quite self-explanatory anyway), I'll surely find a use for it in trackplacer :)
vultraz wrote:Not sure if this is a problem with the app or something else, but I thought I'd point it out.
My guess is that's an upstream problem with Windows 10 and Tcl/Tk, since my code hasn't changed. I'll try to keep an eye on Python's and Tcl's bugtrackers - although I have higher priorities right now.
User avatar
Elvish_Hunter
Developer
 
Posts: 1360
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby vultraz » August 18th, 2015, 11:01 am

Update: I no longer observe the flicker problem, so it must have been a one-off anomaly.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
vultraz
Community Manager
 
Posts: 817
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Postby Elvish_Hunter » September 2nd, 2015, 7:52 pm

After a long time, I finally managed to add tooltips to this program! :D Commit dce1e7b adds the required widget (a subclass of Toplevel) and experimentally wires five of them to the radiobuttons in the wmllint tab.
Have a screenshot on XFCE:
tooltips.png
User avatar
Elvish_Hunter
Developer
 
Posts: 1360
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby gfgtdf » July 19th, 2017, 3:14 pm

I just tried this and it works well but it seems like the wmllint ignore options don't work, i still get spammes with unknown unit erros even though is checked "Disable checks for unknown units"
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
gfgtdf
Developer
 
Posts: 899
Joined: February 10th, 2013, 2:25 pm

Re: A GUI for wmllint

Postby Elvish_Hunter » July 20th, 2017, 6:15 pm

gfgtdf wrote:I just tried this and it works well but it seems like the wmllint ignore options don't work, i still get spammes with unknown unit erros even though is checked "Disable checks for unknown units"
Since this GUI just calls wmllint and adds the required command line switches, it might as well be a bug in wmllint itself. When you run the GUI, the command used is added as the first line of the output in the textbox: can you please copy it here?
User avatar
Elvish_Hunter
Developer
 
Posts: 1360
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

PreviousNext

Return to Coder’s Corner

Who is online

Users browsing this forum: No registered users and 1 guest