* Change screen grab parameter format so that the program name (arecord) is...

* Change screen grab parameter format so that the program name (arecord) is not visible / editable, otherwise could have been a security problem.

* Change render widget to use a larger text edit for avformat parameters, it is now hidden by default, and visible by clicking on the (i) button on top
http://www.kdenlive.org/mantis/view.php?id=287

svn path=/branches/KDE4/; revision=2595
parent e2169a72
......@@ -220,7 +220,7 @@
<entry name="screengrabalsacapture" type="String">
<label>external program audio capture piped into ffmpeg.</label>
<default>arecord -Dplughw:0 -c1 -q -r41000 -traw -fS16_LE -</default>
<default>-Dplughw:0 -c1 -q -r41000 -traw -fS16_LE -</default>
</entry>
<entry name="screengrabalsacapture2" type="String">
......@@ -339,5 +339,10 @@
<default>false</default>
</entry>
<entry name="showrenderparams" type="Bool">
<label>Show avformat render parameters in rendering dialog.</label>
<default>false</default>
</entry>
</group>
</kcfg>
\ No newline at end of file
......@@ -438,8 +438,7 @@ void RecMonitor::slotRecord() {
if (KdenliveSettings::screengrabenableaudio() && !KdenliveSettings::useosscapture()) {
QStringList alsaArgs = KdenliveSettings::screengrabalsacapture().simplified().split(' ');
alsaProcess->setStandardOutputProcess(captureProcess);
const QString alsaBinary = alsaArgs.takeFirst();
alsaProcess->start(alsaBinary, alsaArgs);
alsaProcess->start("arecord", alsaArgs);
}
captureProcess->start("ffmpeg", m_captureArgs);
} else {
......@@ -488,7 +487,7 @@ void RecMonitor::slotStartGrab(const QRect &rect) {
if (KdenliveSettings::screengrabenableaudio() && !KdenliveSettings::useosscapture()) {
QStringList alsaArgs = KdenliveSettings::screengrabalsacapture().simplified().split(' ');
alsaProcess->setStandardOutputProcess(captureProcess);
alsaProcess->start(alsaArgs.takeFirst(), alsaArgs);
alsaProcess->start("arecord", alsaArgs);
}
captureProcess->start("ffmpeg", m_captureArgs);
}
......
......@@ -49,6 +49,14 @@ RenderWidget::RenderWidget(QWidget * parent): QDialog(parent), m_standard("PAL")
m_view.buttonSave->setIcon(KIcon("document-new"));
m_view.buttonSave->setToolTip(i18n("Create new profile"));
m_view.buttonInfo->setIcon(KIcon("help-about"));
if (KdenliveSettings::showrenderparams()) {
m_view.buttonInfo->setDown(true);
} else m_view.advanced_params->hide();
connect(m_view.buttonInfo, SIGNAL(clicked()), this, SLOT(showInfoPanel()));
connect(m_view.buttonSave, SIGNAL(clicked()), this, SLOT(slotSaveProfile()));
connect(m_view.buttonEdit, SIGNAL(clicked()), this, SLOT(slotEditProfile()));
connect(m_view.buttonDelete, SIGNAL(clicked()), this, SLOT(slotDeleteProfile()));
......@@ -68,6 +76,20 @@ RenderWidget::RenderWidget(QWidget * parent): QDialog(parent), m_standard("PAL")
m_view.buttonStart->setEnabled(false);
m_view.guides_box->setVisible(false);
parseProfiles();
m_view.splitter->setStretchFactor(1, 5);
m_view.splitter->setStretchFactor(0, 2);
}
void RenderWidget::showInfoPanel() {
if (m_view.advanced_params->isVisible()) {
m_view.advanced_params->setVisible(false);
m_view.buttonInfo->setDown(false);
KdenliveSettings::setShowrenderparams(false);
} else {
m_view.advanced_params->setVisible(true);
m_view.buttonInfo->setDown(true);
KdenliveSettings::setShowrenderparams(true);
}
}
void RenderWidget::slotUpdateGuideBox() {
......@@ -121,7 +143,7 @@ void RenderWidget::slotSaveProfile() {
int pos = ui.group_name->findText(customGroup);
ui.group_name->setCurrentIndex(pos);
ui.parameters->setText(m_view.advanced_params->text());
ui.parameters->setText(m_view.advanced_params->toPlainText());
ui.extension->setText(m_view.size_list->currentItem()->data(ExtensionRole).toString());
ui.profile_name->setFocus();
if (d->exec() == QDialog::Accepted) {
......@@ -160,7 +182,7 @@ void RenderWidget::slotSaveProfile() {
QDomElement profileElement = doc.createElement("profile");
profileElement.setAttribute("name", newProfileName);
profileElement.setAttribute("extension", ui.extension->text().simplified());
profileElement.setAttribute("args", ui.parameters->text().simplified());
profileElement.setAttribute("args", ui.parameters->toPlainText().simplified());
documentElement.appendChild(profileElement);
//QCString save = doc.toString().utf8();
......@@ -239,7 +261,7 @@ void RenderWidget::slotEditProfile() {
QDomElement profileElement = doc.createElement("profile");
profileElement.setAttribute("name", newProfileName);
profileElement.setAttribute("extension", ui.extension->text().simplified());
profileElement.setAttribute("args", ui.parameters->text().simplified());
profileElement.setAttribute("args", ui.parameters->toPlainText().simplified());
documentElement.appendChild(profileElement);
//QCString save = doc.toString().utf8();
......@@ -323,7 +345,7 @@ void RenderWidget::slotExport() {
startPos = m_view.guide_start->itemData(m_view.guide_start->currentIndex()).toDouble();
endPos = m_view.guide_end->itemData(m_view.guide_end->currentIndex()).toDouble();
}
emit doRender(m_view.out_file->url().path(), item->data(RenderRole).toString(), overlayargs, m_view.advanced_params->text().split(' '), m_view.render_zone->isChecked(), m_view.play_after->isChecked(), startPos, endPos);
emit doRender(m_view.out_file->url().path(), item->data(RenderRole).toString(), overlayargs, m_view.advanced_params->toPlainText().split(' '), m_view.render_zone->isChecked(), m_view.play_after->isChecked(), startPos, endPos);
}
void RenderWidget::setDocumentStandard(QString std) {
......@@ -360,7 +382,7 @@ void RenderWidget::refreshParams() {
if (!item) return;
QString params = item->data(ParamsRole).toString();
QString extension = item->data(ExtensionRole).toString();
m_view.advanced_params->setText(params);
m_view.advanced_params->setPlainText(params);
m_view.advanced_params->setToolTip(params);
KUrl url = m_view.out_file->url();
if (!url.isEmpty()) {
......
......@@ -45,7 +45,7 @@ private slots:
void slotUpdateGuideBox();
void slotCheckStartGuidePosition();
void slotCheckEndGuidePosition();
void showInfoPanel();
private:
Ui::RenderWidget_UI m_view;
......
......@@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>424</width>
<height>381</height>
<width>362</width>
<height>382</height>
</rect>
</property>
<property name="windowTitle" >
......@@ -14,16 +14,23 @@
</property>
<layout class="QGridLayout" name="gridLayout_3" >
<item row="0" column="0" >
<widget class="QSplitter" name="splitter_2" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Output file</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2" >
<item row="1" column="1" colspan="2" >
<widget class="KUrlRequester" name="out_file" />
</item>
<item row="1" column="0" colspan="3" >
<item row="2" column="0" colspan="3" >
<widget class="KTabWidget" name="ktabwidget" >
<property name="currentIndex" >
<number>0</number>
......@@ -40,52 +47,98 @@
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="KListWidget" name="format_list" />
</item>
<item row="1" column="1" colspan="4" >
<widget class="KListWidget" name="size_list" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1" >
<spacer name="horizontalSpacer_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
<property name="sizeHint" stdset="0" >
<size>
<width>165</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="2" >
<widget class="KLineEdit" name="advanced_params" >
<property name="readOnly" >
<bool>true</bool>
<item row="0" column="2" >
<widget class="QToolButton" name="buttonInfo" >
<property name="text" >
<string>I</string>
</property>
</widget>
</item>
<item row="2" column="2" >
<item row="0" column="3" >
<widget class="QToolButton" name="buttonSave" >
<property name="text" >
<string>S</string>
</property>
</widget>
</item>
<item row="2" column="3" >
<item row="0" column="4" >
<widget class="QToolButton" name="buttonEdit" >
<property name="text" >
<string>E</string>
</property>
</widget>
</item>
<item row="2" column="4" >
<item row="0" column="5" >
<widget class="QToolButton" name="buttonDelete" >
<property name="text" >
<string>D</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="6" >
<widget class="QSplitter" name="splitter_3" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<widget class="QSplitter" name="splitter" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<widget class="KListWidget" name="format_list" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<widget class="KListWidget" name="size_list" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</widget>
<widget class="KTextEdit" name="advanced_params" >
<property name="readOnly" >
<bool>true</bool>
</property>
<property name="acceptRichText" >
<bool>false</bool>
</property>
</widget>
</widget>
</item>
</layout>
<zorder>label_3</zorder>
<zorder>format_list</zorder>
<zorder>size_list</zorder>
<zorder>advanced_params</zorder>
<zorder>buttonEdit</zorder>
<zorder>buttonDelete</zorder>
<zorder>horizontalSpacer_2</zorder>
<zorder>buttonSave</zorder>
<zorder>buttonInfo</zorder>
<zorder>advanced_params</zorder>
</widget>
</widget>
</item>
<item row="2" column="0" colspan="2" >
<item row="3" column="0" colspan="2" >
<layout class="QHBoxLayout" name="horizontalLayout" >
<item>
<widget class="QRadioButton" name="render_full" >
......@@ -113,7 +166,7 @@
</item>
</layout>
</item>
<item row="3" column="0" colspan="3" >
<item row="4" column="0" colspan="3" >
<widget class="QGroupBox" name="guides_box" >
<property name="title" >
<string/>
......@@ -156,7 +209,7 @@
</layout>
</widget>
</item>
<item row="4" column="0" colspan="3" >
<item row="5" column="0" colspan="3" >
<layout class="QHBoxLayout" name="horizontalLayout_3" >
<item>
<widget class="QCheckBox" name="play_after" >
......@@ -174,14 +227,27 @@
</item>
</layout>
</item>
<item row="5" column="0" >
<item row="6" column="0" >
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="0" >
<widget class="KPushButton" name="buttonStart" >
<property name="text" >
<string>Start Rendering</string>
</property>
</widget>
</item>
<item row="5" column="1" >
<item row="7" column="1" >
<spacer name="horizontalSpacer" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
......@@ -194,7 +260,7 @@
</property>
</spacer>
</item>
<item row="5" column="2" >
<item row="7" column="2" >
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
......@@ -212,11 +278,6 @@
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KListWidget</class>
<extends>QListWidget</extends>
......@@ -233,6 +294,11 @@
<header>ktabwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KTextEdit</class>
<extends>QTextEdit</extends>
<header>ktextedit.h</header>
</customwidget>
<customwidget>
<class>KUrlRequester</class>
<extends>QFrame</extends>
......
......@@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>225</height>
<width>346</width>
<height>237</height>
</rect>
</property>
<property name="windowTitle" >
......@@ -55,7 +55,14 @@
</widget>
</item>
<item row="4" column="0" colspan="3" >
<widget class="KLineEdit" name="parameters" />
<widget class="KTextEdit" name="parameters" >
<property name="readOnly" >
<bool>false</bool>
</property>
<property name="acceptRichText" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="5" column="2" >
<spacer name="verticalSpacer" >
......@@ -93,6 +100,11 @@
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KTextEdit</class>
<extends>QTextEdit</extends>
<header>ktextedit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
......
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