Finish package setting & add FR language

This commit is contained in:
Xuan Sang LE 2018-03-12 18:55:40 +01:00
parent 7fd6492a31
commit d310d2c03b
26 changed files with 888 additions and 249 deletions

View File

@ -59,7 +59,7 @@ class BasicDialog extends BaseDialog
html += "<#{v.tag} #{v.att} style = 'margin-left:5px; margin-right:5px;' data-id = 'content#{k}'></#{v.tag}>" for k,v of @conf.tags html += "<#{v.tag} #{v.att} style = 'margin-left:5px; margin-right:5px;' data-id = 'content#{k}'></#{v.tag}>" for k,v of @conf.tags
html += "<div data-height = '30' style=' text-align:right;padding-top:3px;'>" html += "<div data-height = '30' style=' text-align:right;padding-top:3px;'>"
html += "<afx-button data-id = 'bt#{k}' text = '#{v.label}' style='margin-right:5px;'></afx-button>" for k,v of @conf.buttons html += "<afx-button data-id = 'bt#{k}' text = '#{v.label}' style='margin-right:5px;'></afx-button>" for k,v of @conf.buttons
html += "</div><div data-height='2'></div></afx-vbox></afx-app-window>" html += "</div><div data-height='5'></div></afx-vbox></afx-app-window>"
#render the html #render the html
_GUI.htmlToScheme html, @, @host _GUI.htmlToScheme html, @, @host
@ -283,7 +283,6 @@ class FileDiaLog extends BaseDialog
location.set "items", ( i for i in @systemsetting.VFS.mountpoints when i.type isnt "app" ) location.set "items", ( i for i in @systemsetting.VFS.mountpoints when i.type isnt "app" )
location.set "selected", 0 unless location.get "selected" location.set "selected", 0 unless location.get "selected"
fileview.set "onfileselect", (f) -> fileview.set "onfileselect", (f) ->
($ filename).val f.filename if f.type is "file" ($ filename).val f.filename if f.type is "file"
(@find "bt-ok").set "onbtclick", (e) -> (@find "bt-ok").set "onbtclick", (e) ->
f = fileview.get "selectedFile" f = fileview.get "selectedFile"
@ -308,5 +307,6 @@ class FileDiaLog extends BaseDialog
if @data and @data.file if @data and @data.file
($ filename).css("display", "block").val @data.file.basename or "Untitled" ($ filename).css("display", "block").val @data.file.basename or "Untitled"
@trigger "resize" @trigger "resize"
fileview.set "showhidden", @data.hidden if @data and @data.hidden
this.OS.register "FileDiaLog", FileDiaLog this.OS.register "FileDiaLog", FileDiaLog

View File

@ -44,10 +44,13 @@ class BaseModel
if @dialog if @dialog
@dialog.show() @dialog.show()
return return
if typeof d is "string"
if not _GUI.subwindows[d] if not _GUI.subwindows[d]
@error __("Dialog {0} not found", d) @error __("Dialog {0} not found", d)
return return
@dialog = new _GUI.subwindows[d]() @dialog = new _GUI.subwindows[d]()
else
@dialog = d
#@dialog.observable = riot.observable() unless @dialog #@dialog.observable = riot.observable() unless @dialog
@dialog.parent = @ @dialog.parent = @
@dialog.handler = f @dialog.handler = f

View File

@ -276,7 +276,8 @@ self.OS.API =
_API.handler.packages { _API.handler.packages {
command: "cache", args: { paths: (v for k, v of _OS.setting.system.pkgpaths) } command: "cache", args: { paths: (v for k, v of _OS.setting.system.pkgpaths) }
}, f }, f
setting: (f) ->
_API.handler.setting f
search: (text) -> search: (text) ->
r = [] r = []

View File

@ -124,7 +124,7 @@ self.OS or=
exit: -> exit: ->
#do clean up first #do clean up first
f() for n, f of _OS.cleanupHandlers f() for n, f of _OS.cleanupHandlers
_API.handler.setting () -> _API.handler.setting (r) ->
_API.handler.logout() _API.handler.logout()
onexit: (n, f) -> onexit: (n, f) ->
self.OS.cleanupHandlers[n] = f unless self.OS.cleanupHandlers[n] self.OS.cleanupHandlers[n] = f unless self.OS.cleanupHandlers[n]

View File

@ -265,6 +265,7 @@ self.OS.GUI =
fp = _OS.setting.desktop.path.asFileHandler() fp = _OS.setting.desktop.path.asFileHandler()
desktop[0].fetch = () -> desktop[0].fetch = () ->
fn = () -> fn = () ->
fp = _OS.setting.desktop.path.asFileHandler()
fp.read (d) -> fp.read (d) ->
return _courrier.osfail d.error, (_API.throwe "OS.VFS"), d.error if d.error return _courrier.osfail d.error, (_API.throwe "OS.VFS"), d.error if d.error
items = [] items = []
@ -341,7 +342,8 @@ self.OS.GUI =
, (e, s) -> , (e, s) ->
alert __("System fail: Cannot init desktop manager") alert __("System fail: Cannot init desktop manager")
console.log s, e console.log s, e
refreshDesktop: () ->
($ "#desktop")[0].fetch()
refreshSystemMenu: () -> refreshSystemMenu: () ->
_GUI.SYS_MENU.length = 1 _GUI.SYS_MENU.length = 1
_GUI.SYS_MENU[0].child.length = 0 _GUI.SYS_MENU[0].child.length = 0
@ -370,6 +372,8 @@ self.OS.GUI =
#console.log menu #console.log menu
mkdialog: (conf) ->
return new _GUI.BasicDialog conf.name, conf.layout
login: () -> login: () ->
_OS.cleanup() _OS.cleanup()

View File

@ -82,10 +82,11 @@ self.OS.API.handler =
p = "#{_REST}/system/settings" p = "#{_REST}/system/settings"
_API.post p, _OS.setting, (d) -> _API.post p, _OS.setting, (d) ->
_courrier.oserror __("Cannot save system setting"), d.error if d.error _courrier.oserror __("Cannot save system setting"), d.error if d.error
f() if f f(d) if f
, (e, s) -> , (e, s) ->
_courrier.osfail __("Fail to make request: {0}", p), e, s m = __("Fail to make request: {0}", p)
f() if f _courrier.osfail m , e, s
f({ error: m }) if f
dbquery: (cmd, d, c) -> dbquery: (cmd, d, c) ->
path = "#{_REST}/db/#{cmd}" path = "#{_REST}/db/#{cmd}"

View File

@ -1,219 +1,248 @@
{ {
"About":"About", "About":"À propos de",
"About: {0}":"About: {0}", "About: {0}":"À propos de: {0}",
"Add category":"Add category", "Add category":"Ajouter une catégorie",
"Add repository":"Add repository", "Add repository":"Ajouter un dépôt",
"Address":"Address", "Address":"Adresse",
"Alive (ms)":"Alive (ms)", "Alive (ms)":"Actif (ms)",
"Application installed":"Application installed", "Application installed":"Application installée",
"Application {0} is not executable":"Application {0} is not executable", "Application {0} is not executable":"L'application {0} n'est pas exécutable",
"Application":"Application", "Application":"Application",
"Applications":"Applications", "Applications":"Applications",
"Authentication":"Authentication", "Authentication":"Authentification",
"Cancel":"Cancel", "Cancel":"Annuler",
"Cannot Edit category":"Cannot Edit category", "Cannot Edit category":"Impossible d'éditer la catégorie",
"Cannot add new category":"Cannot add new category", "Cannot add new category":"Impossible d'ajouter une nouvelle catégorie",
"Cannot create {0}":"Cannot create {0}", "Cannot create {0}":"Impossible de créer {0}",
"Cannot delete all content of: {0} [{1}]":"Cannot delete all content of: {0} [{1}]", "Cannot delete all content of: {0} [{1}]":"Impossible de supprimer tout le contenu de: {0} [{1}]",
"Cannot delete the category: {0} [{1}]":"Cannot delete the category: {0} [{1}]", "Cannot delete the category: {0} [{1}]":"Impossible de supprimer la catégorie: {0} [{1}]",
"Cannot delete the section: {0}":"Cannot delete the section: {0}", "Cannot delete the section: {0}":"Impossible de supprimer la section: {0}",
"Cannot delete: {0}":"Cannot delete: {0}", "Cannot delete: {0}":"Impossible de supprimer: {0}",
"Cannot down load the app {0}":"Cannot down load the app {0}", "Cannot down load the app {0}":"Impossible de télécharger l'application {0}",
"Cannot export file for embedding to text":"Cannot export file for embedding to text", "Cannot export file for embedding to text":"Impossible d'exporter le fichier pour l'intégrer au texte",
"Cannot fetch CV categories":"Cannot fetch CV categories", "Cannot fetch CV categories":"Impossible d'extraire les catégories de CV",
"Cannot fetch the entry content":"Cannot fetch the entry content", "Cannot fetch the entry content":"Impossible d'extraire le contenu",
"Cannot fetch user data":"Cannot fetch user data", "Cannot fetch user data":"Impossible d'extraire les données utilisateur",
"Cannot install {0}":"Cannot install {0}", "Cannot install {0}":"Impossible d'installer {0}",
"Cannot load 3rd library at: {0}":"Cannot load 3rd library at: {0}", "Cannot load 3rd library at: {0}":"Impossible de charger la bibliothèque à: {0}",
"Cannot move section":"Cannot move section", "Cannot move section":"Impossible de déplacer la section",
"Cannot read service script: {0}":"Cannot read service script: {0}", "Cannot read service script: {0}":"Impossible de lire le script de service: {0}",
"Cannot render the PDF file":"Cannot render the PDF file", "Cannot render the PDF file":"Impossible de rendre le fichier PDF",
"Cannot save blog: {0}":"Cannot save blog: {0}", "Cannot save blog: {0}":"Impossible d'enregistrer le blog: {0}",
"Cannot save section: {0}":"Cannot save section: {0}", "Cannot save section: {0}":"Impossible d'enregistrer la section: {0}",
"Cannot save system setting":"Cannot save system setting", "Cannot save system setting":"Impossible d'enregistrer les paramètres du système",
"Cannot save user data":"Cannot save user data", "Cannot save user data":"Impossible d'enregistrer les données utilisateur",
"Cannot share file: {0}":"Cannot share file: {0}", "Cannot share file: {0}":"Impossible de partager le fichier: {0}",
"Cannot uninstall package: {0}":"Cannot uninstall package: {0}", "Cannot uninstall package: {0}":"Impossible de désinstaller le package: {0}",
"Categories":"Categories", "Categories":"Catégories",
"Clear all":"Clear all", "Clear all":"Tout effacer",
"Close tab":"Close tab", "Close tab":"Fermer l'onglet",
"Close without saving ?":"Close without saving ?", "Close without saving ?":"Fermer sans enregistrer?",
"Close":"Close", "Close":"Fermer",
"Copy not yet implemented":"Copy not yet implemented", "Copy not yet implemented":"Copie non encore implémentée",
"Copy":"Copy", "Copy":"Copier",
"Created: {0}":"Created: {0}", "Created: {0}":"Créé: {0}",
"Cut":"Cut", "Cut":"Couper",
"Delete a post":"Delete a post", "Delete a post":"Supprimer le text",
"Delete category":"Delete category", "Delete category":"Supprimer la catégorie",
"Delete section":"Delete section", "Delete section":"Supprimer la section",
"Delete":"Delete", "Delete":"Supprimer",
"Desktop":"Desktop", "Desktop":"Bureau",
"Dialog {0} not found":"Dialog {0} not found", "Dialog {0} not found":"La boîte de dialogue {0} n'a pas été trouvée",
"Do you really want to delete this post ?":"Do you really want to delete this post ?", "Do you really want to delete this post ?":"Voulez-vous vraiment supprimer ce texte ?",
"Do you really want to delete: {0}?":"Do you really want to delete: {0}?", "Do you really want to delete: {0}?":"Voulez-vous vraiment supprimer: {0}?",
"Download":"Download", "Download":"Télécharger",
"Edit category":"Edit category", "Edit category":"Modifier la catégorie",
"Edit repository":"Edit repository", "Edit repository":"Modifier le dépôt",
"Edit":"Edit", "Edit":"Modifier",
"Email":"Email", "Email":"Email",
"Error find app by mimes {0}":"Error find app by mimes {0}", "Error find app by mimes {0}":"Erreur lors de la recherche d'application par mimes {0}",
"Error reading package meta data: {0}":"Error reading package meta data: {0}", "Error reading package meta data: {0}":"Erreur lors de la lecture des métadonnées du package: {0}",
"Error saving file {0}":"Error saving file {0}", "Error saving file {0}":"Erreur lors de l'enregistrement du fichier {0}",
"Exit":"Exit", "Exit":"Quitter",
"Fail to create directory: {0}":"Fail to create directory: {0}", "Fail to create directory: {0}":"Impossible de créer le répertoire: {0}",
"Fail to create {0}: {1}":"Fail to create {0}: {1}", "Fail to create {0}: {1}":"Échec de la création de {0}: {1}",
"Fail to delete {0}: {1}":"Fail to delete {0}: {1}", "Fail to delete {0}: {1}":"Échec de la suppression de {0}: {1}",
"Fail to delete: {0}":"Fail to delete: {0}", "Fail to delete: {0}":"Échec de la suppression: {0}",
"Fail to fetch packages list from: {0}":"Fail to fetch packages list from: {0}", "Fail to fetch packages list from: {0}":"Impossible d'extraire la liste des paquets de: {0}",
"Fail to get file meta data: {0}":"Fail to get file meta data: {0}", "Fail to get file meta data: {0}":"Échec d'obtention des métadonnées de fichier: {0}",
"Fail to make request: {0}":"Fail to make request: {0}", "Fail to make request: {0}":"Echec de la demande: {0}",
"Fail to move file: {0} -> {1}":"Fail to move file: {0} -> {1}", "Fail to move file: {0} -> {1}":"Échec du déplacement du fichier: {0} -> {1}",
"Fail to paste: {0}":"Fail to paste: {0}", "Fail to paste: {0}":"Impossible de coller: {0}",
"Fail to publish file: {0}":"Fail to publish file: {0}", "Fail to publish file: {0}":"Échec de la publication du fichier: {0}",
"Fail to query data from database: {0}":"Fail to query data from database: {0}", "Fail to query data from database: {0}":"Impossible d'interroger les données de la base de données: {0}",
"Fail to read file: {0}":"Fail to read file: {0}", "Fail to read file: {0}":"Impossible de lire le fichier: {0}",
"Fail to rename to {0}: {1}":"Fail to rename to {0}: {1}", "Fail to rename to {0}: {1}":"Impossible de renommer en {0}: {1}",
"Fail to scan directory: {0}":"Fail to scan directory: {0}", "Fail to scan directory: {0}":"Échec de l'analyse du répertoire: {0}",
"Fail to upload file to: {0}":"Fail to upload file to: {0}", "Fail to upload file to: {0}":"Impossible de télécharger le fichier vers: {0}",
"Fail to upload to {0}: {1}":"Fail to upload to {0}: {1}", "Fail to upload to {0}: {1}":"Impossible de télécharger vers {0}: {1}",
"Fail to write to file: {0}":"Fail to write to file: {0}", "Fail to write to file: {0}":"Échec de l'écriture dans le fichier: {0}",
"Fail to {0} package":"Fail to {0} package", "Fail to {0} package":"Échec du {0} paquet",
"File name":"File name", "File name":"Nom de fichier",
"File not found {0}":"File not found {0}", "File not found {0}":"Fichier introuvable {0}",
"File {0} copied":"File {0} copied", "File {0} copied":"Fichier {0} copié",
"File {0} cut":"File {0} cut", "File {0} cut":"Fichier {0} coupé",
"File":"File", "File":"Fichier",
"Folder name":"Folder name", "Folder name":"Nom de dossier",
"Format : [name] url":"Format : [name] url", "Format : [name] url":"Format: [nom] url",
"Found {0} sections":"Found {0} sections", "Found {0} sections":"{0} sections trouvées",
"From":"From", "From":"De",
"Full name must be entered":"Full name must be entered", "Full name must be entered":"Le nom complet doit être entré",
"Full name":"Full name", "Full name":"Nom complet",
"Google Drive":"Google Drive", "Google Drive":"Google Drive",
"Hidden files":"Hidden files", "Hidden files":"Fichiers cachés",
"Home":"Home", "Home":"Accueil",
"Icon view":"Icon view", "Icon view":"Vue d'icône",
"Ignore all {0} unsaved files ?":"Ignore all {0} unsaved files ?", "Ignore all {0} unsaved files ?":"Ignorer tous les {0} fichiers non enregistrés?",
"Install":"Install", "Install":"Installer",
"Invalid package: Meta data file not found":"Invalid package: Meta data file not found", "Invalid package: Meta data file not found":"Paquet invalide: Fichier de métadonnées non trouvé",
"Kill process":"Kill process", "Kill process":"Tuer le processus",
"Language file {0} not found":"Language file {0} not found", "Language file {0} not found":"Fichier de langue {0} introuvable",
"Launch":"Launch", "Launch":"Lancer",
"List view":"List view", "List view":"Vue de liste",
"Location":"Location", "Location":"Localisation",
"Log out":"Log out", "Log out":"Déconnecter",
"Logout":"Logout", "Logout":"Déconnecter",
"Mime type {0} is not supported":"Mime type {0} is not supported", "Mime type {0} is not supported":"Le type MIME {0} n'est pas supporté",
"Modify section entry":"Modify section entry", "Modify section entry":"Modifier le texte",
"Move to":"Move to", "Move to":"Déplacer vers",
"Name":"Name", "Name":"Nom",
"Navigation bar":"Navigation bar", "Navigation bar":"Barre de navigation",
"New file":"New file", "New file":"Nouveau fichier",
"New folder":"New folder", "New folder":"Nouveau dossier",
"New section entry for {0}":"New section entry for {0}", "New section entry for {0}":"Nouvelle entrée de section pour {0}",
"New":"New", "New":"Nouveau",
"No application available to open {0}":"No application available to open {0}", "No application available to open {0}":"Aucune application disponible pour ouvrir {0}",
"No post found: {0}":"No post found: {0}", "No post found: {0}":"Aucun texte trouvé: {0}",
"No":"No", "No":"Non",
"OS":"OS", "OS":"OS",
"Ok":"Ok", "Ok":"Oui",
"Only {0} could be selected":"Only {0} could be selected", "Only {0} could be selected":"Seul {0} peut être sélectionné",
"Open file":"Open file", "Open file":"Ouvrir un fichier",
"Open with":"Open with", "Open with":"Ouvrir avec",
"Open":"Open", "Open":"Ouvrir",
"Options":"Options", "Options":"Options",
"Package uninstalled":"Package uninstalled", "Package uninstalled":"Package désinstallé",
"Parent can not be the category itself":"Parent can not be the category itself", "Parent can not be the category itself":"Parent ne peut pas être la catégorie elle-même",
"Paste":"Paste", "Paste":"Coller",
"Phone":"Phone", "Phone":"Phone",
"Pid":"Pid", "Pid":"Pid",
"Please enter category name":"Please enter category name", "Please enter category name":"Veuillez entrer le nom de la catégorie",
"Please enter tags":"Please enter tags", "Please enter tags":"Veuillez entrer les tags",
"Please insert a title in the text: beginning with heading":"Please insert a title in the text: beginning with heading", "Please insert a title in the text: beginning with heading":"Veuillez insérer un titre dans le texte: en commençant par le heading",
"Please select a category":"Please select a category", "Please select a category":"Veuillez sélectionner une catégorie",
"Please select a date":"Please select a date", "Please select a date":"Veuillez sélectionner une date",
"Please select a file":"Please select a file", "Please select a file":"Veuillez sélectionner un fichier",
"Please select a parent category":"Please select a parent category", "Please select a parent category":"Veuillez sélectionner une catégorie parente",
"Please select a section to edit":"Please select a section to edit", "Please select a section to edit":"Veuillez sélectionner une section à modifier",
"Please select a section to move":"Please select a section to move", "Please select a section to move":"Veuillez sélectionner une section à déplacer",
"Preview":"Preview", "Preview":"Aperçu",
"Properties":"Properties", "Properties":"Propriétés",
"Quit without saving ?":"Quit without saving ?", "Quit without saving ?":"Quitter sans sauvegarder ?",
"Quit":"Quit", "Quit":"Quitter",
"Read more":"Read more", "Read more":"Lire la suite",
"Refresh":"Refresh", "Refresh":"Rafraîchir",
"Rename":"Rename", "Rename":"Renommer",
"Repositories":"Repositories", "Repositories":"Dépôts",
"Resource not found {0}":"Resource not found {0}", "Resource not found {0}":"Ressource non trouvée {0}",
"Resource not found: {0}":"Resource not found: {0}", "Resource not found: {0}":"Ressource non trouvée: {0}",
"Row {0}, col {1}, lines: {2}":"Row {0}, col {1}, lines: {2}", "Row {0}, col {1}, lines: {2}":"Range {0}, col {1}, lignes: {2}",
"Save as":"Save as", "Save as":"Enregistrer sous",
"Save":"Save", "Save":"sauvegarder",
"Section list is empty, please add one":"Section list is empty, please add one", "Section list is empty, please add one":"La liste des sections est vide, veuillez en ajouter une",
"Select image file":"Select image file", "Select image file":"Sélectionnez le fichier image",
"Service":"Service", "Service":"Service",
"Share file":"Share file", "Share file":"Partagez le fichier",
"Shared url: {0}":"Shared url: {0}", "Shared url: {0}":"URL partagée: {0}",
"Shared":"Shared", "Shared":"partagé",
"Short biblio":"Short biblio", "Short biblio":"Biblio court",
"Sidebar":"Sidebar", "Sidebar":"Barre latérale",
"Subtitle":"Subtitle", "Subtitle":"Sous-titre",
"System fail: Cannot init desktop manager":"System fail: Cannot init desktop manager", "System fail: Cannot init desktop manager":"Échec du système: impossible de démarrer le gestionnaire de bureau",
"System fail: Cannot init login screen":"System fail: Cannot init login screen", "System fail: Cannot init login screen":"Echec du système: Impossible de se connecter à l'écran de connexion",
"Tags":"Tags", "Tags":"Tags",
"This feature is not implemented yet":"This feature is not implemented yet", "This feature is not implemented yet":"Cette fonctionnalité n'est pas encore implémentée",
"Title or content must not be blank":"Title or content must not be blank", "Title or content must not be blank":"Le titre ou le contenu ne doit pas être vide",
"Title":"Title", "Title":"Titre",
"Toggle Full screen":"Toggle Full screen", "Toggle Full screen":"Basculer en plein écran",
"Tree view":"Tree view", "Tree view":"Vue de l'arbre",
"Type":"Type", "Type":"Type",
"Uninstall : {0}?":"Uninstall : {0}?", "Uninstall : {0}?":"Désinstaller: {0}?",
"Uninstall":"Uninstall", "Uninstall":"Désinstaller",
"Unknown API setting for {0}":"Unknown API setting for {0}", "Unknown API setting for {0}":"Paramètre d'API inconnu pour {0}",
"Updated: {0}":"Updated: {0}", "Updated: {0}":"Actualisé: {0}",
"Upload":"Upload", "Upload":"Télécharger",
"Url":"Url", "Url":"Url",
"User abort the authentication":"User abort the authentication", "User abort the authentication":"L'utilisateur annule l'authentification",
"User data updated":"User data updated", "User data updated":"Données utilisateur mises à jour",
"VDB Unknown condition for delete command":"VDB Unknown condition for delete command", "VDB Unknown condition for delete command":"VDB Condition inconnue pour la commande de suppression",
"VFS Cannot encode file: {0}":"VFS Cannot encode file: {0}", "VFS Cannot encode file: {0}":"VFS Impossible de coder le fichier: {0}",
"VFS cannot create : {0}":"VFS cannot create : {0}", "VFS cannot create : {0}":"VFS ne peut pas créer: {0}",
"VFS cannot delete : {0}":"VFS cannot delete : {0}", "VFS cannot delete : {0}":"VFS ne peut pas supprimer: {0}",
"VFS cannot download file : {0}":"VFS cannot download file : {0}", "VFS cannot download file : {0}":"VFS ne peut pas télécharger le fichier: {0}",
"VFS cannot get meta data for {0}":"VFS cannot get meta data for {0}", "VFS cannot get meta data for {0}":"VFS ne peut pas obtenir de métadonnées pour {0}",
"VFS cannot init {0}: {1}":"VFS cannot init {0}: {1}", "VFS cannot init {0}: {1}":"VFS ne peut pas init {0}: {1}",
"VFS cannot move : {0}":"VFS cannot move : {0}", "VFS cannot move : {0}":"VFS ne peut pas déplacer: {0}",
"VFS cannot read : {0}":"VFS cannot read : {0}", "VFS cannot read : {0}":"VFS ne peut pas lire: {0}",
"VFS cannot save : {0}":"VFS cannot save : {0}", "VFS cannot save : {0}":"VFS ne peut pas enregistrer: {0}",
"VFS cannot write : {0}":"VFS cannot write : {0}", "VFS cannot write : {0}":"VFS ne peut pas écrire: {0}",
"VFS unknown action: {0}":"VFS unknown action: {0}", "VFS unknown action: {0}":"Action inconnue VFS: {0}",
"VFS unknown handler: {0}":"VFS unknown handler: {0}", "VFS unknown handler: {0}":"Gestionnaire inconnu VFS: {0}",
"View":"View", "View":"Vue",
"Would you like to login to {0}?":"Would you like to login to {0}?", "Would you like to login to {0}?":"Voulez-vous vous connecter à {0}?",
"Wrong format: it should be [name] url":"Wrong format: it should be [name] url", "Wrong format: it should be [name] url":"Mauvais format: il devrait être [nom] url",
"Yes":"Yes", "Yes":"Oui",
"{0} is not a directory":"{0} is not a directory" "{0} is not a directory":"{0} n'est pas un répertoire"
, ,
"April":"April", "April":"Avril",
"August":"August", "August":"août",
"December":"December", "December":"Décembre",
"February":"February", "February":"Février",
"Fri":"Fri", "Fri":"Ven",
"January":"January", "January":"Janvier",
"July":"July", "July":"Juillet",
"June":"June", "June":"Juin",
"March":"March", "March":"Mars",
"May":"May", "May":"Mai",
"Mon":"Mon", "Mon":"Lun",
"November":"November", "November":"Novembre",
"October":"October", "October":"Octobre",
"Sat":"Sat", "Sat":"Sam",
"Selected: {0} ({1} bytes)":"Selected: {0} ({1} bytes)", "Selected: {0} ({1} bytes)":"Sélectionné: {0} ({1} octets)",
"September":"September", "September":"Septembre",
"Size":"Size", "Size":"Taille",
"Sun":"Sun", "Sun":"Dim",
"Thu":"Thu", "Thu":"Jeu",
"Tue":"Tue", "Tue":"Mar",
"Wed":"Wed" "Wed":"Mer"
,
"Add application":"Ajouter une application",
"Add mount point":"Ajouter un point de montage",
"Add service":"Ajouter un service",
"Appearance":"Apparence",
"Cannot fetch system locales: {0}":"Impossible d'extraire les paramètres régionaux du système: {0}",
"Cannot read wallpaper list from {0}":"Impossible de lire la liste des fonds d'écran à partir de {0}",
"Cannot save system setting: {0}":"Impossible d'enregistrer le paramètre système: {0}",
"Desktop path":"Chemin du bureau",
"Edit mount point":"Modifier le point de montage",
"Languages":"Langues",
"Local packages path":"Chemin d'accès aux packages locaux",
"Mount points":"Points de montage",
"Path":"Chemin",
"Please enter mount point name":"Veuillez entrer le nom du point de montage",
"Please select a directory":"Veuillez sélectionner un répertoire",
"Please select an entry":"Veuillez sélectionner une entrée",
"Remove: {0}?":"Supprimer: {0}?",
"Remove":"Supprimer",
"Select a directory":"Sélectionnez un répertoire",
"Startup applications":"Applications de démarrage",
"Startup services":"Services de démarrage",
"Startup":"Démarrage",
"System locale":"Paramètres régionaux du système",
"System setting saved":"Paramètre système enregistré",
"Theme":"Thème",
"VFS":"VFS",
"Wallpaper":"Fond d'écran"
} }

