adapt more apps

This commit is contained in:
lxsang
2020-05-13 19:03:39 +02:00
parent 04e5a4d50c
commit e1591087d5
66 changed files with 985 additions and 865 deletions

View File

@ -72,14 +72,12 @@ class PushNotification extends this.OS.GUI.BaseService
.css "bottom", "0"
.hide()
pushout: (s, o, mfeed) ->
pushout: (s, o) ->
d = {
text: "[#{s}] #{o.name} (#{o.id}): #{o.data.m}",
icon: o.data.icon,
iconclass: o.data.iconclass,
closable: true }
#console.log o.data.s
#console.log o.data.e
@mlist.unshift d
@notifeed d

View File

@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
#along with this program. If not, see https://www.gnu.org/licenses/.
class AppearanceHandler extends SettingHandler
class AppearanceHandle extends SettingHandle
constructor:(scheme, parent) ->
super(scheme, parent)
me = @
@ -27,23 +27,27 @@ class AppearanceHandler extends SettingHandler
@themelist = @find "theme-list"
@syswp = undefined
@wplist.set "onlistselect", (e) ->
$(me.wpreview).css("background-image", "url(#{me.parent._api.handler.get}/#{e.data.path})" )
.css("background-size", "cover")
me.parent.systemsetting.appearance.wp.url = e.data.path
data = e.data.item.get("data")
$(me.wpreview)
.css("background-image", "url(#{data.path.asFileHandle().getlink()})" )
.css("background-size", "cover")
me.parent.systemsetting.appearance.wp.url = data.path
me.parent._gui.wallpaper()
@wplist.set "buttons", [
{
{
text: "+", onbtclick: (e) ->
me.parent.openDialog "FileDiaLog", (d, n, p) ->
me.parent.systemsetting.appearance.wps.push p
me.render()
, __("Select image file"), { mimes: ["image/.*"] }
me.parent.openDialog("FileDialog", {
title: __("Select image file"),
mimes: ["image/.*"]
}).then (d) ->
me.parent.systemsetting.appearance.wps.push d.file.path
me.wplist.set "data", me.getwplist()
}
]
@wpsize.set "onlistselect", (e) ->
me.parent.systemsetting.appearance.wp.size = e.data.text
me.parent.systemsetting.appearance.wp.size = e.data.item.get("data").text
me.parent._gui.wallpaper()
sizes = [
@ -51,46 +55,45 @@ class AppearanceHandler extends SettingHandler
{ text: "auto", selected: me.parent.systemsetting.appearance.wp.size is "auto" },
{ text: "contain", selected: me.parent.systemsetting.appearance.wp.size is "contain" }
]
@wpsize.set "items", sizes
@wpsize.set "data", sizes
repeats = [
{ text: "repeat", selected: me.parent.systemsetting.appearance.wp.repeat is "repeat" },
{ text: "repeat-x", selected: me.parent.systemsetting.appearance.wp.repeat is "repeat-x" },
{ text: "repeat-y", selected: me.parent.systemsetting.appearance.wp.repeat is "repeat-y" },
{ text: "no-repeat", selected: me.parent.systemsetting.appearance.wp.repeat is "no-repeat" }
]
@wprepeat.set "items", repeats
@wprepeat.set "onlistselect", (e) ->
me.parent.systemsetting.appearance.wp.repeat = e.data.text
me.parent.systemsetting.appearance.wp.repeat = e.data.item.get("data").text
me.parent._gui.wallpaper()
@wprepeat.set "data", repeats
@themelist.set "items" , [{ text: "antos", selected: true }]
@themelist.set "data" , [{ text: "antos", selected: true }]
render: () ->
me = @
if not @syswp
path = "os://resources/themes/system/wp"
path.asFileHandler().read (d) ->
me.parent.error __("Cannot read wallpaper list from {0}", path) if d.error
for v in d.result
v.text = v.filename
v.selected = true if v.path is me.parent.systemsetting.appearance.wp.url
v.iconclass = "fa fa-file-image-o"
me.syswp = d.result
me.wplist.set "items", me.getwplist()
path.asFileHandle().read()
.then (d) ->
return me.parent.error __("Cannot read wallpaper list from {0}", path) if d.error
for v in d.result
v.text = v.filename
v.iconclass = "fa fa-file-image-o"
me.syswp = d.result
me.wplist.set "data", me.getwplist()
.catch (e) -> me.parent.error e.stack
else
me.wplist.set "items", me.getwplist()
me.wplist.set "data", me.getwplist()
getwplist: () ->
list = []
for v in @parent.systemsetting.appearance.wps
file = v.asFileHandler()
file = v.asFileHandle()
list.push
text: file.basename,
path: file.path
selected: file.path is @parent.systemsetting.appearance.wp.url,
iconclass: "fa fa-file-image-o"
list = list.concat @syswp
v.selected = v.path is @parent.systemsetting.appearance.wp.url for v in list
return list

View File

@ -16,24 +16,24 @@
# You should have received a copy of the GNU General Public License
#along with this program. If not, see https://www.gnu.org/licenses/.
class LocaleHandler extends SettingHandler
constructor:(scheme, parent) ->
class LocaleHandle extends SettingHandle
constructor: (scheme, parent) ->
super(scheme, parent)
me = @
@lglist = @find "lglist"
@localelist = undefined
@lglist.set "onlistselect", (e) ->
me.parent._api.setLocale e.data.text
render: () ->
me = @
me.parent._api.setLocale e.data.item.get("data").text
if not @localelist
path = "os://resources/languages"
path.asFileHandler().read (d) ->
path.asFileHandle().read()
.then (d) ->
return me.parent.error __("Cannot fetch system locales: {0}", d.error) if d.derror
for v in d.result
v.text = v.filename.replace /\.json$/g, ""
v.selected = v.text is me.parent.systemsetting.system.locale
me.localelist = d.result
me.lglist.set "items", me.localelist
me.lglist.set "data", me.localelist
.catch (e) -> me.parent.error e.stack
else
me.lglist.set "items", me.localelist
me.lglist.set "data", me.localelist

View File

@ -1,10 +1,10 @@
coffee_files = main.coffee AppearanceHandler.coffee VFSHandler.coffee LocaleHandler.coffee StartupHandler.coffee
coffee_files = main.coffee AppearanceHandle.coffee VFSHandle.coffee LocaleHandle.coffee StartupHandle.coffee
jsfiles =
cssfiles = main.css
copyfiles = scheme.html package.json schemes
copyfiles = scheme.html package.json
PKG_NAME=Setting

View File

@ -16,8 +16,8 @@
# You should have received a copy of the GNU General Public License
#along with this program. If not, see https://www.gnu.org/licenses/.
class StartupHandler extends SettingHandler
constructor:(scheme, parent) ->
class StartupHandle extends SettingHandle
constructor: (scheme, parent) ->
super(scheme, parent)
me = @
@srvlist = @find "srvlist"
@ -28,19 +28,22 @@ class StartupHandler extends SettingHandler
services = []
for k, v of me.parent.systemsetting.system.packages
if v.services
srvs = ({ text: "#{k}/#{x}", iconclass:"fa fa-tasks" } for x in v.services)
srvs = ({ text: "#{k}/#{x}", iconclass: "fa fa-tasks" } for x in v.services)
services = services.concat srvs
me.parent.openDialog me.mkdialog(), (d) ->
me.parent.systemsetting.system.startup.services.push d
me.render()
, "__(Add service)", services
me.parent.openDialog("SelectionDialog", {
title: "__(Add service)",
data: services
}).then (d) ->
me.parent.systemsetting.system.startup.services.push d.text
me.refresh()
},
{
text: "-", onbtclick: (e) ->
selidx = me.srvlist.get "selidx"
return unless selidx >= 0
me.parent.systemsetting.system.startup.services.splice selidx,1
me.render()
item = me.srvlist.get "selectedItem"
return unless item
selidx = $(item).index()
me.parent.systemsetting.system.startup.services.splice selidx, 1
me.refresh()
}
]
@ -48,23 +51,27 @@ class StartupHandler extends SettingHandler
{
text: "+", onbtclick: (e) ->
apps = ( { text: k, iconclass: v.iconclass } for k, v of me.parent.systemsetting.system.packages )
me.parent.openDialog me.mkdialog(), (d) ->
me.parent.systemsetting.system.startup.apps.push d
me.render()
, "__(Add application)", apps
me.parent.openDialog("SelectionDialog", {
title: "__(Add application)",
data: apps
}).then (d) ->
me.parent.systemsetting.system.startup.apps.push d.text
me.refresh()
},
{
text: "-", onbtclick: (e) ->
selidx = me.applist.get "selidx"
return unless selidx >= 0
me.parent.systemsetting.system.startup.apps.splice selidx,1
me.render()
item = me.applist.get "selectedItem"
return unless item
selidx = $(item).index()
me.parent.systemsetting.system.startup.apps.splice selidx, 1
me.refresh()
}
]
@refresh()
render: () ->
@srvlist.set "items", ( { text:v } for v in @parent.systemsetting.system.startup.services )
@applist.set "items", ( { text:v } for v in @parent.systemsetting.system.startup.apps )
refresh: () ->
@srvlist.set "data", ( { text:v } for v in @parent.systemsetting.system.startup.services )
@applist.set "data", ( { text:v } for v in @parent.systemsetting.system.startup.apps )
mkdialog: () ->

