video_thumbs->setChecked(KdenliveSettings::videothumbnails());
audio_tracks->setValue(audiotracks);
video_tracks->setValue(videotracks);
- proxy_params->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 5);
connect(generate_proxy, SIGNAL(toggled(bool)), proxy_minsize, SLOT(setEnabled(bool)));
connect(generate_imageproxy, SIGNAL(toggled(bool)), proxy_imageminsize, SLOT(setEnabled(bool)));
-
+ QString proxyparameters;
+ QString proxyextension;
if (projectlist) {
enable_proxy->setChecked(projectlist->getDocumentProperty("enableproxy").toInt());
generate_proxy->setChecked(projectlist->getDocumentProperty("generateproxy").toInt());
proxy_minsize->setValue(projectlist->getDocumentProperty("proxyminsize").toInt());
- proxy_params->setPlainText(projectlist->getDocumentProperty("proxyparams"));
+ proxyparameters = projectlist->getDocumentProperty("proxyparams");
generate_imageproxy->setChecked(projectlist->getDocumentProperty("generateimageproxy").toInt());
proxy_imageminsize->setValue(projectlist->getDocumentProperty("proxyimageminsize").toInt());
- proxy_extension->setText(projectlist->getDocumentProperty("proxyextension"));
+ proxyextension = projectlist->getDocumentProperty("proxyextension");
}
else {
enable_proxy->setChecked(KdenliveSettings::enableproxy());
generate_proxy->setChecked(KdenliveSettings::generateproxy());
proxy_minsize->setValue(KdenliveSettings::proxyminsize());
- proxy_params->setPlainText(KdenliveSettings::proxyparams());
+ proxyparameters = KdenliveSettings::proxyparams();
generate_imageproxy->setChecked(KdenliveSettings::generateimageproxy());
proxy_imageminsize->setValue(KdenliveSettings::proxyimageminsize());
- proxy_extension->setText(KdenliveSettings::proxyextension());
+ proxyextension = KdenliveSettings::proxyextension();
}
proxy_minsize->setEnabled(generate_proxy->isChecked());
proxy_imageminsize->setEnabled(generate_imageproxy->isChecked());
+
+
+ // load proxy profiles
+ QString profileFile = KStandardDirs::locateLocal("appdata", "encodingprofiles.rc");
+ KConfig conf(profileFile, KConfig::SimpleConfig);
+ KConfigGroup group(&conf, "proxy");
+ QMap <QString, QString> values = group.entryMap();
+ QMapIterator<QString, QString> k(values);
+ int ix = -1;
+ while (k.hasNext()) {
+ k.next();
+ if (!k.key().isEmpty()) {
+ QString params = k.value().section(';', 0, 0);
+ QString extension = k.value().section(';', 1, 1);
+ if (params == proxyparameters && extension == proxyextension) {
+ // this is the current profile
+ ix = proxy_profile->count();
+ }
+ proxy_profile->addItem(k.key(), k.value());
+ }
+ }
+ if (ix == -1) {
+ // Current project proxy settings not found
+ ix = proxy_profile->count();
+ proxy_profile->addItem(i18n("Current Settings"), QString(proxyparameters + ';' + proxyextension));
+ }
+ proxy_profile->setCurrentIndex(ix);
+ slotUpdateProxyParams();
+
+ // Proxy GUI stuff
+ proxy_showprofileinfo->setIcon(KIcon("help-about"));
+ connect(proxy_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateProxyParams()));
+ proxyparams->setVisible(false);
+ proxyparams->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 5);
+ connect(proxy_showprofileinfo, SIGNAL(clicked(bool)), proxyparams, SLOT(setVisible(bool)));
if (readOnlyTracks) {
video_tracks->setEnabled(false);
QString ProjectSettings::proxyParams() const
{
- return proxy_params->toPlainText();
+ QString params = proxy_profile->itemData(proxy_profile->currentIndex()).toString();
+ return params.section(';', 0, 0);
}
QString ProjectSettings::proxyExtension() const
{
- return proxy_extension->text();
+ QString params = proxy_profile->itemData(proxy_profile->currentIndex()).toString();
+ return params.section(';', 1, 1);
}
//static
KIO::NetAccess::upload(tmpfile.fileName(), savePath, 0);
}
-
+void ProjectSettings::slotUpdateProxyParams()
+{
+ QString params = proxy_profile->itemData(proxy_profile->currentIndex()).toString();
+ proxyparams->setPlainText(params.section(';', 0, 0));
+}
#include "projectsettings.moc"
<rect>
<x>0</x>
<y>0</y>
- <width>337</width>
- <height>527</height>
+ <width>332</width>
+ <height>529</height>
</rect>
</property>
<property name="windowTitle">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_5">
- <item row="0" column="0">
+ <item row="1" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
+ <item row="0" column="0">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</item>
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
+ <item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="generate_proxy">
<property name="text">
<string>Generate for videos larger than</string>
</property>
</widget>
</item>
- <item row="0" column="1">
+ <item row="0" column="2" colspan="3">
<widget class="KIntSpinBox" name="proxy_minsize">
<property name="suffix">
<string>pixels</string>
</property>
</widget>
</item>
- <item row="1" column="0">
+ <item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="generate_imageproxy">
<property name="text">
<string>Generate for images larger than</string>
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="1" column="2" colspan="3">
<widget class="KIntSpinBox" name="proxy_imageminsize">
<property name="suffix">
<string>pixels</string>
</property>
</widget>
</item>
- <item row="2" column="0" colspan="2">
- <widget class="QLabel" name="label_16">
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_24">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
- <string>FFmpeg video transcoding parameters</string>
+ <string>Encoding profile</string>
</property>
</widget>
</item>
- <item row="3" column="0" colspan="2">
- <widget class="QPlainTextEdit" name="proxy_params"/>
+ <item row="2" column="1" colspan="3">
+ <widget class="KComboBox" name="proxy_profile">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
</item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_17">
- <property name="text">
- <string>File extension</string>
+ <item row="3" column="0" colspan="5">
+ <widget class="QPlainTextEdit" name="proxyparams">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
</property>
</widget>
</item>
- <item row="4" column="1">
- <widget class="KLineEdit" name="proxy_extension">
+ <item row="2" column="4">
+ <widget class="QToolButton" name="proxy_showprofileinfo">
<property name="text">
- <string>avi</string>
+ <string>...</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
</property>
</widget>
</item>