+
+
+void DvdWizardMenu::loadXml(DVDFORMAT format, const QDomElement &xml)
+{
+ kDebug() << "// LOADING MENU";
+ if (xml.isNull()) return;
+ kDebug() << "// LOADING MENU 1";
+ changeProfile(format);
+ m_view.create_menu->setChecked(xml.attribute("enabled").toInt());
+ if (xml.hasAttribute("background_color")) {
+ m_view.background_list->setCurrentIndex(0);
+ m_view.background_color->setColor(xml.attribute("background_color"));
+ } else if (xml.hasAttribute("background_image")) {
+ m_view.background_list->setCurrentIndex(1);
+ m_view.background_image->setUrl(KUrl(xml.attribute("background_image")));
+ } else if (xml.hasAttribute("background_video")) {
+ m_view.background_list->setCurrentIndex(2);
+ m_view.background_image->setUrl(KUrl(xml.attribute("background_video")));
+ }
+
+ m_view.text_color->setColor(xml.attribute("text_color"));
+ m_view.selected_color->setColor(xml.attribute("selected_color"));
+ m_view.highlighted_color->setColor(xml.attribute("highlighted_color"));
+
+ m_view.use_shadow->setChecked(xml.attribute("text_shadow").toInt());
+
+ QDomNodeList buttons = xml.elementsByTagName("button");
+ kDebug() << "// LOADING MENU 2" << buttons.count();
+
+ if (buttons.count() > 0) {
+ // Clear existing buttons
+ QList<QGraphicsItem *> list = m_scene->items();
+
+ for (int i = 0; i < list.count(); ++i) {
+ if (list.at(i)->type() == DvdButtonItem) {
+ delete list.at(i);
+ --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"));
+ QFont font(e.attribute("font_family"));
+ font.setPixelSize(e.attribute("font_size").toInt());
+#if KDE_IS_VERSION(4,6,0)
+ if (m_view.use_shadow->isChecked()) {
+ QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
+ shadow->setBlurRadius(7);
+ shadow->setOffset(4, 4);
+ button->setGraphicsEffect(shadow);
+ }
+#endif
+
+ //font.setStyleStrategy(QFont::NoAntialias);
+ button->setFont(font);
+ button->setTarget(e.attribute("target").toInt(), e.attribute("command"));
+ button->setBackMenu(e.attribute("backtomenu").toInt());
+ button->setDefaultTextColor(m_view.text_color->color());
+ button->setZValue(4);
+ m_scene->addItem(button);
+ button->setPos(e.attribute("posx").toInt(), e.attribute("posy").toInt());
+
+ }
+}
+
+void DvdWizardMenu::slotZoom()
+{
+ m_view.menu_preview->scale(2.0, 2.0);
+}
+
+void DvdWizardMenu::slotUnZoom()
+{
+ m_view.menu_preview->scale(0.5, 0.5);
+}
+
+
+#include "dvdwizardmenu.moc"