mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2026-09-14 11:06:16 +05:00
Added extension for picture as string (.rpic)
This commit is contained in:
parent
e4ad6ad6f9
commit
a439f28f3b
@ -0,0 +1,21 @@
|
||||
|
||||
local filesystem = require("Filesystem")
|
||||
local GUI = require("GUI")
|
||||
local paths = require("Paths")
|
||||
local system = require("System")
|
||||
|
||||
local workspace, icon, menu = select(1, ...), select(2, ...), select(3, ...)
|
||||
local localization = system.getSystemLocalization()
|
||||
|
||||
menu:addItem(localization.setAsWallpaper).onTouch = function()
|
||||
local userSettings = system.getUserSettings()
|
||||
|
||||
userSettings.interfaceWallpaperPath = icon.path
|
||||
userSettings.interfaceWallpaperEnabled = true
|
||||
system.updateWallpaper()
|
||||
workspace:draw()
|
||||
|
||||
system.saveUserSettings()
|
||||
end
|
||||
|
||||
system.addUploadToPastebinMenuItem(menu, icon.path)
|
||||
BIN
Applications/Picture Edit.app/Extensions/.rpic/Icon.pic
Normal file
BIN
Applications/Picture Edit.app/Extensions/.rpic/Icon.pic
Normal file
Binary file not shown.
@ -298,7 +298,7 @@ end
|
||||
local function loadImage(path)
|
||||
local result, reason
|
||||
|
||||
if filesystem.extension(path) == ".rawpic" then
|
||||
if filesystem.extension(path) == ".rpic" then
|
||||
result = image.fromString(filesystem.read(path))
|
||||
else
|
||||
result, reason = image.load(path)
|
||||
@ -335,7 +335,7 @@ local function saveAs()
|
||||
local filesystemDialog = GUI.addFilesystemDialog(workspace, true, 50, math.floor(window.height * 0.8), locale.save, locale.cancel, locale.fileName, "/")
|
||||
filesystemDialog:setMode(GUI.IO_MODE_SAVE, GUI.IO_MODE_FILE)
|
||||
filesystemDialog:addExtensionFilter(".pic")
|
||||
filesystemDialog:addExtensionFilter(".rawpic")
|
||||
filesystemDialog:addExtensionFilter(".rpic")
|
||||
filesystemDialog:expandPath(paths.user.desktop)
|
||||
filesystemDialog.filesystemTree.selectedItem = paths.user.desktop
|
||||
filesystemDialog:show()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user