Skip to content
Snippets Groups Projects
Commit afef3a23 authored by Benoît Minisini's avatar Benoît Minisini :church:
Browse files

'Desktop.UsePortal' is the new property that tells if the desktop portal can be used or not.

[GB.DESKTOP]
* BUG: 'Desktop.UsePortal' is the new property that tells if the desktop portal can be used or not. 'DesktopPortal.Enabled' is actually not public.
* BUG: Null address arrays can be sent to 'Desktop.SendMail()' when desktop portal is used.
parent 38b49c03
No related branches found
No related tags found
No related merge requests found
Pipeline #1097926316 failed
......@@ -24,6 +24,8 @@ Static Property Read RuntimeDir As String
Static Property Read NetworkAvailable As Boolean
Static Property Read RemoteDisplay As Boolean
Static Property UsePortal As Boolean Use $bUsePortal = True
Static Private $cDesktop As Collection
Static Private $cExt As Collection
Static Private $aImgExt As String[]
......
......@@ -4,7 +4,7 @@ Class DBus
Class DBusSignal
Class DBusFile
Property Enabled As Boolean
Property Read Enabled As Boolean
Private $bStarted As Boolean
Private $bCheckAvailable As Boolean
......@@ -109,20 +109,13 @@ End
Private Function Enabled_Read() As Boolean
If $bEnabledSet And If Not $bEnabled Then Return False
If Not Desktop.UsePortal Then Return False
If Env["GB_DESKTOP_PORTAL_ENABLED"] = "0" Then Return False
StartPortal
Try Return DBus.Session.Exist("org.freedesktop.portal.Desktop")
End
Private Sub Enabled_Write(Value As Boolean)
$bEnabled = Value
$bEnabledSet = True
End
Public Sub PickColor() As Integer
Dim sToken As String
......@@ -183,9 +176,12 @@ Public Sub SendMail(aTo As String[], aCc As String[], aBcc As String[], sSubject
cOption = New Collection
If aTo Then cOption["addresses"] = aTo
If aCc Then cOption["cc"] = aCc
If aBcc Then cOption["bcc"] = aBcc
If Not aTo Then aTo = New String[]
cOption["addresses"] = aTo
If Not aCc Then aCc = New String[]
cOption["cc"] = aCc
If Not aBcc Then aBcc = New String[]
cOption["bcc"] = aBcc
cOption["subject"] = sSubject
cOption["body"] = sBody
If aFile Then cOption["attachment_fds"] = aFile
......
......@@ -15,9 +15,7 @@ Private $cSearchPath As New Collection
Public Sub Main()
' Dim hPict As Picture
'Desktop.SendMail(["benoit@minisini.fr"], ["bminisini@asap-info.com"], ["benoit.minisini@gambas-basic.org"], "Sujet", "Corps du mail", "~/adolf.png")
'hPict = Desktop.Screenshot()
For Each sIcon As String In ["~/gambas/git/master/app/desktop/gambas3.desktop", "~/.local/share/applications/gambas3.desktop", "/usr/share/applications/gambas3.desktop"]
If Exist("~/.local/share/applications/gambas3.desktop") Then Break
Next
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment