diff --git a/CMakeLists.txt b/CMakeLists.txt index ac915cd..d976813 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,10 +40,6 @@ find_package(Libmpv) set_package_properties(Libmpv PROPERTIES TYPE REQUIRED URL "https://mpv.io") -find_package(Breeze) -set_package_properties(Breeze PROPERTIES TYPE RECOMMENDED - URL "https://api.kde.org/frameworks/breeze-icons/html/index.html") - find_package(KF5Config) set_package_properties(KF5Config PROPERTIES TYPE REQUIRED URL "https://api.kde.org/frameworks/kconfig/html/index.html") @@ -60,14 +56,6 @@ find_package(KF5FileMetaData) set_package_properties(KF5FileMetaData PROPERTIES TYPE REQUIRED URL "https://api.kde.org/frameworks/kfilemetadata/html/index.html") -find_package(KF5I18n) -set_package_properties(KF5I18n PROPERTIES TYPE REQUIRED - URL "https://api.kde.org/frameworks/ki18n/html/index.html") - -find_package(KF5IconThemes) -set_package_properties(KF5IconThemes PROPERTIES TYPE REQUIRED - URL "https://api.kde.org/frameworks/kiconthemes/html/index.html") - find_package(KF5KIO) set_package_properties(KF5KIO PROPERTIES TYPE REQUIRED URL "https://api.kde.org/frameworks/kio/html/index.html") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 080ba20..186b086 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -55,8 +55,6 @@ target_link_libraries(cutefish-videoplayer PRIVATE KF5::CoreAddons KF5::DocTools KF5::FileMetaData - KF5::I18n - KF5::IconThemes KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets diff --git a/src/application.cpp b/src/application.cpp index 9fba1b8..f88a8b1 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -57,8 +57,6 @@ #include #include #include -#include -#include #include #include @@ -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); } diff --git a/src/lockmanager.cpp b/src/lockmanager.cpp index 161005c..5c56c37 100644 --- a/src/lockmanager.cpp +++ b/src/lockmanager.cpp @@ -7,8 +7,6 @@ #include "lockmanager.h" #include "screensaverdbusinterface.h" -#include - #include LockManager::LockManager(QObject *parent) @@ -31,5 +29,5 @@ void LockManager::setInhibitionOn() { m_cookie = m_iface->Inhibit( QStringLiteral("Haruna Video Player"), - i18n("Playing video.")); + tr("Playing video.")); } diff --git a/src/qml/Actions.qml b/src/qml/Actions.qml index a5a1e3e..38a68e7 100644 --- a/src/qml/Actions.qml +++ b/src/qml/Actions.qml @@ -86,7 +86,7 @@ QtObject { onTriggered: { mpv.setProperty("mute", !mpv.getProperty("mute")) if (mpv.getProperty("mute")) { - text = i18n("Unmute") + text = qsTr("Unmute") icon.name = "player-volume-muted" } else { text = qaction.text @@ -397,7 +397,7 @@ QtObject { property Action playPauseAction: Action { id: playPauseAction - text: i18n("Play/Pause") + text: qsTr("Play/Pause") icon.name: "media-playback-pause" shortcut: "Space" @@ -981,7 +981,7 @@ QtObject { onTriggered: { mpv.command(["add", "sub-scale", "+0.1"]) - osd.message(i18n("Subtitle scale: " + mpv.getProperty("sub-scale").toFixed(1))) + osd.message(qsTr("Subtitle scale: " + mpv.getProperty("sub-scale").toFixed(1))) } } @@ -996,7 +996,7 @@ QtObject { onTriggered: { mpv.command(["add", "sub-scale", "-0.1"]) - osd.message(i18n("Subtitle scale: " + mpv.getProperty("sub-scale").toFixed(1))) + osd.message(qsTr("Subtitle scale: " + mpv.getProperty("sub-scale").toFixed(1))) } } diff --git a/src/qml/Footer.qml b/src/qml/Footer.qml index 3a5a5a1..5b3af59 100644 --- a/src/qml/Footer.qml +++ b/src/qml/Footer.qml @@ -24,11 +24,12 @@ Item { property alias playPauseButton: playPauseButton property alias volume: volume - height: mainLayout.childrenRect.height + FishUI.Units.largeSpacing * 2 - visible: true + height: progressBar.height + 50 + FishUI.Units.smallSpacing +// height: mainLayout.childrenRect.height + FishUI.Units.smallSpacing opacity: mpv.mouseY > window.height - footer.height - FishUI.Units.largeSpacing * 3 && playList.state === "hidden" ? 1 : 0 enabled: opacity !== 0 + visible: true Behavior on opacity { NumberAnimation { @@ -58,18 +59,18 @@ Item { opacity: 0.8 } - layer.enabled: true - layer.effect: OpacityMask { - maskSource: Item { - width: root.width - height: root.height +// layer.enabled: true +// layer.effect: OpacityMask { +// maskSource: Item { +// width: root.width +// height: root.height - Rectangle { - anchors.fill: parent - radius: FishUI.Theme.bigRadius - } - } - } +// Rectangle { +// anchors.fill: parent +// radius: FishUI.Theme.bigRadius +// } +// } +// } Component { id: togglePlaylistButton @@ -82,8 +83,9 @@ Item { ColumnLayout { id: mainLayout anchors.fill: parent - anchors.margins: FishUI.Units.largeSpacing - spacing: FishUI.Units.largeSpacing + anchors.topMargin: 0 + anchors.bottomMargin: FishUI.Units.smallSpacing + spacing: FishUI.Units.smallSpacing HProgressBar { id: progressBar @@ -93,66 +95,114 @@ Item { RowLayout { id: footerRow - ToolButton { - id: playPreviousFile - action: actions.playPreviousAction - text: "" - focusPolicy: Qt.NoFocus - enabled: playList.playlistView.count > 1 - - ToolTip { - text: qsTr("Play previous file") - } + Item { + width: FishUI.Units.smallSpacing } - ToolButton { - id: playPauseButton - action: actions.playPauseAction - text: "" - icon.name: "media-playback-start" - focusPolicy: Qt.NoFocus + Item { + id: leftItem + Layout.fillWidth: true + Layout.fillHeight: true - ToolTip { - id: playPauseButtonToolTip - text: mpv.pause ? qsTr("Start Playback") : qsTr("Pause Playback") + RowLayout { + anchors.fill: parent + + Label { + id: timeInfo + text: app.formatTime(mpv.position) + " / " + app.formatTime(mpv.duration) + font.pointSize: FishUI.Units.gridUnit - 6 + Layout.alignment: Qt.AlignVCenter + } } } - ToolButton { - id: playNextFile - action: actions.playNextAction - text: "" - focusPolicy: Qt.NoFocus - enabled: playList.playlistView.count > 1 - - ToolTip { - text: qsTr("Play next file") + Item { + id: middleItem + Layout.preferredWidth: middleLayout.childrenRect.width + Layout.fillHeight: true + + RowLayout { + id: middleLayout + anchors.fill: parent + + ToolButton { + id: playPreviousFile + action: actions.playPreviousAction + text: "" + focusPolicy: Qt.NoFocus + enabled: playList.playlistView.count > 1 + + ToolTip { + text: qsTr("Play previous file") + } + } + + ToolButton { + id: playPauseButton + action: actions.playPauseAction + text: "" + icon.name: "media-playback-start" + focusPolicy: Qt.NoFocus + + ToolTip { + id: playPauseButtonToolTip + text: mpv.pause ? qsTr("Start Playback") : qsTr("Pause Playback") + } + } + + ToolButton { + id: playNextFile + action: actions.playNextAction + text: "" + focusPolicy: Qt.NoFocus + enabled: playList.playlistView.count > 1 + + ToolTip { + text: qsTr("Play next file") + } + } } } - Label { - id: timeInfo - text: app.formatTime(mpv.position) + " / " + app.formatTime(mpv.duration) - font.pointSize: FishUI.Units.gridUnit - 4 - horizontalAlignment: Qt.AlignHCenter - } + Item { + id: rightItem + Layout.fillWidth: true + Layout.fillHeight: true - ToolButton { - id: mute - action: actions.muteAction - text: "" - focusPolicy: Qt.NoFocus + RowLayout { + anchors.fill: parent + spacing: FishUI.Units.smallSpacing - ToolTip { - text: actions.muteAction.text - } - } + Item { + Layout.fillWidth: true + } + + ToolButton { + id: mute + action: actions.muteAction + text: "" + focusPolicy: Qt.NoFocus - VolumeSlider { id: volume } + ToolTip { + text: actions.muteAction.text + } + } - Loader { - sourceComponent: togglePlaylistButton - visible: true + VolumeSlider { id: volume } + + Item { + width: 1 + } + + Loader { + sourceComponent: togglePlaylistButton + visible: true + } + + Item { + width: FishUI.Units.smallSpacing + } + } } } } diff --git a/src/qml/HProgressBar.qml b/src/qml/HProgressBar.qml index 2000c90..c6633ce 100644 --- a/src/qml/HProgressBar.qml +++ b/src/qml/HProgressBar.qml @@ -24,7 +24,7 @@ Slider { from: 0 to: mpv.duration implicitWidth: 200 - implicitHeight: 20 + implicitHeight: 10 leftPadding: 0 rightPadding: 0 @@ -34,18 +34,18 @@ Slider { id: progressBarBackground color: FishUI.Theme.alternateBackgroundColor - layer.enabled: true - layer.effect: OpacityMask { - maskSource: Item { - width: progressBarBackground.width - height: progressBarBackground.height +// layer.enabled: true +// layer.effect: OpacityMask { +// maskSource: Item { +// width: progressBarBackground.width +// height: progressBarBackground.height - Rectangle { - anchors.fill: parent - radius: FishUI.Theme.smallRadius - } - } - } +// Rectangle { +// anchors.fill: parent +// radius: FishUI.Theme.smallRadius +// } +// } +// } Rectangle { id: loopIndicator @@ -189,7 +189,7 @@ Slider { MenuItem { id: skipChaptersMenuItem - text: i18n("Skip Chapters") + text: qsTr("Skip Chapters") checkable: true checked: PlaybackSettings.skipChapters onCheckedChanged: { diff --git a/src/qml/Haruna/Components/SettingsBasePage.qml b/src/qml/Haruna/Components/SettingsBasePage.qml index ae02631..0d7553a 100644 --- a/src/qml/Haruna/Components/SettingsBasePage.qml +++ b/src/qml/Haruna/Components/SettingsBasePage.qml @@ -22,28 +22,28 @@ Kirigami.ScrollablePage { actions { contextualActions: [ Kirigami.Action { - text: i18n("Help!") + text: qsTr("Help!") iconName: "system-help" Kirigami.Action { - text: i18n("Haruna help window (english only)") + text: qsTr("Haruna help window (english only)") enabled: root.hasHelp onTriggered: root.hasHelp ? helpWindow.show() : undefined } Kirigami.Action { - text: i18n("KHelpCenter") + text: qsTr("KHelpCenter") enabled: root.docPage !== "" onTriggered: enabled ? app.openDocs(root.docPage) : undefined } }, Kirigami.Action { - text: i18n("Open config ...") + text: qsTr("Open config ...") iconName: "folder" Kirigami.Action { - text: i18n("File") + text: qsTr("File") onTriggered: Qt.openUrlExternally(app.configFilePath) } Kirigami.Action { - text: i18n("Folder") + text: qsTr("Folder") onTriggered: Qt.openUrlExternally(app.configFolderPath) } } diff --git a/src/qml/Header.qml b/src/qml/Header.qml index 8ae4756..e01aa34 100644 --- a/src/qml/Header.qml +++ b/src/qml/Header.qml @@ -64,7 +64,7 @@ ToolBar { property var model: 0 - text: i18n("Subtitles") + text: qsTr("Subtitles") icon.name: "add-subtitle" focusPolicy: Qt.NoFocus @@ -84,7 +84,7 @@ ToolBar { Menu { id: secondarySubtitleMenu - title: i18n("Secondary Subtitle") + title: qsTr("Secondary Subtitle") Instantiator { id: secondarySubtitleMenuInstantiator @@ -104,7 +104,7 @@ ToolBar { MenuSeparator {} MenuItem { - text: i18n("Primary Subtitle") + text: qsTr("Primary Subtitle") hoverEnabled: false } @@ -125,7 +125,7 @@ ToolBar { } ToolButton { - text: i18n("Audio") + text: qsTr("Audio") icon.name: "audio-volume-high" focusPolicy: Qt.NoFocus diff --git a/src/qml/Settings/General.qml b/src/qml/Settings/General.qml index e5f0337..bc6d9cc 100644 --- a/src/qml/Settings/General.qml +++ b/src/qml/Settings/General.qml @@ -27,7 +27,7 @@ SettingsBasePage { // OSD Font Size Label { - text: i18n("Osd font size") + text: qsTr("Osd font size") Layout.alignment: Qt.AlignRight } @@ -58,7 +58,7 @@ SettingsBasePage { // Volume Step Label { - text: i18n("Volume step") + text: qsTr("Volume step") Layout.alignment: Qt.AlignRight } @@ -82,7 +82,7 @@ SettingsBasePage { // Seek Small Step Label { - text: i18n("Seek small step") + text: qsTr("Seek small step") Layout.alignment: Qt.AlignRight } @@ -104,7 +104,7 @@ SettingsBasePage { // Seek Medium Step Label { - text: i18n("Seek medium step") + text: qsTr("Seek medium step") Layout.alignment: Qt.AlignRight } @@ -130,7 +130,7 @@ SettingsBasePage { checked: false ToolTip { - text: i18n("This is also used for mouse wheel seeking, when mouse is over the progress bar") + text: qsTr("This is also used for mouse wheel seeking, when mouse is over the progress bar") visible: parent.checked delay: 0 timeout: -1 @@ -144,7 +144,7 @@ SettingsBasePage { // Seek Big Step Label { - text: i18n("Seek big step") + text: qsTr("Seek big step") Layout.alignment: Qt.AlignRight } @@ -165,7 +165,7 @@ SettingsBasePage { } Label { - text: i18n("File dialog location") + text: qsTr("File dialog location") Layout.alignment: Qt.AlignRight } @@ -183,19 +183,19 @@ SettingsBasePage { } ToolTip { - text: i18n("If empty the file dialog will remember the last opened location.") + text: qsTr("If empty the file dialog will remember the last opened location.") } } } SettingsHeader { - text: i18n("Interface") + text: qsTr("Interface") Layout.columnSpan: 2 Layout.fillWidth: true } CheckBox { - text: i18n("Show MenuBar") + text: qsTr("Show MenuBar") checked: GeneralSettings.showMenuBar onCheckedChanged: { GeneralSettings.showMenuBar = checked @@ -206,7 +206,7 @@ SettingsBasePage { } CheckBox { - text: i18n("Show Header") + text: qsTr("Show Header") checked: GeneralSettings.showHeader onCheckedChanged: { GeneralSettings.showHeader = checked @@ -217,7 +217,7 @@ SettingsBasePage { } CheckBox { - text: i18n("Show chapter markers") + text: qsTr("Show chapter markers") checked: GeneralSettings.showChapterMarkers onCheckedChanged: { GeneralSettings.showChapterMarkers = checked @@ -228,7 +228,7 @@ SettingsBasePage { } Label { - text: i18n("Color scheme") + text: qsTr("Color scheme") Layout.alignment: Qt.AlignRight } @@ -265,7 +265,7 @@ SettingsBasePage { } Label { - text: i18n("GUI Style") + text: qsTr("GUI Style") Layout.alignment: Qt.AlignRight } @@ -314,7 +314,7 @@ SettingsBasePage { } CheckBox { - text: i18n("Use Breeze icon theme") + text: qsTr("Use Breeze icon theme") checked: GeneralSettings.useBreezeIconTheme onCheckedChanged: { GeneralSettings.useBreezeIconTheme = checked @@ -324,7 +324,7 @@ SettingsBasePage { Layout.column: 1 ToolTip { - text: i18n("Sets the icon theme to breeze.\nRequires restart.") + text: qsTr("Sets the icon theme to breeze.\nRequires restart.") } } diff --git a/src/qml/Settings/Navigation.qml b/src/qml/Settings/Navigation.qml index 2f1d710..1fcb611 100644 --- a/src/qml/Settings/Navigation.qml +++ b/src/qml/Settings/Navigation.qml @@ -25,7 +25,7 @@ Kirigami.Page anchors.fill: parent ToolButton { - text: i18n("Configure shortcuts") + text: qsTr("Configure shortcuts") icon.name: "configure-shortcuts" onClicked: appActions.configureShortcutsAction.trigger() Layout.fillWidth: true @@ -83,7 +83,7 @@ Kirigami.Page anchors.fill: parent model: settingsPagesModel delegate: Kirigami.BasicListItem { - text: i18n(name) + text: qsTr(name) icon: iconName onClicked: applicationWindow().pageStack.push(model.page) } diff --git a/src/qml/Settings/SettingsEditor.qml b/src/qml/Settings/SettingsEditor.qml index 1902cd6..dd27368 100644 --- a/src/qml/Settings/SettingsEditor.qml +++ b/src/qml/Settings/SettingsEditor.qml @@ -18,7 +18,7 @@ Kirigami.ApplicationWindow { width: 800 height: 600 - title: i18n("Haruna Settings") + title: qsTr("Haruna Settings") visible: false pageStack.initialPage: "qrc:/Navigation.qml" @@ -29,7 +29,7 @@ Kirigami.ApplicationWindow { width: 700 height: 600 - title: i18n("Help") + title: qsTr("Help") color: Kirigami.Theme.backgroundColor onVisibleChanged: info.text = app.getFileContent(applicationWindow().pageStack.currentItem.helpFile) diff --git a/src/qml/main.qml b/src/qml/main.qml index 1aaa015..0e53e86 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -98,9 +98,9 @@ FishUI.Window { anchors.right: parent.right anchors.bottom: mpv.bottom - anchors.leftMargin: FishUI.Units.largeSpacing * 2 - anchors.rightMargin: FishUI.Units.largeSpacing * 2 - anchors.bottomMargin: FishUI.Units.largeSpacing * 2 +// anchors.leftMargin: FishUI.Units.largeSpacing * 2 +// anchors.rightMargin: FishUI.Units.largeSpacing * 2 +// anchors.bottomMargin: FishUI.Units.largeSpacing * 2 } Instantiator {