1 /***************************************************************************
2 * Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
25 #include <QVBoxLayout>
26 #include <QItemDelegate>
32 #include "ui_wizardstandard_ui.h"
33 #include "ui_wizardextra_ui.h"
34 #include "ui_wizardcheck_ui.h"
35 #include "ui_wizardmltcheck_ui.h"
36 #include "ui_wizardcapture_ui.h"
38 class WizardDelegate: public QItemDelegate
41 explicit WizardDelegate(QAbstractItemView* parent = 0)
42 : QItemDelegate(parent)
45 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const {
46 if (index.column() == 1) {
48 QStyleOptionViewItemV4 opt(option);
49 QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
50 const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
51 style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, opt.widget);
53 QFont font = painter->font();
55 painter->setFont(font);
56 QRect r1 = option.rect;
57 r1.adjust(0, textMargin, 0, - textMargin);
58 int mid = (int)((r1.height() / 2));
59 r1.setBottom(r1.y() + mid);
60 QRect r2 = option.rect;
61 r2.setTop(r2.y() + mid);
62 painter->drawText(r1, Qt::AlignLeft | Qt::AlignBottom , index.data().toString());
64 painter->setFont(font);
65 QString subText = index.data(Qt::UserRole).toString();
66 painter->drawText(r2, Qt::AlignLeft | Qt::AlignVCenter , subText);
69 QItemDelegate::paint(painter, option, index);
75 class Wizard : public QWizard
79 explicit Wizard(bool upgrade, QWidget * parent = 0);
80 void installExtraMimes(const QString &baseName, const QStringList &globs);
81 void runUpdateMimeDatabase();
82 void adjustSettings();
86 Ui::WizardStandard_UI m_standard;
87 Ui::WizardExtra_UI m_extra;
88 Ui::WizardMltCheck_UI m_mltCheck;
89 Ui::WizardCapture_UI m_capture;
90 Ui::WizardCheck_UI m_check;
91 QVBoxLayout *m_startLayout;
92 bool m_systemCheckIsOk;
93 QLabel *m_welcomeLabel;
94 QMap <QString, QString> m_dvProfiles;
95 QMap <QString, QString> m_hdvProfiles;
96 QMap <QString, QString> m_otherProfiles;
97 void slotCheckPrograms();
98 void checkMltComponents();
99 void checkMissingCodecs();
104 void slotCheckThumbs();
105 void slotCheckStandard();
106 void slotCheckSelectedItem();
108 void slotShowWebInfos();
109 void slotDetectWebcam();
110 void slotUpdateCaptureParameters();
111 void slotSaveCaptureFormat();
112 void slotUpdateDecklinkDevice(int captureCard);
113 void slotOpenManual();