View File

@ -0,0 +1,150 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# You should have received a copy of the GNU General Public License
#along with this program. If not, see https://www.gnu.org/licenses/.
class VFSSettingDialog extends this.OS.GUI.BasicDialog
constructor: () ->
super "VFSSettingDialog", VFSSettingDialog.scheme
init: () ->
me = @
$(@find("txtPath")).click (e) ->
me.openDialog("FileDialog", {
title: "__(Select a directory)",
mimes: ["dir"],
hidden: true
})
.then (d) ->
(me.find "txtPath").value = d.file.path
@find("btnOk").set "onbtclick", (e) ->
data = {
path: (me.find "txtPath").value,
name: (me.find "txtName").value
}
return me.error __("Please enter mount point name") unless data.name and data.name isnt ""
return me .error __("Please select a directory") unless data.path and data.path isnt ""
me.handle(data) if me.handle
me.quit()
(@find "btnCancel").set "onbtclick", (e) ->
me.quit()
return unless @data
(@find "txtName").value = @data.text if @data.text
(@find "txtPath").value = @data.path if @data.path
VFSSettingDialog.scheme = """
<afx-app-window width='250' height='180' apptitle = "__(Mount Points)">
<afx-vbox>
<afx-hbox>
<div data-width = "10" />
<afx-vbox>
<div data-height="10" />
<afx-label data-height="30" text = "__(Name)" />
<input type = "text" data-id= "txtName" />
<div data-height="3" />
<afx-label data-height="30" text = "__(Path)" />
<input type = "text" data-id= "txtPath" />
<div data-height="10" />
<afx-hbox data-height="30">
<div />
<afx-button data-id = "btnOk" text = "__(Ok)" data-width = "40" />
<afx-button data-id = "btnCancel" text = "__(Cancel)" data-width = "50" />
</afx-hbox>
</afx-vbox>
<div data-width = "10" />
</afx-hbox>
</afx-vbox>
</afx-app-window>
"""
class VFSHandle extends SettingHandle
constructor: (scheme, parent) ->
super(scheme, parent)
me = @
@mplist = @find "mplist"
@dpath = @find "dpath"
@ppath = @find "ppath"
@mplist.set "buttons", [
{
text: "+",
onbtclick: (e) ->
me.parent.openDialog(new VFSSettingDialog(), {
title: "__(Add mount point)"
})
.then (d) ->
me.parent.systemsetting.VFS.mountpoints.push {
text: d.name, path: d.path, iconclass: "fa fa-folder", type: "fs"
}
me.refresh()
},
{
text: "-",
onbtclick: (e) ->
item = me.mplist.get "selectedItem"
return unless item
selidx = $(item).index()
me.parent.openDialog("YesNoDialog", {
title: "__(Remove)",
text: __("Remove: {0}?", item.get("data").text)
}).then (d) ->
return unless d
me.parent.systemsetting.VFS.mountpoints.splice selidx, 1
me.refresh()
},
{
text: "",
iconclass: "fa fa-pencil",
onbtclick: (e) ->
sel = me.mplist.get "selectedItem"
return unless sel
me.parent.openDialog(new VFSSettingDialog(), {
title: "__(Edit mount point)",
text: sel.get("data").text,
path: sel.get("data").path
}).then (d) ->
sel.get("data").text = d.name
sel.get("data").path = d.path
me.refresh()
}
]
(@find "btndpath").set 'onbtclick', (e) ->
me.parent.openDialog("FileDialog", {
title: "__(Select a directory)",
mimes: ["dir"],
hidden: true
}).then (d) ->
me.parent.systemsetting.desktop.path = d.file.path
me.parent._gui.refreshDesktop()
me.refresh()
(@find "btnppath").set 'onbtclick', (e) ->
me.parent.openDialog("FileDialog", {
title: "__(Select a directory)",
mimes: ["dir"],
hidden: true
}).then (d) ->
me.parent.systemsetting.system.pkgpaths.user = d.file.path
me.refresh()
me.refresh()
refresh: () ->
me = @
@mplist.set "data", @parent.systemsetting.VFS.mountpoints
@dpath.set "text", @parent.systemsetting.desktop.path
@ppath.set "text", @parent.systemsetting.system.pkgpaths.user

View File

@ -1,117 +0,0 @@
# Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
# AnTOS Web desktop is is licensed under the GNU General Public
# License v3.0, see the LICENCE file for more information
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# You should have received a copy of the GNU General Public License
#along with this program. If not, see https://www.gnu.org/licenses/.
class VFSHandler extends SettingHandler
constructor:(scheme, parent) ->
super(scheme, parent)
me = @
@mplist = @find "mplist"
@dpath = @find "dpath"
@ppath = @find "ppath"
@mplist.set "buttons", [
{
text: "+",
onbtclick: (e) ->
me.parent.openDialog me.mkdialog(), (d) ->
me.parent.systemsetting.VFS.mountpoints.push {
text: d.name, path: d.path, iconclass: "fa fa-folder", type: "fs"
}
me.render()
, "__(Add mount point)"
},
{
text: "-",
onbtclick: (e) ->
selidx = me.mplist.get "selidx"
sel = me.mplist.get "selected"
return unless selidx >= 0
me.parent.openDialog "YesNoDialog", (d) ->
return unless d
me.parent.systemsetting.VFS.mountpoints.splice selidx, 1
me.render()
, "__(Remove)", { text: __("Remove: {0}?", sel.text) }
},
{
text: "",
iconclass: "fa fa-pencil",
onbtclick: (e) ->
sel = me.mplist.get "selected"
return unless sel
me.parent.openDialog me.mkdialog(), (d) ->
d.el.text = d.name
d.el.path = d.path
me.render()
, "__(Edit mount point)", sel
}
]
(@find "btndpath").set 'onbtclick', (e) ->
me.parent.openDialog "FileDiaLog", (d, n, p) ->
me.parent.systemsetting.desktop.path = p
me.parent._gui.refreshDesktop()
me.render()
, "__(Select a directory)", { mimes: ["dir"], hidden: true }
(@find "btnppath").set 'onbtclick', (e) ->
me.parent.openDialog "FileDiaLog", (d, n, p) ->
me.parent.systemsetting.system.pkgpaths.user = p
me.render()
, "__(Select a directory)", { mimes: ["dir"], hidden: true }
render: () ->
me = @
@mplist.set "items", @parent.systemsetting.VFS.mountpoints
@dpath.set "text", @parent.systemsetting.desktop.path
@ppath.set "text", @parent.systemsetting.system.pkgpaths.user
mkdialog: () ->
return @parent._gui.mkdialog {
name: "MountPointDialog",
layout: {
tags: [
{ tag: "afx-label", att: 'text="__(Name)" data-height="20"' },
{ tag: "input", att: "type='text' data-height='25'" },
{ tag: "afx-label", att: 'text="__(Path)" data-height="20"' },
{ tag: "input", att: "type='text' data-height='25'" }
],
width: 250,
height: 150,
resizable: false,
buttons: [
{
label: "__(Ok)", onclick: (d) ->
data = {
name: (d.find "content1").value,
path: (d.find "content3").value,
el: d.data
}
return d.error __("Please enter mount point name") unless data.name and data.name isnt ""
return d.error __("Please select a directory") unless data.path and data.path isnt ""
d.handler(data) if d.handler
d.quit()
},
{ label: "__(Cancel)", onclick: (d) -> d.quit() }
],
filldata: (dia) ->
$(dia.find "content3").click (e) ->
dia.openDialog "FileDiaLog", (d, n, p) ->
(dia.find "content3").value = p
, "__(Select a directory)", { mimes: ["dir"], hidden: true }
return unless dia.data
(dia.find "content1").value = dia.data.text if dia.data.text
(dia.find "content3").value = dia.data.path if dia.data.path
}
}

View File

@ -16,15 +16,13 @@
# You should have received a copy of the GNU General Public License
#along with this program. If not, see https://www.gnu.org/licenses/.
class SettingHandler
constructor:(@scheme, @parent) ->
class SettingHandle
constructor: (@scheme, @parent) ->
find: (id) -> ($ "[data-id='#{id}']", @scheme)[0] if @scheme
render: () ->
class Setting extends this.OS.GUI.BaseApplication
constructor: (args) ->
super "Setting", args
@ -32,39 +30,18 @@ class Setting extends this.OS.GUI.BaseApplication
main: () ->
me = @
@container = @find "container"
@container.setTabs [
{
text: "__(Appearance)",
iconclass: "fa fa-paint-brush",
url: "#{@path()}/schemes/appearance.html",
handler: (sch) ->
new AppearanceHandler sch, me
},
{
text: "__(VFS)",
iconclass: "fa fa-inbox" ,
url: "#{@path()}/schemes/vfs.html" ,
handler: (sch) ->
new VFSHandler sch, me
},
{
text: "__(Languages)",
iconclass: "fa fa-globe",
url: "#{@path()}/schemes/locale.html",
handler: (sch) ->
new LocaleHandler sch, me
},
{
text: "__(Startup)",
iconclass: "fa fa-cog",
url: "#{@path()}/schemes/startup.html",
handler: (sch) ->
new StartupHandler sch,me
}
]
new AppearanceHandle @find("appearance"), @
new VFSHandle @find("vfs"), @
new LocaleHandle @find("locale"), @
new StartupHandle @find("startup"), @
(@find "btnsave").set "onbtclick", (e) ->
me._api.setting (d) ->
return me.error __("Cannot save system setting: {0}", d.error) if d.error
me.notify __("System setting saved")
me._api.setting()
.then (d) ->
return me.error __("Cannot save system setting: {0}", d.error) if d.error
me.notify __("System setting saved")
.catch (e) ->
me.error __("Cannot save system setting: {0}", e.stack)
Setting.singleton = true
this.OS.register "Setting", Setting

