Content:MirLua/Examples/srmm: Difference between revisions
Jump to navigation
Jump to search
(Created page with "Open received files folder button in SRMM's: {{Content:MirLua/Example|code= local srmm = require('m_srmm') local icolib = require('m_icolib') local moduleName = 'MyReceivedFi...") |
No edit summary |
||
Line 1: | Line 1: | ||
Send files button in SRMM's: | |||
{{Content:MirLua/Example|code= | |||
local srmm = require('m_srmm') | |||
local icolib = require('m_icolib') | |||
local moduleName = 'SendFiles' | |||
local buttonId = 1 | |||
local BBBF_ISIMBUTTON = 32 | |||
local BBBF_ISRSIDEBUTTON = 128 | |||
m.HookTemporaryEvent("SRMM/ButtonsBar/ModuleLoaded", function() | |||
srmm.AddButton{ | |||
Module = moduleName, | |||
ButtonId = buttonId, | |||
Flags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON, | |||
Tooltip = m.Translate('Send File'), | |||
Icon = icolib.AddIcon(moduleName, 'Send File') | |||
} | |||
end) | |||
m.HookEvent("SRMM/ButtonsBar/ButtonPressed", function(w, l) | |||
local bcd = CustomButtonClickData(l) | |||
if bcd.Module == moduleName and bcd.ButtonId == buttonId then | |||
print(bcd.hContact) | |||
m.CallService('SRFile/SendCommand', bcd.hContact) | |||
end | |||
end) | |||
}} | |||
Open received files folder button in SRMM's: | Open received files folder button in SRMM's: | ||
{{Content:MirLua/Example|code= | {{Content:MirLua/Example|code= | ||
Line 14: | Line 46: | ||
Module = moduleName, | Module = moduleName, | ||
ButtonId = buttonId, | ButtonId = buttonId, | ||
Flags = BBBF_ISIMBUTTON | Flags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON, | ||
Tooltip = m.Translate('My received files'), | Tooltip = m.Translate('My received files'), | ||
Icon = icolib.AddIcon(moduleName, 'My received files') | Icon = icolib.AddIcon(moduleName, 'My received files') | ||
Line 23: | Line 55: | ||
local bcd = CustomButtonClickData(l) | local bcd = CustomButtonClickData(l) | ||
if bcd.Module == moduleName and bcd.ButtonId == buttonId then | if bcd.Module == moduleName and bcd.ButtonId == buttonId then | ||
m.CallService('SRFile/OpenContRecDir', bcd.hContact) | m.CallService('SRFile/OpenContRecDir', bcd.hContact, 0) | ||
end | end | ||
end) | end) | ||
}} | }} |
Latest revision as of 00:51, 27 September 2017
Send files button in SRMM's:
local srmm = require('m_srmm')
local icolib = require('m_icolib')
local moduleName = 'SendFiles'
local buttonId = 1
local BBBF_ISIMBUTTON = 32
local BBBF_ISRSIDEBUTTON = 128
m.HookTemporaryEvent("SRMM/ButtonsBar/ModuleLoaded", function()
srmm.AddButton{
Module = moduleName,
ButtonId = buttonId,
Flags = BBBF_ISIMBUTTON
Open received files folder button in SRMM's:
local srmm = require('m_srmm')
local icolib = require('m_icolib')
local moduleName = 'MyReceivedFiles'
local buttonId = 1
local BBBF_ISIMBUTTON = 32
local BBBF_ISRSIDEBUTTON = 128
m.HookTemporaryEvent("SRMM/ButtonsBar/ModuleLoaded", function()
srmm.AddButton{
Module = moduleName,
ButtonId = buttonId,
Flags = BBBF_ISIMBUTTON