m_view.menu_preview->setMouseTracking(true);
connect(m_view.create_menu, SIGNAL(toggled(bool)), m_view.menu_box, SLOT(setEnabled(bool)));
connect(m_view.create_menu, SIGNAL(toggled(bool)), this, SIGNAL(completeChanged()));
-
-#if KDE_IS_VERSION(4,7,0)
- m_menuMessage = new KMessageWidget;
- QGridLayout *s = static_cast <QGridLayout*> (layout());
- s->addWidget(m_menuMessage, 7, 0, 1, -1);
- m_menuMessage->hide();
- m_view.error_message->hide();
-#endif
m_view.add_button->setIcon(KIcon("document-new"));
m_view.delete_button->setIcon(KIcon("trash-empty"));
//m_view.menu_preview->resizefitInView(0, 0, m_width, m_height);
- connect(m_view.play_text, SIGNAL(textChanged(const QString &)), this, SLOT(buildButton()));
- connect(m_view.text_color, SIGNAL(changed(const QColor &)), this, SLOT(updateColor()));
+ connect(m_view.play_text, SIGNAL(textChanged(QString)), this, SLOT(buildButton()));
+ connect(m_view.text_color, SIGNAL(changed(QColor)), this, SLOT(updateColor()));
connect(m_view.font_size, SIGNAL(valueChanged(int)), this, SLOT(buildButton()));
- connect(m_view.font_family, SIGNAL(currentFontChanged(const QFont &)), this, SLOT(buildButton()));
- connect(m_view.background_image, SIGNAL(textChanged(const QString &)), this, SLOT(buildImage()));
- connect(m_view.background_color, SIGNAL(changed(const QColor &)), this, SLOT(buildColor()));
+ connect(m_view.font_family, SIGNAL(currentFontChanged(QFont)), this, SLOT(buildButton()));
+ connect(m_view.background_image, SIGNAL(textChanged(QString)), this, SLOT(buildImage()));
+ connect(m_view.background_color, SIGNAL(changed(QColor)), this, SLOT(buildColor()));
connect(m_view.background_list, SIGNAL(currentIndexChanged(int)), this, SLOT(checkBackgroundType(int)));
connect(m_view.zoom_button, SIGNAL(pressed()), this, SLOT(slotZoom()));
connect(m_view.unzoom_button, SIGNAL(pressed()), this, SLOT(slotUnZoom()));
connect(m_scene, SIGNAL(selectionChanged()), this, SLOT(buttonChanged()));
- connect(m_scene, SIGNAL(changed(const QList<QRectF> &)), this, SIGNAL(completeChanged()));
+ connect(m_scene, SIGNAL(sceneChanged()), this, SIGNAL(completeChanged()));
// red background for error message
KColorScheme scheme(palette().currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
p.setColor(QPalette::Background, scheme.background(KColorScheme::NegativeBackground).color());
m_view.error_message->setAutoFillBackground(true);
m_view.error_message->setPalette(p);
-
m_view.menu_box->setEnabled(false);
+#if KDE_IS_VERSION(4,7,0)
+ m_menuMessage = new KMessageWidget;
+ QGridLayout *s = static_cast <QGridLayout*> (layout());
+ s->addWidget(m_menuMessage, 7, 0, 1, -1);
+ m_menuMessage->hide();
+ m_view.error_message->hide();
+#endif
+
}
DvdWizardMenu::~DvdWizardMenu()
{
#if KDE_IS_VERSION(4,6,0)
QList<QGraphicsItem *> list = m_scene->items();
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
if (enable) {
QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
QList<QGraphicsItem *> list = m_scene->items();
int buttonCount = 0;
// check that the menu buttons don't collide
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
buttonCount++;
DvdButton *button = static_cast < DvdButton* >(list.at(i));
for (int j = 0; j < collisions.count(); j++) {
if (collisions.at(j)->type() == button->type()) {
#if KDE_IS_VERSION(4,7,0)
- m_menuMessage->setText(i18n("Buttons overlapping"));
- m_menuMessage->setMessageType(KMessageWidget::Warning);
- m_menuMessage->animatedShow();
+ m_menuMessage->setText(i18n("Buttons overlapping"));
+ m_menuMessage->setMessageType(KMessageWidget::Warning);
+ m_menuMessage->show();
#else
m_view.error_message->setText(i18n("Buttons overlapping"));
m_view.error_message->setHidden(false);
#if KDE_IS_VERSION(4,7,0)
m_menuMessage->setText(i18n("No button in menu"));
m_menuMessage->setMessageType(KMessageWidget::Warning);
- m_menuMessage->animatedShow();
+ m_menuMessage->show();
#else
m_view.error_message->setText(i18n("No button in menu"));
m_view.error_message->setHidden(false);
}
if (!m_view.background_image->isHidden()) {
- // Make sure user selected a valid image / video file
+ // Make sure user selected a valid image / video file
if (!QFile::exists(m_view.background_image->url().path())) {
#if KDE_IS_VERSION(4,7,0)
m_menuMessage->setText(i18n("Missing background image"));
m_menuMessage->setMessageType(KMessageWidget::Warning);
- m_menuMessage->animatedShow();
+ m_menuMessage->show();
#else
m_view.error_message->setText(i18n("Missing background image"));
m_view.error_message->setHidden(false);
}
#if KDE_IS_VERSION(4,7,0)
- m_menuMessage->animatedHide();
+ m_menuMessage->hide();
#endif
// check that we have a "Play all" entry
if (targets.contains(0)) return true;
// ... or that each video file has a button
- for (int i = m_view.target_list->count() - 1; i > 0; i--) {
+ for (int i = m_view.target_list->count() - 1; i > 0; --i) {
// If there is a vob file entry and it has no button assigned, don't allow to go further
if (m_view.target_list->itemIcon(i).isNull() == false && !targets.contains(i)) {
#if KDE_IS_VERSION(4,7,0)
m_menuMessage->setText(i18n("No menu entry for %1", m_view.target_list->itemText(i)));
m_menuMessage->setMessageType(KMessageWidget::Warning);
- m_menuMessage->animatedShow();
+ m_menuMessage->show();
#else
m_view.error_message->setText(i18n("No menu entry for %1", m_view.target_list->itemText(i)));
m_view.error_message->setHidden(false);
void DvdWizardMenu::setButtonTarget(int ix)
{
QList<QGraphicsItem *> list = m_scene->selectedItems();
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
DvdButton *button = static_cast < DvdButton* >(list.at(i));
button->setTarget(ix, m_view.target_list->itemData(ix).toString());
void DvdWizardMenu::setBackToMenu(bool backToMenu)
{
QList<QGraphicsItem *> list = m_scene->selectedItems();
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
DvdButton *button = static_cast < DvdButton* >(list.at(i));
button->setBackMenu(backToMenu);
{
QList<QGraphicsItem *> list = m_scene->selectedItems();
bool foundButton = false;
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
m_view.play_text->blockSignals(true);
m_view.font_size->blockSignals(true);
void DvdWizardMenu::deleteButton()
{
QList<QGraphicsItem *> list = m_scene->selectedItems();
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
delete list.at(i);
break;
m_view.target_list->clear();
m_view.target_list->addItem(i18n("Play All"), "jump title 1");
int movieCount = 0;
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (targetlist.at(i).contains("chapter"))
m_view.target_list->addItem(list.at(i), targetlist.at(i));
else {
m_view.loop_movie->setVisible(true);
}
}
+ emit completeChanged();
}
void DvdWizardMenu::buildColor()
QString profileName = DvdWizardVob::getDvdProfile(m_format);
Mlt::Profile profile(profileName.toUtf8().constData());
profile.set_explicit(true);
- Mlt::Producer *producer = new Mlt::Producer(profile, m_view.background_image->url().path().toUtf8().data());
+ Mlt::Producer *producer = new Mlt::Producer(profile, m_view.background_image->url().path().toUtf8().constData());
if (producer && producer->is_valid()) {
pix = QPixmap::fromImage(KThumb::getFrame(producer, 0, m_finalSize.width(), m_width, m_height));
m_movieLength = producer->get_length();
{
DvdButton *button = NULL;
QList<QGraphicsItem *> list = m_scene->selectedItems();
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
button = static_cast < DvdButton* >(list.at(i));
break;
//font.setStyleStrategy(QFont::NoAntialias);
button->setFont(font);
button->setDefaultTextColor(m_view.text_color->color());
+ // Check for button overlapping in case we changed text / size
+ emit completeChanged();
}
void DvdWizardMenu::updateColor()
void DvdWizardMenu::prepareUnderLines()
{
QList<QGraphicsItem *> list = m_scene->items();
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
QRectF r = list.at(i)->sceneBoundingRect();
int bottom = r.bottom() - 1;
{
QList<QGraphicsItem *> list = m_scene->items();
QList<QGraphicsItem *> toDelete;
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonUnderlineItem) {
toDelete.append(list.at(i));
}
void DvdWizardMenu::updateUnderlineColor(QColor c)
{
QList<QGraphicsItem *> list = m_scene->items();
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonUnderlineItem) {
DvdButtonUnderline *underline = static_cast < DvdButtonUnderline* >(list.at(i));
underline->setPen(Qt::NoPen);
{
DvdButton *button = NULL;
QList<QGraphicsItem *> list = m_scene->items();
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
button = static_cast < DvdButton* >(list.at(i));
button->setDefaultTextColor(c);
ratioy = (double) letterboxHeight / m_finalSize.height();
offset = (m_finalSize.height() - letterboxHeight) / 2;
}
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
DvdButton *button = static_cast < DvdButton* >(list.at(i));
QRectF r = button->sceneBoundingRect();
QList<QGraphicsItem *> list = m_scene->items();
int buttonCount = 0;
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
buttonCount++;
DvdButton *button = static_cast < DvdButton* >(list.at(i));
}
-void DvdWizardMenu::loadXml(DVDFORMAT format, QDomElement xml)
+void DvdWizardMenu::loadXml(DVDFORMAT format, const QDomElement &xml)
{
kDebug() << "// LOADING MENU";
if (xml.isNull()) return;
// Clear existing buttons
QList<QGraphicsItem *> list = m_scene->items();
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
delete list.at(i);
- i--;
+ --i;
}
}
}
- for (int i = 0; i < buttons.count(); i++) {
+ for (int i = 0; i < buttons.count(); ++i) {
QDomElement e = buttons.at(i).toElement();
// create menu button
DvdButton *button = new DvdButton(e.attribute("text"));
m_view.menu_preview->scale(0.5, 0.5);
}
+
+#include "dvdwizardmenu.moc"