]> git.sesse.net Git - kdenlive/commitdiff
Open website upload page after rendering from a website profile if user wants it
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 29 Jan 2009 12:39:54 +0000 (12:39 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 29 Jan 2009 12:39:54 +0000 (12:39 +0000)
svn path=/branches/KDE4/; revision=3000

export/profiles.xml
src/renderwidget.cpp

index 9e7f9746eb14d924bb7b7d1d214f4d6c94f78b77..f12cca1426e262223b2b03a7a0c3b30ac940da7c 100644 (file)
 
 <group name="Web sites" renderer="avformat" type="av">
   <groupname id="websites">Web sites</groupname>
-  <profile name="Dailymotion 320x240" extension="flv" args="f=flv acodec=libmp3lame ab=128k ar=44100 vcodec=flv minrate=0 b=800k s=320x240 aspect=%dar trellis=1" />
-  <profile name="Dailymotion 512x384" extension="mp4" args="f=mp4 acodec=libfaac ab=96k ar=44100 vcodec=libx264 minrate=0 b=600k s=512x384 aspect=%dar mbd=2 trellis=1 mv4=1" />
-  <profile name="Dailymotion 1280x720" extension="mp4" args="f=mp4 acodec=libfaac ab=96k ar=44100 vcodec=libx264 minrate=0 b=1500k s=1280x720 aspect=%dar mbd=2 trellis=1 mv4=1" />
-   <profile name="Vimeo 640x480" extension="mp4" args="f=mp4 acodec=libfaac ab=128k ar=44100 vcodec=libx264 minrate=0 b=3000k s=640x480 aspect=%dar mbd=2 trellis=1 mv4=1" />
-  <profile name="Vimeo 1280x720" extension="mp4" args="f=mp4 acodec=libfaac ab=128k ar=44100 vcodec=libx264 minrate=0 b=5000k s=1280x720 aspect=%dar mbd=2 trellis=1 mv4=1" />
-  <profile name="Youtube 640x480" extension="mp4" args="f=mp4 acodec=libmp3lame ab=128k ar=44100 vcodec=mpeg4 minrate=0 b=800k s=640x480 aspect=%dar mbd=2 trellis=1 mv4=1" />
-  <profile name="Youtube 1290x720" extension="mp4" args="f=mp4 hq=1 acodec=libfaac ab=128k ar=41100 vcodec=mpeg4 minrate=0 b=2000k s=1290x720 aspect=%dar mbd=2 trellis=1 mv4=1" />
+  <profile name="Dailymotion 320x240" extension="flv" args="f=flv acodec=libmp3lame ab=128k ar=44100 vcodec=flv minrate=0 b=800k s=320x240 aspect=%dar trellis=1" url="http://www.dailymotion.com/upload" />
+  <profile name="Dailymotion 512x384" extension="mp4" args="f=mp4 acodec=libfaac ab=96k ar=44100 vcodec=libx264 minrate=0 b=600k s=512x384 aspect=%dar mbd=2 trellis=1 mv4=1" url="http://www.dailymotion.com/upload" />
+  <profile name="Dailymotion 1280x720" extension="mp4" args="f=mp4 acodec=libfaac ab=96k ar=44100 vcodec=libx264 minrate=0 b=1500k s=1280x720 aspect=%dar mbd=2 trellis=1 mv4=1" url="http://www.dailymotion.com/upload" />
+   <profile name="Vimeo 640x480" extension="mp4" args="f=mp4 acodec=libfaac ab=128k ar=44100 vcodec=libx264 minrate=0 b=3000k s=640x480 aspect=%dar mbd=2 trellis=1 mv4=1" url="http://www.vimeo.com/upload" />
+  <profile name="Vimeo 1280x720" extension="mp4" args="f=mp4 acodec=libfaac ab=128k ar=44100 vcodec=libx264 minrate=0 b=5000k s=1280x720 aspect=%dar mbd=2 trellis=1 mv4=1" url="http://www.vimeo.com/upload" />
+  <profile name="Youtube 640x480" extension="mp4" args="f=mp4 acodec=libmp3lame ab=128k ar=44100 vcodec=mpeg4 minrate=0 b=800k s=640x480 aspect=%dar mbd=2 trellis=1 mv4=1" url="http://www.youtube.com/upload" />
+  <profile name="Youtube 1290x720" extension="mp4" args="f=mp4 hq=1 acodec=libfaac ab=128k ar=41100 vcodec=mpeg4 minrate=0 b=2000k s=1290x720 aspect=%dar mbd=2 trellis=1 mv4=1" url="http://www.youtube.com/upload" />
 
 </group>
 
index 4b8ef6b687cb6d489a736b763b6cbf9087ac3995..a28aa0f7478676df4b1a70a72dfdbeee83942883 100644 (file)
@@ -27,6 +27,7 @@
 #include <KDebug>
 #include <KMessageBox>
 #include <KComboBox>
+#include <KRun>
 
 #include "kdenlivesettings.h"
 #include "renderwidget.h"
@@ -39,6 +40,7 @@ const int RenderRole = GroupRole + 3;
 const int ParamsRole = GroupRole + 4;
 const int EditableRole = GroupRole + 5;
 const int MetaGroupRole = GroupRole + 6;
+const int ExtraRole = GroupRole + 7;
 
 RenderWidget::RenderWidget(QWidget * parent): QDialog(parent) {
     m_view.setupUi(this);
@@ -484,6 +486,11 @@ void RenderWidget::slotExport() {
             kDebug() << "// render profile: " << prof;
             renderItem->setData(0, Qt::UserRole + 1, prof);
         }
+    } else if (group == "websites" && m_view.open_browser->isChecked()) {
+        renderItem->setData(0, Qt::UserRole, group);
+        // pass the url
+        QString url = m_view.size_list->currentItem()->data(ExtraRole).toString();
+        renderItem->setData(0, Qt::UserRole + 1, url);
     }
 
     emit doRender(dest, item->data(RenderRole).toString(), overlayargs, renderArgs.simplified().split(' '), m_view.render_zone->isChecked(), m_view.play_after->isChecked(), startPos, endPos, resizeProfile);
@@ -750,6 +757,7 @@ void RenderWidget::parseFile(QString exportFile, bool editable) {
             item->setData(RenderRole, renderer);
             item->setData(StandardRole, standard);
             item->setData(ParamsRole, params);
+            if (profileElement.hasAttribute("url")) item->setData(ExtraRole, profileElement.attribute("url"));
             if (editable) item->setData(EditableRole, "true");
             n = n.nextSibling();
         }
@@ -779,8 +787,10 @@ void RenderWidget::setRenderStatus(const QString &dest, int status, const QStrin
         QString itemGroup = item->data(0, Qt::UserRole).toString();
         if (itemGroup == "dvd") {
             emit openDvdWizard(item->text(0), item->data(0, Qt::UserRole + 1).toString());
+        } else if (itemGroup == "websites") {
+            QString url = item->data(0, Qt::UserRole + 1).toString();
+            if (!url.isEmpty()) KRun *openBrowser = new KRun(url, this);
         }
-
     } else if (status == -2) {
         // Rendering crashed
         item->setIcon(0, KIcon("dialog-close"));