forked from vnotex/vnote
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvhelpue.cpp
More file actions
86 lines (68 loc) · 2.34 KB
/
vhelpue.cpp
File metadata and controls
86 lines (68 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include "vhelpue.h"
#include "vlistwidget.h"
VHelpUE::VHelpUE(QObject *p_parent)
: IUniversalEntry(p_parent),
m_listWidget(NULL)
{
}
void VHelpUE::init()
{
if (m_initialized) {
return;
}
m_initialized = true;
m_listWidget = new VListWidget(m_widgetParent);
m_listWidget->setFitContent(true);
}
QString VHelpUE::description(int p_id) const
{
Q_UNUSED(p_id);
return tr("View help information about Universal Entry");
}
QWidget *VHelpUE::widget(int p_id)
{
Q_UNUSED(p_id);
init();
return m_listWidget;
}
void VHelpUE::processCommand(int p_id, const QString &p_cmd)
{
Q_UNUSED(p_id);
Q_UNUSED(p_cmd);
init();
if (initListWidget()) {
m_listWidget->updateGeometry();
emit widgetUpdated();
}
emit stateUpdated(State::Success);
}
void VHelpUE::clear(int p_id)
{
Q_UNUSED(p_id);
m_listWidget->clearAll();
}
bool VHelpUE::initListWidget()
{
if (m_listWidget->count() == 0) {
m_listWidget->addItem(tr("Esc or Ctrl+[: Hide Universal Entry"));
m_listWidget->addItem(tr("Ctrl+U: Clear the command input"));
m_listWidget->addItem(tr("Ctrl+E: Clear the command input except the entry key"));
m_listWidget->addItem(tr("Ctrl+F: Select the entry key to change"));
m_listWidget->addItem(tr("Ctrl+D: Cancel the command"));
m_listWidget->addItem(tr("Ctrl+J: Go to next item"));
m_listWidget->addItem(tr("Ctrl+K: Go to previous item"));
m_listWidget->addItem(tr("Ctrl+L: Go to current item's parent item"));
m_listWidget->addItem(tr("Ctrl+I: Expand/Collapse current item"));
m_listWidget->addItem(tr("Ctrl+B: Expand/Collapse all items"));
m_listWidget->addItem(tr("Ctrl+S: Sort items"));
m_listWidget->addItem(tr("Enter: Activate current item"));
m_listWidget->addItem(tr("Ctrl+M: Browse current item folder or the folder containing current item"));
m_listWidget->addItem(tr("Magic Switches:"));
m_listWidget->addItem(tr("\\c or \\C: Case insensitive or sensitive"));
m_listWidget->addItem(tr("\\r or \\R: Disable or enable regular expression"));
m_listWidget->addItem(tr("\\f or \\F: Disable or enable fuzzy search"));
m_listWidget->addItem(tr("\\w or \\W: Disable or enable whole word only"));
return true;
}
return false;
}