#104 GNOME menu integration for archer and mged

Minor Effort
open-accepted
nobody
3
2009-05-31
2009-05-30
Rob
No

BrlCAD Developers,

after one year of pause I compiled BrlCAD svn version 34597 for my Debian
GNU/Linux testing "Squeeze". All went well and I could see how the whole project
evolve. Archer had made huge progress.

My destination is an integration of archer and mged into the GNOME menu. The menu
should have three entries. One should start archer, one should start mged and one
should open a terminal (ex. gnome-terminal) with proper setting of BrlCAD environ-
ment variables. The last entry give the user the ability to run mged in the classic
mode or run any BrlCAD application.

An integration of archer or mged into the GNOME menu isn't as easy as I thought.
Before GNOME menu can run one of the application, the environment variables of
BrlCAD must be set. One solution is a bash script that first set the environment
varibles and then start the application. The solution is not very elegant, because
in same cases a terminal window will pop-up, this window spits out the application
and then close the terminal window. This kind of window flicker isn't really a
good solution.

1. Archer GNOME menu entry

To start archer from the GNOME menu, I found the following solution. In the sub
directory /opt/brlcad/bin/ I found the start script of archer. This script runs
in the first stage as bash script and in the second state as tcl script. I added
two bash export commands into the archer script. The following lines show my
changes:

.
.
29 # Description:
30 # Main for Archer.
31 #
32 #\ <-- begin of the changes
33 export BRLCADDIR=/opt/brlcad |
34 #\ |
35 export $PATH:$BRLCADDIR=/bin |
36 #\ <-- end
37 ARCHER_HOME=`dirname $0`/..
38 #\ 39 export ARCHER_HOME
.
.

Now follows the GNOME menu desktop entry script. This script reside with the
file name archer.desktop under the sub directory /usr/share/applications and
will but archer into the GNOME menu (I found the menu entry script in Mr.
Giuseppe Iuculano BrlCAD Debian source package):

01 [Desktop Entry]
02 Name=Archer
03 Comment=Powerful combinatorial Constructive Solid Geometry (CSG)
04 Exec=/opt/brlcad/bin
05 Icon=archer.png <-- picture comes from html/manuals/
archer/archer.ico
05 Terminal=false
06 Type=Application
07 Categories=Application;Graphics;
08 StartupNotify=false

With this combination the user can run archer from the GNOME menu.

2. Mged GNOME menu entry

I but mged with the following entry script into the GNOME menu:

01 [Desktop Entry]
02 Name=Mged
03 Comment=Powerful combinatorial Constructive Solid Geometry (CSG)
04 Exec=sh /opt/brlcad/mged.sh
05 Terminal=true <-- true is needed, because the script
that starts mged must run in a
terminal
07 Icon=? <-- do You have a nice icon? I thought
of the BrlCAD eagle as icon
06 Type=Application
07 Categories=Application;Graphics;
08 StartupNotify=false

But now the user click on the proper menu entry will start the bash script
mged.sh. The script include the following commands:

01 export BRLCADDIR=/opt/brlcad
02 export $PATH:$BRLCADDIR=/bin
03 mged -b

This script will start a terminal window on the desktop, runs the two export
commands, and close it's terminal window after it has started mged. The -b
parameter let run mged as background process. Because of the window flicker
this solution is not very elegant. So my question to the developers, could
You write a script that starts mged like the script that starts archer?

3. Terminal GNOME menu entry

In this mode the GNOME menu should start a terminal like gnome-terminal. The
terminal should be prepared to run mged in the classic mode or one of the
application from the sub directory /opt/brlcad/bin. In the terminal the
environment variables BRLCADDIR and PATH must exist and have there proper
values. A shell script could be a solution but that isn't very elegant.
Maybe one of You could help me with a better solution. I would be very
glad, because with this three menu entries I could close my Debian package
project.

At the end of my letter a question concerning the build of the BrlCAD
manuals. During my last compilation of BrlCAD svn version 34597 I let
BrlCAD build the pfd manuals via fop. But I was a little surprised, because
all the picture in the pdf files aren't correct scaled. Do You know about
this or is this a result of the installed fop version on my machine?

Regards,
Robert Wotzlaw

Discussion

  • Sean Morrison

    Sean Morrison - 2009-05-31
    • labels: --> Compilation
    • milestone: --> Minor Effort
    • priority: 5 --> 3
    • status: open --> open-accepted
     
  • Sean Morrison

    Sean Morrison - 2009-05-31

    Rob,

    The long term goal is actually to merge Archer and MGED so I'm disinclined to put too much duplicative effort into both. Archer is effectively a new prototype interface that is having MGED functionality merged in. They will eventually be merged together (with the result looking more like Archer but having all the features of MGED). I'm hoping we can push out an alpha release later this (2009) year.

    As for setting environment variables, that shouldn't be required. Something is either wrong in the compilation/installation, or in the source code resource lookups. Environment variables are only meant to override what a build was set for (except for PATH/MANPATH of course, but those are just convenience). If I read you example menu entries correctly, you were just referring to PATH but even there it's not necessary. Just have the menu option exec /opt/brlcad/bin/mged -b etc.

    If you can work on and clean up the menu options, I'd be happy to include them in the distribution for others.

    Finally, last nitpick is that the name of the package is BRL-CAD, not BrlCAD. Identity consistency. ;-)

    Cheers!
    Sean

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks