First steps for downloadable rendering profiles

svn path=/branches/KDE4/; revision=3050
parent 93e855bf
......@@ -185,7 +185,7 @@ install( FILES kdenliveui.rc kdenlive.notifyrc DESTINATION ${DATA_INSTALL_DIR}/
install (FILES kdenlivesettings.kcfg DESTINATION share/config.kcfg)
install (FILES kdenlive.desktop DESTINATION share/applications/kde)
install (FILES application-x-kdenlive.svgz video-mlt-playlist.svgz DESTINATION share/icons/oxygen/scalable/mimetypes)
install( FILES kdenlive.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
install( FILES kdenlive.knsrc kdenlive_render.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
kde4_install_icons( ${ICON_INSTALL_DIR} )
[KNewStuff2]
ProvidersUrl=http://download.kde.org/khotnewstuff/kdenlive-providers.xml
TargetDir=kdenlive/lumas
Uncompress=archive
\ No newline at end of file
Uncompress=archive
[KNewStuff2]
ProvidersUrl=http://kdenlive.org/data/rendersources.xml
TargetDir=kdenlive/export
Uncompress=archive
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<gui name="kdenlive" version="32">
<gui name="kdenlive" version="33">
<ToolBar name="extraToolBar" >
<text>Extra Toolbar</text>
<Action name="project_render" />
......@@ -109,7 +109,8 @@
</Menu>
<Menu name="settings" >
<Action name="manage_profiles" />
<Action name="get_new_stuff" />
<Action name="get_new_lumas" />
<Action name="get_new_profiles" />
<Action name="run_wizard" />
</Menu>
</MenuBar>
......
......@@ -776,7 +776,9 @@ void MainWindow::setupActions() {
collection->addAction("manage_profiles", profilesAction);
connect(profilesAction, SIGNAL(triggered(bool)), this, SLOT(slotEditProfiles()));
KAction* fileGHNS = KNS::standardAction(i18n("Download New Lumas..."), this, SLOT(slotGetNewStuff()), actionCollection(), "get_new_stuff");
KNS::standardAction(i18n("Download New Lumas..."), this, SLOT(slotGetNewLumaStuff()), actionCollection(), "get_new_lumas");
KNS::standardAction(i18n("Download New Profiles..."), this, SLOT(slotGetNewRenderStuff()), actionCollection(), "get_new_profiles");
KAction* wizAction = new KAction(KIcon("configure"), i18n("Run Config Wizard"), this);
collection->addAction("run_wizard", wizAction);
......@@ -2248,7 +2250,7 @@ void MainWindow::slotSetOutPoint() {
} else m_activeTimeline->projectView()->setOutPoint();
}
void MainWindow::slotGetNewStuff() {
void MainWindow::slotGetNewLumaStuff() {
//KNS::Entry::List download();
KNS::Entry::List entries = KNS::Engine::download();
int numberInstalled = 0;
......@@ -2266,6 +2268,27 @@ void MainWindow::slotGetNewStuff() {
initEffects::refreshLumas();
}
void MainWindow::slotGetNewRenderStuff() {
//KNS::Entry::List download();
KNS::Engine engine(0);
if (engine.init("kdenlive_render.knsrc")) {
KNS::Entry::List entries = engine.downloadDialogModal(this);
if (entries.size() > 0) {
foreach(KNS::Entry* entry, entries) {
// care only about installed ones
if (entry->status() == KNS::Entry::Installed) {
foreach(const QString &file, entry->installedFiles()) {
kDebug() << "// CURRENTLY INSTALLED: " << file;
}
}
}
}
if (m_renderWidget) m_renderWidget->reloadProfiles();
}
}
void MainWindow::slotAutoTransition() {
m_activeTimeline->projectView()->autoTransition();
}
......
......@@ -283,7 +283,8 @@ private slots:
void slotInsertTrack(int ix = 0);
void slotDeleteTrack(int ix = 0);
void slotChangeTrack(int ix = 0);
void slotGetNewStuff();
void slotGetNewLumaStuff();
void slotGetNewRenderStuff();
void slotAutoTransition();
void slotRunWizard();
void generateClip();
......
......@@ -746,6 +746,10 @@ void RenderWidget::refreshParams() {
m_view.buttonStart->setEnabled(true);
}
void RenderWidget::reloadProfiles() {
parseProfiles();
}
void RenderWidget::parseProfiles(QString group, QString profile) {
m_view.size_list->clear();
m_view.format_list->clear();
......@@ -753,13 +757,22 @@ void RenderWidget::parseProfiles(QString group, QString profile) {
m_view.destination_list->addItem(KIcon("video-x-generic"), i18n("File rendering"));
QString exportFile = KStandardDirs::locate("appdata", "export/profiles.xml");
parseFile(exportFile, false);
exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
if (QFile::exists(exportFile)) parseFile(exportFile, true);
QString exportFolder = KStandardDirs::locateLocal("appdata", "export/");
QDir directory = QDir(exportFolder);
QStringList filter;
filter << "*.xml";
const QStringList fileList = directory.entryList(filter, QDir::Files);
foreach(const QString filename, fileList)
parseFile(exportFolder + '/' + filename, true);
refreshView();
QList<QListWidgetItem *> child;
child = m_view.format_list->findItems(group, Qt::MatchExactly);
if (!group.isEmpty()) child = m_view.format_list->findItems(group, Qt::MatchExactly);
if (!child.isEmpty()) m_view.format_list->setCurrentItem(child.at(0));
child = m_view.size_list->findItems(profile, Qt::MatchExactly);
child.clear();
if (!profile.isEmpty()) child = m_view.size_list->findItems(profile, Qt::MatchExactly);
if (!child.isEmpty()) m_view.size_list->setCurrentItem(child.at(0));
}
......@@ -801,6 +814,7 @@ void RenderWidget::parseFile(QString exportFile, bool editable) {
else if (metagroupId == "websites") icon = KIcon("applications-internet");
else if (metagroupId == "mediaplayers") icon = KIcon("applications-multimedia");
else if (metagroupId == "lossless") icon = KIcon("drive-harddisk");
else if (metagroupId == "mobile") icon = KIcon("pda");
m_view.destination_list->addItem(icon, i18n(metagroupName.toUtf8().data()), metagroupId);
}
}
......
......@@ -141,6 +141,7 @@ public:
void setRenderJob(const QString &dest, int progress = 0);
void setRenderStatus(const QString &dest, int status, const QString &error);
void setDocumentPath(const QString path);
void reloadProfiles();
private slots:
void slotUpdateButtons(KUrl url);
......
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