X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fwizard.h;h=633ba299eb2469996be7228b44074ce085f94c44;hb=f20225e0078b03502709b4bee99563cd5593ee75;hp=ba9fa42244c000319b720f90edf25f0468fcf781;hpb=67d46ca1e8cf6f1abb5ad16d5bdbdfe8f8aa9a78;p=kdenlive diff --git a/src/wizard.h b/src/wizard.h index ba9fa422..633ba299 100644 --- a/src/wizard.h +++ b/src/wizard.h @@ -22,28 +22,86 @@ #define WIZARD_H #include +#include +#include +#include + +#include #include #include "ui_wizardstandard_ui.h" #include "ui_wizardextra_ui.h" +#include "ui_wizardcheck_ui.h" +#include "ui_wizardmltcheck_ui.h" + +class WizardDelegate: public QItemDelegate +{ +public: + WizardDelegate(QAbstractItemView* parent = 0): QItemDelegate(parent) { + } + void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const { + if (index.column() == 1) { + const bool hover = option.state & (QStyle::State_Selected); + QRect r1 = option.rect; + painter->save(); + if (hover) { + painter->setPen(option.palette.color(QPalette::HighlightedText)); + QColor backgroundColor = option.palette.color(QPalette::Highlight); + painter->setBrush(QBrush(backgroundColor)); + painter->fillRect(r1, backgroundColor); + } + QFont font = painter->font(); + font.setBold(true); + painter->setFont(font); + 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->setPen(option.palette.color(QPalette::Mid)); + painter->drawText(r2, Qt::AlignLeft | Qt::AlignVCenter , subText); + painter->restore(); + } else { + QItemDelegate::paint(painter, option, index); + } + } +}; -class Wizard : public QWizard { +class Wizard : public QWizard +{ Q_OBJECT public: - Wizard(QWidget * parent = 0); + Wizard(bool upgrade, QWidget * parent = 0); void installExtraMimes(QString baseName, QStringList globs); void runUpdateMimeDatabase(); void adjustSettings(); + bool isOk() const; private: Ui::WizardStandard_UI m_standard; Ui::WizardExtra_UI m_extra; + Ui::WizardMltCheck_UI m_mltCheck; + Ui::WizardCheck_UI m_check; + QVBoxLayout *m_startLayout; + bool m_systemCheckIsOk; + QMap m_dvProfiles; + QMap m_hdvProfiles; + QMap m_otherProfiles; + void slotCheckPrograms(); + void checkMltComponents(); + KIcon m_okIcon; + KIcon m_badIcon; private slots: void slotCheckThumbs(); void slotCheckStandard(); void slotCheckSelectedItem(); + void slotCheckMlt(); + void slotShowWebInfos(); }; #endif