Board index FlightGear Development New features

Simple FG GUI front-end for Linux

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Re: Simple FG GUI front-end for Linux

Postby erobo » Tue Jun 03, 2014 5:26 pm

That is great news! Many thanks.
erobo
 
Posts: 98
Joined: Wed Mar 19, 2008 11:10 pm
Location: Poland

Re: Simple FG GUI front-end for Linux

Postby santosdumont » Fri Aug 08, 2014 11:45 am

I've been a fan of FGo for several years but now have a problem with a new installation of Linux Mint 17 (although a similar installation on another machine uses FGo 1.3.1-2 no problem). If I download from repository (still 1.3.1-2) I get this:

Code: Select all
 ~ $ fgo
Traceback (most recent call last):
  File "/usr/games/fgo", line 17, in <module>
    run(WORKING_DIR)
  File "/usr/share/games/fgo/src/__init__.py", line 19, in run
    data = Config()
  File "/usr/share/games/fgo/src/config.py", line 78, in __init__
    self.update(first_run=True)
  File "/usr/share/games/fgo/src/config.py", line 208, in update
    self.updateAptLists()
  File "/usr/share/games/fgo/src/config.py", line 214, in updateAptLists
    self._readApt()
  File "/usr/share/games/fgo/src/config.py", line 494, in _readApt
    self._makeApt()
  File "/usr/share/games/fgo/src/config.py", line 372, in _makeApt
    lat += float(e[1])
ValueError: could not convert string to float: Version


I then downloaded & extracted latest version 1.5.2 from website into Downloads folder but can't get it to run, e.g.

Code: Select all
 ~/Downloads $ python fgo
/usr/bin/python: can't find '__main__' module in 'fgo'

 ~/Downloads $ ./fgo
bash: ./fgo: Is a directory

 ~/Downloads $ fgo
bash: /usr/games/fgo: No such file or directory


(Not sure why it's looking in /usr/games/ when README states "This program requires no installation").
No doubt I'm missing something simple but I can' see it!
santosdumont
 
Posts: 168
Joined: Mon Nov 03, 2008 9:20 pm

Re: Simple FG GUI front-end for Linux

Postby Philosopher » Fri Aug 08, 2014 11:51 am

for the latter: cd fgo before ./fgo :)

btw: I just tried this again on Mac, and it works well. All I had to do was compile PIL first, because the dependencies come by default with OS X (including zlib for PNGs). Thanks for your work Erobo!
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Simple FG GUI front-end for Linux

Postby erobo » Fri Aug 08, 2014 3:36 pm

Hello santosdumont, the first problem is due to FGo! 1.3.1 is not handling new airport database format introduced in last FG. Using newest version of FGo! should solve this.

The second one, as Philosopher just pointed out, is probably because you are not running fgo command from directory where FGo! 1.5.2 was unpacked.

Thanks for using FGo!, hope this info will help you.
erobo
 
Posts: 98
Joined: Wed Mar 19, 2008 11:10 pm
Location: Poland

Re: Simple FG GUI front-end for Linux

Postby santosdumont » Sat Aug 09, 2014 11:40 am

Of course, knew it was simple! Slightly confused by terminology "..directory where FGo! was unpacked..." i.e. Downloads.
Seems repository needs updating to 1.5.2
santosdumont
 
Posts: 168
Joined: Mon Nov 03, 2008 9:20 pm

Re: Simple FG GUI front-end for Linux

Postby santosdumont » Sat Aug 09, 2014 1:59 pm

Now have the problem that the aircraft list in FGo is blank, can't figure out how to find it!
santosdumont
 
Posts: 168
Joined: Mon Nov 03, 2008 9:20 pm

Re: Simple FG GUI front-end for Linux

Postby erobo » Sun Aug 10, 2014 10:10 am

santosdumont wrote in Sat Aug 09, 2014 11:40 am:Slightly confused by terminology "..directory where FGo! was unpacked..." i.e. Downloads.

The documentation seems to be confusing in that part, obviously you should run the command inside fgo directory. Thanks for pointing that out, I will fix the readme file it next release.

Now have the problem that the aircraft list in FGo is blank, can't figure out how to find it!

Please make sure that FG_ROOT path in preferences window is set properly. If you installed FG from repositories it should be probably set to /usr/share/games/flightgear/ catalog; if you compiled it yourself, it should point to "data" directory.
erobo
 
Posts: 98
Joined: Wed Mar 19, 2008 11:10 pm
Location: Poland

Re: Simple FG GUI front-end for Linux

Postby santosdumont » Sun Aug 10, 2014 2:28 pm

FGFS 3.0 installed from repositories, /usr/share/games/flightgear/ is the FG_ROOT path in preferences, don't know why FGo finds Airports but not Aircraft. Launcher works fine, I just have to specify aircraft required in terminal.
santosdumont
 
Posts: 168
Joined: Mon Nov 03, 2008 9:20 pm

Re: Simple FG GUI front-end for Linux

Postby erobo » Sun Aug 10, 2014 5:32 pm

That is strange...
Can you confirm that inside /usr/share/games/flightgear/Aircraft actually are aircraft catalogs? If they are in some other location, you can use "additional aircraft path" entry in FGo! preferences to set path to it.
erobo
 
Posts: 98
Joined: Wed Mar 19, 2008 11:10 pm
Location: Poland

Re: Simple FG GUI front-end for Linux

Postby santosdumont » Mon Aug 11, 2014 11:19 am

Got the same path in FGRun & that works. Tried copying the Aircraft directory onto Desktop & setting Additional Aircraft Path to it but no luck. There's something here that FGo doesn't like!
santosdumont
 
Posts: 168
Joined: Mon Nov 03, 2008 9:20 pm

Re: Simple FG GUI front-end for Linux

Postby erobo » Mon Aug 11, 2014 1:11 pm

It may be that there is some bug in the app but to rule out other possibilitiy, could you reset FGo! settings to see if maybe it is corrupted config file that causes the problem?

Just rename the ./fgo folder in your home directory, run FGo! and fill only first three entries in preferences window, that is: path to executable file, FG_ROOT and FG_SCENERY. Let me know if aircraft and airport list are updated.
erobo
 
Posts: 98
Joined: Wed Mar 19, 2008 11:10 pm
Location: Poland

Re: Simple FG GUI front-end for Linux

Postby Philosopher » Tue Aug 12, 2014 12:00 am

Hello, thanks for making it compatible with v850 btw :)

I'm working on using it as an alternative to the mac launcher, and it fits very well ;). (See #1521 for why the Mac launcher doesn't work with OS X 10.10 – I'm sure Linux doesn't have that issue of removing old software ;).) I have a request for a small patch for you to merge into your source (it's really only needed for Mac... but oh well, it could be used for others):
Code: Select all
--- src/__init__.py
+++ src/__init__.py
@@ -22,13 +22,14 @@
 file if you need to run FGo! with some pre-configurations."""
 
 
-def run(working_dir):
+def run(working_dir, on_load=None):
     """Initialize application."""
     # Set current working directory.
     chdir(working_dir)
 
     root = Tk()
     root.title('FGo!')
+    if on_load is not None: on_load()
     # Initialize data object.
     data = Config()
     promptToNotUseCli()

I use it like so:
Code: Select all
#!/usr/bin/env python


"""FGo! - a simple GUI launcher for FlightGear Flight Simulator."""


from sys import path
from os import chdir
from os.path import join
import imp
path[0] = join(path[0], '../Resources/fgo/')
chdir(path[0])
from src import run

## Start gui hack
# Raise this Tk-created Python process to be the top window
# Adapted from http://stackoverflow.com/a/23571300
import subprocess
def applescript(script):
    return subprocess.check_output(['/usr/bin/osascript', '-e', script])
def procidset():
    return set(applescript(
        'tell app "System Events" to return id of every process whose name is "Python"'
        ).replace(',','').split())
idset = procidset()
def on_load():
    try:
        procid = iter(procidset() - idset).next()
        applescript('''
            tell app "System Events"
                repeat with proc in every process whose name is "Python"
                    if id of proc is ''' + procid + ''' then
                        set frontmost of proc to true
                        exit repeat
                    end if
                end repeat
            end tell''')
    except StopIteration:
        print("Mac error: process not found")
        print(repr(idset))
## End gui hack


SCRIPT_DIR = path[0]
MAIN_DIR = 'src'
WORKING_DIR = join(SCRIPT_DIR, MAIN_DIR)


run(WORKING_DIR, on_load=on_load)

The thing is, with Mac, somehow the Tk process starts in the background – behind all other windows. We don't want this, so this was a little hack I adapted to make it pop to the front (like every other Mac application under the sun ;)). You could, of course, add the whole hack to the __init__.py script (and conditionalize it for Mac OS X), but I thought this way would be easier ;).
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Simple FG GUI front-end for Linux

Postby Jabberwocky » Tue Aug 12, 2014 1:04 am

On Ubuntu, this not showing of planes appears to be connected to permissions. Funny thing, to too many permissions, as it looks. My FGo! failed when I had some development directories in the Aircraft-folder with ugoa+w.
Jabberwocky
Retired
 
Posts: 1319
Joined: Sat Mar 22, 2014 7:36 pm
Callsign: JWOCKY
Version: 3.0.0
OS: Ubuntu 14.04

Re: Simple FG GUI front-end for Linux

Postby santosdumont » Tue Aug 12, 2014 10:53 am

Jabberwocky's suggestion was on the right track, I'd copied the Aircraft directory over from an FG installation in another PC, when I checked inside the migrated directory I realised the additional aircraft folders I'd downloaded into the original all now had the dreaded "X" on them (no idea why) so I removed them & hey presto! the list now appears, just have to download the extra aircraft again. In short it was little to do with FGo per se, just a Mint/Ubuntu permissions thing, some folders just didn't like being transferred! Thanks for your help!
santosdumont
 
Posts: 168
Joined: Mon Nov 03, 2008 9:20 pm

Re: Simple FG GUI front-end for Linux

Postby erobo » Tue Aug 12, 2014 2:41 pm

@ Philosopher
Thanks for your patch I'm happy to hear that FGo! is working on OS X, will surely include it in the next release.

santosdumont wrote in Tue Aug 12, 2014 10:53 am:In short it was little to do with FGo per se, just a Mint/Ubuntu permissions thing, some folders just didn't like being transferred!

But still FGo! should not show empty list if only one of the folders is read protected - that is evidently a bug.

@ Jabberwocky and santosdumont
Many thanks for the info, now I will probably be able to easily fix the problem. :)
erobo
 
Posts: 98
Joined: Wed Mar 19, 2008 11:10 pm
Location: Poland

PreviousNext

Return to New features

Who is online

Users browsing this forum: No registered users and 0 guests