]> git.sesse.net Git - kdenlive/commitdiff
Setup some default external apps to open/edit files
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 26 Jun 2009 15:23:51 +0000 (15:23 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 26 Jun 2009 15:23:51 +0000 (15:23 +0000)
svn path=/trunk/kdenlive/; revision=3673

src/widgets/wizardcheck_ui.ui
src/widgets/wizardmltcheck_ui.ui
src/wizard.cpp
src/wizard.h

index a29e8550752015f1f99640623366f2e5f8cac58a..650990ce00764a8edf3b5564997c224429bd2413 100644 (file)
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>WizardCheck_UI</class>
- <widget class="QWidget" name="WizardCheck_UI" >
-  <property name="geometry" >
+ <widget class="QWidget" name="WizardCheck_UI">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
@@ -9,9 +10,35 @@
     <height>236</height>
    </rect>
   </property>
-  <layout class="QGridLayout" name="gridLayout" >
-   <item row="0" column="0" >
-    <widget class="QTreeWidget" name="programList" />
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QTreeWidget" name="programList">
+     <property name="alternatingRowColors">
+      <bool>true</bool>
+     </property>
+     <property name="rootIsDecorated">
+      <bool>false</bool>
+     </property>
+     <property name="columnCount">
+      <number>2</number>
+     </property>
+     <attribute name="headerVisible">
+      <bool>false</bool>
+     </attribute>
+     <attribute name="headerVisible">
+      <bool>false</bool>
+     </attribute>
+     <column>
+      <property name="text">
+       <string notr="true">1</string>
+      </property>
+     </column>
+     <column>
+      <property name="text">
+       <string notr="true">2</string>
+      </property>
+     </column>
+    </widget>
    </item>
   </layout>
  </widget>
index f21996e38994b89fac66cbba239d0950dd0a8e84..4a0dc6f8041d6c410f7a5c2c10e4360f438a33f9 100644 (file)
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>WizardMltCheck_UI</class>
- <widget class="QWidget" name="WizardMltCheck_UI" >
-  <property name="geometry" >
+ <widget class="QWidget" name="WizardMltCheck_UI">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <height>284</height>
    </rect>
   </property>
-  <layout class="QGridLayout" name="gridLayout_3" >
-   <item row="0" column="0" >
-    <widget class="QTabWidget" name="tabWidget" >
-     <property name="currentIndex" >
+  <layout class="QGridLayout" name="gridLayout_3">
+   <item row="0" column="0">
+    <widget class="QTabWidget" name="tabWidget">
+     <property name="currentIndex">
       <number>0</number>
      </property>
-     <widget class="QWidget" name="tab" >
-      <attribute name="title" >
+     <widget class="QWidget" name="tab">
+      <attribute name="title">
        <string>Installed modules</string>
       </attribute>
-      <layout class="QGridLayout" name="gridLayout_2" >
-       <item row="0" column="0" >
-        <widget class="QTreeWidget" name="programList" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Expanding" hsizetype="MinimumExpanding" >
+      <layout class="QGridLayout" name="gridLayout_2">
+       <item row="0" column="0">
+        <widget class="QTreeWidget" name="programList">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="alternatingRowColors">
+          <bool>true</bool>
+         </property>
+         <property name="rootIsDecorated">
+          <bool>false</bool>
+         </property>
+         <property name="columnCount">
+          <number>2</number>
+         </property>
+         <attribute name="headerVisible">
+          <bool>false</bool>
+         </attribute>
+         <attribute name="headerVisible">
+          <bool>false</bool>
+         </attribute>
          <column>
-          <property name="text" >
+          <property name="text">
            <string>1</string>
           </property>
          </column>
+         <column>
+          <property name="text">
+           <string notr="true">2</string>
+          </property>
+         </column>
         </widget>
        </item>
       </layout>
      </widget>
-     <widget class="QWidget" name="tab_2" >
-      <attribute name="title" >
+     <widget class="QWidget" name="tab_2">
+      <attribute name="title">
        <string>Available Codecs (avformat)</string>
       </attribute>
-      <layout class="QGridLayout" name="gridLayout" >
-       <item row="0" column="0" >
-        <widget class="QLabel" name="label" >
-         <property name="text" >
-          <string>Audio Codecs</string>
+      <layout class="QGridLayout" name="gridLayout">
+       <item row="1" column="0">
+        <widget class="QListWidget" name="acodecs_list">
+         <property name="alternatingRowColors">
+          <bool>true</bool>
          </property>
         </widget>
        </item>
-       <item row="0" column="1" >
-        <widget class="QLabel" name="label_2" >
-         <property name="text" >
-          <string>Video Codecs</string>
+       <item row="1" column="1">
+        <widget class="QListWidget" name="vcodecs_list">
+         <property name="alternatingRowColors">
+          <bool>true</bool>
          </property>
         </widget>
        </item>
-       <item row="0" column="2" >
-        <widget class="QLabel" name="label_3" >
-         <property name="text" >
-          <string>Formats</string>
+       <item row="1" column="2">
+        <widget class="QListWidget" name="formats_list">
+         <property name="alternatingRowColors">
+          <bool>true</bool>
          </property>
         </widget>
        </item>
-       <item row="1" column="0" >
-        <widget class="QListWidget" name="acodecs_list" />
+       <item row="0" column="2">
+        <widget class="QLabel" name="label_3">
+         <property name="text">
+          <string>Formats</string>
+         </property>
+        </widget>
        </item>
-       <item row="1" column="1" >
-        <widget class="QListWidget" name="vcodecs_list" />
+       <item row="0" column="1">
+        <widget class="QLabel" name="label_2">
+         <property name="text">
+          <string>Video Codecs</string>
+         </property>
+        </widget>
        </item>
-       <item row="1" column="2" >
-        <widget class="QListWidget" name="formats_list" />
+       <item row="0" column="0">
+        <widget class="QLabel" name="label">
+         <property name="text">
+          <string>Audio Codecs</string>
+         </property>
+        </widget>
        </item>
       </layout>
       <zorder>acodecs_list</zorder>
index 4266ec8adbada2d7fd4878acef5a2ea50bd298c1..97973dad5873ffff0f9536326e189bd2a2d1cc56 100644 (file)
@@ -27,6 +27,8 @@
 #include <KProcess>
 #include <kmimetype.h>
 #include <KRun>
+#include <KService>
+#include <KMimeTypeTrader>
 
 #include <QLabel>
 #include <QFile>
@@ -135,9 +137,6 @@ Wizard::Wizard(bool upgrade, QWidget *parent) :
 
 void Wizard::checkMltComponents()
 {
-    m_mltCheck.programList->setColumnCount(2);
-    m_mltCheck.programList->setRootIsDecorated(false);
-    m_mltCheck.programList->setHeaderHidden(true);
     QSize itemSize(20, fontMetrics().height() * 2.5);
     m_mltCheck.programList->setColumnWidth(0, 30);
     m_mltCheck.programList->setIconSize(QSize(24, 24));
@@ -305,9 +304,6 @@ void Wizard::checkMltComponents()
 
 void Wizard::slotCheckPrograms()
 {
-    m_check.programList->setColumnCount(2);
-    m_check.programList->setRootIsDecorated(false);
-    m_check.programList->setHeaderHidden(true);
     QSize itemSize(20, fontMetrics().height() * 2.5);
     m_check.programList->setColumnWidth(0, 30);
     m_check.programList->setIconSize(QSize(24, 24));
@@ -344,6 +340,23 @@ void Wizard::slotCheckPrograms()
     if (KStandardDirs::findExe("mkisofs").isEmpty()) item->setIcon(0, m_badIcon);
     else item->setIcon(0, m_okIcon);
 
+    // set up some default applications
+    QString program;
+    if (KdenliveSettings::defaultimageapp().isEmpty()) {
+        program = KStandardDirs::findExe("gimp");
+        if (program.isEmpty()) program = KStandardDirs::findExe("krita");
+        if (!program.isEmpty()) KdenliveSettings::setDefaultimageapp(program);
+    }
+    if (KdenliveSettings::defaultaudioapp().isEmpty()) {
+        program = KStandardDirs::findExe("audacity");
+        if (program.isEmpty()) program = KStandardDirs::findExe("traverso");
+        if (!program.isEmpty()) KdenliveSettings::setDefaultaudioapp(program);
+    }
+    if (KdenliveSettings::defaultvideoapp().isEmpty()) {
+        KService::Ptr offer = KMimeTypeTrader::self()->preferredService("video/mpeg");
+        if (offer)
+            KdenliveSettings::setDefaultvideoapp(KRun::binaryName(offer->exec(), true));
+    }
 }
 
 void Wizard::installExtraMimes(QString baseName, QStringList globs)
@@ -546,7 +559,7 @@ bool Wizard::isOk() const
     return m_systemCheckIsOk;
 }
 
-bool Wizard::slotShowWebInfos()
+void Wizard::slotShowWebInfos()
 {
     KRun::runUrl(KUrl("http://kdenlive.org/discover/" + QString(version).section(' ', 0, 0)), "text/html", this);
 }
index 232437d088c6ed0aed4446a2ee39f1eb321989d6..b376632875fecace74bcf5b3d0936df8934b5fc3 100644 (file)
@@ -101,7 +101,7 @@ private slots:
     void slotCheckStandard();
     void slotCheckSelectedItem();
     void slotCheckMlt();
-    bool slotShowWebInfos();
+    void slotShowWebInfos();
 };
 
 #endif