Logo Search packages:      
Sourcecode: kdenlive version File versions

void Gui::KdenliveApp::slotProjectAddClips (  )  [slot]

Add clips to the project

Definition at line 3076 of file kdenlive.cpp.

References addCommand(), getDocument(), m_doc, m_fileDialogPath, m_projectList, slotStatusMsg(), and KdenliveDoc::URL().

Referenced by initActions().

                                          {
      slotStatusMsg(i18n("Adding Clips"));

      // Make a reasonable filter for video / audio files.
      QString filter = "application/vnd.kde.kdenlive application/vnd.westley.scenelist application/flv application/vnd.rn-realmedia video/x-dv video/x-msvideo video/mpeg video/x-ms-wmv audio/x-mp3 audio/x-wav application/ogg *.m2t *.dv video/mp4 video/quicktime image/gif image/jpeg image/png image/x-bmp image/svg+xml image/tiff image/x-xcf-gimp image/x-vnd.adobe.photoshop image/x-pcx image/x-exr";
      KURL::List urlList =
          KFileDialog::getOpenURLs(m_fileDialogPath.path(), filter, this,
        i18n("Open File..."));

      KURL::List::Iterator it;
      KURL url;
      
      KMacroCommand *macroCommand = new KMacroCommand(i18n("Add Clips"));
      for (it = urlList.begin(); it != urlList.end(); it++) {
          url = (*it);
          if (!url.isEmpty()) {
            if (m_doc->URL() == url) {
                  KMessageBox::sorry(this, i18n("You cannot include the current Kdenlive document in itself."));
            }
            else if (getDocument()->clipManager().findClip(url)) KMessageBox::sorry(this, i18n("The clip %1 is already present in this project").arg(url.filename()));
            else { 
                  Command::KAddClipCommand * command;
                  command = new Command::KAddClipCommand(*m_doc, m_projectList->parentName(), url, true);
                  macroCommand->addCommand(command);
            }
            m_fileDialogPath = url;
          }
      }
      addCommand(macroCommand, true);

      m_fileDialogPath.setFileName(QString::null);

      slotStatusMsg(i18n("Ready."));
    }


Generated by  Doxygen 1.6.0   Back to index