First run wizard will now only show on first run if install errors/warnings are detected.

Default project format is autodetected and set to HD1080p 25 or 29.97 fps depending on your country.
On first clip insert, if clip profile does not match a message box asks for default profile change
parent 14657ee2
......@@ -14,9 +14,9 @@ if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
# Minimum versions of main dependencies.
set(MLT_MIN_MAJOR_VERSION 0)
set(MLT_MIN_MINOR_VERSION 9)
set(MLT_MIN_PATCH_VERSION 8)
set(MLT_MIN_MAJOR_VERSION 6)
set(MLT_MIN_MINOR_VERSION 0)
set(MLT_MIN_PATCH_VERSION 0)
set(MLT_MIN_VERSION ${MLT_MIN_MAJOR_VERSION}.${MLT_MIN_MINOR_VERSION}.${MLT_MIN_PATCH_VERSION})
set(QT_MIN_VERSION 5.2.0)
......
......@@ -114,7 +114,8 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
QWidget *p4 = new QWidget;
m_configCapture.setupUi(p4);
m_configCapture.tabWidget->removeTab(0);
m_configCapture.tabWidget->removeTab(2);
#ifdef USE_V4L
// Video 4 Linux device detection
......
This diff is collapsed.
......@@ -24,6 +24,7 @@
#include <QWizard>
#include <QVBoxLayout>
#include <QItemDelegate>
#include <QWizardPage>
#include <QPainter>
#include <QIcon>
......@@ -35,48 +36,22 @@
#include "ui_wizardmltcheck_ui.h"
#include "ui_wizardcapture_ui.h"
class WizardDelegate: public QItemDelegate
class KMessageWidget;
class MyWizardPage : public QWizardPage
{
public:
explicit WizardDelegate(QAbstractItemView* parent = 0)
: QItemDelegate(parent)
{
}
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const {
if (index.column() == 1) {
painter->save();
QStyleOptionViewItemV4 opt(option);
QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, opt.widget);
QFont font = painter->font();
font.setBold(true);
painter->setFont(font);
QRect r1 = option.rect;
r1.adjust(0, textMargin, 0, - textMargin);
int mid = (int)((r1.height() / 2));
r1.setBottom(r1.y() + mid);
QRect r2 = option.rect;
r2.setTop(r2.y() + mid);
painter->drawText(r1, Qt::AlignLeft | Qt::AlignBottom , index.data().toString());
font.setBold(false);
painter->setFont(font);
QString subText = index.data(Qt::UserRole).toString();
painter->drawText(r2, Qt::AlignLeft | Qt::AlignVCenter , subText);
painter->restore();
} else {
QItemDelegate::paint(painter, option, index);
}
}
explicit MyWizardPage(QWidget *parent = Q_NULLPTR);
void setComplete(bool complete);
bool isComplete() const;
bool m_isComplete;
};
class Wizard : public QWizard
{
Q_OBJECT
public:
explicit Wizard(bool upgrade, QWidget * parent = 0);
explicit Wizard(bool autoClose, QWidget * parent = 0);
void installExtraMimes(const QString &baseName, const QStringList &globs);
void runUpdateMimeDatabase();
void adjustSettings();
......@@ -89,17 +64,20 @@ private:
Ui::WizardCapture_UI m_capture;
Ui::WizardCheck_UI m_check;
QVBoxLayout *m_startLayout;
MyWizardPage *m_page;
KMessageWidget *m_errorWidget;
bool m_systemCheckIsOk;
bool m_brokenModule;
QLabel *m_welcomeLabel;
QString m_errors;
QString m_warnings;
QString m_infos;
QMap <QString, QString> m_dvProfiles;
QMap <QString, QString> m_hdvProfiles;
QMap <QString, QString> m_otherProfiles;
void slotCheckPrograms();
void checkMltComponents();
void checkMissingCodecs();
QIcon m_okIcon;
QIcon m_badIcon;
QSize m_itemSize;
private slots:
void slotCheckStandard();
......
......@@ -1459,10 +1459,6 @@ void KdenliveDoc::slotSwitchProfile()
QString id = data.takeFirst().toString();
if (!data.isEmpty()) {
// we want a profile switch
if (id.startsWith(QStringLiteral("#"))) {
// We want to use as default profile
KdenliveSettings::setDefault_profile(id.remove(0,1));
}
m_profile = MltVideoProfile(data);
updateProjectProfile(true);
emit docModified(true);
......@@ -1483,6 +1479,29 @@ void KdenliveDoc::switchProfile(MltVideoProfile profile, const QString &id, cons
QMap< QString, QString > profileProperties = ProfilesDialog::getSettingsFromFile(matchingProfile);
profile.path = matchingProfile;
profile.description = profileProperties.value("description");
if (KdenliveSettings::default_profile().isEmpty()) {
// Default project format not yet confirmed, propose
KMessageBox::ButtonCode answer =
KMessageBox::questionYesNoCancel(QApplication::activeWindow(), i18n("Your default project profile is %1, but your clip's profile is %2.\nDo you want to change default profile for future projects ?", m_profile.description, profile.description), i18n("Change default project profile"), KGuiItem(i18n("Change default to %1", profile.description)), KGuiItem(i18n("Keep current default %1", m_profile.description)), KGuiItem(i18n("Ask me later")));
switch(answer) {
case KMessageBox::Yes :
KdenliveSettings::setDefault_profile(profile.path);
m_profile = profile;
updateProjectProfile(true);
emit docModified(true);
pCore->producerQueue()->getFileProperties(xml, id, 150, true);
return;
break;
case KMessageBox::No :
KdenliveSettings::setDefault_profile(m_profile.path);
return;
break;
default:
break;
}
}
// Build actions for the info message (switch / cancel)
QList <QAction*> list;
......@@ -1496,15 +1515,6 @@ void KdenliveDoc::switchProfile(MltVideoProfile profile, const QString &id, cons
params2 << id;
ac2->setData(params2);
connect(ac2, SIGNAL(triggered(bool)), this, SLOT(slotSwitchProfile()));
if (KdenliveSettings::default_profile().isEmpty()) {
// Default project format not yet confirmed, propose
QAction *ac3 = new QAction(KoIconUtils::themedIcon(QStringLiteral("dialog-ok")), i18n("Switch and use as default"), this);
QVariantList params3;
params3 << QString("#%1").arg(profile.path) << profile.toList();
ac3->setData(params3);
connect(ac3, SIGNAL(triggered(bool)), this, SLOT(slotSwitchProfile()));
list << ac3;
}
list << ac << ac2;
pCore->bin()->doDisplayMessage(i18n("Switch to clip profile %1?", profile.descriptiveString()), KMessageWidget::Information, list);
} else {
......
......@@ -390,11 +390,6 @@
<default></default>
</entry>
<entry name="defaultplayerapp" type="String">
<label>Default video player application.</label>
<default></default>
</entry>
</group>
......
......@@ -790,7 +790,7 @@ void MainWindow::saveProperties(KConfigGroup &config)
// save properties here
KXmlGuiWindow::saveProperties(config);
//TODO: fix session management
if (qApp->isSavingSession()) {
if (qApp->isSavingSession() && pCore->projectManager()) {
if (pCore->projectManager()->current() && !pCore->projectManager()->current()->url().isEmpty()) {
config.writeEntry("kdenlive_lastUrl", pCore->projectManager()->current()->url().path());
}
......@@ -1515,7 +1515,7 @@ void MainWindow::readOptions()
KdenliveSettings::setTrackheight(50);
}
KConfigGroup initialGroup(config, "version");
if (!initialGroup.exists() || KdenliveSettings::ffmpegpath().isEmpty() || KdenliveSettings::ffplaypath().isEmpty()) {
if (!initialGroup.exists()) {
// First run, check if user is on a KDE Desktop
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
if (env.contains(QStringLiteral("XDG_CURRENT_DESKTOP"))) {
......@@ -1528,7 +1528,7 @@ void MainWindow::readOptions()
}
}
// this is our first run, show Wizard
QPointer<Wizard> w = new Wizard(false, this);
QPointer<Wizard> w = new Wizard(true);
if (w->exec() == QDialog::Accepted && w->isOk()) {
w->adjustSettings();
delete w;
......
......@@ -48,9 +48,10 @@ class RecManager : public QObject
Q_OBJECT
enum CaptureDevice {
Firewire = 0,
Video4Linux = 1,
ScreenGrab = 2,
Video4Linux = 0,
ScreenGrab = 1,
// Not implemented
Firewire = 2,
BlackMagic = 3
};
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>413</width>
<height>722</height>
<width>501</width>
<height>817</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_8">
......@@ -32,11 +32,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Firewire</string>
</property>
</item>
<item>
<property name="text">
<string>FFmpeg</string>
......@@ -47,11 +42,6 @@
<string>Screen grab</string>
</property>
</item>
<item>
<property name="text">
<string>Blackmagic card</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0" colspan="2">
......@@ -62,9 +52,6 @@
<height>0</height>
</size>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Firewire</string>
......
......@@ -179,7 +179,6 @@ void ThemeManager::populateThemeMenu()
schemeFiles << directory.absoluteFilePath(fname);
}
}
QMap<QString, QAction*> actionMap;
for (int i = 0; i < schemeFiles.size(); ++i)
......@@ -187,10 +186,10 @@ void ThemeManager::populateThemeMenu()
const QString filename = schemeFiles.at(i);
const QFileInfo info(filename);
KSharedConfigPtr config = KSharedConfig::openConfig(filename);
QIcon icon = createSchemePreviewIcon(config);
QIcon icon = createSchemePreviewIcon(config);
KConfigGroup group(config, "General");
const QString name = group.readEntry("Name", info.baseName());
QAction* ac = new QAction(name, d->themeMenuActionGroup);
const QString name = group.readEntry("Name", info.baseName());
QAction* ac = new QAction(name, d->themeMenuActionGroup);
d->themeMap.insert(name, filename);
ac->setIcon(icon);
ac->setCheckable(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment