add welcome page

This commit is contained in:
Le Tan 2021-07-16 20:10:14 +08:00
parent 2e9c727248
commit 3d7cd68707
11 changed files with 54 additions and 3 deletions

View File

@ -5,7 +5,7 @@
一个舒适的笔记平台! 一个舒适的笔记平台!
更多信息,请访问 [VNote 主页](https://tamlok.gitee.io/vnote) 或者 [Gitee 托管主页](https://tamlok.gitee.io/vnote) 。 更多信息,请访问 [VNote 主页](https://tamlok.gitee.io/vnote) 或者[Gitee 托管主页](https://tamlok.gitee.io/vnote) 。
![VNote](pics/vnote.png) ![VNote](pics/vnote.png)

View File

@ -118,4 +118,5 @@ void MainConfig::doVersionSpecificOverride()
{ {
// In a new version, we may want to change one value by force. // In a new version, we may want to change one value by force.
m_coreConfig->m_shortcuts[CoreConfig::Shortcut::LocationListDock] = "Ctrl+G, C"; m_coreConfig->m_shortcuts[CoreConfig::Shortcut::LocationListDock] = "Ctrl+G, C";
m_coreConfig->m_shortcuts[CoreConfig::Shortcut::NewWorkspace] = "";
} }

View File

@ -17,7 +17,7 @@ QString DummyVersionControllerFactory::getName() const
QString DummyVersionControllerFactory::getDisplayName() const QString DummyVersionControllerFactory::getDisplayName() const
{ {
return QObject::tr("Dummy Version Control"); return QObject::tr("No Version Control");
} }
QString DummyVersionControllerFactory::getDescription() const QString DummyVersionControllerFactory::getDescription() const

View File

@ -28,7 +28,7 @@
"MaximizeSplit" : "Ctrl+G, Shift+\\", "MaximizeSplit" : "Ctrl+G, Shift+\\",
"DistributeSplits" : "Ctrl+G, =", "DistributeSplits" : "Ctrl+G, =",
"RemoveSplitAndWorkspace" : "Ctrl+G, R", "RemoveSplitAndWorkspace" : "Ctrl+G, R",
"NewWorkspace" : "Ctrl+G, M", "NewWorkspace" : "",
"Export" : "Ctrl+G, T", "Export" : "Ctrl+G, T",
"Quit" : "Ctrl+Q", "Quit" : "Ctrl+Q",
"FlashPage" : "Ctrl+Alt+L", "FlashPage" : "Ctrl+Alt+L",

View File

@ -0,0 +1,10 @@
# Welcome To VNote
A pleasant note-taking platform.
For more information, please visit [**VNote's Home Page**](https://vnotex.github.io/vnote) or [Home Page on Gitee](https://tamlok.gitee.io/vnote).
## FAQs
* If VNote crashes after update, please delete the `vnotex.json` file under user configuration folder.
* VNote has a series of powerful shortcuts. Please view the user configuration file `vnotex.json` for a complete list of shortcuts.
* Feedbacks are appreciated! Please [post an issue](https://github.com/vnotex/vnote/issues) on GitHub if there is any.

View File

@ -0,0 +1,10 @@
# 欢迎使用 VNote
一个舒适的笔记平台。
更多信息,请访问 [VNote 主页](https://tamlok.gitee.io/vnote) 或者[由 Gitee 托管的主页](https://tamlok.gitee.io/vnote) 。
## 常见问题
* 如果更新后 VNote 崩溃,请删除用户配置文件夹中的 `vnotex.json` 文件。
* VNote 有着一系列强大的快捷键。请查看用户配置文件 `vnotex.json` 以获取一个完整的快捷键列表。
* 使用中有任何问题,欢迎[反馈](https://github.com/vnotex/vnote/issues) 。

View File

@ -5,11 +5,13 @@
<file>docs/en/shortcuts.md</file> <file>docs/en/shortcuts.md</file>
<file>docs/en/markdown_guide.md</file> <file>docs/en/markdown_guide.md</file>
<file>docs/en/external_programs.md</file> <file>docs/en/external_programs.md</file>
<file>docs/en/welcome.md</file>
<file>docs/zh_CN/get_started.txt</file> <file>docs/zh_CN/get_started.txt</file>
<file>docs/zh_CN/about_vnotex.txt</file> <file>docs/zh_CN/about_vnotex.txt</file>
<file>docs/zh_CN/shortcuts.md</file> <file>docs/zh_CN/shortcuts.md</file>
<file>docs/zh_CN/markdown_guide.md</file> <file>docs/zh_CN/markdown_guide.md</file>
<file>docs/zh_CN/external_programs.md</file> <file>docs/zh_CN/external_programs.md</file>
<file>docs/zh_CN/welcome.md</file>
<file>web/markdown-viewer-template.html</file> <file>web/markdown-viewer-template.html</file>
<file>web/markdown-export-template.html</file> <file>web/markdown-export-template.html</file>
<file>web/css/globalstyles.css</file> <file>web/css/globalstyles.css</file>

View File

@ -28,6 +28,7 @@
#include <core/configmgr.h> #include <core/configmgr.h>
#include <core/sessionconfig.h> #include <core/sessionconfig.h>
#include <core/coreconfig.h> #include <core/coreconfig.h>
#include <core/mainconfig.h>
#include <core/widgetconfig.h> #include <core/widgetconfig.h>
#include <core/events.h> #include <core/events.h>
#include <core/fileopenparameters.h> #include <core/fileopenparameters.h>
@ -45,6 +46,7 @@
#include <notebook/notebook.h> #include <notebook/notebook.h>
#include "searchinfoprovider.h" #include "searchinfoprovider.h"
#include <vtextedit/spellchecker.h> #include <vtextedit/spellchecker.h>
#include <utils/docsutils.h>
using namespace vnotex; using namespace vnotex;
@ -95,6 +97,15 @@ void MainWindow::kickOffOnStart(const QStringList &p_paths)
demoWidget(); demoWidget();
openFiles(p_paths); openFiles(p_paths);
if (MainConfig::isVersionChanged()) {
const auto file = DocsUtils::getDocFile(QStringLiteral("welcome.md"));
if (!file.isEmpty()) {
auto paras = QSharedPointer<FileOpenParameters>::create();
paras->m_readOnly = true;
emit VNoteX::getInst().openFileRequested(file, paras);
}
}
}); });
} }

