|
|
|
|
@ -57,8 +57,6 @@
|
|
|
|
|
#include <KConfig>
|
|
|
|
|
#include <KConfigGroup>
|
|
|
|
|
#include <KFileMetaData/Properties>
|
|
|
|
|
#include <KLocalizedContext>
|
|
|
|
|
#include <KLocalizedString>
|
|
|
|
|
#include <KShortcutsDialog>
|
|
|
|
|
#include <KTreeWidgetSearchLine>
|
|
|
|
|
|
|
|
|
|
@ -148,17 +146,17 @@ void Application::setupWorkerThread()
|
|
|
|
|
void Application::setupAboutData()
|
|
|
|
|
{
|
|
|
|
|
m_aboutData = KAboutData(QStringLiteral("haruna"),
|
|
|
|
|
i18n("Video Player"),
|
|
|
|
|
tr("Video Player"),
|
|
|
|
|
Application::version());
|
|
|
|
|
m_aboutData.setShortDescription(i18n("A configurable video player."));
|
|
|
|
|
m_aboutData.setShortDescription(tr("A configurable video player."));
|
|
|
|
|
m_aboutData.setLicense(KAboutLicense::GPL_V3);
|
|
|
|
|
m_aboutData.setCopyrightStatement(i18n("(c) 2019-2021"));
|
|
|
|
|
m_aboutData.setCopyrightStatement(tr("(c) 2019-2021"));
|
|
|
|
|
m_aboutData.setHomepage(QStringLiteral("https://invent.kde.org/multimedia/haruna"));
|
|
|
|
|
m_aboutData.setBugAddress(QStringLiteral("https://bugs.kde.org").toUtf8());
|
|
|
|
|
m_aboutData.setDesktopFileName("org.kde.haruna");
|
|
|
|
|
|
|
|
|
|
m_aboutData.addAuthor(i18n("George Florea Bănuș"),
|
|
|
|
|
i18n("Developer"),
|
|
|
|
|
m_aboutData.addAuthor(tr("George Florea Bănuș"),
|
|
|
|
|
tr("Developer"),
|
|
|
|
|
QStringLiteral("georgefb899@gmail.com"),
|
|
|
|
|
QStringLiteral("https://georgefb.com"));
|
|
|
|
|
|
|
|
|
|
@ -169,7 +167,7 @@ void Application::setupCommandLineParser()
|
|
|
|
|
{
|
|
|
|
|
QCommandLineParser parser;
|
|
|
|
|
m_aboutData.setupCommandLine(&parser);
|
|
|
|
|
parser.addPositionalArgument(QStringLiteral("file"), i18n("File to open"));
|
|
|
|
|
parser.addPositionalArgument(QStringLiteral("file"), tr("File to open"));
|
|
|
|
|
parser.process(*m_app);
|
|
|
|
|
m_aboutData.processCommandLine(&parser);
|
|
|
|
|
|
|
|
|
|
@ -234,8 +232,6 @@ void Application::setupQmlContextProperties()
|
|
|
|
|
auto proxyCustomCommandsModel = new ProxyCustomCommandsModel();
|
|
|
|
|
proxyCustomCommandsModel->setSourceModel(customCommandsModel);
|
|
|
|
|
m_engine->rootContext()->setContextProperty(QStringLiteral("proxyCustomCommandsModel"), proxyCustomCommandsModel);
|
|
|
|
|
|
|
|
|
|
m_engine->rootContext()->setContextObject(new KLocalizedContext(this));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QUrl Application::configFilePath()
|
|
|
|
|
@ -415,14 +411,14 @@ void Application::setupActions(const QString &actionName)
|
|
|
|
|
{
|
|
|
|
|
if (actionName == QStringLiteral("screenshot")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Screenshot"));
|
|
|
|
|
action->setText(tr("Screenshot"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("image-x-generic"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_S);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("file_quit")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Quit"));
|
|
|
|
|
action->setText(tr("Quit"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("application-exit"));
|
|
|
|
|
connect(action, &QAction::triggered, m_app, &QApplication::quit);
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_Q);
|
|
|
|
|
@ -430,7 +426,7 @@ void Application::setupActions(const QString &actionName)
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("options_configure_keybinding")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Configure Keyboard Shortcuts"));
|
|
|
|
|
action->setText(tr("Configure Keyboard Shortcuts"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("configure-shortcuts"));
|
|
|
|
|
connect(action, &QAction::triggered, this, [=]() { configureShortcuts(); });
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_S);
|
|
|
|
|
@ -438,7 +434,7 @@ void Application::setupActions(const QString &actionName)
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("configure")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Configure"));
|
|
|
|
|
action->setText(tr("Configure"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("configure"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_Comma);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
@ -446,7 +442,7 @@ void Application::setupActions(const QString &actionName)
|
|
|
|
|
|
|
|
|
|
if (actionName == QStringLiteral("togglePlaylist")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Playlist"));
|
|
|
|
|
action->setText(tr("Playlist"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("view-media-playlist"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_P);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
@ -454,7 +450,7 @@ void Application::setupActions(const QString &actionName)
|
|
|
|
|
|
|
|
|
|
if (actionName == QStringLiteral("openContextMenu")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Open Context Menu"));
|
|
|
|
|
action->setText(tr("Open Context Menu"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("application-menu"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_Menu);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
@ -462,7 +458,7 @@ void Application::setupActions(const QString &actionName)
|
|
|
|
|
|
|
|
|
|
if (actionName == QStringLiteral("toggleFullscreen")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Toggle Fullscreen"));
|
|
|
|
|
action->setText(tr("Toggle Fullscreen"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("view-fullscreen"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_F);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
@ -470,7 +466,7 @@ void Application::setupActions(const QString &actionName)
|
|
|
|
|
|
|
|
|
|
if (actionName == QStringLiteral("openFile")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Open File"));
|
|
|
|
|
action->setText(tr("Open File"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("folder-videos"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_O);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
@ -478,7 +474,7 @@ void Application::setupActions(const QString &actionName)
|
|
|
|
|
|
|
|
|
|
if (actionName == QStringLiteral("openUrl")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Open Url"));
|
|
|
|
|
action->setText(tr("Open Url"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("internet-services"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_O);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
@ -486,7 +482,7 @@ void Application::setupActions(const QString &actionName)
|
|
|
|
|
|
|
|
|
|
if (actionName == QStringLiteral("aboutHaruna")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("About Haruna"));
|
|
|
|
|
action->setText(tr("About Haruna"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("help-about"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_F1);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
@ -496,84 +492,84 @@ void Application::setupActions(const QString &actionName)
|
|
|
|
|
// mpv actions
|
|
|
|
|
if (actionName == QStringLiteral("contrastUp")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Contrast Up"));
|
|
|
|
|
action->setText(tr("Contrast Up"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("contrast"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_1);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("contrastDown")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Contrast Down"));
|
|
|
|
|
action->setText(tr("Contrast Down"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("contrast"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_2);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("contrastReset")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Contrast Reset"));
|
|
|
|
|
action->setText(tr("Contrast Reset"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("contrast"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_1);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("brightnessUp")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Brightness Up"));
|
|
|
|
|
action->setText(tr("Brightness Up"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("contrast"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_3);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("brightnessDown")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Brightness Down"));
|
|
|
|
|
action->setText(tr("Brightness Down"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("contrast"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_4);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("brightnessReset")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Brightness Reset"));
|
|
|
|
|
action->setText(tr("Brightness Reset"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("contrast"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_3);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("gammaUp")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Gamma Up"));
|
|
|
|
|
action->setText(tr("Gamma Up"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("contrast"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_5);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("gammaDown")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Gamma Down"));
|
|
|
|
|
action->setText(tr("Gamma Down"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("contrast"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_6);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("gammaReset")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Gamma Reset"));
|
|
|
|
|
action->setText(tr("Gamma Reset"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("contrast"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_5);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("saturationUp")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Saturation Up"));
|
|
|
|
|
action->setText(tr("Saturation Up"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("contrast"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_7);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("saturationDown")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Saturation Down"));
|
|
|
|
|
action->setText(tr("Saturation Down"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("contrast"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_8);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("saturationReset")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Saturation Reset"));
|
|
|
|
|
action->setText(tr("Saturation Reset"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("contrast"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_7);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
@ -581,277 +577,277 @@ void Application::setupActions(const QString &actionName)
|
|
|
|
|
|
|
|
|
|
if (actionName == QStringLiteral("playNext")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Play Next"));
|
|
|
|
|
action->setText(tr("Play Next"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("media-skip-forward"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::SHIFT + Qt::Key_Period);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("playPrevious")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Play Previous"));
|
|
|
|
|
action->setText(tr("Play Previous"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("media-skip-backward"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::SHIFT + Qt::Key_Comma);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("volumeUp")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Volume Up"));
|
|
|
|
|
action->setText(tr("Volume Up"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("audio-volume-high"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_9);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("volumeDown")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Volume Down"));
|
|
|
|
|
action->setText(tr("Volume Down"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("audio-volume-low"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_0);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("mute")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Mute"));
|
|
|
|
|
action->setText(tr("Mute"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("player-volume"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_M);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("seekForwardSmall")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Seek Small Step Forward"));
|
|
|
|
|
action->setText(tr("Seek Small Step Forward"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("media-seek-forward"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_Right);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("seekBackwardSmall")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Seek Small Step Backward"));
|
|
|
|
|
action->setText(tr("Seek Small Step Backward"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("media-seek-backward"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_Left);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("seekForwardMedium")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Seek Medium Step Forward"));
|
|
|
|
|
action->setText(tr("Seek Medium Step Forward"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("media-seek-forward"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::SHIFT + Qt::Key_Right);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("seekBackwardMedium")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Seek Medium Step Backward"));
|
|
|
|
|
action->setText(tr("Seek Medium Step Backward"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("media-seek-backward"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::SHIFT + Qt::Key_Left);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("seekForwardBig")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Seek Big Step Forward"));
|
|
|
|
|
action->setText(tr("Seek Big Step Forward"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("media-seek-forward"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_Up);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("seekBackwardBig")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Seek Big Step Backward"));
|
|
|
|
|
action->setText(tr("Seek Big Step Backward"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("media-seek-backward"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_Down);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("seekPreviousChapter")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Seek Previous Chapter"));
|
|
|
|
|
action->setText(tr("Seek Previous Chapter"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("media-seek-backward"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_PageDown);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("seekNextChapter")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Seek Next Chapter"));
|
|
|
|
|
action->setText(tr("Seek Next Chapter"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("media-seek-forward"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_PageUp);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("seekNextSubtitle")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Seek To Next Subtitle"));
|
|
|
|
|
action->setText(tr("Seek To Next Subtitle"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("media-seek-forward"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_Right);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("seekPreviousSubtitle")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Seek To Previous Subtitle"));
|
|
|
|
|
action->setText(tr("Seek To Previous Subtitle"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("media-seek-backward"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_Left);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("frameStep")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Move one frame forward, then pause"));
|
|
|
|
|
action->setText(tr("Move one frame forward, then pause"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_Period);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("frameBackStep")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Move one frame backward, then pause"));
|
|
|
|
|
action->setText(tr("Move one frame backward, then pause"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_Comma);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("increasePlayBackSpeed")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Playback speed increase"));
|
|
|
|
|
action->setText(tr("Playback speed increase"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_BracketRight);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("decreasePlayBackSpeed")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Playback speed decrease"));
|
|
|
|
|
action->setText(tr("Playback speed decrease"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_BracketLeft);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("resetPlayBackSpeed")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Playback speed reset"));
|
|
|
|
|
action->setText(tr("Playback speed reset"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_Backspace);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("subtitleQuicken")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Subtitle Quicken"));
|
|
|
|
|
action->setText(tr("Subtitle Quicken"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_Z);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("subtitleDelay")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Subtitle Delay"));
|
|
|
|
|
action->setText(tr("Subtitle Delay"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::SHIFT + Qt::Key_Z);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("subtitleToggle")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Subtitle Toggle"));
|
|
|
|
|
action->setText(tr("Subtitle Toggle"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_S);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("audioCycleUp")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Cycle Audio Up"));
|
|
|
|
|
action->setText(tr("Cycle Audio Up"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::SHIFT + Qt::Key_3);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("audioCycleDown")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Cycle Audio Down"));
|
|
|
|
|
action->setText(tr("Cycle Audio Down"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::SHIFT + Qt::Key_2);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("subtitleCycleUp")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Cycle Subtitle Up"));
|
|
|
|
|
action->setText(tr("Cycle Subtitle Up"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_J);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("subtitleCycleDown")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Cycle Subtitle Down"));
|
|
|
|
|
action->setText(tr("Cycle Subtitle Down"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::SHIFT + Qt::Key_J);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("zoomIn")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Zoom In"));
|
|
|
|
|
action->setText(tr("Zoom In"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("zoom-in"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::ALT + Qt::Key_Plus);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("zoomOut")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Zoom Out"));
|
|
|
|
|
action->setText(tr("Zoom Out"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("zoom-out"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::ALT + Qt::Key_Minus);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("zoomReset")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Zoom Reset"));
|
|
|
|
|
action->setText(tr("Zoom Reset"));
|
|
|
|
|
action->setIcon(QIcon::fromTheme("zoom-original"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::ALT + Qt::Key_Backspace);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("videoPanXLeft")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Video pan x left"));
|
|
|
|
|
action->setText(tr("Video pan x left"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::ALT + Qt::Key_Left);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("videoPanXRight")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Video pan x right"));
|
|
|
|
|
action->setText(tr("Video pan x right"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::ALT + Qt::Key_Right);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("videoPanYUp")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Video pan y up"));
|
|
|
|
|
action->setText(tr("Video pan y up"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::ALT + Qt::Key_Up);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("videoPanYDown")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Video pan y down"));
|
|
|
|
|
action->setText(tr("Video pan y down"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::ALT + Qt::Key_Down);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("toggleMenuBar")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Toggle Menu Bar"));
|
|
|
|
|
action->setText(tr("Toggle Menu Bar"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_M);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("toggleHeader")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Toggle Header"));
|
|
|
|
|
action->setText(tr("Toggle Header"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_H);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("setLoop")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Set Loop"));
|
|
|
|
|
action->setText(tr("Set Loop"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_L);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("increaseSubtitleFontSize")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Increase Subtitle Font Size"));
|
|
|
|
|
action->setText(tr("Increase Subtitle Font Size"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_Z);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("decreaseSubtitleFontSize")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Decrease Subtitle Font Size"));
|
|
|
|
|
action->setText(tr("Decrease Subtitle Font Size"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::CTRL + Qt::Key_X);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("subtitlePositionUp")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Move Subtitle Up"));
|
|
|
|
|
action->setText(tr("Move Subtitle Up"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_R);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("subtitlePositionDown")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Move Subtitle Down"));
|
|
|
|
|
action->setText(tr("Move Subtitle Down"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::SHIFT + Qt::Key_R);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("toggleDeinterlacing")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Toggle deinterlacing"));
|
|
|
|
|
action->setText(tr("Toggle deinterlacing"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_D);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
if (actionName == QStringLiteral("exitFullscreen")) {
|
|
|
|
|
auto action = new HAction();
|
|
|
|
|
action->setText(i18n("Exit Fullscreen"));
|
|
|
|
|
action->setText(tr("Exit Fullscreen"));
|
|
|
|
|
m_collection.setDefaultShortcut(action, Qt::Key_Escape);
|
|
|
|
|
m_collection.addAction(actionName, action);
|
|
|
|
|
}
|
|
|
|
|
|