support N to view current note's information in Captain mode

This commit is contained in:
Le Tan 2019-04-03 21:53:04 +08:00
parent db68df4352
commit 93d2001519
6 changed files with 46 additions and 1 deletions

View File

@ -274,6 +274,8 @@ Expand/restore live preview panel.
Toggle full-text search.
- `P`
Parse HTML as Markdown text in clipboard and paste.
- `N`
View and edit current note's information.
- `Shift+?`
Display shortcuts documentation.
@ -283,6 +285,12 @@ Within the Captain Mode, `W` will turn VNote into **Navigation Mode**. In this m
# Vim Mode
VNote supports a simple but useful Vim mode, including **Normal**, **Insert**, **Visual**, and **VisualLine** modes.
::: alert-info
Open `Settings` dialog via the `File` menu, then jump to `Read/Edit` tab and you could enable Vim via the combo box in `Key mode`. Restart VNote to take effect.
:::
VNote supports following features of Vim:
- `r`, `s`, `S`, `i`, `I`, `a`, `A`, `c`, `C`, `o`, and `O`;

View File

@ -265,6 +265,8 @@ RemoveSplit=R
全文検索を切り替えます。
- `P`
クリップボードのHTMLをMarksownテキストとして貼り付けます。
- `N`
View and edit current note's information.
- `Shift+?`
ショートカットのドキュメントを表示します。
@ -274,6 +276,12 @@ RemoveSplit=R
# Vimモード
VNoteは、**Normal**、**Insert**、**Visual**、および**VisualLine**の各モードを含む、単純で有用なVimモードをサポートしています。
::: alert-info
Open `Settings` dialog via the `File` menu, then jump to `Read/Edit` tab and you could enable Vim via the combo box in `Key mode`. Restart VNote to take effect.
:::
VNoteはVimの次の機能をサポートしています
- `r`, `s`, `S`, `i`, `I`, `a`, `A`, `c`, `C`, `o`, and `O`;

View File

@ -275,6 +275,8 @@ RemoveSplit=R
打开或关闭全文查找。
- `P`
解析剪切板中的HTML为Markdown文本并粘贴。
- `N`
查看和编辑当前笔记信息。
- `Shift+?`
显示本快捷键说明。
@ -284,6 +286,12 @@ RemoveSplit=R
# Vim Mode
VNote支持一个简单但有用的Vim模式包括 **正常** **插入** **可视** **可视行** 模式。
::: alert-info
`文件`菜单中选择`设置`打开对话框,跳转到`阅读/编辑`标签页,在`按键模式`下拉框中选择开启Vim即可。需要重启VNote以生效。
:::
VNote支持以下几个Vim的特性
- `r`, `s`, `S`, `i`, `I`, `a`, `A`, `c`, `C`, `o`, `O`;

View File

@ -541,6 +541,8 @@ ExpandLivePreview=U
FocusEditArea=Y
; Parse HTML and paste
ParseAndPaste=P
; View note info of current edit tab
CurrentNoteInfo=N
[external_editors]
; Define external editors which could be called to edit notes

View File

@ -197,6 +197,10 @@ void VMainWindow::registerCaptainAndNavigationTargets()
g_config->getCaptainShortcutKeySequence("ExpandMode"),
this,
toggleExpandModeByCaptain);
m_captain->registerCaptainTarget(tr("CurrentNoteInfo"),
g_config->getCaptainShortcutKeySequence("CurrentNoteInfo"),
this,
currentNoteInfoByCaptain);
m_captain->registerCaptainTarget(tr("DiscardAndRead"),
g_config->getCaptainShortcutKeySequence("DiscardAndRead"),
this,
@ -731,7 +735,9 @@ QToolBar *VMainWindow::initFileToolBar(QSize p_iconSize)
m_fileList, &VFileList::newFile);
noteInfoAct = new QAction(VIconUtils::toolButtonIcon(":/resources/icons/note_info_tb.svg"),
tr("Note Info"), this);
tr("Note Info"),
this);
VUtils::fixTextWithCaptainShortcut(noteInfoAct, "CurrentNoteInfo");
noteInfoAct->setStatusTip(tr("View and edit current note's information"));
connect(noteInfoAct, &QAction::triggered,
this, &VMainWindow::curEditFileInfo);
@ -2858,6 +2864,17 @@ bool VMainWindow::toggleExpandModeByCaptain(void *p_target, void *p_data)
return true;
}
bool VMainWindow::currentNoteInfoByCaptain(void *p_target, void *p_data)
{
Q_UNUSED(p_data);
VMainWindow *obj = static_cast<VMainWindow *>(p_target);
if (obj->noteInfoAct->isEnabled()) {
obj->curEditFileInfo();
}
return true;
}
bool VMainWindow::discardAndReadByCaptain(void *p_target, void *p_data)
{
Q_UNUSED(p_data);

View File

@ -340,6 +340,8 @@ private:
static bool toggleExpandModeByCaptain(void *p_target, void *p_data);
static bool currentNoteInfoByCaptain(void *p_target, void *p_data);
static bool discardAndReadByCaptain(void *p_target, void *p_data);
static bool toggleToolBarByCaptain(void *p_target, void *p_data);