Commit 73d0cf75 authored by Julius Künzel's avatar Julius Künzel
Browse files

At least a little bit more order in configure shortcuts dialog

parent c56863f9
Pipeline #123572 passed with stage
in 6 minutes and 46 seconds
......@@ -2789,19 +2789,19 @@ void Bin::doRefreshPanel(const QString &id)
}
}
QAction *Bin::addAction(const QString &name, const QString &text, const QIcon &icon)
QAction *Bin::addAction(const QString &name, const QString &text, const QIcon &icon, const QString &category)
{
auto *action = new QAction(text, this);
if (!icon.isNull()) {
action->setIcon(icon);
}
pCore->window()->addAction(name, action);
pCore->window()->addAction(name, action, {}, category);
return action;
}
void Bin::setupAddClipAction(QMenu *addClipMenu, ClipType::ProducerType type, const QString &name, const QString &text, const QIcon &icon)
{
QAction *action = addAction(name, text, icon);
QAction *action = addAction(name, text, icon, QStringLiteral("addclip"));
action->setData(static_cast<QVariant>(type));
addClipMenu->addAction(action);
connect(action, &QAction::triggered, this, &Bin::slotCreateProjectClip);
......@@ -3067,7 +3067,7 @@ void Bin::setupMenu()
auto *addClipMenu = new QMenu(this);
m_addClip =
addAction(QStringLiteral("add_clip"), i18n("Add Clip or Folder"), QIcon::fromTheme(QStringLiteral("kdenlive-add-clip")));
addAction(QStringLiteral("add_clip"), i18n("Add Clip or Folder"), QIcon::fromTheme(QStringLiteral("kdenlive-add-clip")), QStringLiteral("addclip"));
addClipMenu->addAction(m_addClip);
connect(m_addClip, &QAction::triggered, this, &Bin::slotAddClip);
......
......@@ -549,7 +549,7 @@ private:
long m_processedAudio;
/** @brief Indicates whether audio thumbnail creation is running. */
QFuture<void> m_audioThumbsThread;
QAction *addAction(const QString &name, const QString &text, const QIcon &icon);
QAction *addAction(const QString &name, const QString &text, const QIcon &icon, const QString &category = {});
void setupAddClipAction(QMenu *addClipMenu, ClipType::ProducerType type, const QString &name, const QString &text, const QIcon &icon);
/** @brief Get the QModelIndex value for an item in the Bin. */
QModelIndex getIndexForId(const QString &id, bool folderWanted) const;
......
......@@ -50,7 +50,7 @@ DragButton::DragButton(int ix, const QString &tag, const QString &description, Q
ac->setIcon(QIcon(pix));
ac->setCheckable(true);
setDefaultAction(ac);
pCore->window()->actionCollection()->addAction(QString("tag_%1").arg(ix), ac);
pCore->window()->addAction(QString("tag_%1").arg(ix), ac, {}, QStringLiteral("bintags"));
connect(ac, &QAction::triggered, this, [&] (bool checked) {
emit switchTag(m_tag, checked);
});
......
......@@ -59,11 +59,11 @@ LayoutManagement::LayoutManagement(QObject *parent)
// Dock Area Oriantation
QAction *rowDockAreaAction = new QAction(QIcon::fromTheme(QStringLiteral("object-rows")), i18n("Arrange Dock Areas In Rows"), this);
pCore->window()->addAction(QStringLiteral("horizontal_dockareaorientation"), rowDockAreaAction);
layoutActions->addAction(QStringLiteral("horizontal_dockareaorientation"), rowDockAreaAction);
connect(rowDockAreaAction, &QAction::triggered, this, &LayoutManagement::slotDockAreaRows);
QAction * colDockAreaAction = new QAction(QIcon::fromTheme(QStringLiteral("object-columns")), i18n("Arrange Dock Areas In Columns"), this);
pCore->window()->addAction(QStringLiteral("vertical_dockareaorientation"), colDockAreaAction);
layoutActions->addAction(QStringLiteral("vertical_dockareaorientation"), colDockAreaAction);
connect(colDockAreaAction, &QAction::triggered, this, &LayoutManagement::slotDockAreaColumns);
// Create layout switcher for the menu bar
......
......@@ -142,6 +142,17 @@ MainWindow::MainWindow(QWidget *parent)
: KXmlGuiWindow(parent)
, m_activeTool(ToolType::SelectTool)
{
// Init all action categories that are used by other parts of the software
// before we call MainWindow::init and therefore can't be initilized there
KActionCategory *category = new KActionCategory(i18n("Monitor"), actionCollection());
kdenliveCategoryMap.insert(QStringLiteral("monitor"), category);
category = new KActionCategory(i18n("Add Clip"), actionCollection());
kdenliveCategoryMap.insert(QStringLiteral("addclip"), category);
category = new KActionCategory(i18n("Navigation and Playback"), actionCollection());
kdenliveCategoryMap.insert(QStringLiteral("navandplayback"), category);
category = new KActionCategory(i18n("Bin Tags"), actionCollection());
kdenliveCategoryMap.insert(QStringLiteral("bintags"), category);
}
void MainWindow::init(const QString &mltPath)
......@@ -1021,6 +1032,11 @@ void MainWindow::addAction(const QString &name, QAction *action, const QKeySeque
actionCollection()->setDefaultShortcut(action, shortcut);
}
void MainWindow::addAction(const QString &name, QAction *action, const QKeySequence &shortcut, const QString &category)
{
addAction(name, action, shortcut, kdenliveCategoryMap.value(category, nullptr));
}
QAction *MainWindow::addAction(const QString &name, const QString &text, const QObject *receiver, const char *member, const QIcon &icon,
const QKeySequence &shortcut, KActionCategory *category)
{
......@@ -1034,6 +1050,12 @@ QAction *MainWindow::addAction(const QString &name, const QString &text, const Q
return action;
}
QAction *MainWindow::addAction(const QString &name, const QString &text, const QObject *receiver, const char *member, const QIcon &icon,
const QKeySequence &shortcut, const QString &category)
{
return addAction(name, text, receiver, member, icon, shortcut, kdenliveCategoryMap.value(category, nullptr));
}
void MainWindow::setupActions()
{
// create edit mode buttons
......@@ -1224,32 +1246,6 @@ void MainWindow::setupActions()
// toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
/*QWidget * actionWidget;
int max = toolbar->iconSizeDefault() + 2;
actionWidget = toolbar->widgetForAction(m_normalEditTool);
actionWidget->setMaximumWidth(max);
actionWidget->setMaximumHeight(max - 4);
actionWidget = toolbar->widgetForAction(m_insertEditTool);
actionWidget->setMaximumWidth(max);
actionWidget->setMaximumHeight(max - 4);
actionWidget = toolbar->widgetForAction(m_overwriteEditTool);
actionWidget->setMaximumWidth(max);
actionWidget->setMaximumHeight(max - 4);
actionWidget = toolbar->widgetForAction(m_buttonSelectTool);
actionWidget->setMaximumWidth(max);
actionWidget->setMaximumHeight(max - 4);
actionWidget = toolbar->widgetForAction(m_buttonRazorTool);
actionWidget->setMaximumWidth(max);
actionWidget->setMaximumHeight(max - 4);
actionWidget = toolbar->widgetForAction(m_buttonSpacerTool);
actionWidget->setMaximumWidth(max);
actionWidget->setMaximumHeight(max - 4);*/
connect(toolGroup, &QActionGroup::triggered, this, &MainWindow::slotChangeTool);
m_buttonVideoThumbs = new QAction(QIcon::fromTheme(QStringLiteral("kdenlive-show-videothumb")), i18n("Show video thumbnails"), this);
......@@ -1347,16 +1343,19 @@ void MainWindow::setupActions()
toolbar->layout()->setContentsMargins(0, 0, 0, 0);
statusBar()->setContentsMargins(0, 0, 0, 0);
addAction(QStringLiteral("normal_mode"), m_normalEditTool);
addAction(QStringLiteral("overwrite_mode"), m_overwriteEditTool);
addAction(QStringLiteral("insert_mode"), m_insertEditTool);
addAction(QStringLiteral("select_tool"), m_buttonSelectTool, Qt::Key_S);
addAction(QStringLiteral("razor_tool"), m_buttonRazorTool, Qt::Key_X);
addAction(QStringLiteral("spacer_tool"), m_buttonSpacerTool, Qt::Key_M);
addAction(QStringLiteral("ripple_tool"), m_buttonRippleTool);
//addAction(QStringLiteral("roll_tool"), m_buttonRollTool);
addAction(QStringLiteral("slip_tool"), m_buttonSlipTool);
addAction(QStringLiteral("multicam_tool"), m_buttonMulticamTool);
KActionCategory *toolsActionCategory = new KActionCategory(i18n("Tools"), actionCollection());
addAction(QStringLiteral("select_tool"), m_buttonSelectTool, Qt::Key_S, toolsActionCategory);
addAction(QStringLiteral("razor_tool"), m_buttonRazorTool, Qt::Key_X, toolsActionCategory);
addAction(QStringLiteral("spacer_tool"), m_buttonSpacerTool, Qt::Key_M, toolsActionCategory);
addAction(QStringLiteral("ripple_tool"), m_buttonRippleTool, {}, toolsActionCategory);
//addAction(QStringLiteral("roll_tool"), m_buttonRollTool, QKeySequence(), toolsActionCategory);
addAction(QStringLiteral("slip_tool"), m_buttonSlipTool, {}, toolsActionCategory);
addAction(QStringLiteral("multicam_tool"), m_buttonMulticamTool, {}, toolsActionCategory);
//addAction(QStringLiteral("slide_tool"), m_buttonSlideTool);
addAction(QStringLiteral("automatic_transition"), m_buttonTimelineTags);
......@@ -1412,9 +1411,9 @@ void MainWindow::setupActions()
});
m_playZone = addAction(QStringLiteral("monitor_play_zone"), i18n("Play Zone"), pCore->monitorManager(), SLOT(slotPlayZone()),
QIcon::fromTheme(QStringLiteral("media-playback-start")), Qt::CTRL + Qt::Key_Space);
QIcon::fromTheme(QStringLiteral("media-playback-start")), Qt::CTRL + Qt::Key_Space, QStringLiteral("navandplayback"));
m_loopZone = addAction(QStringLiteral("monitor_loop_zone"), i18n("Loop Zone"), pCore->monitorManager(), SLOT(slotLoopZone()),
QIcon::fromTheme(QStringLiteral("media-playback-start")), Qt::CTRL + Qt::SHIFT + Qt::Key_Space);
QIcon::fromTheme(QStringLiteral("media-playback-start")), Qt::CTRL + Qt::SHIFT + Qt::Key_Space, QStringLiteral("navandplayback"));
m_loopClip = new QAction(QIcon::fromTheme(QStringLiteral("media-playback-start")), i18n("Loop selected clip"), this);
addAction(QStringLiteral("monitor_loop_clip"), m_loopClip);
m_loopClip->setEnabled(false);
......@@ -1435,27 +1434,27 @@ void MainWindow::setupActions()
QIcon::fromTheme(QStringLiteral("document-open")));
QAction *overlayInfo = new QAction(QIcon::fromTheme(QStringLiteral("help-hint")), i18n("Monitor Info Overlay"), this);
addAction(QStringLiteral("monitor_overlay"), overlayInfo);
addAction(QStringLiteral("monitor_overlay"), overlayInfo, {}, QStringLiteral("monitor"));
overlayInfo->setCheckable(true);
overlayInfo->setData(0x01);
QAction *overlayTCInfo = new QAction(QIcon::fromTheme(QStringLiteral("help-hint")), i18n("Monitor Overlay Timecode"), this);
addAction(QStringLiteral("monitor_overlay_tc"), overlayTCInfo);
addAction(QStringLiteral("monitor_overlay_tc"), overlayTCInfo, {}, QStringLiteral("monitor"));
overlayTCInfo->setCheckable(true);
overlayTCInfo->setData(0x02);
QAction *overlayFpsInfo = new QAction(QIcon::fromTheme(QStringLiteral("help-hint")), i18n("Monitor Overlay Playback Fps"), this);
addAction(QStringLiteral("monitor_overlay_fps"), overlayFpsInfo);
addAction(QStringLiteral("monitor_overlay_fps"), overlayFpsInfo, {}, QStringLiteral("monitor"));
overlayFpsInfo->setCheckable(true);
overlayFpsInfo->setData(0x20);
QAction *overlayMarkerInfo = new QAction(QIcon::fromTheme(QStringLiteral("help-hint")), i18n("Monitor Overlay Markers"), this);
addAction(QStringLiteral("monitor_overlay_markers"), overlayMarkerInfo);
addAction(QStringLiteral("monitor_overlay_markers"), overlayMarkerInfo, {}, QStringLiteral("monitor"));
overlayMarkerInfo->setCheckable(true);
overlayMarkerInfo->setData(0x04);
QAction *overlayAudioInfo = new QAction(QIcon::fromTheme(QStringLiteral("help-hint")), i18n("Monitor Overlay Audio Waveform"), this);
addAction(QStringLiteral("monitor_overlay_audiothumb"), overlayAudioInfo);
addAction(QStringLiteral("monitor_overlay_audiothumb"), overlayAudioInfo, {}, QStringLiteral("monitor"));
overlayAudioInfo->setCheckable(true);
overlayAudioInfo->setData(0x10);
......@@ -1527,7 +1526,7 @@ void MainWindow::setupActions()
KSelectAction *monitorGamma = new KSelectAction(i18n("Monitor Gamma"), this);
monitorGamma->addAction(i18n("sRGB (computer)"));
monitorGamma->addAction(i18n("Rec. 709 (TV)"));
addAction(QStringLiteral("mlt_gamma"), monitorGamma);
addAction(QStringLiteral("mlt_gamma"), monitorGamma, {}, QStringLiteral("monitor"));
monitorGamma->setCurrentItem(KdenliveSettings::monitor_gamma());
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5,78,0)
connect(monitorGamma, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &MainWindow::slotSetMonitorGamma);
......@@ -1540,18 +1539,19 @@ void MainWindow::setupActions()
QIcon::fromTheme(QStringLiteral("kdenlive-add-clip")), Qt::CTRL + Qt::Key_I);
addAction(QStringLiteral("monitor_seek_snap_backward"), i18n("Go to Previous Snap Point"), this, SLOT(slotSnapRewind()),
QIcon::fromTheme(QStringLiteral("media-seek-backward")), Qt::ALT + Qt::Key_Left);
addAction(QStringLiteral("monitor_seek_guide_backward"), i18n("Go to Previous Guide"), this, SLOT(slotGuideRewind()),
QIcon::fromTheme(QStringLiteral("media-seek-backward")), Qt::CTRL + Qt::Key_Left);
QIcon::fromTheme(QStringLiteral("media-seek-backward")), Qt::ALT + Qt::Key_Left, QStringLiteral("navandplayback"));
addAction(QStringLiteral("monitor_seek_snap_forward"), i18n("Go to Next Snap Point"), this, SLOT(slotSnapForward()),
QIcon::fromTheme(QStringLiteral("media-seek-forward")), Qt::ALT + Qt::Key_Right, QStringLiteral("navandplayback"));
addAction(QStringLiteral("seek_clip_start"), i18n("Go to Clip Start"), this, SLOT(slotClipStart()), QIcon::fromTheme(QStringLiteral("media-seek-backward")),
Qt::Key_Home);
Qt::Key_Home, QStringLiteral("navandplayback"));
addAction(QStringLiteral("seek_clip_end"), i18n("Go to Clip End"), this, SLOT(slotClipEnd()), QIcon::fromTheme(QStringLiteral("media-seek-forward")),
Qt::Key_End);
addAction(QStringLiteral("monitor_seek_snap_forward"), i18n("Go to Next Snap Point"), this, SLOT(slotSnapForward()),
QIcon::fromTheme(QStringLiteral("media-seek-forward")), Qt::ALT + Qt::Key_Right);
Qt::Key_End, QStringLiteral("navandplayback"));
addAction(QStringLiteral("monitor_seek_guide_backward"), i18n("Go to Previous Guide"), this, SLOT(slotGuideRewind()),
QIcon::fromTheme(QStringLiteral("media-seek-backward")), Qt::CTRL + Qt::Key_Left, QStringLiteral("navandplayback"));
addAction(QStringLiteral("monitor_seek_guide_forward"), i18n("Go to Next Guide"), this, SLOT(slotGuideForward()),
QIcon::fromTheme(QStringLiteral("media-seek-forward")), Qt::CTRL + Qt::Key_Right);
addAction(QStringLiteral("align_playhead"), i18n("Align Playhead to Mouse Position"), this, SLOT(slotAlignPlayheadToMousePos()), QIcon(), Qt::Key_P);
QIcon::fromTheme(QStringLiteral("media-seek-forward")), Qt::CTRL + Qt::Key_Right, QStringLiteral("navandplayback"));
addAction(QStringLiteral("align_playhead"), i18n("Align Playhead to Mouse Position"), this, SLOT(slotAlignPlayheadToMousePos()), QIcon(),
Qt::Key_P, QStringLiteral("navandplayback"));
addAction(QStringLiteral("grab_item"), i18n("Grab Current Item"), this, SLOT(slotGrabItem()), QIcon::fromTheme(QStringLiteral("transform-move")),
Qt::SHIFT + Qt::Key_G);
......@@ -1860,22 +1860,23 @@ void MainWindow::setupActions()
disableEffects->setChecked(false);
addAction(QStringLiteral("switch_track_disabled"), i18n("Toggle Track Disabled"), pCore->projectManager(), SLOT(slotSwitchTrackDisabled()), QIcon(),
Qt::SHIFT + Qt::Key_H);
Qt::SHIFT + Qt::Key_H, timelineActions);
addAction(QStringLiteral("switch_track_lock"), i18n("Toggle Track Lock"), pCore->projectManager(), SLOT(slotSwitchTrackLock()), QIcon(),
Qt::SHIFT + Qt::Key_L);
Qt::SHIFT + Qt::Key_L, timelineActions);
addAction(QStringLiteral("switch_all_track_lock"), i18n("Toggle All Track Lock"), pCore->projectManager(), SLOT(slotSwitchAllTrackLock()), QIcon(),
Qt::CTRL + Qt::SHIFT + Qt::Key_L);
Qt::CTRL + Qt::SHIFT + Qt::Key_L, timelineActions);
addAction(QStringLiteral("switch_track_target"), i18n("Toggle Track Target"), pCore->projectManager(), SLOT(slotSwitchTrackTarget()), QIcon(),
Qt::SHIFT + Qt::Key_T);
Qt::SHIFT + Qt::Key_T, timelineActions);
addAction(QStringLiteral("switch_active_target"), i18n("Toggle Track Active"), pCore->projectManager(), SLOT(slotSwitchTrackActive()), QIcon(),
Qt::Key_A);
Qt::Key_A, timelineActions);
addAction(QStringLiteral("switch_all_targets"), i18n("Toggle All Tracks Active"), pCore->projectManager(), SLOT(slotSwitchAllTrackActive()), QIcon(),
Qt::SHIFT + Qt::Key_A);
Qt::SHIFT + Qt::Key_A, timelineActions);
addAction(QStringLiteral("activate_all_targets"), i18n("Switch All Tracks Active"), pCore->projectManager(), SLOT(slotMakeAllTrackActive()), QIcon(),
Qt::SHIFT + Qt::ALT + Qt::Key_A);
addAction(QStringLiteral("restore_all_sources"), i18n("Restore Current Clip Target Tracks"), pCore->projectManager(), SLOT(slotRestoreTargetTracks()));
Qt::SHIFT + Qt::ALT + Qt::Key_A, timelineActions);
addAction(QStringLiteral("restore_all_sources"), i18n("Restore Current Clip Target Tracks"), pCore->projectManager(), SLOT(slotRestoreTargetTracks()),
{}, {}, timelineActions);
addAction(QStringLiteral("add_project_note"), i18n("Add Project Note"), pCore->projectManager(), SLOT(slotAddProjectNote()),
QIcon::fromTheme(QStringLiteral("bookmark-new")));
QIcon::fromTheme(QStringLiteral("bookmark-new")), {}, timelineActions);
// Build activate track shortcut sequences
......@@ -3445,6 +3446,9 @@ void MainWindow::loadDockActions()
QMap<QString, QAction *> sorted;
QStringList sortedList;
for (QAction *a : qAsConst(list)) {
if(a->objectName().startsWith(QStringLiteral("raise_"))) {
continue;
}
sorted.insert(a->text(), a);
sortedList << a->text();
}
......@@ -3562,6 +3566,12 @@ void MainWindow::updateDockMenu()
}
dockInformations->setChecked(!dock->isHidden());
guiActions->addAction(dockInformations->text(), dockInformations);
QAction *action = new QAction(i18n("Raise %1", dockInformations->text()), this);
connect(action, &QAction::triggered, this, [dock](){
dock->raise();
dock->setFocus();
});
addAction("raise_" + dock->objectName(), action, {}, guiActions);
}
kdenliveCategoryMap.insert(QStringLiteral("interface"), guiActions);
}
......@@ -3841,7 +3851,7 @@ void MainWindow::triggerKey(QKeyEvent *ev)
QWidget::keyPressEvent(ev);
}
QDockWidget *MainWindow::addDock(const QString &title, const QString &objectName, QWidget *widget, Qt::DockWidgetArea area, const QKeySequence &shortcut)
QDockWidget *MainWindow::addDock(const QString &title, const QString &objectName, QWidget *widget, Qt::DockWidgetArea area)
{
QDockWidget *dockWidget = new QDockWidget(title, this);
dockWidget->setObjectName(objectName);
......@@ -3849,12 +3859,12 @@ QDockWidget *MainWindow::addDock(const QString &title, const QString &objectName
addDockWidget(area, dockWidget);
// Add action to raise and focus the Dock (e.g. with a shortcut)
QAction *action = new QAction(i18n("Raise %1", title), this);
/*QAction *action = new QAction(i18n("Raise %1", title), this);
connect(action, &QAction::triggered, this, [dockWidget](){
dockWidget->raise();
dockWidget->setFocus();
});
addAction("raise_" + objectName, action, shortcut);
addAction("raise_" + objectName, action, {});*/
return dockWidget;
}
......
......@@ -89,9 +89,14 @@ public:
/** @brief Adds an action to the action collection and stores the name. */
void addAction(const QString &name, QAction *action, const QKeySequence &shortcut = QKeySequence(), KActionCategory *category = nullptr);
/** @brief Same as above, but takes a string for category to populate it with kdenliveCategoryMap */
void addAction(const QString &name, QAction *action, const QKeySequence &shortcut, const QString &category);
/** @brief Adds an action to the action collection and stores the name. */
QAction *addAction(const QString &name, const QString &text, const QObject *receiver, const char *member, const QIcon &icon = QIcon(),
const QKeySequence &shortcut = QKeySequence(), KActionCategory *category = nullptr);
/** @brief Same as above, but takes a string for category to populate it with kdenliveCategoryMap */
QAction *addAction(const QString &name, const QString &text, const QObject *receiver, const char *member, const QIcon &icon,
const QKeySequence &shortcut, const QString &category);
/**
* @brief Adds a new dock widget to this window.
......@@ -102,7 +107,7 @@ public:
* @param shortcut default shortcut to raise the dock
* @returns the created dock widget
*/
QDockWidget *addDock(const QString &title, const QString &objectName, QWidget *widget, Qt::DockWidgetArea area = Qt::TopDockWidgetArea, const QKeySequence &shortcut = QKeySequence());
QDockWidget *addDock(const QString &title, const QString &objectName, QWidget *widget, Qt::DockWidgetArea area = Qt::TopDockWidgetArea);
QUndoGroup *m_commandStack;
QUndoView *m_undoView;
......
......@@ -464,46 +464,62 @@ void MonitorManager::setupActions()
playAction->setInactiveIcon(QIcon::fromTheme(QStringLiteral("media-playback-start")));
playAction->setActiveIcon(QIcon::fromTheme(QStringLiteral("media-playback-pause")));
connect(playAction, &KDualAction::activeChangedByUser, this, &MonitorManager::slotPlay);
pCore->window()->addAction(QStringLiteral("monitor_play"), playAction, Qt::Key_Space);
pCore->window()->addAction(QStringLiteral("monitor_play"), playAction, Qt::Key_Space, QStringLiteral("navandplayback"));
QAction *monitorPause = new QAction(QIcon::fromTheme(QStringLiteral("media-playback-stop")), i18n("Pause"), this);
connect(monitorPause, &QAction::triggered, this, &MonitorManager::slotPause);
pCore->window()->addAction(QStringLiteral("monitor_pause"), monitorPause, Qt::Key_K);
pCore->window()->addAction(QStringLiteral("monitor_pause"), monitorPause, Qt::Key_K, QStringLiteral("navandplayback"));
QAction *fullMonitor = new QAction(i18n("Switch monitor fullscreen"), this);
fullMonitor->setIcon(QIcon::fromTheme(QStringLiteral("view-fullscreen")));
connect(fullMonitor, &QAction::triggered, this, &MonitorManager::slotSwitchFullscreen);
pCore->window()->addAction(QStringLiteral("monitor_fullscreen"), fullMonitor);
pCore->window()->addAction(QStringLiteral("monitor_fullscreen"), fullMonitor, Qt::Key_F11, QStringLiteral("monitor"));
QAction *monitorZoomIn = new QAction(i18n("Zoom in monitor"), this);
monitorZoomIn->setIcon(QIcon::fromTheme(QStringLiteral("zoom-in")));
connect(monitorZoomIn, &QAction::triggered, this, &MonitorManager::slotZoomIn);
pCore->window()->addAction(QStringLiteral("monitor_zoomin"), monitorZoomIn);
pCore->window()->addAction(QStringLiteral("monitor_zoomin"), monitorZoomIn, {}, QStringLiteral("monitor"));
QAction *monitorZoomOut = new QAction(i18n("Zoom out monitor"), this);
monitorZoomOut->setIcon(QIcon::fromTheme(QStringLiteral("zoom-out")));
connect(monitorZoomOut, &QAction::triggered, this, &MonitorManager::slotZoomOut);
pCore->window()->addAction(QStringLiteral("monitor_zoomout"), monitorZoomOut);
pCore->window()->addAction(QStringLiteral("monitor_zoomout"), monitorZoomOut, {}, QStringLiteral("monitor"));
QAction *monitorSeekBackward = new QAction(QIcon::fromTheme(QStringLiteral("media-seek-backward")), i18n("Rewind"), this);
connect(monitorSeekBackward, &QAction::triggered, this, &MonitorManager::slotRewind);
pCore->window()->addAction(QStringLiteral("monitor_seek_backward"), monitorSeekBackward, Qt::Key_J);
pCore->window()->addAction(QStringLiteral("monitor_seek_backward"), monitorSeekBackward, Qt::Key_J, QStringLiteral("navandplayback"));
QAction *monitorSeekBackwardOneFrame = new QAction(QIcon::fromTheme(QStringLiteral("media-skip-backward")), i18n("Rewind 1 Frame"), this);
connect(monitorSeekBackwardOneFrame, &QAction::triggered, this, &MonitorManager::slotRewindOneFrame);
pCore->window()->addAction(QStringLiteral("monitor_seek_backward-one-frame"), monitorSeekBackwardOneFrame, Qt::Key_Left);
pCore->window()->addAction(QStringLiteral("monitor_seek_backward-one-frame"), monitorSeekBackwardOneFrame, Qt::Key_Left,
QStringLiteral("navandplayback"));
QAction *monitorSeekBackwardOneSecond = new QAction(QIcon::fromTheme(QStringLiteral("media-skip-backward")), i18n("Rewind 1 Second"), this);
connect(monitorSeekBackwardOneSecond, &QAction::triggered, this, &MonitorManager::slotRewindOneSecond);
pCore->window()->addAction(QStringLiteral("monitor_seek_backward-one-second"), monitorSeekBackwardOneSecond, Qt::SHIFT + Qt::Key_Left);
pCore->window()->addAction(QStringLiteral("monitor_seek_backward-one-second"), monitorSeekBackwardOneSecond, Qt::SHIFT + Qt::Key_Left,
QStringLiteral("navandplayback"));
QAction *monitorSeekForward = new QAction(QIcon::fromTheme(QStringLiteral("media-seek-forward")), i18n("Forward"), this);
connect(monitorSeekForward, &QAction::triggered, this, &MonitorManager::slotForward);
pCore->window()->addAction(QStringLiteral("monitor_seek_forward"), monitorSeekForward, Qt::Key_L);
pCore->window()->addAction(QStringLiteral("monitor_seek_forward"), monitorSeekForward, Qt::Key_L, QStringLiteral("navandplayback"));
QAction *projectStart = new QAction(QIcon::fromTheme(QStringLiteral("go-first")), i18n("Go to Project Start"), this);
connect(projectStart, &QAction::triggered, this, &MonitorManager::slotStart);
pCore->window()->addAction(QStringLiteral("seek_start"), projectStart, Qt::CTRL + Qt::Key_Home);
pCore->window()->addAction(QStringLiteral("seek_start"), projectStart, Qt::CTRL + Qt::Key_Home, QStringLiteral("navandplayback"));
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, QStringLiteral("navandplayback"));
QAction *monitorSeekForwardOneFrame = new QAction(QIcon::fromTheme(QStringLiteral("media-skip-forward")), i18n("Forward 1 Frame"), this);
connect(monitorSeekForwardOneFrame, &QAction::triggered, this, &MonitorManager::slotForwardOneFrame);
pCore->window()->addAction(QStringLiteral("monitor_seek_forward-one-frame"), monitorSeekForwardOneFrame, Qt::Key_Right,
QStringLiteral("navandplayback"));
QAction *monitorSeekForwardOneSecond = new QAction(QIcon::fromTheme(QStringLiteral("media-skip-forward")), i18n("Forward 1 Second"), this);
connect(monitorSeekForwardOneSecond, &QAction::triggered, this, &MonitorManager::slotForwardOneSecond);
pCore->window()->addAction(QStringLiteral("monitor_seek_forward-one-second"), monitorSeekForwardOneSecond, Qt::SHIFT + Qt::Key_Right,
QStringLiteral("navandplayback"));
m_multiTrack = new QAction(QIcon::fromTheme(QStringLiteral("view-split-left-right")), i18n("Multitrack view"), this);
m_multiTrack->setCheckable(true);
......@@ -512,7 +528,7 @@ void MonitorManager::setupActions()
emit m_projectMonitor->multitrackView(checked, true);
}
});
pCore->window()->addAction(QStringLiteral("monitor_multitrack"), m_multiTrack);
pCore->window()->addAction(QStringLiteral("monitor_multitrack"), m_multiTrack, {}, QStringLiteral("monitor"));
QAction *performMultiTrackOperation = new QAction(QIcon::fromTheme(QStringLiteral("media-playback-pause")), i18n("Perform Multitrack Operation"), this);
connect(performMultiTrackOperation, &QAction::triggered, this, &MonitorManager::slotPerformMultiTrackMode);
......@@ -522,19 +538,7 @@ void MonitorManager::setupActions()
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);
QAction *monitorSeekForwardOneFrame = new QAction(QIcon::fromTheme(QStringLiteral("media-skip-forward")), i18n("Forward 1 Frame"), this);
connect(monitorSeekForwardOneFrame, &QAction::triggered, this, &MonitorManager::slotForwardOneFrame);
pCore->window()->addAction(QStringLiteral("monitor_seek_forward-one-frame"), monitorSeekForwardOneFrame, Qt::Key_Right);
QAction *monitorSeekForwardOneSecond = new QAction(QIcon::fromTheme(QStringLiteral("media-skip-forward")), i18n("Forward 1 Second"), this);
connect(monitorSeekForwardOneSecond, &QAction::triggered, this, &MonitorManager::slotForwardOneSecond);
pCore->window()->addAction(QStringLiteral("monitor_seek_forward-one-second"), monitorSeekForwardOneSecond, Qt::SHIFT + Qt::Key_Right);
pCore->window()->addAction(QStringLiteral("monitor_editmode"), enableEditmode, {}, QStringLiteral("monitor"));
KSelectAction *interlace = new KSelectAction(i18n("Deinterlacer"), this);
interlace->addAction(i18n("One Field (fast)"));
......@@ -586,19 +590,19 @@ void MonitorManager::setupActions()
progressive->setCheckable(true);
progressive->setChecked(KdenliveSettings::monitor_progressive());
QAction *zoneStart = new QAction(QIcon::fromTheme(QStringLiteral("media-seek-backward")), i18n("Go to Zone Start"), this);
connect(zoneStart, &QAction::triggered, this, &MonitorManager::slotZoneStart);
pCore->window()->addAction(QStringLiteral("seek_zone_start"), zoneStart, Qt::SHIFT + Qt::Key_I);
m_muteAction = new KDualAction(i18n("Mute monitor"), i18n("Unmute monitor"), this);
m_muteAction->setActiveIcon(QIcon::fromTheme(QStringLiteral("audio-volume-medium")));
m_muteAction->setInactiveIcon(QIcon::fromTheme(QStringLiteral("audio-volume-muted")));
connect(m_muteAction, &KDualAction::activeChangedByUser, this, &MonitorManager::slotMuteCurrentMonitor);
pCore->window()->addAction(QStringLiteral("mlt_mute"), m_muteAction);
pCore->window()->addAction(QStringLiteral("mlt_mute"), m_muteAction, {}, QStringLiteral("monitor"));
QAction *zoneStart = new QAction(QIcon::fromTheme(QStringLiteral("media-seek-backward")), i18n("Go to Zone Start"), this);
connect(zoneStart, &QAction::triggered, this, &MonitorManager::slotZoneStart);
pCore->window()->addAction(QStringLiteral("seek_zone_start"), zoneStart, Qt::SHIFT + Qt::Key_I, QStringLiteral("navandplayback"));
QAction *zoneEnd = new QAction(QIcon::fromTheme(QStringLiteral("media-seek-forward")), i18n("Go to Zone End"), this);
connect(zoneEnd, &QAction::triggered, this, &MonitorManager::slotZoneEnd);
pCore->window()->addAction(QStringLiteral("seek_zone_end"), zoneEnd, Qt::SHIFT + Qt::Key_O);
pCore->window()->addAction(QStringLiteral("seek_zone_end"), zoneEnd, Qt::SHIFT + Qt::Key_O, QStringLiteral("navandplayback"));
QAction *markIn = new QAction(QIcon::fromTheme(QStringLiteral("zone-in")), i18n("Set Zone In"), this);
connect(markIn, &QAction::triggered, this, &MonitorManager::slotSetInPoint);
......
  • Julius if I can ask... it's possible to have ( already assigned at first startup ) an Hotkey to switch from/to multiview ( on project monitor) ?

  • Yes I general it is possible? Do you have a suggestion which Shortcut that could be? Maybe F12?

  • Tab can be the best... but is already used by interface... ( maybe with ctrl or alt ? )

  • I think that f12 can't be used on windows ( or not?)

  • Hmm. Tab is a very prominent Key and we might use it for toggling edit mode or tools in the future. Honestly I don't know about F12 on windows. Maybe @massimostella and @emohr can give some advice here?

  • Just tried on Windows 10 and Windows 11... F12 can be set as default also on Windows. :)

    Edited by Davy Bartoloni
  • Premiere, Multi-Camera View: Shift + 0

    Edited by Eugen Mohr
  • Ok seems good :)

  • i can add this hotkey to jog shuttle to rapidly switch from multiview to singleview :) can be nice (without every day adding the shortcut by myself)

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