widgets/geometryval_ui.ui
widgets/wizardstandard_ui.ui
widgets/wizardextra_ui.ui
+ widgets/wizardcheck_ui.ui
widgets/spacerdialog_ui.ui
widgets/addtrack_ui.ui
)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<gui name="kdenlive" version="26">
+<gui name="kdenlive" version="27">
<ToolBar name="extraToolBar" >
<text>Extra Toolbar</text>
<Action name="project_render" />
<Menu name="settings" >
<Action name="manage_profiles" />
<Action name="get_new_stuff" />
- </Menu>
+ <Action name="run_wizard" />
+</Menu>
</MenuBar>
</gui>
\ No newline at end of file
KAction* fileGHNS = KNS::standardAction(i18n("Download New Lumas..."), this, SLOT(slotGetNewStuff()), actionCollection(), "get_new_stuff");
+ KAction* wizAction = new KAction(KIcon("configure"), i18n("Run Config Wizard"), this);
+ collection->addAction("run_wizard", wizAction);
+ connect(wizAction, SIGNAL(triggered(bool)), this, SLOT(slotRunWizard()));
+
KAction* projectAction = new KAction(KIcon("configure"), i18n("Project Settings"), this);
collection->addAction("project_settings", projectAction);
connect(projectAction, SIGNAL(triggered(bool)), this, SLOT(slotEditProjectSettings()));
m_projectList->setHeaderInfo(state);
}
+void MainWindow::slotRunWizard() {
+ Wizard *w = new Wizard(this);
+ if (w->exec() == QDialog::Accepted && w->isOk()) {
+ w->adjustSettings();
+ }
+ delete w;
+}
+
void MainWindow::newFile(bool showProjectSettings) {
QString profileName;
KUrl projectFolder;
void slotChangeTrack(int ix = 0);
void slotGetNewStuff();
void slotAutoTransition();
+ void slotRunWizard();
};
connect(listView, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotItemEdited(QTreeWidgetItem *, int)));
connect(listView, SIGNAL(showProperties(DocClipBase *)), this, SIGNAL(showClipProperties(DocClipBase *)));
- m_listViewDelegate = new ItemDelegate(listView);
- listView->setItemDelegate(m_listViewDelegate);
+ ItemDelegate *listViewDelegate = new ItemDelegate(listView);
+ listView->setItemDelegate(listViewDelegate);
}
ProjectList::~ProjectList() {
QAction *m_editAction;
QAction *m_deleteAction;
KdenliveDoc *m_doc;
- ItemDelegate *m_listViewDelegate;
ProjectItem *m_selectedItem;
bool m_refreshed;
QMap <QString, QDomElement> m_infoQueue;
--- /dev/null
+<ui version="4.0" >
+ <class>WizardCheck_UI</class>
+ <widget class="QWidget" name="WizardCheck_UI" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>360</width>
+ <height>236</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTreeWidget" name="programList" />
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
QWizardPage *page2 = new QWizardPage;
page2->setTitle(i18n("Video Standard"));
m_standard.setupUi(page2);
- //m_standard.profiles_list->setMaximumHeight(100);
+
// build profiles lists
m_profilesInfo = ProfilesDialog::getProfilesInfo();
QMap<QString, QString>::const_iterator i = m_profilesInfo.constBegin();
connect(m_standard.button_all, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
connect(m_standard.button_hdv, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
connect(m_standard.button_dv, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
- slotCheckStandard();
+ m_standard.button_all->setChecked(true);
connect(m_standard.profiles_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotCheckSelectedItem()));
+
+ // select default profile
+ QList<QListWidgetItem *> 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));
addPage(page2);
QWizardPage *page3 = new QWizardPage;
connect(m_extra.audiothumbs, SIGNAL(stateChanged(int)), this, SLOT(slotCheckThumbs()));
slotCheckThumbs();
addPage(page3);
+
+
+ QWizardPage *page4 = new QWizardPage;
+ page4->setTitle(i18n("Checking system"));
+ m_check.setupUi(page4);
+ slotCheckPrograms();
+ addPage(page4);
+
+ WizardDelegate *listViewDelegate = new WizardDelegate(m_check.programList);
+ m_check.programList->setItemDelegate(listViewDelegate);
+
QTimer::singleShot(500, this, SLOT(slotCheckMlt()));
}
+void Wizard::slotCheckPrograms() {
+ m_check.programList->setColumnCount(2);
+ m_check.programList->setRootIsDecorated(false);
+ m_check.programList->setHeaderHidden(true);
+ QSize itemSize(20, this->fontMetrics().height() * 2.5);
+ KIcon okIcon("dialog-ok");
+ KIcon missingIcon("dialog-close");
+ m_check.programList->setColumnWidth(0, 30);
+ m_check.programList->setIconSize(QSize(24, 24));
+ QTreeWidgetItem *item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << "FFmpeg & ffplay");
+ item->setData(1, Qt::UserRole, QString("Required for webcam capture"));
+ item->setSizeHint(0, itemSize);
+ QString exepath = KStandardDirs::findExe("ffmpeg");
+ if (exepath.isEmpty()) item->setIcon(0, missingIcon);
+ else if (KStandardDirs::findExe("ffplay").isEmpty()) item->setIcon(0, missingIcon);
+ else item->setIcon(0, okIcon);
+
+ item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << "Recordmydesktop");
+ item->setData(1, Qt::UserRole, QString("Required for screen capture"));
+ item->setSizeHint(0, itemSize);
+ if (KStandardDirs::findExe("recordmydesktop").isEmpty()) item->setIcon(0, missingIcon);
+ else item->setIcon(0, okIcon);
+
+ item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << "Dvgrab");
+ item->setData(1, Qt::UserRole, QString("Required for firewire capture"));
+ item->setSizeHint(0, itemSize);
+ if (KStandardDirs::findExe("dvgrab").isEmpty()) item->setIcon(0, missingIcon);
+ else item->setIcon(0, okIcon);
+
+ item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << "Inigo");
+ item->setData(1, Qt::UserRole, QString("Required for rendering (part of MLT package)"));
+ item->setSizeHint(0, itemSize);
+ if (KStandardDirs::findExe("inigo").isEmpty()) item->setIcon(0, missingIcon);
+ else item->setIcon(0, okIcon);
+}
+
void Wizard::installExtraMimes(QString baseName, QStringList globs) {
QString mimefile = baseName;
mimefile.replace('/', '-');
#include <QWizard>
#include <QVBoxLayout>
+#include <QItemDelegate>
+#include <QPainter>
+
#include <KDebug>
#include "ui_wizardstandard_ui.h"
#include "ui_wizardextra_ui.h"
+#include "ui_wizardcheck_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, QBrush(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 {
private:
Ui::WizardStandard_UI m_standard;
Ui::WizardExtra_UI m_extra;
+ Ui::WizardCheck_UI m_check;
QVBoxLayout *m_startLayout;
bool m_systemCheckIsOk;
QStringList m_dvProfiles;
QStringList m_hdvProfiles;
QStringList m_otherProfiles;
QMap <QString, QString> m_profilesInfo;
+ void slotCheckPrograms();
private slots:
void slotCheckThumbs();