+void ArchiveWidget::slotDisplayMessage(const QString &icon, const QString &text)
+{
+ icon_info->setPixmap(KIcon(icon).pixmap(16, 16));
+ text_info->setText(text);
+}
+
+void ArchiveWidget::openArchiveForExtraction()
+{
+ emit showMessage("system-run", i18n("Opening archive..."));
+ m_extractArchive = new KTar(m_extractUrl.path());
+ if (!m_extractArchive->isOpen() && !m_extractArchive->open( QIODevice::ReadOnly )) {
+ emit showMessage("dialog-close", i18n("Cannot open archive file:\n %1", m_extractUrl.path()));
+ groupBox->setEnabled(false);
+ return;
+ }
+
+ // Check that it is a kdenlive project archive
+ bool isProjectArchive = false;
+ QStringList files = m_extractArchive->directory()->entries();
+ for (int i = 0; i < files.count(); i++) {
+ if (files.at(i).endsWith(".kdenlive")) {
+ m_projectName = files.at(i);
+ isProjectArchive = true;
+ break;
+ }
+ }
+
+ if (!isProjectArchive) {
+ emit showMessage("dialog-close", i18n("File %1\n is not an archived Kdenlive project", m_extractUrl.path()));
+ groupBox->setEnabled(false);
+ return;
+ }
+ buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
+ emit showMessage("dialog-ok", i18n("Ready"));
+}
+