Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuickAccess: add quick note #2373

Merged
merged 9 commits into from
Aug 24, 2023
Merged

Conversation

feloxx
Copy link
Member

@feloxx feloxx commented Apr 4, 2023

Impl: #2351

In this modification, the function of double-click tab to quickly create notes is added. do not adjust the template for now.

src/widgets/viewsplit.cpp Outdated Show resolved Hide resolved
src/widgets/viewsplit.cpp Outdated Show resolved Hide resolved
src/widgets/viewsplit.cpp Outdated Show resolved Hide resolved
@@ -92,6 +92,8 @@ namespace vnotex

void distributeSplitsRequested();

void newNoteRequested(ViewSplit *p_split, const QVector<int> &p_type, const QString &p_path);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function necessary? Can we just emit the final signal here instead of via the ViewArea?

auto node = checkNotebookAndGetCurrentExploredFolderNode();
if (!node) {
return;
if (p_type.length() <= c_defaultCreateNote) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c_defaultCreateNode is 0. So what does this logic mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is mainly used to determine p_type, Is it the default, is it single, is it multiple.

paras->m_newFile = true;
emit VNoteX::getInst().openNodeRequested(dialog.getNewNode().data(), paras);
}
} else if (p_type.length() == c_singleQuickNote) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use 1 is fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to use < 1= 1, but that's a magic constant, which is hard to understand

src/core/notebook/node.h Outdated Show resolved Hide resolved
@tamlok tamlok merged commit e8fe072 into vnotex:master Aug 24, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants