Logo Search packages:      
Sourcecode: kdenlive version File versions

void Gui::KdenliveApp::slotFileSaveAs ( QString  suggestedName = QString::null  )  [slot]

save a document by a new filename

Definition at line 2727 of file kdenlive.cpp.

References KdenliveDoc::isModified(), m_doc, m_fileDialogPath, m_projectFormat, ProjectFormatManager::saveDocument(), ProjectFormatManager::saveMimeTypes(), KdenliveDoc::setURL(), and slotStatusMsg().

Referenced by initActions(), saveModified(), and slotFileSave().

                                                          {
      slotStatusMsg(i18n("Saving file with a new filename..."));
      m_autoSaveTimer->stop();
      KURL url = KFileDialog::getSaveURL(m_fileDialogPath.path() + "/" + suggestedName,
          m_projectFormatManager.saveMimeTypes(), this, i18n("Save as..."));

      if (!url.isEmpty()) {
          if (!url.path().endsWith(".kdenlive"))
            url.setFileName(url.filename() + ".kdenlive");

          if (KIO::NetAccess::exists(url, true, this) && KMessageBox::questionYesNo(this, i18n("File already exists.\nDo you want to overwrite it ?")) ==  KMessageBox::No) {
            if (KdenliveSettings::autosave())
                m_autoSaveTimer->start(KdenliveSettings::autosavetime() * 60000, false);
            return;
          }
          if (m_projectFormatManager.saveDocument(url, m_doc)) {
          fileOpenRecent->addURL(url);

            setCaption(url.fileName() + " - " + projectFormatName(m_projectFormat), m_doc->isModified());
          m_doc->setURL(url);
          }
          m_fileDialogPath = url;
          m_fileDialogPath.setFileName(QString::null);
      }
      if (KdenliveSettings::autosave())
          m_autoSaveTimer->start(KdenliveSettings::autosavetime() * 60000, false);
      slotStatusMsg(i18n("Ready."));
    }


Generated by  Doxygen 1.6.0   Back to index