X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fwizard.cpp;h=0a28a9e04027a58049ce56603fbd7c22d79cc657;hb=39bee505f09eb2f520b60d376960e5c95b0a29cb;hp=20983bab7ba6fb09536c6d62825a12e67e531afe;hpb=ab4c36da56fce7229c3e6505c79c1d34307981fc;p=kdenlive diff --git a/src/wizard.cpp b/src/wizard.cpp index 20983bab..0a28a9e0 100644 --- a/src/wizard.cpp +++ b/src/wizard.cpp @@ -27,13 +27,15 @@ #include #include #include +#include +#include #include #include #include #include -const double recommendedMltVersion = 40; +const double recommendedMltVersion = 45; static const char version[] = VERSION; Wizard::Wizard(bool upgrade, QWidget *parent) : @@ -94,7 +96,7 @@ Wizard::Wizard(bool upgrade, QWidget *parent) : slotCheckStandard(); connect(m_standard.profiles_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotCheckSelectedItem())); - + // select default profile if (!KdenliveSettings::default_profile().isEmpty()) { for (int i = 0; i < m_standard.profiles_list->count(); i++) { if (m_standard.profiles_list->item(i)->data(Qt::UserRole).toString() == KdenliveSettings::default_profile()) { @@ -105,19 +107,13 @@ Wizard::Wizard(bool upgrade, QWidget *parent) : } } - // select default profile - fprintf(stderr, "LOOKING FOR: %s", ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()).toUtf8().data()); - QList profiles = m_standard.profiles_list->findItems(ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()), Qt::MatchExactly); - if (profiles.count() > 0) m_standard.profiles_list->setCurrentItem(profiles.at(0)); - - fprintf(stderr, "LOOKING FOR: %s // %d", ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()).toUtf8().data(), profiles.count()); addPage(page2); QWizardPage *page3 = new QWizardPage; page3->setTitle(i18n("Additional Settings")); m_extra.setupUi(page3); m_extra.projectfolder->setMode(KFile::Directory); - m_extra.projectfolder->setPath(KdenliveSettings::defaultprojectfolder()); + m_extra.projectfolder->setUrl(KUrl(KdenliveSettings::defaultprojectfolder())); m_extra.videothumbs->setChecked(KdenliveSettings::videothumbnails()); m_extra.audiothumbs->setChecked(KdenliveSettings::audiothumbnails()); m_extra.autosave->setChecked(KdenliveSettings::crashrecovery()); @@ -141,9 +137,6 @@ Wizard::Wizard(bool upgrade, QWidget *parent) : void Wizard::checkMltComponents() { - m_mltCheck.programList->setColumnCount(2); - m_mltCheck.programList->setRootIsDecorated(false); - m_mltCheck.programList->setHeaderHidden(true); QSize itemSize(20, fontMetrics().height() * 2.5); m_mltCheck.programList->setColumnWidth(0, 30); m_mltCheck.programList->setIconSize(QSize(24, 24)); @@ -311,9 +304,6 @@ void Wizard::checkMltComponents() void Wizard::slotCheckPrograms() { - m_check.programList->setColumnCount(2); - m_check.programList->setRootIsDecorated(false); - m_check.programList->setHeaderHidden(true); QSize itemSize(20, fontMetrics().height() * 2.5); m_check.programList->setColumnWidth(0, 30); m_check.programList->setIconSize(QSize(24, 24)); @@ -326,6 +316,7 @@ void Wizard::slotCheckPrograms() else if (KStandardDirs::findExe("ffplay").isEmpty()) item->setIcon(0, m_badIcon); else item->setIcon(0, m_okIcon); +#ifndef Q_WS_MAC item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Recordmydesktop")); item->setData(1, Qt::UserRole, i18n("Required for screen capture")); item->setSizeHint(0, itemSize); @@ -337,6 +328,7 @@ void Wizard::slotCheckPrograms() item->setSizeHint(0, itemSize); if (KStandardDirs::findExe("dvgrab").isEmpty()) item->setIcon(0, m_badIcon); else item->setIcon(0, m_okIcon); +#endif item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Dvdauthor")); item->setData(1, Qt::UserRole, i18n("Required for creation of DVD")); @@ -350,6 +342,23 @@ void Wizard::slotCheckPrograms() if (KStandardDirs::findExe("mkisofs").isEmpty()) item->setIcon(0, m_badIcon); else item->setIcon(0, m_okIcon); + // set up some default applications + QString program; + if (KdenliveSettings::defaultimageapp().isEmpty()) { + program = KStandardDirs::findExe("gimp"); + if (program.isEmpty()) program = KStandardDirs::findExe("krita"); + if (!program.isEmpty()) KdenliveSettings::setDefaultimageapp(program); + } + if (KdenliveSettings::defaultaudioapp().isEmpty()) { + program = KStandardDirs::findExe("audacity"); + if (program.isEmpty()) program = KStandardDirs::findExe("traverso"); + if (!program.isEmpty()) KdenliveSettings::setDefaultaudioapp(program); + } + if (KdenliveSettings::defaultplayerapp().isEmpty()) { + KService::Ptr offer = KMimeTypeTrader::self()->preferredService("video/mpeg"); + if (offer) + KdenliveSettings::setDefaultplayerapp(KRun::binaryName(offer->exec(), true)); + } } void Wizard::installExtraMimes(QString baseName, QStringList globs) @@ -499,8 +508,9 @@ void Wizard::adjustSettings() KdenliveSettings::setDefault_profile(selectedProfile); } QString path = m_extra.projectfolder->url().path(); - if (KStandardDirs::makeDir(path) == false) kDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path; - KdenliveSettings::setDefaultprojectfolder(path); + if (KStandardDirs::makeDir(path) == false) { + kDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path; + } else KdenliveSettings::setDefaultprojectfolder(path); } @@ -552,7 +562,7 @@ bool Wizard::isOk() const return m_systemCheckIsOk; } -bool Wizard::slotShowWebInfos() +void Wizard::slotShowWebInfos() { KRun::runUrl(KUrl("http://kdenlive.org/discover/" + QString(version).section(' ', 0, 0)), "text/html", this); }