View File

@ -0,0 +1,219 @@
{
"About":"About",
"About: {0}":"About: {0}",
"Add category":"Add category",
"Add repository":"Add repository",
"Address":"Address",
"Alive (ms)":"Alive (ms)",
"Application installed":"Application installed",
"Application {0} is not executable":"Application {0} is not executable",
"Application":"Application",
"Applications":"Applications",
"Authentication":"Authentication",
"Cancel":"Cancel",
"Cannot Edit category":"Cannot Edit category",
"Cannot add new category":"Cannot add new category",
"Cannot create {0}":"Cannot create {0}",
"Cannot delete all content of: {0} [{1}]":"Cannot delete all content of: {0} [{1}]",
"Cannot delete the category: {0} [{1}]":"Cannot delete the category: {0} [{1}]",
"Cannot delete the section: {0}":"Cannot delete the section: {0}",
"Cannot delete: {0}":"Cannot delete: {0}",
"Cannot down load the app {0}":"Cannot down load the app {0}",
"Cannot export file for embedding to text":"Cannot export file for embedding to text",
"Cannot fetch CV categories":"Cannot fetch CV categories",
"Cannot fetch the entry content":"Cannot fetch the entry content",
"Cannot fetch user data":"Cannot fetch user data",
"Cannot install {0}":"Cannot install {0}",
"Cannot load 3rd library at: {0}":"Cannot load 3rd library at: {0}",
"Cannot move section":"Cannot move section",
"Cannot read service script: {0}":"Cannot read service script: {0}",
"Cannot render the PDF file":"Cannot render the PDF file",
"Cannot save blog: {0}":"Cannot save blog: {0}",
"Cannot save section: {0}":"Cannot save section: {0}",
"Cannot save system setting":"Cannot save system setting",
"Cannot save user data":"Cannot save user data",
"Cannot share file: {0}":"Cannot share file: {0}",
"Cannot uninstall package: {0}":"Cannot uninstall package: {0}",
"Categories":"Categories",
"Clear all":"Clear all",
"Close tab":"Close tab",
"Close without saving ?":"Close without saving ?",
"Close":"Close",
"Copy not yet implemented":"Copy not yet implemented",
"Copy":"Copy",
"Created: {0}":"Created: {0}",
"Cut":"Cut",
"Delete a post":"Delete a post",
"Delete category":"Delete category",
"Delete section":"Delete section",
"Delete":"Delete",
"Desktop":"Desktop",
"Dialog {0} not found":"Dialog {0} not found",
"Do you really want to delete this post ?":"Do you really want to delete this post ?",
"Do you really want to delete: {0}?":"Do you really want to delete: {0}?",
"Download":"Download",
"Edit category":"Edit category",
"Edit repository":"Edit repository",
"Edit":"Edit",
"Email":"Email",
"Error find app by mimes {0}":"Error find app by mimes {0}",
"Error reading package meta data: {0}":"Error reading package meta data: {0}",
"Error saving file {0}":"Error saving file {0}",
"Exit":"Exit",
"Fail to create directory: {0}":"Fail to create directory: {0}",
"Fail to create {0}: {1}":"Fail to create {0}: {1}",
"Fail to delete {0}: {1}":"Fail to delete {0}: {1}",
"Fail to delete: {0}":"Fail to delete: {0}",
"Fail to fetch packages list from: {0}":"Fail to fetch packages list from: {0}",
"Fail to get file meta data: {0}":"Fail to get file meta data: {0}",
"Fail to make request: {0}":"Fail to make request: {0}",
"Fail to move file: {0} -> {1}":"Fail to move file: {0} -> {1}",
"Fail to paste: {0}":"Fail to paste: {0}",
"Fail to publish file: {0}":"Fail to publish file: {0}",
"Fail to query data from database: {0}":"Fail to query data from database: {0}",
"Fail to read file: {0}":"Fail to read file: {0}",
"Fail to rename to {0}: {1}":"Fail to rename to {0}: {1}",
"Fail to scan directory: {0}":"Fail to scan directory: {0}",
"Fail to upload file to: {0}":"Fail to upload file to: {0}",
"Fail to upload to {0}: {1}":"Fail to upload to {0}: {1}",
"Fail to write to file: {0}":"Fail to write to file: {0}",
"Fail to {0} package":"Fail to {0} package",
"File name":"File name",
"File not found {0}":"File not found {0}",
"File {0} copied":"File {0} copied",
"File {0} cut":"File {0} cut",
"File":"File",
"Folder name":"Folder name",
"Format : [name] url":"Format : [name] url",
"Found {0} sections":"Found {0} sections",
"From":"From",
"Full name must be entered":"Full name must be entered",
"Full name":"Full name",
"Google Drive":"Google Drive",
"Hidden files":"Hidden files",
"Home":"Home",
"Icon view":"Icon view",
"Ignore all {0} unsaved files ?":"Ignore all {0} unsaved files ?",
"Install":"Install",
"Invalid package: Meta data file not found":"Invalid package: Meta data file not found",
"Kill process":"Kill process",
"Language file {0} not found":"Language file {0} not found",
"Launch":"Launch",
"List view":"List view",
"Location":"Location",
"Log out":"Log out",
"Logout":"Logout",
"Mime type {0} is not supported":"Mime type {0} is not supported",
"Modify section entry":"Modify section entry",
"Move to":"Move to",
"Name":"Name",
"Navigation bar":"Navigation bar",
"New file":"New file",
"New folder":"New folder",
"New section entry for {0}":"New section entry for {0}",
"New":"New",
"No application available to open {0}":"No application available to open {0}",
"No post found: {0}":"No post found: {0}",
"No":"No",
"OS":"OS",
"Ok":"Ok",
"Only {0} could be selected":"Only {0} could be selected",
"Open file":"Open file",
"Open with":"Open with",
"Open":"Open",
"Options":"Options",
"Package uninstalled":"Package uninstalled",
"Parent can not be the category itself":"Parent can not be the category itself",
"Paste":"Paste",
"Phone":"Phone",
"Pid":"Pid",
"Please enter category name":"Please enter category name",
"Please enter tags":"Please enter tags",
"Please insert a title in the text: beginning with heading":"Please insert a title in the text: beginning with heading",
"Please select a category":"Please select a category",
"Please select a date":"Please select a date",
"Please select a file":"Please select a file",
"Please select a parent category":"Please select a parent category",
"Please select a section to edit":"Please select a section to edit",
"Please select a section to move":"Please select a section to move",
"Preview":"Preview",
"Properties":"Properties",
"Quit without saving ?":"Quit without saving ?",
"Quit":"Quit",
"Read more":"Read more",
"Refresh":"Refresh",
"Rename":"Rename",
"Repositories":"Repositories",
"Resource not found {0}":"Resource not found {0}",
"Resource not found: {0}":"Resource not found: {0}",
"Row {0}, col {1}, lines: {2}":"Row {0}, col {1}, lines: {2}",
"Save as":"Save as",
"Save":"Save",
"Section list is empty, please add one":"Section list is empty, please add one",
"Select image file":"Select image file",
"Service":"Service",
"Share file":"Share file",
"Shared url: {0}":"Shared url: {0}",
"Shared":"Shared",
"Short biblio":"Short biblio",
"Sidebar":"Sidebar",
"Subtitle":"Subtitle",
"System fail: Cannot init desktop manager":"System fail: Cannot init desktop manager",
"System fail: Cannot init login screen":"System fail: Cannot init login screen",
"Tags":"Tags",
"This feature is not implemented yet":"This feature is not implemented yet",
"Title or content must not be blank":"Title or content must not be blank",
"Title":"Title",
"Toggle Full screen":"Toggle Full screen",
"Tree view":"Tree view",
"Type":"Type",
"Uninstall : {0}?":"Uninstall : {0}?",
"Uninstall":"Uninstall",
"Unknown API setting for {0}":"Unknown API setting for {0}",
"Updated: {0}":"Updated: {0}",
"Upload":"Upload",
"Url":"Url",
"User abort the authentication":"User abort the authentication",
"User data updated":"User data updated",
"VDB Unknown condition for delete command":"VDB Unknown condition for delete command",
"VFS Cannot encode file: {0}":"VFS Cannot encode file: {0}",
"VFS cannot create : {0}":"VFS cannot create : {0}",
"VFS cannot delete : {0}":"VFS cannot delete : {0}",
"VFS cannot download file : {0}":"VFS cannot download file : {0}",
"VFS cannot get meta data for {0}":"VFS cannot get meta data for {0}",
"VFS cannot init {0}: {1}":"VFS cannot init {0}: {1}",
"VFS cannot move : {0}":"VFS cannot move : {0}",
"VFS cannot read : {0}":"VFS cannot read : {0}",
"VFS cannot save : {0}":"VFS cannot save : {0}",
"VFS cannot write : {0}":"VFS cannot write : {0}",
"VFS unknown action: {0}":"VFS unknown action: {0}",
"VFS unknown handler: {0}":"VFS unknown handler: {0}",
"View":"View",
"Would you like to login to {0}?":"Would you like to login to {0}?",
"Wrong format: it should be [name] url":"Wrong format: it should be [name] url",
"Yes":"Yes",
"{0} is not a directory":"{0} is not a directory"
,
"April":"April",
"August":"August",
"December":"December",
"February":"February",
"Fri":"Fri",
"January":"January",
"July":"July",
"June":"June",
"March":"March",
"May":"May",
"Mon":"Mon",
"November":"November",
"October":"October",
"Sat":"Sat",
"Selected: {0} ({1} bytes)":"Selected: {0} ({1} bytes)",
"September":"September",
"Size":"Size",
"Sun":"Sun",
"Thu":"Thu",
"Tue":"Tue",
"Wed":"Wed"
}

View File

@ -220,6 +220,39 @@
, ,
"Add":"Thêm", "Add":"Thêm",
"Cannot read wallpaper list from {0}":"Không thể truy vấn danh sách wallpaper {0}", "Cannot read wallpaper list from {0}":"Không thể truy vấn danh sách wallpaper {0}",
"Theme":"Theme", "Theme":"Chủ đề",
"Wallpaper":"Wallpaper" "Wallpaper":"Hình nền"
,
"Appearance":"Giao diện",
"Cannot fetch system locales: {0}":"Không thể truy vấn danh sách ngôn ngữ: {0}",
"Cannot save system setting: {0}":"Không thể lưu cài đặt hệ thống: {0}",
"Desktop path":"Đường dẫn đến desktop",
"Languages":"Ngôn ngữ",
"Local packages path":"Đường dẫn đến ứng dụng riêng",
"Mount points":"Điểm truy cập nhanh",
"Path":"Đường dẫn",
"Please enter mount point name":"Vui lòng nhập điểm truy cập",
"Please select a directory":"Vui lòng chọn một thư mục",
"Remove: {0}?":"xoá: {0}?",
"Remove":"xoá",
"Select a directory":"Chọn một thư mục",
"System locale":"Ngôn ngữ",
"System setting saved":"Đã lưu cài đặt hệ thống",
"VFS":"VFS"
,
"Add mount point":"Thêm điểm truy cập",
"Edit mount point":"Sửa điểm truy cập"
,
"Services":"Dịch vụ",
"Startup":"Khởi chạy"
,
"Add application":"Thêm ứng dụng",
"Add service":"Thêm dịch vụ",
"Please select an entry":"Vui lòng chọn 1 mục từ danh sách",
"Startup applications":"Ứng dụng khởi chạy",
"Startup services":"Dịch vụ khởi chạy"
} }

View File

@ -216,4 +216,36 @@
"Thu":"Năm", "Thu":"Năm",
"Tue":"Ba", "Tue":"Ba",
"Wed":"Tư" "Wed":"Tư"
,
"Add":"Thêm",
"Cannot read wallpaper list from {0}":"Không thể truy vấn danh sách wallpaper {0}",
"Theme":"Chủ đề",
"Wallpaper":"Hình nền"
,
"Appearance":"Giao diện",
"Cannot fetch system locales: {0}":"Không thể truy vấn danh sách ngôn ngữ: {0}",
"Cannot save system setting: {0}":"Không thể lưu cài đặt hệ thống: {0}",
"Desktop path":"Đường dẫn đến desktop",
"Languages":"Ngôn ngữ",
"Local packages path":"Đường dẫn đến ứng dụng riêng",
"Mount points":"Điểm truy cập nhanh",
"Path":"Đường dẫn",
"Please enter mount point name":"Vui lòng nhập điểm truy cập",
"Please select a directory":"Vui lòng chọn một thư mục",
"Remove: {0}?":"xoá: {0}?",
"Remove":"xoá",
"Select a directory":"Chọn một thư mục",
"System locale":"Ngôn ngữ",
"System setting saved":"Đã lưu cài đặt hệ thống",
"VFS":"VFS"
,
"Add mount point":"Thêm điểm truy cập",
"Edit mount point":"Sửa điểm truy cập"
,
"Services":"Services",
"Startup":"Startup"
} }

View File

@ -7,6 +7,7 @@
size: "cover", size: "cover",
repeat: "repeat" repeat: "repeat"
} unless _OS.setting.appearance.wp } unless _OS.setting.appearance.wp
_OS.setting.appearance.wps = [] unless _OS.setting.appearance.wps
_OS.setting.user = conf.user _OS.setting.user = conf.user
_OS.setting.VFS = conf.VFS if conf.VFS _OS.setting.VFS = conf.VFS if conf.VFS
_OS.setting.desktop.path = "home://.desktop" unless _OS.setting.desktop.path _OS.setting.desktop.path = "home://.desktop" unless _OS.setting.desktop.path

View File

@ -12,7 +12,7 @@
</ul> </ul>
</div> </div>
<div if = {opts.dropdown != "true" && buttons} class = "button_container"> <div if = {opts.dropdown != "true" && buttons} class = "button_container">
<afx-button each = {btn,i in buttons} text = {btn.text} icon = {btn.icon} iconclass = {btn.icon} onbtclick = {btn.onbtclick}></afx-button> <afx-button each = {btn,i in buttons} text = {btn.text} icon = {btn.icon} iconclass = {btn.iconclass} onbtclick = {btn.onbtclick}></afx-button>
</div> </div>
<script> <script>
this.items = opts.items || [] this.items = opts.items || []
@ -121,6 +121,7 @@
{ {
self.root.observable.on("calibrate", function(){ self.root.observable.on("calibrate", function(){
$(self.refs.container).css("width", $(self.root).width() + "px" ) $(self.refs.container).css("width", $(self.root).width() + "px" )
$(self.refs.mlist).css("width", $(self.root).width() + "px" )
}) })
$(document).click(function(event) { $(document).click(function(event) {
if(!$(event.target).closest(self.refs.container).length) { if(!$(event.target).closest(self.refs.container).length) {

View File

@ -1,5 +1,4 @@
<afx-tree-view> <afx-tree-view>
<div class={afx_tree_item_selected:treeroot.selectedItem && treeroot.selectedItem.treepath == data.treepath, afx_folder_item: isFolder(), afx_tree_item_odd: index%2 != 0 } onclick={select} ondblclick = {_dbclick} oncontextmenu = {select}> <div class={afx_tree_item_selected:treeroot.selectedItem && treeroot.selectedItem.treepath == data.treepath, afx_folder_item: isFolder(), afx_tree_item_odd: index%2 != 0 } onclick={select} ondblclick = {_dbclick} oncontextmenu = {select}>
<ul style = "padding:0;margin:0;white-space: nowrap;"> <ul style = "padding:0;margin:0;white-space: nowrap;">
<li ref = "padding" ></li> <li ref = "padding" ></li>
@ -12,8 +11,6 @@
</li> </li>
</ul> </ul>
</div> </div>
<ul if={ isFolder() } show={ isFolder() && open }> <ul if={ isFolder() } show={ isFolder() && open }>
<li each={ child, i in data.nodes }> <li each={ child, i in data.nodes }>
<afx-tree-view ontreeselect = {parent.ontreeselect} index = {i} fetch = {parent.fetch} ontreedbclick = {parent.ontreedbclick} data={child} indent={indent+1} observable = {parent.root.observable} path = {parent.data.treepath + ">" + i} treeroot= {parent.treeroot}></afx-tree-view> <afx-tree-view ontreeselect = {parent.ontreeselect} index = {i} fetch = {parent.fetch} ontreedbclick = {parent.ontreedbclick} data={child} indent={indent+1} observable = {parent.root.observable} path = {parent.data.treepath + ">" + i} treeroot= {parent.treeroot}></afx-tree-view>

View File

@ -7,7 +7,7 @@ class AppearanceHandler extends SettingHandler
@wpsize = @find "wpsize" @wpsize = @find "wpsize"
@wprepeat = @find "wprepeat" @wprepeat = @find "wprepeat"
@themelist = @find "theme-list" @themelist = @find "theme-list"
@syswp = undefined
@wplist.set "onlistselect", (e) -> @wplist.set "onlistselect", (e) ->
$(me.wpreview).css("background-image", "url(#{me.parent._api.handler.get}/#{e.data.path})" ) $(me.wpreview).css("background-image", "url(#{me.parent._api.handler.get}/#{e.data.path})" )
.css("background-size", "cover") .css("background-size", "cover")
@ -15,7 +15,13 @@ class AppearanceHandler extends SettingHandler
me.parent._gui.wallpaper() me.parent._gui.wallpaper()
@wplist.set "buttons", [ @wplist.set "buttons", [
{ text: "+", onbtclick: (e) -> console.log "click +" } {
text: "+", onbtclick: (e) ->
me.parent.openDialog "FileDiaLog", (d, n, p) ->
me.parent.systemsetting.appearance.wps.push p
me.render()
, __("Select image file"), { mimes: ["image/.*"] }
}
] ]
@wpsize.set "onlistselect", (e) -> @wpsize.set "onlistselect", (e) ->
@ -42,8 +48,10 @@ class AppearanceHandler extends SettingHandler
me.parent._gui.wallpaper() me.parent._gui.wallpaper()
@themelist.set "items" , [{ text: "antos", selected: true }] @themelist.set "items" , [{ text: "antos", selected: true }]
render: () -> render: () ->
me = @ me = @
if not @syswp
path = "os://resources/themes/system/wp" path = "os://resources/themes/system/wp"
path.asFileHandler().read (d) -> path.asFileHandler().read (d) ->
me.parent.error __("Cannot read wallpaper list from {0}", path) if d.error me.parent.error __("Cannot read wallpaper list from {0}", path) if d.error
@ -51,4 +59,20 @@ class AppearanceHandler extends SettingHandler
v.text = v.filename v.text = v.filename
v.selected = true if v.path is me.parent.systemsetting.appearance.wp.url v.selected = true if v.path is me.parent.systemsetting.appearance.wp.url
v.iconclass = "fa fa-file-image-o" v.iconclass = "fa fa-file-image-o"
me.wplist.set "items", d.result me.syswp = d.result
me.wplist.set "items", me.getwplist()
else
me.wplist.set "items", me.getwplist()
getwplist: () ->
list = []
for v in @parent.systemsetting.appearance.wps
file = v.asFileHandler()
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
return list

View File

@ -0,0 +1,21 @@
class LocaleHandler extends SettingHandler
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 = @
if not @localelist
path = "os://resources/languages"
path.asFileHandler().read (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
else
me.lglist.set "items", me.localelist

View File

@ -1,4 +1,4 @@
coffee_files = main.coffee AppearanceHandler.coffee coffee_files = main.coffee AppearanceHandler.coffee VFSHandler.coffee LocaleHandler.coffee StartupHandler.coffee
jsfiles = jsfiles =

View File

@ -0,0 +1,76 @@
class StartupHandler extends SettingHandler
constructor:(scheme, parent) ->
super(scheme, parent)
me = @
@srvlist = @find "srvlist"
@applist = @find "applist"
@srvlist.set "buttons", [
{
text: "+", onbtclick: (e) ->
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)
services = services.concat srvs
me.parent.openDialog me.mkdialog(), (d) ->
me.parent.systemsetting.system.startup.services.push d
me.render()
, "__(Add service)", services
},
{
text: "-", onbtclick: (e) ->
selidx = me.srvlist.get "selidx"
return unless selidx >= 0
me.parent.systemsetting.system.startup.services.splice selidx,1
me.render()
}
]
@applist.set "buttons", [
{
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
},
{
text: "-", onbtclick: (e) ->
selidx = me.applist.get "selidx"
return unless selidx >= 0
me.parent.systemsetting.system.startup.apps.splice selidx,1
me.render()
}
]
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 )
mkdialog: () ->
return @parent._gui.mkdialog {
name: "StartupDialog",
layout: {
tags: [
{ tag: "afx-list-view" }
],
width: 250,
height: 200,
resizable: false,
buttons: [
{
label: "__(Ok)", onclick: (d) ->
sel = (d.find "content0").get "selected"
return d.error __("Please select an entry") unless sel
d.handler(sel.text) if d.handler
d.quit()
},
{ label: "__(Cancel)", onclick: (d) -> d.quit() }
],
filldata: (dia) ->
(dia.find "content0").set "items", dia.data if dia.data
}
}

View File

@ -0,0 +1,99 @@
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,22 +16,37 @@ class Setting extends this.OS.GUI.BaseApplication
@container = @find "container" @container = @find "container"
@container.setTabs [ @container.setTabs [
{ {
text: "Appearance", text: "__(Appearance)",
iconclass: "fa fa-paint-brush", iconclass: "fa fa-paint-brush",
url: "#{@path()}/schemes/appearance.html", url: "#{@path()}/schemes/appearance.html",
handler: (sch) -> handler: (sch) ->
me.appearance = new AppearanceHandler(sch, me) new AppearanceHandler sch, me
me.appearance
}, },
{ {
text: "VFS", text: "__(VFS)",
iconclass: "fa fa-inbox" , iconclass: "fa fa-inbox" ,
url: "#{@path()}/schemes/vfs.html" , url: "#{@path()}/schemes/vfs.html" ,
handler: (sch) -> handler: (sch) ->
render: () -> new VFSHandler sch, me
console.log "finish init VFS" },
{
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
} }
] ]
(@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")
Setting.singleton = true Setting.singleton = true
this.OS.register "Setting", Setting this.OS.register "Setting", Setting

View File

@ -13,7 +13,9 @@ afx-app-window[data-id = "setting-window"] afx-tab-container div[data-ref="cont
afx-app-window[data-id = "setting-window"] afx-label.header{ afx-app-window[data-id = "setting-window"] afx-label.header{
font-weight: bold; font-weight: bold;
} }
afx-app-window[data-id = "setting-window"] div.footer{
border-right: 1px solid #cbcbcb;
}
/*APPEARANCE*/ /*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-vbox[data-id="appearance"] div[data-id = "wp-preview"]{
display: block; display: block;
@ -30,3 +32,24 @@ afx-app-window[data-id = "setting-window"] afx-vbox[data-id="appearance"] afx-re
border:0; border:0;
background-color: transparent; background-color: transparent;
} }
/*VFS*/
afx-app-window[data-id = "setting-window"] afx-vbox[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{
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"]
{
border: 1px solid #cbcbcb;
}
/*STARTUP*/
afx-app-window[data-id = "setting-window"] afx-vbox[data-id="startup"] afx-list-view
{
border: 1px solid #cbcbcb;
}

View File

@ -1,5 +1,12 @@
<afx-app-window data-id = "setting-window" apptitle="Setting" width="600" height="400"> <afx-app-window data-id = "setting-window" apptitle="Setting" width="600" height="400">
<afx-vbox> <afx-vbox>
<afx-tab-container data-id = "container" barwidth="120" bar="left"></afx-tab-container> <afx-tab-container data-id = "container" barwidth="120" bar="left"></afx-tab-container>
<afx-hbox data-height="35">
<div data-width = "120" class = "footer"></div>
<div style="text-align:right" >
<afx-button text="__(Save)" data-id="btnsave" iconclass="fa fa-save" style="margin-right:10px;" ></afx-button>
</div>
</afx-hbox>
</afx-vbox> </afx-vbox>
</afx-app-window> </afx-app-window>

View File

@ -5,7 +5,7 @@
<afx-vbox> <afx-vbox>
<afx-label text = "__(Wallpaper)" iconclass = "fa fa-image" class = "header" data-height="23"></afx-label> <afx-label text = "__(Wallpaper)" iconclass = "fa fa-image" class = "header" data-height="23"></afx-label>
<afx-hbox> <afx-hbox>
<afx-list-view data-width="120" data-id="wplist"></afx-list-view> <afx-list-view data-width="150" data-id="wplist"></afx-list-view>
<afx-resizer data-width="5"></afx-resizer> <afx-resizer data-width="5"></afx-resizer>
<afx-vbox> <afx-vbox>
<div data-id = "wp-preview"></div> <div data-id = "wp-preview"></div>
@ -24,9 +24,4 @@
</afx-vbox> </afx-vbox>
<div data-width="10"></div> <div data-width="10"></div>
</afx-hbox> </afx-hbox>
<afx-hbox data-height="30" >
<div style="text-align:right;"><afx-button text="__(Save)" iconclass="fa fa-save"></afx-button></div>
<div data-width="10"></div>
</afx-hbox>
<div data-height="5"></div>
</afx-vbox> </afx-vbox>

View File

@ -0,0 +1,12 @@
<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

@ -0,0 +1,15 @@
<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 +1,26 @@
<afx-label text = "example2" ></afx-label> <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

@ -1,5 +1,5 @@
afx-list-view{ afx-list-view{
overflow:auto; overflow:hidden;
padding: 5px; padding: 5px;
display: block; display: block;
} }
@ -11,6 +11,9 @@ afx-list-view div.list-container{
position: relative; position: relative;
background-color: red; background-color: red;
}*/ }*/
afx-list-view > div.list-container{
overflow: auto;
}
afx-list-view > div.list-container > ul{ afx-list-view > div.list-container > ul{
margin:0; margin:0;
padding: 0; padding: 0;
@ -78,6 +81,9 @@ afx-list-view.dropdown {
padding:0; padding:0;
margin: 0; margin: 0;
} }
afx-list-view.dropdown > div.list-container{
overflow: visible;
}
afx-list-view.dropdown > div.list-container > ul{ afx-list-view.dropdown > div.list-container > ul{
max-height: 150px; max-height: 150px;
overflow-y: auto; overflow-y: auto;