You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	All: Removed sync target info out of setting class
This commit is contained in:
		| @@ -718,10 +718,6 @@ msgstr "" | ||||
| msgid "Cannot move note to \"%s\" notebook" | ||||
| msgstr "" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "Invalid option value: \"%s\". Possible values are: %s." | ||||
| msgstr "" | ||||
|  | ||||
| msgid "File system synchronisation target directory" | ||||
| msgstr "" | ||||
|  | ||||
| @@ -788,6 +784,10 @@ msgstr "" | ||||
| msgid "Show advanced options" | ||||
| msgstr "" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "Invalid option value: \"%s\". Possible values are: %s." | ||||
| msgstr "" | ||||
|  | ||||
| msgid "Sync status (synced items / total items)" | ||||
| msgstr "" | ||||
|  | ||||
|   | ||||
| @@ -775,10 +775,6 @@ msgstr "Impossible de copier la note vers le carnet \"%s\"" | ||||
| msgid "Cannot move note to \"%s\" notebook" | ||||
| msgstr "Impossible de déplacer la note vers le carnet \"%s\"" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "Invalid option value: \"%s\". Possible values are: %s." | ||||
| msgstr "Option invalide: \"%s\". Les valeurs possibles sont : %s." | ||||
|  | ||||
| msgid "File system synchronisation target directory" | ||||
| msgstr "Cible de la synchronisation sur le disque dur" | ||||
|  | ||||
| @@ -852,6 +848,10 @@ msgstr "Quitter le logiciel." | ||||
| msgid "Show advanced options" | ||||
| msgstr "Montrer les options avancées" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "Invalid option value: \"%s\". Possible values are: %s." | ||||
| msgstr "Option invalide: \"%s\". Les valeurs possibles sont : %s." | ||||
|  | ||||
| msgid "Sync status (synced items / total items)" | ||||
| msgstr "Status de la synchronisation (objets synchro. / total)" | ||||
|  | ||||
|   | ||||
| @@ -718,10 +718,6 @@ msgstr "" | ||||
| msgid "Cannot move note to \"%s\" notebook" | ||||
| msgstr "" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "Invalid option value: \"%s\". Possible values are: %s." | ||||
| msgstr "" | ||||
|  | ||||
| msgid "File system synchronisation target directory" | ||||
| msgstr "" | ||||
|  | ||||
| @@ -788,6 +784,10 @@ msgstr "" | ||||
| msgid "Show advanced options" | ||||
| msgstr "" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "Invalid option value: \"%s\". Possible values are: %s." | ||||
| msgstr "" | ||||
|  | ||||
| msgid "Sync status (synced items / total items)" | ||||
| msgstr "" | ||||
|  | ||||
|   | ||||
| @@ -9,6 +9,7 @@ const { Database } = require('lib/database.js'); | ||||
| const { Setting } = require('lib/models/setting.js'); | ||||
| const { BaseItem } = require('lib/models/base-item.js'); | ||||
| const { BaseModel } = require('lib/base-model.js'); | ||||
| const SyncTargetRegistry = require('lib/SyncTargetRegistry.js'); | ||||
|  | ||||
| process.on('unhandledRejection', (reason, p) => { | ||||
| 	console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); | ||||
| @@ -37,7 +38,7 @@ async function localItemsSameAsRemote(locals, expect) { | ||||
| 			expect(!!remote).toBe(true); | ||||
| 			if (!remote) continue; | ||||
|  | ||||
| 			if (syncTargetId() == Setting.SYNC_TARGET_FILESYSTEM) { | ||||
| 			if (syncTargetId() == SyncTargetRegistry.nameToId('filesystem')) { | ||||
| 				expect(remote.updated_time).toBe(Math.floor(dbItem.updated_time / 1000) * 1000); | ||||
| 			} else { | ||||
| 				expect(remote.updated_time).toBe(dbItem.updated_time); | ||||
|   | ||||
| @@ -32,10 +32,13 @@ Resource.fsDriver_ = fsDriver; | ||||
| const logDir = __dirname + '/../tests/logs'; | ||||
| fs.mkdirpSync(logDir, 0o755); | ||||
|  | ||||
| const syncTargetId_ = Setting.SYNC_TARGET_MEMORY; | ||||
| SyncTargetRegistry.addClass(SyncTargetMemory); | ||||
| SyncTargetRegistry.addClass(SyncTargetFilesystem); | ||||
|  | ||||
| const syncTargetId_ = SyncTargetRegistry.nameToId('memory'); | ||||
| const syncDir = __dirname + '/../tests/sync'; | ||||
|  | ||||
| const sleepTime = syncTargetId_ == Setting.SYNC_TARGET_FILESYSTEM ? 1001 : 400; | ||||
| const sleepTime = syncTargetId_ == SyncTargetRegistry.nameToId('filesystem') ? 1001 : 400; | ||||
|  | ||||
| const logger = new Logger(); | ||||
| logger.addTarget('file', { path: logDir + '/log.txt' }); | ||||
| @@ -50,9 +53,6 @@ BaseItem.loadClass('NoteTag', NoteTag); | ||||
| Setting.setConstant('appId', 'net.cozic.joplin-cli'); | ||||
| Setting.setConstant('appType', 'cli'); | ||||
|  | ||||
| SyncTargetRegistry.addClass(SyncTargetMemory); | ||||
| SyncTargetRegistry.addClass(SyncTargetFilesystem); | ||||
|  | ||||
| function syncTargetId() { | ||||
| 	return syncTargetId_; | ||||
| } | ||||
| @@ -132,7 +132,7 @@ async function setupDatabaseAndSynchronizer(id = null) { | ||||
| 		synchronizers_[id] = await syncTarget.synchronizer(); | ||||
| 	} | ||||
|  | ||||
| 	if (syncTargetId_ == Setting.SYNC_TARGET_FILESYSTEM) { | ||||
| 	if (syncTargetId_ == SyncTargetRegistry.nameToId('filesystem')) { | ||||
| 		fs.removeSync(syncDir) | ||||
| 		fs.mkdirpSync(syncDir, 0o755); | ||||
| 	} else { | ||||
| @@ -153,11 +153,11 @@ function synchronizer(id = null) { | ||||
| function fileApi() { | ||||
| 	if (fileApi_) return fileApi_; | ||||
|  | ||||
| 	if (syncTargetId_ == Setting.SYNC_TARGET_FILESYSTEM) { | ||||
| 	if (syncTargetId_ == SyncTargetRegistry.nameToId('filesystem')) { | ||||
| 		fs.removeSync(syncDir) | ||||
| 		fs.mkdirpSync(syncDir, 0o755); | ||||
| 		fileApi_ = new FileApi(syncDir, new FileApiDriverLocal()); | ||||
| 	} else if (syncTargetId_ == Setting.SYNC_TARGET_MEMORY) { | ||||
| 	} else if (syncTargetId_ == SyncTargetRegistry.nameToId('memory')) { | ||||
| 		fileApi_ = new FileApi('/root', new FileApiDriverMemory()); | ||||
| 	} | ||||
| 	// } else if (syncTargetId == Setting.SYNC_TARGET_ONEDRIVE) { | ||||
|   | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -25,6 +25,9 @@ const SyncTargetRegistry = require('lib/SyncTargetRegistry.js'); | ||||
| const SyncTargetFilesystem = require('lib/SyncTargetFilesystem.js'); | ||||
| const SyncTargetOneDrive = require('lib/SyncTargetOneDrive.js'); | ||||
|  | ||||
| SyncTargetRegistry.addClass(SyncTargetFilesystem); | ||||
| SyncTargetRegistry.addClass(SyncTargetOneDrive); | ||||
|  | ||||
| class BaseApplication { | ||||
|  | ||||
| 	constructor() { | ||||
| @@ -325,9 +328,6 @@ class BaseApplication { | ||||
| 		Setting.setConstant('resourceDir', resourceDir); | ||||
| 		Setting.setConstant('tempDir', tempDir); | ||||
|  | ||||
| 		SyncTargetRegistry.addClass(SyncTargetFilesystem); | ||||
| 		SyncTargetRegistry.addClass(SyncTargetOneDrive); | ||||
|  | ||||
| 		await fs.mkdirp(profileDir, 0o755); | ||||
| 		await fs.mkdirp(resourceDir, 0o755); | ||||
| 		await fs.mkdirp(tempDir, 0o755); | ||||
|   | ||||
| @@ -34,6 +34,12 @@ class BaseSyncTarget { | ||||
| 		throw new Error('id() not implemented'); | ||||
| 	} | ||||
|  | ||||
| 	// Note: it cannot be called just "name()" because that's a reserved keyword and | ||||
| 	// it would throw an obscure error in React Native. | ||||
| 	static targetName() { | ||||
| 		throw new Error('targetName() not implemented'); | ||||
| 	} | ||||
|  | ||||
| 	static label() { | ||||
| 		throw new Error('label() not implemented'); | ||||
| 	} | ||||
|   | ||||
| @@ -11,6 +11,10 @@ class SyncTargetFilesystem extends BaseSyncTarget { | ||||
| 		return 2; | ||||
| 	} | ||||
|  | ||||
| 	static targetName() { | ||||
| 		return 'filesystem'; | ||||
| 	} | ||||
|  | ||||
| 	static label() { | ||||
| 		return _('File system'); | ||||
| 	} | ||||
|   | ||||
| @@ -11,6 +11,10 @@ class SyncTargetMemory extends BaseSyncTarget { | ||||
| 		return 1; | ||||
| 	} | ||||
|  | ||||
| 	static targetName() { | ||||
| 		return 'memory'; | ||||
| 	} | ||||
|  | ||||
| 	static label() { | ||||
| 		return 'Memory'; | ||||
| 	} | ||||
|   | ||||
| @@ -18,6 +18,10 @@ class SyncTargetOneDrive extends BaseSyncTarget { | ||||
| 		return 3; | ||||
| 	} | ||||
|  | ||||
| 	static targetName() { | ||||
| 		return 'onedrive'; | ||||
| 	} | ||||
|  | ||||
| 	static label() { | ||||
| 		return _('OneDrive'); | ||||
| 	} | ||||
|   | ||||
| @@ -9,11 +9,31 @@ class SyncTargetRegistry { | ||||
| 	static addClass(SyncTargetClass) { | ||||
| 		this.reg_[SyncTargetClass.id()] = { | ||||
| 			id: SyncTargetClass.id(), | ||||
| 			name: SyncTargetClass.targetName(), | ||||
| 			label: SyncTargetClass.label(), | ||||
| 			classRef: SyncTargetClass, | ||||
| 		}; | ||||
| 	} | ||||
|  | ||||
| 	static nameToId(name) { | ||||
| 		console.info(this.reg_); | ||||
|  | ||||
| 		for (let n in this.reg_) { | ||||
| 			if (!this.reg_.hasOwnProperty(n)) continue; | ||||
| 			if (this.reg_[n].name === name) return this.reg_[n].id; | ||||
| 		} | ||||
| 		throw new Error('Name not found: ' + name); | ||||
| 	} | ||||
|  | ||||
| 	static idAndLabelPlainObject() { | ||||
| 		let output = {}; | ||||
| 		for (let n in this.reg_) { | ||||
| 			if (!this.reg_.hasOwnProperty(n)) continue; | ||||
| 			output[n] = this.reg_[n].label; | ||||
| 		} | ||||
| 		return output; | ||||
| 	} | ||||
|  | ||||
| } | ||||
|  | ||||
| SyncTargetRegistry.reg_ = {}; | ||||
|   | ||||
| @@ -1,6 +1,7 @@ | ||||
| const { BaseModel } = require('lib/base-model.js'); | ||||
| const { Database } = require('lib/database.js'); | ||||
| const { Logger } = require('lib/logger.js'); | ||||
| const SyncTargetRegistry = require('lib/SyncTargetRegistry.js'); | ||||
| const { sprintf } = require('sprintf-js'); | ||||
| const { _, supportedLocalesToLanguages, defaultLocale } = require('lib/locale.js'); | ||||
|  | ||||
| @@ -14,22 +15,82 @@ class Setting extends BaseModel { | ||||
| 		return BaseModel.TYPE_SETTING; | ||||
| 	} | ||||
|  | ||||
| 	static metadata() { | ||||
| 		if (this.metadata_) return this.metadata_; | ||||
|  | ||||
| 		this.metadata_ = { | ||||
| 			'activeFolderId': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 			'firstStart': { value: true, type: Setting.TYPE_BOOL, public: false }, | ||||
| 			'sync.2.path': { value: '', type: Setting.TYPE_STRING, public: true, appTypes: ['cli'], label: () => _('File system synchronisation target directory'), description: () => _('The path to synchronise with when file system synchronisation is enabled. See `sync.target`.') }, | ||||
| 			'sync.3.auth': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 			'sync.4.auth': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 			'sync.target': { value: SyncTargetRegistry.nameToId('onedrive'), type: Setting.TYPE_INT, isEnum: true, public: true, label: () => _('Synchronisation target'), description: () => _('The target to synchonise to. If synchronising with the file system, set `sync.2.path` to specify the target directory.'), options: () => { | ||||
| 				return SyncTargetRegistry.idAndLabelPlainObject(); | ||||
| 			}}, | ||||
| 			'sync.1.context': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 			'sync.2.context': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 			'sync.3.context': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 			'sync.4.context': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 			'sync.5.context': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 			'sync.6.context': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 			'editor': { value: '', type: Setting.TYPE_STRING, public: true, appTypes: ['cli'], label: () => _('Text editor'), description: () => _('The editor that will be used to open a note. If none is provided it will try to auto-detect the default editor.') }, | ||||
| 			'locale': { value: defaultLocale(), type: Setting.TYPE_STRING, isEnum: true, public: true, label: () => _('Language'), options: () => { | ||||
| 				return supportedLocalesToLanguages(); | ||||
| 			}}, | ||||
| 			'theme': { value: Setting.THEME_LIGHT, type: Setting.TYPE_INT, public: true, appTypes: ['mobile'], isEnum: true, label: () => _('Theme'), options: () => { | ||||
| 				let output = {}; | ||||
| 				output[Setting.THEME_LIGHT] = _('Light'); | ||||
| 				output[Setting.THEME_DARK] = _('Dark'); | ||||
| 				return output; | ||||
| 			}}, | ||||
| 			// 'logLevel': { value: Logger.LEVEL_INFO, type: Setting.TYPE_STRING, isEnum: true, public: true, label: () => _('Log level'), options: () => { | ||||
| 			// 	return Logger.levelEnum(); | ||||
| 			// }}, | ||||
| 			// Not used for now: | ||||
| 			// 'todoFilter': { value: 'all', type: Setting.TYPE_STRING, isEnum: true, public: false, appTypes: ['mobile'], label: () => _('Todo filter'), options: () => ({ | ||||
| 			// 	all: _('Show all'), | ||||
| 			// 	recent: _('Non-completed and recently completed ones'), | ||||
| 			// 	nonCompleted: _('Non-completed ones only'), | ||||
| 			// })}, | ||||
| 			'uncompletedTodosOnTop': { value: true, type: Setting.TYPE_BOOL, public: true, label: () => _('Show uncompleted todos on top of the lists') }, | ||||
| 			'trackLocation': { value: true, type: Setting.TYPE_BOOL, public: true, label: () => _('Save geo-location with notes') }, | ||||
| 			'sync.interval': { value: 300, type: Setting.TYPE_INT, isEnum: true, public: true, label: () => _('Synchronisation interval'), options: () => { | ||||
| 				return { | ||||
| 					0: _('Disabled'), | ||||
| 					300: _('%d minutes', 5), | ||||
| 					600: _('%d minutes', 10), | ||||
| 					1800: _('%d minutes', 30), | ||||
| 					3600: _('%d hour', 1), | ||||
| 					43200: _('%d hours', 12), | ||||
| 					86400: _('%d hours', 24), | ||||
| 				}; | ||||
| 			}}, | ||||
| 			'noteVisiblePanes': { value: ['editor', 'viewer'], type: Setting.TYPE_ARRAY, public: false, appTypes: ['desktop'] }, | ||||
| 			'autoUpdateEnabled': { value: true, type: Setting.TYPE_BOOL, public: true, appTypes: ['desktop'], label: () => _('Automatically update the application') }, | ||||
| 			'showAdvancedOptions': { value: false, type: Setting.TYPE_BOOL, public: true, appTypes: ['mobile' ], label: () => _('Show advanced options') }, | ||||
| 		}; | ||||
|  | ||||
| 		return this.metadata_; | ||||
| 	} | ||||
|  | ||||
| 	static settingMetadata(key) { | ||||
| 		if (!(key in this.metadata_)) throw new Error('Unknown key: ' + key); | ||||
| 		let output = Object.assign({}, this.metadata_[key]); | ||||
| 		const metadata = this.metadata(); | ||||
| 		if (!(key in metadata)) throw new Error('Unknown key: ' + key); | ||||
| 		let output = Object.assign({}, metadata[key]); | ||||
| 		output.key = key; | ||||
| 		return output; | ||||
| 	} | ||||
|  | ||||
| 	static keyExists(key) { | ||||
| 		return key in this.metadata_; | ||||
| 		return key in this.metadata(); | ||||
| 	} | ||||
|  | ||||
| 	static keys(publicOnly = false, appType = null) { | ||||
| 		if (!this.keys_) { | ||||
| 			const metadata = this.metadata(); | ||||
| 			this.keys_ = []; | ||||
| 			for (let n in this.metadata_) { | ||||
| 				if (!this.metadata_.hasOwnProperty(n)) continue; | ||||
| 			for (let n in metadata) { | ||||
| 				if (!metadata.hasOwnProperty(n)) continue; | ||||
| 				this.keys_.push(n); | ||||
| 			} | ||||
| 		} | ||||
| @@ -225,9 +286,10 @@ class Setting extends BaseModel { | ||||
| 	} | ||||
|  | ||||
| 	static enumOptions(key) { | ||||
| 		if (!this.metadata_[key]) throw new Error('Unknown key: ' + key); | ||||
| 		if (!this.metadata_[key].options) throw new Error('No options for: ' + key); | ||||
| 		return this.metadata_[key].options(); | ||||
| 		const metadata = this.metadata(); | ||||
| 		if (!metadata[key]) throw new Error('Unknown key: ' + key); | ||||
| 		if (!metadata[key].options) throw new Error('No options for: ' + key); | ||||
| 		return metadata[key].options(); | ||||
| 	} | ||||
|  | ||||
| 	static enumOptionsDoc(key, templateString = null) { | ||||
| @@ -303,10 +365,12 @@ class Setting extends BaseModel { | ||||
| 	static publicSettings(appType) { | ||||
| 		if (!appType) throw new Error('appType is required'); | ||||
|  | ||||
| 		const metadata = this.metadata(); | ||||
|  | ||||
| 		let output = {}; | ||||
| 		for (let key in Setting.metadata_) { | ||||
| 			if (!Setting.metadata_.hasOwnProperty(key)) continue; | ||||
| 			let s = Object.assign({}, Setting.metadata_[key]); | ||||
| 		for (let key in metadata) { | ||||
| 			if (!metadata.hasOwnProperty(key)) continue; | ||||
| 			let s = Object.assign({}, metadata[key]); | ||||
| 			if (!s.public) continue; | ||||
| 			if (s.appTypes && s.appTypes.indexOf(appType) < 0) continue; | ||||
| 			s.value = this.value(key); | ||||
| @@ -325,11 +389,6 @@ class Setting extends BaseModel { | ||||
|  | ||||
| } | ||||
|  | ||||
| Setting.SYNC_TARGET_MEMORY = 1; | ||||
| Setting.SYNC_TARGET_FILESYSTEM = 2; | ||||
| Setting.SYNC_TARGET_ONEDRIVE = 3; | ||||
| //Setting.SYNC_TARGET_ONEDRIVE_DEV = 4; | ||||
|  | ||||
| Setting.TYPE_INT = 1; | ||||
| Setting.TYPE_STRING = 2; | ||||
| Setting.TYPE_BOOL = 3; | ||||
| @@ -339,63 +398,6 @@ Setting.TYPE_OBJECT = 5; | ||||
| Setting.THEME_LIGHT = 1; | ||||
| Setting.THEME_DARK = 2; | ||||
|  | ||||
| Setting.metadata_ = { | ||||
| 	'activeFolderId': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 	'firstStart': { value: true, type: Setting.TYPE_BOOL, public: false }, | ||||
| 	'sync.2.path': { value: '', type: Setting.TYPE_STRING, public: true, appTypes: ['cli'], label: () => _('File system synchronisation target directory'), description: () => _('The path to synchronise with when file system synchronisation is enabled. See `sync.target`.') }, | ||||
| 	'sync.3.auth': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 	'sync.4.auth': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 	'sync.target': { value: Setting.SYNC_TARGET_ONEDRIVE, type: Setting.TYPE_INT, isEnum: true, public: true, label: () => _('Synchronisation target'), description: () => _('The target to synchonise to. If synchronising with the file system, set `sync.2.path` to specify the target directory.'), options: () => { | ||||
| 		let output = {}; | ||||
| 		output[Setting.SYNC_TARGET_MEMORY] = 'Memory'; | ||||
| 		output[Setting.SYNC_TARGET_FILESYSTEM] = _('File system'); | ||||
| 		output[Setting.SYNC_TARGET_ONEDRIVE] = _('OneDrive'); | ||||
| 		//output[Setting.SYNC_TARGET_ONEDRIVE_DEV] = _('OneDrive (Testing Only)'); | ||||
| 		return output; | ||||
| 	}}, | ||||
| 	'sync.1.context': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 	'sync.2.context': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 	'sync.3.context': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 	'sync.4.context': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 	'sync.5.context': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 	'sync.6.context': { value: '', type: Setting.TYPE_STRING, public: false }, | ||||
| 	'editor': { value: '', type: Setting.TYPE_STRING, public: true, appTypes: ['cli'], label: () => _('Text editor'), description: () => _('The editor that will be used to open a note. If none is provided it will try to auto-detect the default editor.') }, | ||||
| 	'locale': { value: defaultLocale(), type: Setting.TYPE_STRING, isEnum: true, public: true, label: () => _('Language'), options: () => { | ||||
| 		return supportedLocalesToLanguages(); | ||||
| 	}}, | ||||
| 	'theme': { value: Setting.THEME_LIGHT, type: Setting.TYPE_INT, public: true, appTypes: ['mobile'], isEnum: true, label: () => _('Theme'), options: () => { | ||||
| 		let output = {}; | ||||
| 		output[Setting.THEME_LIGHT] = _('Light'); | ||||
| 		output[Setting.THEME_DARK] = _('Dark'); | ||||
| 		return output; | ||||
| 	}}, | ||||
| 	// 'logLevel': { value: Logger.LEVEL_INFO, type: Setting.TYPE_STRING, isEnum: true, public: true, label: () => _('Log level'), options: () => { | ||||
| 	// 	return Logger.levelEnum(); | ||||
| 	// }}, | ||||
| 	// Not used for now: | ||||
| 	// 'todoFilter': { value: 'all', type: Setting.TYPE_STRING, isEnum: true, public: false, appTypes: ['mobile'], label: () => _('Todo filter'), options: () => ({ | ||||
| 	// 	all: _('Show all'), | ||||
| 	// 	recent: _('Non-completed and recently completed ones'), | ||||
| 	// 	nonCompleted: _('Non-completed ones only'), | ||||
| 	// })}, | ||||
| 	'uncompletedTodosOnTop': { value: true, type: Setting.TYPE_BOOL, public: true, label: () => _('Show uncompleted todos on top of the lists') }, | ||||
| 	'trackLocation': { value: true, type: Setting.TYPE_BOOL, public: true, label: () => _('Save geo-location with notes') }, | ||||
| 	'sync.interval': { value: 300, type: Setting.TYPE_INT, isEnum: true, public: true, label: () => _('Synchronisation interval'), options: () => { | ||||
| 		return { | ||||
| 			0: _('Disabled'), | ||||
| 			300: _('%d minutes', 5), | ||||
| 			600: _('%d minutes', 10), | ||||
| 			1800: _('%d minutes', 30), | ||||
| 			3600: _('%d hour', 1), | ||||
| 			43200: _('%d hours', 12), | ||||
| 			86400: _('%d hours', 24), | ||||
| 		}; | ||||
| 	}}, | ||||
| 	'noteVisiblePanes': { value: ['editor', 'viewer'], type: Setting.TYPE_ARRAY, public: false, appTypes: ['desktop'] }, | ||||
| 	'autoUpdateEnabled': { value: true, type: Setting.TYPE_BOOL, public: true, appTypes: ['desktop'], label: () => _('Automatically update the application') }, | ||||
| 	'showAdvancedOptions': { value: false, type: Setting.TYPE_BOOL, public: true, appTypes: ['mobile' ], label: () => _('Show advanced options') }, | ||||
| }; | ||||
|  | ||||
| // Contains constants that are set by the application and | ||||
| // cannot be modified by the user: | ||||
| Setting.constants_ = { | ||||
|   | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -40,6 +40,8 @@ const { reducer, defaultState } = require('lib/reducer.js'); | ||||
| const SyncTargetRegistry = require('lib/SyncTargetRegistry.js'); | ||||
| const SyncTargetOneDrive = require('lib/SyncTargetOneDrive.js'); | ||||
|  | ||||
| SyncTargetRegistry.addClass(SyncTargetOneDrive); | ||||
|  | ||||
| const generalMiddleware = store => next => async (action) => { | ||||
| 	if (action.type !== 'SIDE_MENU_OPEN_PERCENT') reg.logger().info('Reducer action', action.type); | ||||
| 	PoorManIntervals.update(); // This function needs to be called regularly so put it here | ||||
| @@ -257,8 +259,6 @@ async function initialize(dispatch, backButtonHandler) { | ||||
|  | ||||
| 	reg.setLogger(mainLogger); | ||||
|  | ||||
| 	SyncTargetRegistry.addClass(SyncTargetOneDrive); | ||||
|  | ||||
| 	reg.logger().info('===================================='); | ||||
| 	reg.logger().info('Starting application ' + Setting.value('appId') + ' (' + Setting.value('env') + ')'); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user