[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gambas3.desktop install idea to detect installed toolkits...


The suggestion of a menu item in the IDE that re-configures the icon was a
good one.

My script was bash but could also easily be gambas code.
force a re-install simply using ..

xdg-desktop-menu uninstall gambas3.desktop
xdg-desktop-menu install --novendor /tmp/gambas3.desktop

Here is a simple function that will do it....
----------------
Public Sub MakeNewGambasIcon()

  Dim sTemp As String = File.SetExt(Temp("gambas3"), "desktop")
  Dim sText, sGui As String
  Dim aToolkits As String[] = ["GTK3", "GTK4", "QT4", "QT5", "QT6"]

  For c As Integer = aToolkits.Max DownTo 0
    If Not Exist(Component.Path &/ "gb." & LCase(aToolkits[c]) &
".webview.component") Then aToolkits.Remove(c)
  Next

  sText = "[Desktop Entry]\n"
    "Name=Gambas 3\n"
    "Exec=gambas3\n"
    "GenericName=Gambas 3 IDE\n"
    "GenericName[fr]=EDI Gambas 3\n"
    "GenericName[ru]=Gambas 3 IDE(ИСР)\n"
    "GenericName[nl]=Gambas 3 IDE\n"
    "Comment=Gambas3 Integrated Development Environment\n"
    "Comment[fr]=Environnement de développement intégré Gambas3\n"
    "Comment[ru]=Gambas3 IDE(ИСР) - альтернатива для Visual Basic\n"
    "Comment[nl]=Gambas3 Geïntegreerde Ontwikkel Omgeving\n"
    "Icon=gambas3\n"
    "Terminal=false\n"
    "Type=Application\n"
    "Categories=Development;IDE;\n"
    "StartupNotify=true\n"
    "Actions=" & aToolkits.Join(";")

  For Each sGui In aToolkits

    sText &= "\n\n" & ["[Desktop Action " & sGui & "]",
    "Name=Run with " & sGui,
    "Name[fr]=Exécuter avec " & sGui,
    "Name[nl]=Uitvoeren met " & sGui,
    "Name[it]=Esegui con " & sGui,
    "Exec=env GB_GUI=gb." & LCase(sGui) & " gambas3"].Join("\n")

  Next

  If Exist(sTemp) Then Kill sTemp
  File.Save(sTemp, sText)
  Exec ["xdg-desktop-menu", "uninstall", "gambas3.desktop"] Wait
  Exec ["xdg-desktop-menu", "install", "--novendor", sTemp] Wait
  Kill sTemp

End
------------------

Respects
BruceS


On Wed, 5 Nov 2025 at 17:34, Benoît Minisini <
benoit.minisini@xxxxxxxxxxxxxxxx> wrote:

> Le 05/11/2025 à 17:54, gbWilly a écrit :
> > On Wednesday, November 5th, 2025 at 14:56, Benoît Minisini <
> benoit.minisini@xxxxxxxxxxxxxxxx> wrote:
> >
> >> Le 05/11/2025 à 14:45, Benoît Minisini a écrit :
> >>
> >>> Sorry, but this is rather wrong.
> >>>
> >>> The 'gambas3.desktop' is installed with the 'gambas3-ide' package,
> which
> >>> is the package for the Gambas3 IDE (obviously).
> >
> > And yes, you are correct to state that the package gambas3-ide does
> install the gambas3.desktop. Did you ever istall gambas doeing "apt-get
> install gambas3-ide" or see it advised anywhere as the manner to install
> gambas3?
> >
> > The package gambas3-ide only depends om the minimal packages required to
> run the gambas-ide itself (yes gb.gui is amongst them), but all components
> NOT needed by the IDE would NOT be installed and people would have to
> install all other components separately. It that how you would like it?
> >
> > Hence there is the metapackage named gambas3, that installs all (but
> deprecated) components by default. When installing gambas you do "apt-get
> install gambas3". That will install ALL available toolkits and other
> components that aren't deprecated, as it is the metapackage (the big one
> thing that connects all).
> >
> > I hope that clarifies it a bit better.
> >
> > gbWilly
> >
> >
>
> I don't know what must be clarified exactly.
>
> I just said that the script that generates 'gambas3.desktop' should
> logically be run each time a package that impacts it (gambas3-ide,
> gambas3-gb-{qt5,qt6,gtk3}-webview) is installed or removed.
>
> Is it possible?
>
> Otherwise the 'gambas3.desktop' may be out of sync with the actual gui
> packages available for the IDE.
>
> The situation will be not different from the current one, where all GUI
> components are listed whatever. But then the script becomes useless.
>
> Regards,
>
> --
> Benoît Minisini.
>
>
>

Follow-Ups:
Re: gambas3.desktop install idea to detect installed toolkits...Bruce Steers <bsteers4@xxxxxxxxx>
References:
gambas3.desktop install idea to detect installed toolkits...Bruce Steers <bsteers4@xxxxxxxxx>
Re: gambas3.desktop install idea to detect installed toolkits...Bruce Steers <bsteers4@xxxxxxxxx>
Re: gambas3.desktop install idea to detect installed toolkits...Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: gambas3.desktop install idea to detect installed toolkits...Bruce Steers <bsteers4@xxxxxxxxx>
Re: gambas3.desktop install idea to detect installed toolkits...Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: gambas3.desktop install idea to detect installed toolkits...Tim Dickson <dickson.tim@xxxxxxxxxxxxxx>
Re: gambas3.desktop install idea to detect installed toolkits...gbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: gambas3.desktop install idea to detect installed toolkits...Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: gambas3.desktop install idea to detect installed toolkits...Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: gambas3.desktop install idea to detect installed toolkits...gbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: gambas3.desktop install idea to detect installed toolkits...Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>