Board index FlightGear Development Canvas

Reinstating Canvas based Aircraft Center for non Qt builds

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Reinstating Canvas based Aircraft Center for non Qt builds

Postby Hooray » Sun Oct 01, 2017 8:40 pm

https://sourceforge.net/p/flightgear/ma ... /35150680/
Thorsten wrote:I've heard a lot of unhappy talk in forum conversations and via PM about how the aircraft center was declared 'dead' a while ago - it's not a sentiment shared by everyone. I don't see how keeping a third GUI option open hurts anyone.


Referring to: https://sourceforge.net/p/flightgear/ma ... /36057801/
wkitty42 wrote:i think that, basically, since there's no way for the --launcher to be called
without QT compiled in, it should abort... in the same way, there should also be
some other code path for the in-sim Aircraft Center which also cannot work
without QT... /IF/ you have a console, you might notice this message

Failed to execute command open-launcher

when you use F10->File->Aircraft Center (Experimental) but it doesn't do you any
real good... the other (old?) aircraft center code path should be branched to
and followed at this point so there's a working aircraft center.
.. or a dialog
box popped up with a better message... or the menu item should be dynamic and
only appear if QT and the launcher are available...


That should be trivial to do by looking at the original patch/diff that disabled the original Canvas based aircraft center: https://sourceforge.net/p/flightgear/fg ... 152d12c2a/

If this is something that people with non-Qt enabled builds want to try, I would suggest to edit $FG_ROOT/gui/menubar.xml according to the following (untested):

Code: Select all
 <item>
                        <name>aircraft-center</name>
                        <binding>
                                <command>nasal</command>
                                <script><![CDATA[
                                # https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/src/Main/fg_scene_commands.cxx#l360
                                var haveQtLauncher = fgcommand("open-launcher");
                                if (!haveQtLauncher) {
                                        # https://sourceforge.net/p/flightgear/fgdata/ci/654a343bbb7eb51b387060515e3415e152d12c2a/
                                        canvas.loadDialog("AircraftCenter");
                                }
                                ]]></script>
                        </binding>
                </item>



Freel free to test/report back here and share if this works or not.

Obviously, it would also be possible to run the heuristics during startup and patch the open-launcher fgcommand using the addCommand() API.

The only problem I foresee though is that we may have already exceeded the point where our UIs are diverging, so that things may no longer work properly for the original Canvas based Aircraft Center. Anyway, the original idea was to use a common service layer, quoting Torsten:
New Canvas GUI
Torsten wrote:There is currently heavy activity towards a new UI. There will be the HTML5 based version, I am currently working on and an internal implementation based on well supported libraries. Most likely, both will use a common service layer to provide necessary data.
Neither of those will use Nasal or Canvas to render the UI elements.

Torsten
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Return to Canvas

Who is online

Users browsing this forum: No registered users and 3 guests