1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Minor usability improvements

This commit is contained in:
Laurent Cozic 2017-10-24 21:22:57 +01:00
parent 47da5f24e9
commit fed256753c
9 changed files with 150 additions and 54 deletions

View File

@ -90,6 +90,10 @@ class AppGui {
return this.widget('statusBar').prompt(initialText, promptString);
}
stdoutMaxWidth() {
return this.widget('console').innerWidth - 1;
}
buildUi() {
this.rootWidget_ = new ReduxRootWidget(this.store_);
this.rootWidget_.name = 'root';
@ -261,6 +265,18 @@ class AppGui {
setupShortcuts() {
const shortcuts = {};
shortcuts['TAB'] = {
friendlyName: 'Tab',
description: _('Give focus to next widget'),
isDocOnly: true,
}
shortcuts['SHIFT_TAB'] = {
friendlyName: 'Shift+Tab',
description: _('Give focus to previous widget'),
isDocOnly: true,
}
shortcuts['DELETE'] = {
description: _('Delete the currently selected note or notebook.'),
action: async () => {

View File

@ -60,7 +60,7 @@ class Application {
}
commandStdoutMaxWidth() {
return 78;
return this.gui().stdoutMaxWidth();
}
async refreshCurrentFolder() {
@ -421,6 +421,7 @@ class Application {
exit: () => {},
showModalOverlay: (text) => {},
hideModalOverlay: () => {},
stdoutMaxWidth: () => { return 78; }
};
}

View File

@ -55,10 +55,11 @@ class Command extends BaseCommand {
this.stdout('');
this.stdout(commandNames.join(', '));
this.stdout('');
this.stdout(_('To move from one widget to another, press Tab or Shift+Tab.'));
this.stdout(_('To maximise/minimise the console, press "C".'));
this.stdout(_('To enter command line mode, press ":"'));
this.stdout(_('To exit command line mode, press ESCAPE'));
this.stdout(_('To view a list of available shortcuts type `help shortcuts`'));
this.stdout(_('For the complete list of available keyboard shortcuts, type `help shortcuts`'));
}
app().gui().showConsole();

View File

@ -35,6 +35,8 @@ class Command extends BaseCommand {
const ok = force ? true : await this.prompt(msg);
if (!ok) return;
let lastProgress = '';
let options = {
fuzzyMatching: args.options['fuzzy-matching'] === true,
onProgress: (progressState) => {
@ -45,7 +47,8 @@ class Command extends BaseCommand {
if (progressState.skipped) line.push(_('Skipped: %d.', progressState.skipped));
if (progressState.resourcesCreated) line.push(_('Resources: %d.', progressState.resourcesCreated));
if (progressState.notesTagged) line.push(_('Tagged: %d.', progressState.notesTagged));
cliUtils.redraw(line.join(' '));
lastProgress = line.join(' ');
cliUtils.redraw(lastProgress);
},
onError: (error) => {
let s = error.trace ? error.trace : error.toString();
@ -57,6 +60,7 @@ class Command extends BaseCommand {
this.stdout(_('Importing notes...'));
await importEnex(folder.id, filePath, options);
cliUtils.redrawDone();
this.stdout(_('The notes have been imported: %s', lastProgress));
}
}

View File

@ -49,12 +49,17 @@ function renderCommandHelp(cmd, width = null) {
if (cmd.name() === 'config') {
const renderMetadata = (md) => {
let desc = [];
if (md.label) {
let label = md.label();
if (label.length && label[label.length - 1] !== '.') label += '.';
desc.push(label);
}
if (md.description) {
desc.push(md.description());
}
desc.push(_('Type: %s.', md.isEnum ? _('Enum') : Setting.typeToString(md.type)));
if (md.isEnum) desc.push(_('Possible values: %s.', Setting.enumOptionsDoc(md.key, '%s (%s)')));
@ -82,6 +87,7 @@ function renderCommandHelp(cmd, width = null) {
let keysValues = [];
const keys = Setting.keys(true, 'cli');
for (let i = 0; i < keys.length; i++) {
if (keysValues.length) keysValues.push(['','']);
const md = Setting.settingMetadata(keys[i]);
if (!md.label) continue;
keysValues.push(renderMetadata(md));

View File

@ -15,6 +15,12 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Give focus to next widget"
msgstr ""
msgid "Give focus to previous widget"
msgstr ""
msgid "Delete the currently selected note or notebook."
msgstr ""
@ -244,6 +250,9 @@ msgstr ""
msgid "The possible commands are:"
msgstr ""
msgid "To move from one widget to another, press Tab or Shift+Tab."
msgstr ""
msgid "To maximise/minimise the console, press \"C\"."
msgstr ""
@ -253,7 +262,8 @@ msgstr ""
msgid "To exit command line mode, press ESCAPE"
msgstr ""
msgid "To view a list of available shortcuts type `help shortcuts`"
msgid ""
"For the complete list of available keyboard shortcuts, type `help shortcuts`"
msgstr ""
msgid "Imports an Evernote notebook file (.enex file)."
@ -299,6 +309,10 @@ msgstr ""
msgid "Importing notes..."
msgstr ""
#, javascript-format
msgid "The notes have been imported: %s"
msgstr ""
msgid ""
"Displays the notes in the current notebook. Use `ls /` to display the list "
"of notebooks."
@ -564,15 +578,31 @@ msgstr ""
msgid "Invalid option value: \"%s\". Possible values are: %s."
msgstr ""
msgid "File system synchronisation target directory"
msgstr ""
msgid ""
"The path to synchronise with when file system synchronisation is enabled. "
"See `sync.target`."
msgstr ""
msgid "Synchronisation target"
msgstr ""
msgid ""
"The target to synchonise to. If synchronising with the file system, set "
"`sync.2.path` to specify the target directory."
msgstr ""
msgid "File system"
msgstr ""
msgid "OneDrive"
msgstr ""
msgid "Text editor"
msgstr ""
msgid ""
"The editor that will be used to open a note. If none is provided it will try "
"to auto-detect the default editor."
@ -581,25 +611,13 @@ msgstr ""
msgid "Language"
msgstr ""
msgid "Todo filter"
msgstr ""
msgid "Show all"
msgstr ""
msgid "Non-completed and recently completed ones"
msgstr ""
msgid "Non-completed ones only"
msgstr ""
msgid "Show uncompleted todos on top of the lists"
msgstr ""
msgid "Show advanced options"
msgstr ""
msgid "Save location with notes"
msgid "Save geo-location with notes"
msgstr ""
msgid "Synchronisation interval"

View File

@ -15,6 +15,12 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.3\n"
msgid "Give focus to next widget"
msgstr ""
msgid "Give focus to previous widget"
msgstr ""
msgid "Delete the currently selected note or notebook."
msgstr ""
@ -271,6 +277,9 @@ msgstr ""
msgid "The possible commands are:"
msgstr ""
msgid "To move from one widget to another, press Tab or Shift+Tab."
msgstr ""
#, fuzzy
msgid "To maximise/minimise the console, press \"C\"."
msgstr "Quitter le logiciel."
@ -281,7 +290,8 @@ msgstr ""
msgid "To exit command line mode, press ESCAPE"
msgstr ""
msgid "To view a list of available shortcuts type `help shortcuts`"
msgid ""
"For the complete list of available keyboard shortcuts, type `help shortcuts`"
msgstr ""
msgid "Imports an Evernote notebook file (.enex file)."
@ -330,6 +340,10 @@ msgstr "Etiquettes : %d."
msgid "Importing notes..."
msgstr "Importation des notes..."
#, fuzzy, javascript-format
msgid "The notes have been imported: %s"
msgstr "Aucun carnet n'est spécifié."
#, fuzzy
msgid ""
"Displays the notes in the current notebook. Use `ls /` to display the list "
@ -627,15 +641,32 @@ msgstr "Impossible de déplacer la note vers le carnet \"%s\""
msgid "Invalid option value: \"%s\". Possible values are: %s."
msgstr "Option invalide: \"%s\". Les valeurs possibles sont : %s."
#, fuzzy
msgid "File system synchronisation target directory"
msgstr "Cible de la synchronisation"
msgid ""
"The path to synchronise with when file system synchronisation is enabled. "
"See `sync.target`."
msgstr ""
msgid "Synchronisation target"
msgstr "Cible de la synchronisation"
msgid ""
"The target to synchonise to. If synchronising with the file system, set "
"`sync.2.path` to specify the target directory."
msgstr ""
msgid "File system"
msgstr "Système de fichier"
msgid "OneDrive"
msgstr "OneDrive"
msgid "Text editor"
msgstr ""
msgid ""
"The editor that will be used to open a note. If none is provided it will try "
"to auto-detect the default editor."
@ -644,25 +675,14 @@ msgstr ""
msgid "Language"
msgstr "Langue"
msgid "Todo filter"
msgstr "Filtre des tâches"
msgid "Show all"
msgstr "Afficher tous"
msgid "Non-completed and recently completed ones"
msgstr "Tâches non-complétées et récentes"
msgid "Non-completed ones only"
msgstr "Tâches complétées seulement"
msgid "Show uncompleted todos on top of the lists"
msgstr "Tâches non-terminées en haut des listes"
msgid "Show advanced options"
msgstr ""
msgid "Save location with notes"
#, fuzzy
msgid "Save geo-location with notes"
msgstr "Enregistrer l'emplacement avec les notes"
msgid "Synchronisation interval"
@ -822,6 +842,18 @@ msgstr ""
msgid "Welcome"
msgstr "Bienvenue"
#~ msgid "Todo filter"
#~ msgstr "Filtre des tâches"
#~ msgid "Show all"
#~ msgstr "Afficher tous"
#~ msgid "Non-completed and recently completed ones"
#~ msgstr "Tâches non-complétées et récentes"
#~ msgid "Non-completed ones only"
#~ msgstr "Tâches complétées seulement"
#, fuzzy
#~ msgid "Delete a note"
#~ msgstr "Supprimer la note"

View File

@ -15,6 +15,12 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Give focus to next widget"
msgstr ""
msgid "Give focus to previous widget"
msgstr ""
msgid "Delete the currently selected note or notebook."
msgstr ""
@ -244,6 +250,9 @@ msgstr ""
msgid "The possible commands are:"
msgstr ""
msgid "To move from one widget to another, press Tab or Shift+Tab."
msgstr ""
msgid "To maximise/minimise the console, press \"C\"."
msgstr ""
@ -253,7 +262,8 @@ msgstr ""
msgid "To exit command line mode, press ESCAPE"
msgstr ""
msgid "To view a list of available shortcuts type `help shortcuts`"
msgid ""
"For the complete list of available keyboard shortcuts, type `help shortcuts`"
msgstr ""
msgid "Imports an Evernote notebook file (.enex file)."
@ -299,6 +309,10 @@ msgstr ""
msgid "Importing notes..."
msgstr ""
#, javascript-format
msgid "The notes have been imported: %s"
msgstr ""
msgid ""
"Displays the notes in the current notebook. Use `ls /` to display the list "
"of notebooks."
@ -564,15 +578,31 @@ msgstr ""
msgid "Invalid option value: \"%s\". Possible values are: %s."
msgstr ""
msgid "File system synchronisation target directory"
msgstr ""
msgid ""
"The path to synchronise with when file system synchronisation is enabled. "
"See `sync.target`."
msgstr ""
msgid "Synchronisation target"
msgstr ""
msgid ""
"The target to synchonise to. If synchronising with the file system, set "
"`sync.2.path` to specify the target directory."
msgstr ""
msgid "File system"
msgstr ""
msgid "OneDrive"
msgstr ""
msgid "Text editor"
msgstr ""
msgid ""
"The editor that will be used to open a note. If none is provided it will try "
"to auto-detect the default editor."
@ -581,25 +611,13 @@ msgstr ""
msgid "Language"
msgstr ""
msgid "Todo filter"
msgstr ""
msgid "Show all"
msgstr ""
msgid "Non-completed and recently completed ones"
msgstr ""
msgid "Non-completed ones only"
msgstr ""
msgid "Show uncompleted todos on top of the lists"
msgstr ""
msgid "Show advanced options"
msgstr ""
msgid "Save location with notes"
msgid "Save geo-location with notes"
msgstr ""
msgid "Synchronisation interval"

View File

@ -318,9 +318,9 @@ 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'] },
'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.target': { value: Setting.SYNC_TARGET_ONEDRIVE, type: Setting.TYPE_INT, isEnum: true, public: true, label: () => _('Synchronisation target'), options: () => {
'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');
@ -333,7 +333,7 @@ Setting.metadata_ = {
'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: () => _('The editor that will be used to open a note. If none is provided it will try to auto-detect the default editor.') },
'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();
}},
@ -341,14 +341,14 @@ Setting.metadata_ = {
// 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'),
})},
// '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') },
'showAdvancedOptions': { value: false, type: Setting.TYPE_BOOL, public: true, appTypes: ['mobile'], label: () => _('Show advanced options') },
'trackLocation': { value: true, type: Setting.TYPE_BOOL, public: true, label: () => _('Save location with notes') },
'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'),