]> git.sesse.net Git - kdenlive/commitdiff
Fix broken audio menu, fix translation of effect names
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 18 Oct 2008 19:11:44 +0000 (19:11 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 18 Oct 2008 19:11:44 +0000 (19:11 +0000)
svn path=/branches/KDE4/; revision=2478

src/effectslist.cpp
src/mainwindow.cpp

index b5b9cee7a0cef42bd195007b5f982b4b22bf24ec..39b3b145713aa8100463a6384beb0e1a7436a9fc 100644 (file)
@@ -112,7 +112,7 @@ QStringList EffectsList::effectIdInfo(const int ix) const {
     QStringList info;
     QDomElement effect =  this->at(ix);
     QDomNode namenode = effect.elementsByTagName("name").item(0);
-    info << namenode.toElement().text().toUtf8().data() << effect.attribute("tag") << effect.attribute("id");
+    info << i18n(namenode.toElement().text().toUtf8().data()) << effect.attribute("tag") << effect.attribute("id");
     return info;
 }
 
index 40a4d2c18b4f917fa954ec82cb9349a0e8da5389..fe2200cd714a00625953172a7a8c29ee4446b993 100644 (file)
@@ -209,39 +209,32 @@ MainWindow::MainWindow(const QString &MltPath, QWidget *parent)
     QAction *action;
     QMenu *videoEffectsMenu = static_cast<QMenu*>(factory()->container("video_effects_menu", this));
 
-    int ix = 0;
-    QStringList effects = videoEffects.effectNames();
     QStringList effectInfo;
-    foreach(const QString &name, effects) {
-        action = new QAction(name, this);
+
+    for (int ix = 0; ix < videoEffects.count(); ix++) {
         effectInfo = videoEffects.effectIdInfo(ix);
+        action = new QAction(effectInfo.at(0), this);
         action->setData(effectInfo);
         videoEffectsMenu->addAction(action);
-        ix++;
     }
     QMenu *audioEffectsMenu = static_cast<QMenu*>(factory()->container("audio_effects_menu", this));
 
-    ix = 0;
-    effects = audioEffects.effectNames();
-    foreach(const QString &name, effects) {
-        action = new QAction(name, this);
+    for (int ix = 0; ix < audioEffects.count(); ix++) {
         effectInfo = audioEffects.effectIdInfo(ix);
+        action = new QAction(effectInfo.at(0), this);
         action->setData(effectInfo);
         audioEffectsMenu->addAction(action);
-        ix++;
     }
     m_customEffectsMenu = static_cast<QMenu*>(factory()->container("custom_effects_menu", this));
-    effects = customEffects.effectNames();
-    if (effects.isEmpty()) m_customEffectsMenu->setEnabled(false);
+
+    if (customEffects.isEmpty()) m_customEffectsMenu->setEnabled(false);
     else m_customEffectsMenu->setEnabled(true);
 
-    ix = 0;
-    foreach(const QString &name, effects) {
-        action = new QAction(name, this);
-        effectInfo = videoEffects.effectIdInfo(ix);
+    for (int ix = 0; ix < customEffects.count(); ix++) {
+        effectInfo = customEffects.effectIdInfo(ix);
+        action = new QAction(effectInfo.at(0), this);
         action->setData(effectInfo);
         m_customEffectsMenu->addAction(action);
-        ix++;
     }
 
     QMenu *newEffect = new QMenu(this);
@@ -265,7 +258,7 @@ MainWindow::MainWindow(const QString &MltPath, QWidget *parent)
 
 
     QMenu *transitionsMenu = new QMenu(i18n("Add Transition"), this);
-    effects = transitions.effectNames();
+    QStringList effects = transitions.effectNames();
     foreach(const QString &name, effects) {
         action = new QAction(name, this);
         action->setData(name);