Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
717121c4
Commit
717121c4
authored
Mar 20, 2021
by
Julius Künzel
Browse files
Monitor: add possiblity to use shortcut for show/hide edit mode
BUG: 434405
parent
813cd149
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/monitor/monitor.cpp
View file @
717121c4
...
...
@@ -129,7 +129,6 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
,
m_dragStarted
(
false
)
,
m_recManager
(
nullptr
)
,
m_loopClipAction
(
nullptr
)
,
m_sceneVisibilityAction
(
nullptr
)
,
m_contextMenu
(
nullptr
)
,
m_markerMenu
(
nullptr
)
,
m_audioChannels
(
nullptr
)
...
...
@@ -439,11 +438,7 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
connect
(
m_glMonitor
->
getControllerProxy
(),
&
MonitorProxy
::
addRemoveKeyframe
,
this
,
&
Monitor
::
addRemoveKeyframe
);
connect
(
m_glMonitor
->
getControllerProxy
(),
&
MonitorProxy
::
seekToKeyframe
,
this
,
&
Monitor
::
slotSeekToKeyFrame
);
m_sceneVisibilityAction
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"transform-crop"
)),
i18n
(
"Show/Hide edit mode"
),
this
);
m_sceneVisibilityAction
->
setCheckable
(
true
);
m_sceneVisibilityAction
->
setChecked
(
KdenliveSettings
::
showOnMonitorScene
());
connect
(
m_sceneVisibilityAction
,
&
QAction
::
triggered
,
this
,
&
Monitor
::
slotEnableEffectScene
);
m_toolbar
->
addAction
(
m_sceneVisibilityAction
);
m_toolbar
->
addAction
(
manager
->
getAction
(
QStringLiteral
(
"monitor_editmode"
)));
m_toolbar
->
addSeparator
();
m_toolbar
->
addWidget
(
m_timePos
);
...
...
@@ -1849,7 +1844,7 @@ QPoint Monitor::getZoneInfo() const
return
m_glMonitor
->
getControllerProxy
()
->
zone
();
}
void
Monitor
::
slotE
nableEffectScene
(
bool
enable
)
void
Monitor
::
e
nableEffectScene
(
bool
enable
)
{
KdenliveSettings
::
setShowOnMonitorScene
(
enable
);
MonitorSceneType
sceneType
=
enable
?
m_lastMonitorSceneType
:
MonitorSceneDefault
;
...
...
@@ -2213,7 +2208,7 @@ void Monitor::loadQmlScene(MonitorSceneType type, QVariant sceneData)
return
;
}
bool
sceneWithEdit
=
type
==
MonitorSceneGeometry
||
type
==
MonitorSceneCorners
||
type
==
MonitorSceneRoto
;
if
(
(
m_
sceneVisibilityAction
!=
nullptr
)
&&
!
m_sceneVisibilityAction
->
isChecked
()
&&
sceneWithEdit
)
{
if
(
!
m_
monitorManager
->
getAction
(
QStringLiteral
(
"monitor_editmode"
))
->
isChecked
()
&&
sceneWithEdit
)
{
// User doesn't want effect scenes
pCore
->
displayMessage
(
i18n
(
"Enable edit mode in monitor to edit effect"
),
InformationMessage
,
500
);
type
=
MonitorSceneDefault
;
...
...
src/monitor/monitor.h
View file @
717121c4
...
...
@@ -154,6 +154,8 @@ public:
void
normalizeAudioThumbs
();
/** @brief Returns true if monitor is playing */
bool
isPlaying
()
const
;
/** @brief Enables / disables effect scene*/
void
enableEffectScene
(
bool
enable
);
protected:
...
...
@@ -200,7 +202,6 @@ private:
KSelectAction
*
m_forceSize
;
/** Has to be available so we can enable and disable it. */
QAction
*
m_loopClipAction
;
QAction
*
m_sceneVisibilityAction
;
QAction
*
m_zoomVisibilityAction
;
QMenu
*
m_contextMenu
;
QMenu
*
m_configMenu
;
...
...
@@ -247,7 +248,6 @@ private slots:
void
onFrameDisplayed
(
const
SharedFrame
&
frame
);
void
slotStartDrag
();
void
setZoom
();
void
slotEnableEffectScene
(
bool
enable
);
void
slotAdjustEffectCompare
();
void
slotShowMenu
(
const
QPoint
pos
);
void
slotForceSize
(
QAction
*
a
);
...
...
src/monitor/monitormanager.cpp
View file @
717121c4
...
...
@@ -331,6 +331,13 @@ void MonitorManager::resetConsumers(bool fullReset)
}
}
void
MonitorManager
::
slotToggleEffectScene
(
bool
enable
)
{
if
(
m_activeMonitor
)
{
static_cast
<
Monitor
*>
(
m_activeMonitor
)
->
enableEffectScene
(
enable
);
}
}
void
MonitorManager
::
slotUpdateAudioMonitoring
()
{
if
(
m_clipMonitor
)
{
...
...
@@ -422,6 +429,12 @@ void MonitorManager::setupActions()
});
pCore
->
window
()
->
addAction
(
QStringLiteral
(
"monitor_multitrack"
),
m_multiTrack
);
QAction
*
enableEditmode
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"transform-crop"
)),
i18n
(
"Show/Hide edit mode"
),
this
);
enableEditmode
->
setCheckable
(
true
);
enableEditmode
->
setChecked
(
KdenliveSettings
::
showOnMonitorScene
());
connect
(
enableEditmode
,
&
QAction
::
triggered
,
this
,
&
MonitorManager
::
slotToggleEffectScene
);
pCore
->
window
()
->
addAction
(
QStringLiteral
(
"monitor_editmode"
),
enableEditmode
);
QAction
*
projectEnd
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"go-last"
)),
i18n
(
"Go to Project End"
),
this
);
connect
(
projectEnd
,
&
QAction
::
triggered
,
this
,
&
MonitorManager
::
slotEnd
);
pCore
->
window
()
->
addAction
(
QStringLiteral
(
"seek_end"
),
projectEnd
,
Qt
::
CTRL
+
Qt
::
Key_End
);
...
...
src/monitor/monitormanager.h
View file @
717121c4
...
...
@@ -128,6 +128,8 @@ private slots:
void
slotZoomOut
();
/** @brief Trigger refresh of both monitors */
void
forceProjectMonitorRefresh
();
/** @brief Enables / disables effect scene*/
void
slotToggleEffectScene
(
bool
enable
);
private:
/** @brief Make sure 2 monitors cannot be activated simultaneously*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment