[Gambas-user] Error in gb.dbus ?

Hans Lehmann hans at gambas-buch.de
Mon Mar 19 15:24:57 CET 2018


Hello,

if I want to observe selected signals for two DBus applications in a 
project, it does not work.
Only the signals of the DBus object _noted first_ are observed. The 
signals of the second object are ignored.
An error in the component gb.dbus?

With kind regards

Hans

Source section:

Public Sub Form_Open()
...
   $cDBus = DBus.Session
   $sInterface = "org.gtk.Private.RemoteVolumeMonitor"
   hDBusSignal = New DBusSignal($cDBus, $sInterface, True) As "hDBusSignal"

   $cDBus = DBus.System
   $sInterface = "org.freedesktop.NetworkManager"
   hDBusSignalNM = New DBusSignal($cDBus, $sInterface, True) As 
"hDBusSignalNM"
...
End

Public Sub hDBusSignalNM_Signal(Signal As String, Arguments As Variant[])

   If Signal = "StateChanged" Then
      $iNetworkState = Arguments[0]
   Endif

End

Public Sub hDBusSignal_Signal(Signal As String, Arguments As Variant[])

   txaReport.Insert(Signal & gb.NewLine)

   If Signal = "MountAdded" Then $sMountAddedPath = Arguments[2][5]
   If $sMountAddedPath Begins "file:///" Then $sDataDestination = 
Replace($sMountAddedPath, "file://", "")
...
End


More information about the User mailing list