X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fdvdwizardmenu.cpp;h=39f9909c7707547135d37211d67818104236c987;hb=841cfc540d57c2acdbf3dc17dde7892c7b7170b8;hp=167baa8cbf8e417fb23b47b58fee53b6780ae458;hpb=464c319bc0c7916060fe5f1d425136e257e70ecd;p=kdenlive diff --git a/src/dvdwizardmenu.cpp b/src/dvdwizardmenu.cpp index 167baa8c..39f9909c 100644 --- a/src/dvdwizardmenu.cpp +++ b/src/dvdwizardmenu.cpp @@ -46,14 +46,6 @@ DvdWizardMenu::DvdWizardMenu(DVDFORMAT format, QWidget *parent) : 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 (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")); @@ -117,12 +109,12 @@ DvdWizardMenu::DvdWizardMenu(DVDFORMAT format, QWidget *parent) : //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))); @@ -134,7 +126,7 @@ DvdWizardMenu::DvdWizardMenu(DVDFORMAT format, QWidget *parent) : 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 &)), 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())); @@ -142,9 +134,16 @@ DvdWizardMenu::DvdWizardMenu(DVDFORMAT format, QWidget *parent) : 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 (layout()); + s->addWidget(m_menuMessage, 7, 0, 1, -1); + m_menuMessage->hide(); + m_view.error_message->hide(); +#endif + } DvdWizardMenu::~DvdWizardMenu() @@ -191,9 +190,9 @@ bool DvdWizardMenu::isComplete() const 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); @@ -210,7 +209,7 @@ bool DvdWizardMenu::isComplete() const #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); @@ -224,7 +223,7 @@ bool DvdWizardMenu::isComplete() const #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); @@ -234,7 +233,7 @@ bool DvdWizardMenu::isComplete() const } #if KDE_IS_VERSION(4,7,0) - m_menuMessage->animatedHide(); + m_menuMessage->hide(); #endif // check that we have a "Play all" entry @@ -246,7 +245,7 @@ bool DvdWizardMenu::isComplete() const #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); @@ -429,6 +428,7 @@ void DvdWizardMenu::checkBackgroundType(int ix) m_view.loop_movie->setVisible(true); } } + emit completeChanged(); } void DvdWizardMenu::buildColor() @@ -458,7 +458,7 @@ void DvdWizardMenu::buildImage() 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(); @@ -495,6 +495,8 @@ void DvdWizardMenu::buildButton() //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()