diff --git a/src/dialog/vnewfiledialog.cpp b/src/dialog/vnewfiledialog.cpp index 40c5796b..81f47b1e 100644 --- a/src/dialog/vnewfiledialog.cpp +++ b/src/dialog/vnewfiledialog.cpp @@ -19,7 +19,8 @@ void VNewFileDialog::setupUI() nameLabel = new QLabel(name); nameEdit = new QLineEdit(defaultName); - nameEdit->selectAll(); + int dotIndex = defaultName.lastIndexOf('.'); + nameEdit->setSelection(0, (dotIndex == -1) ? defaultName.size() : dotIndex); nameLabel->setBuddy(nameEdit); // Ok is the default button. diff --git a/src/translations/vnote_zh_CN.qm b/src/translations/vnote_zh_CN.qm index 6774ebcb..8bd95fc1 100644 Binary files a/src/translations/vnote_zh_CN.qm and b/src/translations/vnote_zh_CN.qm differ diff --git a/src/translations/vnote_zh_CN.ts b/src/translations/vnote_zh_CN.ts index edcf3ae6..3e10878b 100644 --- a/src/translations/vnote_zh_CN.ts +++ b/src/translations/vnote_zh_CN.ts @@ -364,63 +364,68 @@ Create a note in %1. - 在目录 %1 中新建一个笔记。 + 在目录 %1 中新建笔记。 + Note with name ending with ".md" will be treated as Markdown type. + 名字以".md"结尾的笔记会被作为Markdown类型处理。 + + + Note &name: 笔记名 (&N): - + Create Note 新建笔记 - + Name already exists. Please choose another name. 该笔记本名已存在。请选择另一个名字。 - - - - + + + + Warning 警告 - + Fail to create note %1. 新建笔记失败: %1。 - + Are you sure to delete note %1? 确认删除笔记: %1? - + This may be unrecoverable! 该操作不可撤消! - + Fail to copy note %1. 复制笔记失败: %1。 - + Please check if there already exists a file with the same name in the target directory. 请检查目标文件夹中是否存在同名文件。 - + The renaming will change the note type. 重命名会更改笔记类型。 - + You should close the note %1 before continue. 请在继续前先关闭笔记: %1。 diff --git a/src/vfilelist.cpp b/src/vfilelist.cpp index 8031261f..4579dc4e 100644 --- a/src/vfilelist.cpp +++ b/src/vfilelist.cpp @@ -174,8 +174,9 @@ void VFileList::newFile() return; } QString info = tr("Create a note in %1.").arg(m_directory->getName()); + info = info + "\n" + tr("Note with name ending with \".md\" will be treated as Markdown type."); QString text(tr("Note &name:")); - QString defaultText("new_note"); + QString defaultText("new_note.md"); do { VNewFileDialog dialog(tr("Create Note"), info, text, defaultText, this); if (dialog.exec() == QDialog::Accepted) {