View File

@ -74,6 +74,8 @@ void NotebookExplorer::setupUI()
auto id = static_cast<ID>(m_selector->itemData(p_idx).toULongLong()); auto id = static_cast<ID>(m_selector->itemData(p_idx).toULongLong());
emit notebookActivated(id); emit notebookActivated(id);
}); });
connect(m_selector, &NotebookSelector::newNotebookRequested,
this, &NotebookExplorer::newNotebook);
mainLayout->addWidget(m_selector); mainLayout->addWidget(m_selector);
const auto &widgetConfig = ConfigMgr::getInst().getWidgetConfig(); const auto &widgetConfig = ConfigMgr::getInst().getWidgetConfig();

View File

@ -176,3 +176,13 @@ void NotebookSelector::clearNavigation()
NavigationMode::clearNavigation(); NavigationMode::clearNavigation();
} }
void NotebookSelector::mousePressEvent(QMouseEvent *p_event)
{
if (count() == 0) {
emit newNotebookRequested();
return;
}
QComboBox::mousePressEvent(p_event);
}

View File

@ -23,6 +23,9 @@ namespace vnotex
void setCurrentNotebook(ID p_id); void setCurrentNotebook(ID p_id);
signals:
void newNotebookRequested();
// NavigationMode. // NavigationMode.
protected: protected:
QVector<void *> getVisibleNavigationItems() Q_DECL_OVERRIDE; QVector<void *> getVisibleNavigationItems() Q_DECL_OVERRIDE;
@ -36,6 +39,8 @@ namespace vnotex
protected: protected:
bool eventFilter(QObject *p_obj, QEvent *p_event) Q_DECL_OVERRIDE; bool eventFilter(QObject *p_obj, QEvent *p_event) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent *p_event) Q_DECL_OVERRIDE;
private: private:
void addNotebookItem(const QSharedPointer<Notebook> &p_notebook); void addNotebookItem(const QSharedPointer<Notebook> &p_notebook);