View File

@ -1,4 +1,4 @@
afx-app-window[data-id = "setting-window"] afx-tab-container afx-tab-bar afx-list-view > div > ul > li{
afx-app-window[data-id = "setting-window"] afx-tab-container afx-tab-bar afx-list-view > div > ul li{
float:none;
border-radius: 0;
font-weight: bold;
@ -6,8 +6,8 @@ afx-app-window[data-id = "setting-window"] afx-tab-container afx-tab-bar afx-lis
padding-bottom: 3px;
border:0;
}
afx-app-window[data-id = "setting-window"] afx-tab-container div[data-ref="container"]{
border-left: 1px solid #cbcbcb;
afx-app-window[data-id = "setting-window"] afx-tab-bar{
border-right: 1px solid #cbcbcb;
}
afx-app-window[data-id = "setting-window"] afx-label.header{
@ -17,39 +17,39 @@ afx-app-window[data-id = "setting-window"] div.footer{
border-right: 1px solid #cbcbcb;
}
/*APPEARANCE*/
afx-app-window[data-id = "setting-window"] afx-vbox[data-id="appearance"] div[data-id = "wp-preview"]{
afx-app-window[data-id = "setting-window"] afx-hbox[data-id="appearance"] div[data-id = "wp-preview"]{
display: block;
border:1px solid #cbcbcb;
border-radius: 10px;
}
afx-app-window[data-id = "setting-window"] afx-vbox[data-id="appearance"] afx-list-view[data-id="wplist"]
afx-app-window[data-id = "setting-window"] afx-hbox[data-id="appearance"] afx-list-view[data-id="wplist"]
{
border:1px solid #cbcbcb;
padding:2px;
}
afx-app-window[data-id = "setting-window"] afx-vbox[data-id="appearance"] afx-resizer{
afx-app-window[data-id = "setting-window"] afx-hbox[data-id="appearance"] afx-resizer{
border:0;
background-color: transparent;
}
/*VFS*/
afx-app-window[data-id = "setting-window"] afx-vbox[data-id="vfs"] afx-list-view[data-id="mplist"]
afx-app-window[data-id = "setting-window"] afx-hbox[data-id="vfs"] afx-list-view[data-id="mplist"]
{
border: 1px solid #cbcbcb;
}
afx-app-window[data-id = "setting-window"] afx-vbox[data-id="vfs"] afx-button.btnsel button{
afx-app-window[data-id = "setting-window"] afx-hbox[data-id="vfs"] afx-button.btnsel button{
border-radius: 0;
padding-top:2px;
padding-bottom: 2px;
}
/*LANGUAGES*/
afx-app-window[data-id = "setting-window"] afx-vbox[data-id="locale"] afx-list-view[data-id="lglist"]
afx-app-window[data-id = "setting-window"] afx-hbox[data-id="locale"] afx-list-view[data-id="lglist"]
{
border: 1px solid #cbcbcb;
}
/*STARTUP*/
afx-app-window[data-id = "setting-window"] afx-vbox[data-id="startup"] afx-list-view
afx-app-window[data-id = "setting-window"] afx-hbox[data-id="startup"] afx-list-view
{
border: 1px solid #cbcbcb;
}

View File

@ -1,6 +1,83 @@
<afx-app-window data-id = "setting-window" apptitle="Setting" width="600" height="400">
<afx-vbox>
<afx-tab-container data-id = "container" barwidth="120" bar="left"></afx-tab-container>
<afx-tab-container data-id = "container" dir = "row" tabbarwidth= "120">
<afx-hbox tabname="__(Appearance)" data-id="appearance" iconclass = "fa fa-paint-brush">
<div data-width="10"></div>
<afx-vbox>
<div data-height="5"></div>
<afx-label text = "__(Wallpaper)" iconclass = "fa fa-image" class = "header" data-height="23"></afx-label>
<afx-hbox>
<afx-list-view data-width="150" data-id="wplist"></afx-list-view>
<afx-resizer data-width="2"></afx-resizer>
<afx-vbox>
<div data-id = "wp-preview"></div>
<div data-height="5"></div>
<afx-hbox data-height="25">
<afx-list-view data-id = "wpsize" dropdown="true"></afx-list-view>
<div data-width="5"></div>
<afx-list-view data-id = "wprepeat" dropdown="true"></afx-list-view>
</afx-hbox>
</afx-vbox>
</afx-hbox>
<div data-height="5"></div>
<afx-label text = "__(Theme)" iconclass = "fa fa-window-restore" class = "header" data-height="23"></afx-label>
<afx-list-view data-height="30" data-id="theme-list" dropdown="true"></afx-list-view>
<div data-height="5"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
<afx-hbox data-id="vfs" tabname = "__(VFS)" iconclass = "fa fa-inbox">
<div data-width="10"></div>
<afx-vbox>
<div data-height="5"></div>
<afx-label text = "__(Mount points)" iconclass = "fa fa-folder" class = "header" data-height="23"></afx-label>
<afx-list-view data-id="mplist"></afx-list-view>
<div data-height="5"></div>
<afx-label text = "__(Desktop path)" iconclass = "fa fa-desktop" class = "header" data-height="23"></afx-label>
<afx-hbox data-height = "25" >
<div data-width="16"></div>
<afx-label data-id="dpath"></afx-label>
<afx-button text="" iconclass = "fa fa-arrow-up" data-id="btndpath" data-width="20" class="btnsel"></afx-button>
</afx-hbox>
<div data-height="5"></div>
<afx-label text = "__(Local packages path)" iconclass = "fa fa-cube" class = "header" data-height="23"></afx-label>
<afx-hbox data-height = "25" >
<div data-width="16"></div>
<afx-label data-id="ppath"></afx-label>
<afx-button text="" data-id="btnppath" iconclass = "fa fa-arrow-up" data-width="20" class="btnsel"></afx-button>
</afx-hbox>
<div data-height="10"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
<afx-hbox data-id="locale" tabname = "__(Languages)"iconclass = "fa fa-globe">
<div data-width="10"></div>
<afx-vbox>
<div data-height="5"></div>
<afx-label text = "__(System locale)" iconclass = "fa fa-globe" class = "header" data-height="23"></afx-label>
<afx-list-view data-id="lglist"></afx-list-view>
<div data-height="10"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
<afx-hbox data-id="startup" tabname = "__(Startup)" iconclass = "fa fa-cog">
<div data-width="10"></div>
<afx-vbox>
<afx-label text = "__(Startup services)" iconclass = "fa fa-tasks" class = "header" data-height="23"></afx-label>
<afx-list-view data-id="srvlist"></afx-list-view>
<div data-height="5"></div>
<afx-label text = "__(Startup applications)" iconclass = "fa fa-adn" class = "header" data-height="23"></afx-label>
<afx-list-view data-id="applist"></afx-list-view>
<div data-height="10"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
</afx-tab-container>
<afx-hbox data-height="35">
<div data-width = "120" class = "footer"></div>
<div style="text-align:right" >

View File

@ -1,27 +0,0 @@
<afx-vbox data-id="appearance">
<div data-height="5"></div>
<afx-hbox>
<div data-width="10"></div>
<afx-vbox>
<afx-label text = "__(Wallpaper)" iconclass = "fa fa-image" class = "header" data-height="23"></afx-label>
<afx-hbox>
<afx-list-view data-width="150" data-id="wplist"></afx-list-view>
<afx-resizer data-width="5"></afx-resizer>
<afx-vbox>
<div data-id = "wp-preview"></div>
<div data-height="5"></div>
<afx-hbox data-height="25">
<afx-list-view data-id = "wpsize" dropdown="true"></afx-list-view>
<div data-width="5"></div>
<afx-list-view data-id = "wprepeat" dropdown="true"></afx-list-view>
</afx-hbox>
</afx-vbox>
</afx-hbox>
<div data-height="5"></div>
<afx-label text = "__(Theme)" iconclass = "fa fa-window-restore" class = "header" data-height="23"></afx-label>
<afx-list-view data-height="30" data-id="theme-list" dropdown="true"></afx-list-view>
<div data-height="5"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
</afx-vbox>

View File

@ -1,12 +0,0 @@
<afx-vbox data-id="locale">
<div data-height="5"></div>
<afx-hbox>
<div data-width="10"></div>
<afx-vbox>
<afx-label text = "__(System locale)" iconclass = "fa fa-globe" class = "header" data-height="23"></afx-label>
<afx-list-view data-id="lglist"></afx-list-view>
<div data-height="10"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
</afx-vbox>

View File

@ -1,15 +0,0 @@
<afx-vbox data-id="startup">
<div data-height="5"></div>
<afx-hbox>
<div data-width="10"></div>
<afx-vbox>
<afx-label text = "__(Startup services)" iconclass = "fa fa-tasks" class = "header" data-height="23"></afx-label>
<afx-list-view data-id="srvlist"></afx-list-view>
<div data-height="5"></div>
<afx-label text = "__(Startup applications)" iconclass = "fa fa-adn" class = "header" data-height="23"></afx-label>
<afx-list-view data-id="applist"></afx-list-view>
<div data-height="10"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
</afx-vbox>

View File

@ -1,26 +0,0 @@
<afx-vbox data-id="vfs">
<div data-height="5"></div>
<afx-hbox>
<div data-width="10"></div>
<afx-vbox>
<afx-label text = "__(Mount points)" iconclass = "fa fa-folder" class = "header" data-height="23"></afx-label>
<afx-list-view data-id="mplist"></afx-list-view>
<div data-height="5"></div>
<afx-label text = "__(Desktop path)" iconclass = "fa fa-desktop" class = "header" data-height="23"></afx-label>
<afx-hbox data-height = "25" >
<div data-width="16"></div>
<afx-label data-id="dpath"></afx-label>
<afx-button text="" iconclass = "fa fa-arrow-up" data-id="btndpath" data-width="20" class="btnsel"></afx-button>
</afx-hbox>
<div data-height="5"></div>
<afx-label text = "__(Local packages path)" iconclass = "fa fa-cube" class = "header" data-height="23"></afx-label>
<afx-hbox data-height = "25" >
<div data-width="16"></div>
<afx-label data-id="ppath"></afx-label>
<afx-button text="" data-id="btnppath" iconclass = "fa fa-arrow-up" data-width="20" class="btnsel"></afx-button>
</afx-hbox>
<div data-height="10"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
</afx-vbox>

View File

@ -8,13 +8,13 @@ class ShowCase extends this.OS.GUI.BaseApplication
bt = @find 'bttest'
bt.set "onbtclick", (e) ->
console.log "btclicked"
me.notify "btclicked"
@observable.on "btclick", (e) ->
console.log "button clicked"
me.notify "button clicked"
@observable.on "menuselect", (e) ->
console.log e.id
me.notify e.id
list = @find 'list'
@ -27,19 +27,15 @@ class ShowCase extends this.OS.GUI.BaseApplication
{ text: "some thing 5" }
]
list.unshift { text: "shifted el" }
list.set "onlistselect", (e) -> console.log(e.data.items)
@observable.on "itemclose", (e) ->
console.log "remove", list.get("data")
console.log list[0].get "selectedItem"
console.log list[0].get "selectedItems"
list.set "onlistselect", (e) -> me.notify(e.data.items)
sw = @find 'switch'
sw.set "onchange", (e) ->
console.log e.data
me.notify e.data
spin = @find 'spin'
spin.set "onchange", (e) ->
console.log e.data
me.notify e.data
menu = @find 'menu'
menu.set "items", @menu()
@ -50,12 +46,12 @@ class ShowCase extends this.OS.GUI.BaseApplication
grid = @find 'grid'
grid.set "oncelldbclick", (e) ->
console.log "on dbclick", e
me.notify "on dbclick", e
grid.set "onrowselect", (e) ->
console.log "on rowselect", e.data.items
me.notify "on rowselect", e.data.items
@observable.on "cellselect", (e) ->
console.log "observable", e
console.log "observable", e
grid.set "header", [{ text: "header1", width: 80 }, { text: "header2" }, { text: "header3" }]
grid.set "rows", [
@ -104,25 +100,25 @@ class ShowCase extends this.OS.GUI.BaseApplication
tree = @find 'tree'
tree.set "data", tdata
tree.set "ontreeselect", (e) ->
console.log e.data.item.get "treepath"
me.notify e.data.item.get "treepath"
tree.set "ontreedbclick", (e) ->
console.log "treedbclick", e
me.notify "treedbclick", e
@observable.on "treedbclick", (e) ->
console.log "observable treedbclick", e
me.notify "observable treedbclick", e
slider = @find 'slider'
slider.set "onchanging", (v) ->
console.log v
slider.set "onchange", (v) ->
me.notify v
cal = @find 'cal'
cal.set "ondateselect", (e) ->
console.log e
me.notify e
pk = @find 'cpk'
pk.set "oncolorselect", (e) ->
console.log e
me.notify e
pk.set "oncolorselect", (e) ->
console.log e
me.notify e
fileview = @find 'fileview'
fileview.set "fetch", (path) ->
@ -144,7 +140,7 @@ class ShowCase extends this.OS.GUI.BaseApplication
{ text: "tree" }
]
viewoption.set "onlistselect", (e) ->
console.log e.data.item.get("data").text
me.notify e.data.item.get("data").text
fileview.set "view", e.data.item.get("data").text
dllist = @find "dialoglist"
@ -172,17 +168,17 @@ class ShowCase extends this.OS.GUI.BaseApplication
label: "enter value"
})
.then (d) ->
console.log d
me.notify d
when "calendar"
me.openDialog("CalendarDialog", {
title: "Calendar"
})
.then (d) ->
console.log d
me.notify d
when "colorpicker"
me.openDialog("ColorPickerDialog")
.then (d) ->
console.log d
me.notify d
when "info"
me.openDialog("InfoDialog", {
title: "Info application",
@ -197,7 +193,7 @@ class ShowCase extends this.OS.GUI.BaseApplication
text: "Do you realy want to delete file ?"
})
.then (d) ->
console.log d
me.notify d
when "selection"
me.openDialog("SelectionDialog", {
title: "Select data ?",
@ -208,7 +204,7 @@ class ShowCase extends this.OS.GUI.BaseApplication
]
})
.then (d) ->
console.log d
me.notify d.text
when "about"
me.openDialog("AboutDialog" )
.then (d) ->
@ -220,13 +216,13 @@ class ShowCase extends this.OS.GUI.BaseApplication
file: "Untitled".asFileHandle()
})
.then (f, name) ->
console.log f, name
me.notify f, name
else return
mnFile: () ->
#console.log file
#me.notify file
me = @
arr = {
text: "__(File)",
@ -238,7 +234,7 @@ class ShowCase extends this.OS.GUI.BaseApplication
{ text: "__(Download)", dataid: "#{@name}-download" },
{ text: "__(Share file)", dataid: "#{@name}-share", shortcut: 'C-S' },
{ text: "__(Properties)", dataid: "#{@name}-info", shortcut: 'C-I' }
], onchildselect: (e) -> console.log "child", e
], onchildselect: (e) -> me.notify "child", e
}
return arr
mnEdit: () ->
@ -251,7 +247,7 @@ class ShowCase extends this.OS.GUI.BaseApplication
{ text: "__(Cut)", dataid: "#{@name}-cut", shortcut: 'C-X' },
{ text: "__(Copy)", dataid: "#{@name}-copy", shortcut: 'C-C' },
{ text: "__(Paste)", dataid: "#{@name}-paste", shortcut: 'C-P' }
], onchildselect: (e) -> console.log "child", e
], onchildselect: (e) -> console.log "child", e
}
menu: () ->