]> git.sesse.net Git - kdenlive/blobdiff - src/dvdwizardmenu.cpp
Fix a couple of compile warnings because of unused and uninitialized variables.
[kdenlive] / src / dvdwizardmenu.cpp
index 33c089bfa4063198d7e6071d06a4f432bb555526..625754c6b24bef9aced3391d5b6a314d9a9edfe0 100644 (file)
@@ -18,6 +18,7 @@
  ***************************************************************************/
 
 #include "dvdwizardmenu.h"
+#include "kdenlivesettings.h"
 
 #include <KDebug>
 #include <KColorScheme>
@@ -111,7 +112,7 @@ DvdWizardMenu::DvdWizardMenu(const QString &profile, QWidget *parent) :
     connect(m_scene, SIGNAL(changed(const QList<QRectF> &)), this, SIGNAL(completeChanged()));
 
     // red background for error message
-    KColorScheme scheme(palette().currentColorGroup(), KColorScheme::Window);
+    KColorScheme scheme(palette().currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
     QPalette p = m_view.error_message->palette();
     p.setColor(QPalette::Background, scheme.background(KColorScheme::NegativeBackground).color());
     m_view.error_message->setAutoFillBackground(true);
@@ -276,14 +277,11 @@ void DvdWizardMenu::changeProfile(bool isPal)
     if (isPal == false) {
         m_width = 720;
         m_height = 480;
-        m_isPal = false;
-        updatePreview();
     } else {
         m_width = 720;
         m_height = 576;
-        m_isPal = true;
-        updatePreview();
     }
+    updatePreview();
 }
 
 void DvdWizardMenu::updatePreview()
@@ -304,7 +302,7 @@ void DvdWizardMenu::updatePreview()
 void DvdWizardMenu::setTargets(QStringList list, QStringList targetlist)
 {
     m_view.target_list->clear();
-    m_view.target_list->addItem(i18n("Play All"), "title 1");
+    m_view.target_list->addItem(i18n("Play All"), "jump title 1");
     int movieCount = 0;
     for (int i = 0; i < list.count(); i++) {
         if (targetlist.at(i).contains("chapter"))
@@ -425,69 +423,54 @@ void DvdWizardMenu::createButtonImages(const QString &img1, const QString &img2,
 {
     if (m_view.create_menu->isChecked()) {
         m_scene->clearSelection();
-        QImage img(m_width, m_height, QImage::Format_ARGB32_Premultiplied);
-        img.fill(Qt::transparent);
         if (m_safeRect->scene() != 0) m_scene->removeItem(m_safeRect);
         if (m_color->scene() != 0) m_scene->removeItem(m_color);
         if (m_background->scene() != 0) m_scene->removeItem(m_background);
+        
+        QImage img(m_width, m_height, QImage::Format_Mono);
+        img.fill(Qt::white);
+        updateColor(Qt::black);
         QPainter p(&img);
         p.setRenderHints(QPainter::Antialiasing, false);
         p.setRenderHints(QPainter::TextAntialiasing, false);
         m_scene->render(&p, QRectF(0, 0, m_width, m_height));
         p.end();
 #if QT_VERSION >= 0x040600
-        img.setColorCount(4);
+        img.setColor(0, m_view.text_color->color().rgb());
+        img.setColor(1, qRgba(0,0,0,0));
 #else
         img.setNumColors(4);
 #endif
         img.save(img1);
 
-        /*QImage saved;
-        if (m_view.menu_profile->currentIndex() < 2)
-            saved = img.scaled(720, 576);
-        else saved = img.scaled(720, 480);
-        saved.setNumColors(4);
-        saved.save(img1);*/
-
-        updateColor(m_view.selected_color->color());
-        img.fill(Qt::transparent);
+        img.fill(Qt::white);
         p.begin(&img);
         p.setRenderHints(QPainter::Antialiasing, false);
         p.setRenderHints(QPainter::TextAntialiasing, false);
         m_scene->render(&p, QRectF(0, 0, m_width, m_height));
         p.end();
-        /*        if (m_view.menu_profile->currentIndex() < 2)
-                    saved = img.scaled(720, 576);
-                else saved = img.scaled(720, 480);
-                saved.setNumColors(4);
-                saved.save(img2);*/
 #if QT_VERSION >= 0x040600
-        img.setColorCount(4);
+        img.setColor(0, m_view.highlighted_color->color().rgb());
+        img.setColor(1, qRgba(0,0,0,0));
 #else
         img.setNumColors(4);
 #endif
-        img.save(img2);
-
+        img.save(img3);        
 
-        updateColor(m_view.highlighted_color->color());
-        img.fill(Qt::transparent);
+        img.fill(Qt::white);
         p.begin(&img);
         p.setRenderHints(QPainter::Antialiasing, false);
         p.setRenderHints(QPainter::TextAntialiasing, false);
         m_scene->render(&p, QRectF(0, 0, m_width, m_height));
         p.end();
-        /*if (m_view.menu_profile->currentIndex() < 2)
-            saved = img.scaled(720, 576);
-        else saved = img.scaled(720, 480);
-        saved.setNumColors(4);
-        saved.save(img3);*/
+
 #if QT_VERSION >= 0x040600
-        img.setColorCount(4);
+        img.setColor(0, m_view.selected_color->color().rgb());
+        img.setColor(1, qRgba(0,0,0,0));
 #else
         img.setNumColors(4);
 #endif
-        img.save(img3);
-
+        img.save(img2);
         updateColor();
 
         m_scene->addItem(m_safeRect);
@@ -657,7 +640,6 @@ void DvdWizardMenu::loadXml(QDomElement xml)
         button->setBackMenu(e.attribute("backtomenu").toInt());
         button->setDefaultTextColor(m_view.text_color->color());
         button->setZValue(4);
-        QRectF r = button->sceneBoundingRect();
         m_scene->addItem(button);
         button->setPos(e.attribute("posx").toDouble(), e.attribute("posy").toDouble());