Commit 54bbc6ae authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Add monitor and ruler key binding info.

Related to #916
parent a4b4c526
Pipeline #47634 passed with stage
in 10 minutes and 47 seconds
......@@ -544,13 +544,13 @@ void MyListView::focusInEvent(QFocusEvent *event)
void MyListView::enterEvent(QEvent *event)
{
QListView::enterEvent(event);
pCore->window()->setWidgetKeyBinding(i18n("<b>Double click</b> to add a file to the project"));
pCore->setWidgetKeyBinding(i18n("<b>Double click</b> to add a file to the project"));
}
void MyListView::leaveEvent(QEvent *event)
{
QListView::leaveEvent(event);
pCore->window()->setWidgetKeyBinding();
pCore->setWidgetKeyBinding();
}
void MyListView::mousePressEvent(QMouseEvent *event)
......@@ -584,7 +584,7 @@ void MyListView::mouseMoveEvent(QMouseEvent *event)
qDebug()<<"<<< NO DELEGATE!!!";
}
}
pCore->window()->showKeyBinding(i18n("F2 to rename selected item"));
pCore->window()->showKeyBinding(i18n("<b>F2</b> to rename selected item"));
} else {
pCore->window()->showKeyBinding();
}
......@@ -624,13 +624,13 @@ void MyTreeView::focusInEvent(QFocusEvent *event)
void MyTreeView::enterEvent(QEvent *event)
{
QTreeView::enterEvent(event);
pCore->window()->setWidgetKeyBinding(i18n("<b>Double click</b> to add a file to the project"));
pCore->setWidgetKeyBinding(i18n("<b>Double click</b> to add a file to the project"));
}
void MyTreeView::leaveEvent(QEvent *event)
{
QTreeView::leaveEvent(event);
pCore->window()->setWidgetKeyBinding();
pCore->setWidgetKeyBinding();
}
void MyTreeView::mouseMoveEvent(QMouseEvent *event)
......@@ -649,7 +649,7 @@ void MyTreeView::mouseMoveEvent(QMouseEvent *event)
int frame = static_cast<BinItemDelegate *>(del)->getFrame(index, event->pos().x());
emit displayBinFrame(index, frame);
}
pCore->window()->showKeyBinding(i18n("F2 to rename selected item"));
pCore->window()->showKeyBinding(i18n("<b>F2</b> to rename selected item"));
} else {
pCore->window()->showKeyBinding();
}
......
......@@ -1004,16 +1004,22 @@ void Core::addGuides(QList <int> guides)
GenTime p(pos, pCore->getCurrentFps());
markers.insert(p, pCore->currentDoc()->timecode().getDisplayTimecode(p, false));
}
pCore->currentDoc()->getGuideModel()->addMarkers(markers);
currentDoc()->getGuideModel()->addMarkers(markers);
}
void Core::temporaryUnplug(QList<int> clipIds, bool hide)
{
pCore->window()->getMainTimeline()->controller()->temporaryUnplug(clipIds, hide);
window()->getMainTimeline()->controller()->temporaryUnplug(clipIds, hide);
}
void Core::transcodeFile(const QString url)
{
qDebug()<<"=== TRANSCODING: "<<url;
pCore->window()->slotTranscode({url});
window()->slotTranscode({url});
}
void Core::setWidgetKeyBinding(const QString &mess)
{
window()->setWidgetKeyBinding(mess);
}
......@@ -241,6 +241,8 @@ public:
std::shared_ptr<SubtitleModel> getSubtitleModel(bool enforce = false);
/** @brief Transcode a video file. */
void transcodeFile(const QString url);
/** @brief Display key binding info in statusbar. */
void setWidgetKeyBinding(const QString &mess = QString());
KSharedDataCache audioThumbCache;
private:
......
......@@ -106,19 +106,6 @@ bool QuickEventEater::eventFilter(QObject *obj, QEvent *event)
}
break;
}
default:
break;
}
return QObject::eventFilter(obj, event);
}
QuickMonitorEventEater::QuickMonitorEventEater(QWidget *parent)
: QObject(parent)
{
}
bool QuickMonitorEventEater::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::KeyPress) {
auto *ev = static_cast<QKeyEvent *>(event);
if (ev) {
......@@ -126,6 +113,9 @@ bool QuickMonitorEventEater::eventFilter(QObject *obj, QEvent *event)
return true;
}
}
default:
break;
}
return QObject::eventFilter(obj, event);
}
......@@ -170,16 +160,13 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
auto *leventEater = new QuickEventEater(this);
m_videoWidget->installEventFilter(leventEater);
connect(leventEater, &QuickEventEater::addEffect, this, &Monitor::slotAddEffect);
connect(leventEater, &QuickEventEater::doKeyPressEvent, this, &Monitor::doKeyPressEvent);
m_qmlManager = new QmlManager(m_glMonitor);
connect(m_qmlManager, &QmlManager::effectChanged, this, &Monitor::effectChanged);
connect(m_qmlManager, &QmlManager::effectPointsChanged, this, &Monitor::effectPointsChanged);
connect(m_qmlManager, &QmlManager::activateTrack, this, &Monitor::activateTrack);
auto *monitorEventEater = new QuickMonitorEventEater(this);
m_videoWidget->installEventFilter(monitorEventEater);
connect(monitorEventEater, &QuickMonitorEventEater::doKeyPressEvent, this, &Monitor::doKeyPressEvent);
glayout->addWidget(m_videoWidget, 0, 0);
m_verticalScroll = new QScrollBar(Qt::Vertical);
glayout->addWidget(m_verticalScroll, 0, 1);
......
......@@ -65,21 +65,10 @@ protected:
signals:
void addEffect(const QStringList &);
};
class QuickMonitorEventEater : public QObject
{
Q_OBJECT
public:
explicit QuickMonitorEventEater(QWidget *parent);
protected:
bool eventFilter(QObject *obj, QEvent *event) override;
signals:
void doKeyPressEvent(QKeyEvent *);
};
class Monitor : public AbstractMonitor
{
Q_OBJECT
......
......@@ -388,3 +388,8 @@ void MonitorProxy::setTimeCode(TimecodeDisplay *td)
{
m_td = td;
}
void MonitorProxy::setWidgetKeyBinding(const QString &text) const
{
pCore->setWidgetKeyBinding(text);
}
......@@ -105,6 +105,7 @@ public:
Q_INVOKABLE double fps() const;
Q_INVOKABLE void switchAutoKeyframe();
Q_INVOKABLE bool autoKeyframe() const;
Q_INVOKABLE void setWidgetKeyBinding(const QString &text = QString()) const;
QPoint profile();
void setClipProperties(int clipId, ClipType::ProducerType type, bool hasAV, const QString clipName);
void setAudioThumb(const QList <int> streamIndexes = QList <int>(), QList <int> channels = QList <int>());
......
......@@ -417,6 +417,12 @@ Rectangle {
wheel.accepted = false
}
}
onEntered: {
controller.setWidgetKeyBinding(i18n("<b>Wheel</b> or <b>arrows</b> to seek 1 frame, <b>Shift</b> to seek 1 second, <b>Alt</b> to seek to marker, <b>Home</b> / <b>End</b> to go to first / last frame"));
}
onExited: {
controller.setWidgetKeyBinding();
}
}
// Zone duration indicator
Rectangle {
......
......@@ -141,6 +141,12 @@ Item {
onWheel: {
controller.seek(wheel.angleDelta.x + wheel.angleDelta.y, wheel.modifiers)
}
onEntered: {
controller.setWidgetKeyBinding(i18n("<b>Click</b> to play, <b>Double click</b> for fullscreen, <b>Hover right</b> for toolbar, <b>Wheel</b> or <b>arrows</b> to seek, <b>Ctrl wheel</b> to zoom"));
}
onExited: {
controller.setWidgetKeyBinding();
}
}
SceneToolBar {
......
......@@ -71,6 +71,12 @@ Item {
onWheel: {
controller.seek(wheel.angleDelta.x + wheel.angleDelta.y, wheel.modifiers)
}
onEntered: {
controller.setWidgetKeyBinding(i18n("<b>Click</b> to play, <b>Double click</b> for fullscreen, <b>Hover right</b> for toolbar, <b>Wheel</b> or <b>arrows</b> to seek, <b>Ctrl wheel</b> to zoom"));
}
onExited: {
controller.setWidgetKeyBinding();
}
}
SceneToolBar {
id: sceneToolBar
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment