// virtual
void CustomRuler::mouseMoveEvent(QMouseEvent * event) {
if (event->buttons() == Qt::LeftButton) {
- int pos = (int)((event->x() + offset()) / pixelPerMark() / FRAME_SIZE);
- if (pos < 0) pos = 0;
- if (m_moveCursor == RULER_CURSOR) {
- m_view->setCursorPos(pos);
- return;
- } else if (m_moveCursor == RULER_START) m_zoneStart = pos;
- else if (m_moveCursor == RULER_END) m_zoneEnd = pos;
- else if (m_moveCursor == RULER_MIDDLE) {
- int move = pos - (m_zoneStart + (m_zoneEnd - m_zoneStart) / 2);
- m_zoneStart += move;
- m_zoneEnd += move;
- }
- update();
- }
- else {
- int pos = (int)((event->x() + offset()));
- if (event->y() <= 10) setCursor(Qt::ArrowCursor);
- else if (qAbs(pos - m_zoneStart * pixelPerMark() * FRAME_SIZE) < 4) setCursor(KCursor("left_side", Qt::SizeHorCursor));
- else if (qAbs(pos - m_zoneEnd * pixelPerMark() * FRAME_SIZE) < 4) setCursor(KCursor("right_side", Qt::SizeHorCursor));
- else if (qAbs(pos - (m_zoneStart + (m_zoneEnd - m_zoneStart) / 2) * pixelPerMark() * FRAME_SIZE) < 4) setCursor(Qt::SizeHorCursor);
- else setCursor(Qt::ArrowCursor);
+ int pos = (int)((event->x() + offset()) / pixelPerMark() / FRAME_SIZE);
+ if (pos < 0) pos = 0;
+ if (m_moveCursor == RULER_CURSOR) {
+ m_view->setCursorPos(pos);
+ return;
+ } else if (m_moveCursor == RULER_START) m_zoneStart = pos;
+ else if (m_moveCursor == RULER_END) m_zoneEnd = pos;
+ else if (m_moveCursor == RULER_MIDDLE) {
+ int move = pos - (m_zoneStart + (m_zoneEnd - m_zoneStart) / 2);
+ m_zoneStart += move;
+ m_zoneEnd += move;
+ }
+ update();
+ } else {
+ int pos = (int)((event->x() + offset()));
+ if (event->y() <= 10) setCursor(Qt::ArrowCursor);
+ else if (qAbs(pos - m_zoneStart * pixelPerMark() * FRAME_SIZE) < 4) setCursor(KCursor("left_side", Qt::SizeHorCursor));
+ else if (qAbs(pos - m_zoneEnd * pixelPerMark() * FRAME_SIZE) < 4) setCursor(KCursor("right_side", Qt::SizeHorCursor));
+ else if (qAbs(pos - (m_zoneStart + (m_zoneEnd - m_zoneStart) / 2) * pixelPerMark() * FRAME_SIZE) < 4) setCursor(Qt::SizeHorCursor);
+ else setCursor(Qt::ArrowCursor);
}
}
<label>Default folder for captured files.</label>
<default>$HOME</default>
</entry>
+
+ <entry name="defaultimageapp" type="String">
+ <label>Default image editing application.</label>
+ <default></default>
+ </entry>
+
+ <entry name="defaultaudioapp" type="String">
+ <label>Default audio editing application.</label>
+ <default></default>
+ </entry>
+
+ <entry name="defaultplayerapp" type="String">
+ <label>Default video player application.</label>
+ <default></default>
+ </entry>
+
</group>
+
<group name="capture">
<entry name="defaultcapture" type="UInt">
<label>Default video capture system.</label>
#include <KStandardDirs>
#include <KDebug>
+#include <kopenwithdialog.h>
#include <stdlib.h>
#include <stdio.h>
connect(m_configCapture.kcfg_video4size, SIGNAL(editingFinished()), this, SLOT(rebuildVideo4Commands()));
connect(m_configCapture.kcfg_video4rate, SIGNAL(editingFinished()), this, SLOT(rebuildVideo4Commands()));
+ connect(m_configEnv.kp_image, SIGNAL(clicked()), this, SLOT(slotEditImageApplication()));
+ connect(m_configEnv.kp_audio, SIGNAL(clicked()), this, SLOT(slotEditAudioApplication()));
+ connect(m_configEnv.kp_player, SIGNAL(clicked()), this, SLOT(slotEditVideoApplication()));
QStringList profilesNames = ProfilesDialog::getProfileNames();
m_configMisc.kcfg_profiles_list->addItems(profilesNames);
KdenliveSettingsDialog::~KdenliveSettingsDialog() {}
+void KdenliveSettingsDialog::slotEditVideoApplication() {
+ KService::Ptr service;
+ KOpenWithDialog dlg(KUrl::List(), i18n("Select default video player"), m_configEnv.kcfg_defaultplayerapp->text(), this);
+ if (dlg.exec() != QDialog::Accepted)
+ return;
+
+ service = dlg.service();
+ m_configEnv.kcfg_defaultplayerapp->setText(service->exec());
+}
+
+void KdenliveSettingsDialog::slotEditAudioApplication() {
+ KService::Ptr service;
+ KOpenWithDialog dlg(KUrl::List(), i18n("Select default audio editor"), m_configEnv.kcfg_defaultaudioapp->text(), this);
+ if (dlg.exec() != QDialog::Accepted)
+ return;
+
+ service = dlg.service();
+ m_configEnv.kcfg_defaultaudioapp->setText(service->exec());
+}
+
+void KdenliveSettingsDialog::slotEditImageApplication() {
+ KService::Ptr service;
+ KOpenWithDialog dlg(KUrl::List(), i18n("Select default image editor"), m_configEnv.kcfg_defaultimageapp->text(), this);
+ if (dlg.exec() != QDialog::Accepted)
+ return;
+
+ service = dlg.service();
+ m_configEnv.kcfg_defaultimageapp->setText(service->exec());
+}
+
void KdenliveSettingsDialog::slotCheckShuttle(int state) {
m_configShuttle.config_group->setEnabled(state);
if (m_configShuttle.shuttledevicelist->count() == 0) {
void rebuildVideo4Commands();
void slotCheckShuttle(int state = 0);
void slotUpdateShuttleDevice(int ix = 0);
+ void slotEditImageApplication();
+ void slotEditAudioApplication();
+ void slotEditVideoApplication();
private:
KPageWidgetItem *page1;
args << "-erase";
if (zoneOnly) args << "in=" + QString::number(in) << "out=" + QString::number(out);
QString videoPlayer = "-";
- if (playAfter) videoPlayer = "kmplayer";
+ if (playAfter) {
+ videoPlayer = KdenliveSettings::defaultplayerapp();
+ if (videoPlayer.isEmpty()) KMessageBox::sorry(this, i18n("Cannot play video after rendering because the default video player application is not set.\nPlease define it in Kdenlive settings dialog."));
+ }
args << "inigo" << m_activeDocument->profilePath() << render << videoPlayer << temp.fileName() << dest << avformat_args;
QProcess::startDetached("kdenlive_render", args);
}
<rect>
<x>0</x>
<y>0</y>
- <width>416</width>
- <height>238</height>
+ <width>342</width>
+ <height>378</height>
</rect>
</property>
- <layout class="QGridLayout" name="gridLayout_3" >
+ <layout class="QGridLayout" name="gridLayout_4" >
<item row="0" column="0" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
</widget>
</item>
<item row="2" column="0" >
+ <widget class="QGroupBox" name="groupBox_3" >
+ <property name="title" >
+ <string>Default apps</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Image editing</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="KLineEdit" name="kcfg_defaultimageapp" >
+ <property name="showClearButton" stdset="0" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="KPushButton" name="kp_image" >
+ <property name="text" >
+ <string>Change</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_11" >
+ <property name="text" >
+ <string>Audio editing</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="KLineEdit" name="kcfg_defaultaudioapp" >
+ <property name="showClearButton" stdset="0" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="KPushButton" name="kp_audio" >
+ <property name="text" >
+ <string>Change</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_12" >
+ <property name="text" >
+ <string>Video player</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="KLineEdit" name="kcfg_defaultplayerapp" >
+ <property name="showClearButton" stdset="0" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <widget class="KPushButton" name="kp_player" >
+ <property name="text" >
+ <string>Change</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="0" >
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</layout>
</widget>
<customwidgets>
+ <customwidget>
+ <class>KLineEdit</class>
+ <extends>QLineEdit</extends>
+ <header>klineedit.h</header>
+ </customwidget>
+ <customwidget>
+ <class>KPushButton</class>
+ <extends>QPushButton</extends>
+ <header>kpushbutton.h</header>
+ </customwidget>
<customwidget>
<class>KUrlRequester</class>
<extends>QFrame</extends>