Re: InFile
Posted: Saturday 13th February 2021 10:57am
And 'folder' instead of 'folders' and '.*jepg' instead of 'jpeg, all fixed. Nice video too!
And 'folder' instead of 'folders' and '.*jepg' instead of 'jpeg, all fixed. Nice video too!
Haha , isn't it always the way
TaskGetFiles = New GetFiles As "TaskGetFiles" ?
I am asking because I try to adopt the tasks into my project. I exactly copied the task related code and implemented it into my project. Nothing starts the function Main(). I always need an explicit command like TaskGetFiles.Main()
Otherwise the task won't run. I suppose the problem sits in front of the computer as usual.Public sFolder As String = User.Home
Public bRecursive As Boolean = False
Public sPattern As String = "*"
TaskGetFiles As Task
Public Sub Form_Open()
TaskGetFiles = New GetFiles As "TaskGetFiles" 'Creates a new instant of the 'Task' and runs it
End
Public Sub TaskGetFiles_Kill() 'When the 'Task' is finished this will catch the event
Dim sFileList As String[] = TaskGetFiles.Value
Dim iLoop As Integer
For iLoop = 0 To sFileList.Max
Print sFileList[iLoop]
Next
End
Hopefully that will help. The line TaskGetFiles = New GetFiles As "TaskGetFiles" causes the 'Task' to run.' Gambas class file
'MyTask_FTS.class
Inherits Task
Public Function Main() As Variant 'DB_update_FTS() As Variant
Dim DBS As New Cls_SQL_DataBase
Dim $Rec As Result
Dim $Query, $QueryUpdate As String
Dim sToday As String = Format(Now(), AV.FormatDBDateNoTime)
'Debug sToday
$QueryUpdate = "UPDATE App_variables SET Val='" & sToday & "' WHERE Var='LastCreateFTS'"
'Debug $Query
$Query = "SELECT * FROM App_variables WHERE Var='LastCreateFTS'"
$Rec = DBS.$Con.Exec($Query)
If Not $Rec.Available Then
'Message("No variable defined")
Return False
Endif
If sToday > $Rec!Val Then
'Debug "Action: Create Virt. Table: --> sToday '" & sToday & "' ist größer als der letzte Eintrag: '" & $Rec!Val & "'"
DBS.Refresh_FTS
$Rec = DBS.$Con.Exec($QueryUpdate)
Wait
Else
'Debug "No activities required sToday '" & sToday & "' ist NICHT größer oder jedoch gleich letzter Eintrag: '" & $Rec!Val & "'"
Endif
Return True
End
DBus["session://org.freedesktop.FileManager1"]["/org/freedesktop/FileManager1", "org.freedesktop.FileManager1"].ShowItems([sFileName], "SHF")
no need to use filmeanager searching at all.
Public Sub Main()
OpenFM("/path/to/file")
End
Public Sub OpenFM(sFile As String)
If Not Left(sFile, 7) = "file://" Then sFile = "file://" & sFile
If DBus.Session.Applications.Exist("org.freedesktop.FileManager1") Then
DBus["session://org.freedesktop.FileManager1"]["/org/freedesktop/FileManager1", "org.freedesktop.FileManager1"].ShowItems([sFile], "SHF")
Else
' Other code here
Endif
End
Sorry fella I assumed that command would be on all desktops No I didn't , there is one on the Farm though made by Fabien Bodard and Benoît Minisini.cogier wrote: ↑Thursday 19th August 2021 4:41pm I have just been having a look at D-Bus. I just need to go into a darkened room for an hour! Am I any wiser - Er.. NO!
There is a program called D-feet (available from the Ubuntu Repos) that shows all the available connections on the D-Bus.
Have you created an example program in Gambas that will demonstrate what can be done with this?