Logo Search packages:      
Sourcecode: kdenlive version File versions

bool Gui::KdenliveApp::saveModified (  ) 

If the document has been modified, asks the user if they want to save it. Returns true if we can proceed. i.e., the document has been saved or discarded.

Definition at line 2071 of file kdenlive.cpp.

References KdenliveDoc::isModified(), m_doc, KdenliveDoc::projectName(), ProjectFormatManager::saveDocument(), slotFileSaveAs(), and KdenliveDoc::URL().

Referenced by openDocumentFile(), queryClose(), and slotFileNew().

                                   {
      bool completed = true;

      if (m_doc->isModified()) {
          int want_save = KMessageBox::warningYesNoCancel(this,
            i18n("The current file has been modified.\n"
                "Do you want to save it?"),
            i18n("Warning"));

          switch (want_save) {
          case KMessageBox::Yes:
            if (m_doc->URL().isEmpty()) {
                slotFileSaveAs(m_doc->projectName());
            } else {
                m_projectFormatManager.saveDocument(m_doc->URL(), m_doc);
            };

            completed = true;
            break;

          case KMessageBox::No:
            completed = true;
            break;

          case KMessageBox::Cancel:
            completed = false;
            break;

          default:
            completed = false;
            break;
          }

      }

      return completed;
    }


Generated by  Doxygen 1.6.0   Back to index