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"
37 class WizardDelegate: public QItemDelegate
40 WizardDelegate(QAbstractItemView* parent = 0): QItemDelegate(parent) {
42 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const {
43 if (index.column() == 1) {
44 const bool hover = option.state & (QStyle::State_Selected);
45 QRect r1 = option.rect;
48 painter->setPen(option.palette.color(QPalette::HighlightedText));
49 QColor backgroundColor = option.palette.color(QPalette::Highlight);
50 painter->setBrush(QBrush(backgroundColor));
51 painter->fillRect(r1, backgroundColor);
53 QFont font = painter->font();
55 painter->setFont(font);
56 int mid = (int)((r1.height() / 2));
57 r1.setBottom(r1.y() + mid);
58 QRect r2 = option.rect;
59 r2.setTop(r2.y() + mid);
60 painter->drawText(r1, Qt::AlignLeft | Qt::AlignBottom , index.data().toString());
62 painter->setFont(font);
63 QString subText = index.data(Qt::UserRole).toString();
64 painter->setPen(option.palette.color(QPalette::Mid));
65 painter->drawText(r2, Qt::AlignLeft | Qt::AlignVCenter , subText);
68 QItemDelegate::paint(painter, option, index);
74 class Wizard : public QWizard
78 Wizard(bool upgrade, QWidget * parent = 0);
79 void installExtraMimes(QString baseName, QStringList globs);
80 void runUpdateMimeDatabase();
81 void adjustSettings();
85 Ui::WizardStandard_UI m_standard;
86 Ui::WizardExtra_UI m_extra;
87 Ui::WizardMltCheck_UI m_mltCheck;
88 Ui::WizardCheck_UI m_check;
89 QVBoxLayout *m_startLayout;
90 bool m_systemCheckIsOk;
91 QMap <QString, QString> m_dvProfiles;
92 QMap <QString, QString> m_hdvProfiles;
93 QMap <QString, QString> m_otherProfiles;
94 void slotCheckPrograms();
95 void checkMltComponents();
100 void slotCheckThumbs();
101 void slotCheckStandard();
102 void slotCheckSelectedItem();
104 void slotShowWebInfos();