Changeset View
Changeset View
Standalone View
Standalone View
src/mainwindow.cpp
Context not available. | |||||
1155 | addAction(QStringLiteral("zoom_in"), m_zoomIn); | 1155 | addAction(QStringLiteral("zoom_in"), m_zoomIn); | ||
---|---|---|---|---|---|
1156 | addAction(QStringLiteral("zoom_out"), m_zoomOut); | 1156 | addAction(QStringLiteral("zoom_out"), m_zoomOut); | ||
1157 | 1157 | | |||
1158 | KNS3::standardAction(i18n("Download New Wipes..."), this, SLOT(slotGetNewLumaStuff()), actionCollection(), "get_new_lumas"); | | |||
1159 | KNS3::standardAction(i18n("Download New Keyboard Schemes..."), this, SLOT(slotGetNewKeyboardStuff()), actionCollection(), "get_new_keyboardschemes"); | | |||
1160 | KNS3::standardAction(i18n("Download New Render Profiles..."), this, SLOT(slotGetNewRenderStuff()), actionCollection(), "get_new_profiles"); | | |||
1161 | KNS3::standardAction(i18n("Download New Title Templates..."), this, SLOT(slotGetNewTitleStuff()), actionCollection(), "get_new_titles"); | | |||
1162 | | ||||
1163 | addAction(QStringLiteral("run_wizard"), i18n("Run Config Wizard"), this, SLOT(slotRunWizard()), QIcon::fromTheme(QStringLiteral("tools-wizard"))); | 1158 | addAction(QStringLiteral("run_wizard"), i18n("Run Config Wizard"), this, SLOT(slotRunWizard()), QIcon::fromTheme(QStringLiteral("tools-wizard"))); | ||
1164 | addAction(QStringLiteral("project_settings"), i18n("Project Settings"), this, SLOT(slotEditProjectSettings()), | 1159 | addAction(QStringLiteral("project_settings"), i18n("Project Settings"), this, SLOT(slotEditProjectSettings()), | ||
1165 | QIcon::fromTheme(QStringLiteral("configure"))); | 1160 | QIcon::fromTheme(QStringLiteral("configure"))); | ||
Context not available. | |||||
2072 | void MainWindow::slotEditKeys() | 2067 | void MainWindow::slotEditKeys() | ||
2073 | { | 2068 | { | ||
2074 | KShortcutsDialog dialog(KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcutsAllowed, this); | 2069 | KShortcutsDialog dialog(KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcutsAllowed, this); | ||
2070 | // Find the combobox inside KShortcutsDialog for choosing keyboard scheme | ||||
2071 | QComboBox *schemesList = nullptr; | ||||
2072 | foreach (QLabel *label, dialog.findChildren<QLabel *>()) { | ||||
2073 | if (label->text() == i18n("Current scheme:")) { | ||||
2074 | schemesList = qobject_cast<QComboBox *>(label->buddy()); | ||||
2075 | break; | ||||
2076 | } | ||||
2077 | } | ||||
2078 | // If scheme choosing combobox was found, find the "More Actions" button in the same | ||||
2079 | // dialog that provides a dropdown menu with additional actions, and add | ||||
2080 | // "Download New Keyboard Schemes..." button into that menu | ||||
2081 | if (schemesList) { | ||||
2082 | foreach (QPushButton *button, dialog.findChildren<QPushButton *>()) { | ||||
2083 | if (button->text() == i18n("More Actions")) { | ||||
2084 | QMenu *moreActionsMenu = button->menu(); | ||||
2085 | moreActionsMenu->addAction(i18n("Download New Keyboard Schemes..."), this, | ||||
2086 | [this, schemesList]{slotGetNewKeyboardStuff(schemesList);}); | ||||
2087 | break; | ||||
2088 | } | ||||
2089 | } | ||||
2090 | } else { | ||||
2091 | qWarning() << "Could not get list of schemes. Downloading new schemes is not available."; | ||||
2092 | } | ||||
2075 | dialog.addCollection(actionCollection(), i18nc("general keyboard shortcuts", "General")); | 2093 | dialog.addCollection(actionCollection(), i18nc("general keyboard shortcuts", "General")); | ||
2076 | dialog.configure(); | 2094 | dialog.configure(); | ||
2077 | } | 2095 | } | ||
Context not available. | |||||
2935 | return entries.size(); | 2953 | return entries.size(); | ||
2936 | } | 2954 | } | ||
2937 | 2955 | | |||
2938 | void MainWindow::slotGetNewTitleStuff() | 2956 | void MainWindow::slotGetNewKeyboardStuff(QComboBox *schemesList) | ||
2939 | { | | |||
2940 | if (getNewStuff(QStringLiteral(":data/kdenlive_titles.knsrc")) > 0) { | | |||
2941 | // get project title path | | |||
2942 | QString titlePath = pCore->currentDoc()->projectDataFolder() + QStringLiteral("/titles/"); | | |||
2943 | TitleWidget::refreshTitleTemplates(titlePath); | | |||
2944 | } | | |||
2945 | } | | |||
2946 | | ||||
2947 | void MainWindow::slotGetNewLumaStuff() | | |||
2948 | { | | |||
2949 | if (getNewStuff(QStringLiteral(":data/kdenlive_wipes.knsrc")) > 0) { | | |||
2950 | initEffects::refreshLumas(); | | |||
2951 | // TODO: refresh currently displayd trans ? | | |||
2952 | } | | |||
2953 | } | | |||
2954 | | ||||
2955 | void MainWindow::slotGetNewKeyboardStuff() | | |||
2956 | { | 2957 | { | ||
2957 | if (getNewStuff(QStringLiteral(":data/kdenlive_keyboardschemes.knsrc")) > 0) { | 2958 | if (getNewStuff(QStringLiteral(":data/kdenlive_keyboardschemes.knsrc")) > 0) { | ||
2958 | // Is there something to do ? | 2959 | // Refresh keyboard schemes list (schemes list creation code copied from KShortcutSchemesEditor) | ||
2959 | } | 2960 | QStringList schemes; | ||
2960 | } | 2961 | schemes << QStringLiteral("Default"); | ||
2961 | 2962 | // List files in the shortcuts subdir, each one is a scheme. See KShortcutSchemesHelper::{shortcutSchemeFileName,exportActionCollection} | |||
2962 | void MainWindow::slotGetNewRenderStuff() | 2963 | const QStringList shortcutsDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QCoreApplication::applicationName() + QStringLiteral("/shortcuts"), QStandardPaths::LocateDirectory); | ||
2963 | { | 2964 | qCDebug(KDENLIVE_LOG) << "shortcut scheme dirs:" << shortcutsDirs; | ||
2964 | if (getNewStuff(QStringLiteral(":data/kdenlive_renderprofiles.knsrc")) > 0) | 2965 | Q_FOREACH (const QString &dir, shortcutsDirs) { | ||
2965 | if (m_renderWidget) { | 2966 | Q_FOREACH (const QString &file, QDir(dir).entryList(QDir::Files | QDir::NoDotAndDotDot)) { | ||
2966 | m_renderWidget->reloadProfiles(); | 2967 | qCDebug(KDENLIVE_LOG) << "shortcut scheme file:" << file; | ||
2967 | } | 2968 | schemes << file; | ||
2969 | } | ||||
2970 | } | ||||
2971 | schemesList->clear(); | ||||
2972 | schemesList->addItems(schemes); | ||||
2973 | } | ||||
2968 | } | 2974 | } | ||
2969 | 2975 | | |||
2970 | void MainWindow::slotAutoTransition() | 2976 | void MainWindow::slotAutoTransition() | ||
Context not available. |