]> git.sesse.net Git - kdenlive/blobdiff - src/dvdwizardmenu.h
Video not needed when creating audio thumbs
[kdenlive] / src / dvdwizardmenu.h
index a8496a3fbc66179dd77df8eb7b281e3a52fd5453..4f6b732415d4ebfa2f007d1770eacb0a03da2381 100644 (file)
 #include <QDomElement>
 
 #include <KDebug>
+#include <kdeversion.h>
+
+#if KDE_IS_VERSION(4,7,0)
+#include <KMessageWidget>
+#endif
 
 #include "ui_dvdwizardmenu_ui.h"
 
@@ -36,7 +41,9 @@ class DvdScene : public QGraphicsScene
 {
 
 public:
-    DvdScene(QObject * parent = 0): QGraphicsScene(parent) {}
+    DvdScene(QObject * parent = 0): QGraphicsScene(parent) {
+        m_width = 0; m_height = 0;
+    }
     void setProfile(int width, int height) {
         m_width = width;
         m_height = height;
@@ -57,8 +64,12 @@ class DvdButton : public QGraphicsTextItem
 {
 
 public:
-    DvdButton(const QString & text): QGraphicsTextItem(text), m_target(0), m_command(QString("jump title 1")), m_backToMenu(false) {}
-    enum { Type = UserType + 1 };
+    DvdButton(const QString & text): QGraphicsTextItem(text), m_target(0), m_command(QString("jump title 1")), m_backToMenu(false) {
+        setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+#if QT_VERSION >= 0x040600
+        setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
+#endif
+    }
     void setTarget(int t, QString c) {
         m_target = t;
         m_command = c;
@@ -74,7 +85,7 @@ public:
     }
     int type() const {
         // Enable the use of qgraphicsitem_cast with this item.
-        return Type;
+        return UserType + 1;
     }
     void setBackMenu(bool back) {
         m_backToMenu = back;
@@ -89,12 +100,11 @@ protected:
 
     virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) {
         if (change == ItemPositionChange && scene()) {
-
             QPointF newPos = value.toPointF();
             QRectF sceneShape = sceneBoundingRect();
             DvdScene *sc = static_cast < DvdScene * >(scene());
-            newPos.setX(qMax(newPos.x(), 0.0));
-            newPos.setY(qMax(newPos.y(), 0.0));
+            newPos.setX(qMax(newPos.x(), (qreal)0));
+            newPos.setY(qMax(newPos.y(), (qreal)0));
             if (newPos.x() + sceneShape.width() > sc->width()) newPos.setX(sc->width() - sceneShape.width());
             if (newPos.y() + sceneShape.height() > sc->height()) newPos.setY(sc->height() - sceneShape.height());
 
@@ -127,6 +137,7 @@ public:
     void createButtonImages(const QString &img1, const QString &img2, const QString &img3);
     void setTargets(QStringList list, QStringList targetlist);
     QMap <QString, QRect> buttonsInfo();
+    bool loopMovie() const;
     bool menuMovie() const;
     QString menuMoviePath() const;
     bool isPalMenu() const;
@@ -143,6 +154,9 @@ private:
     QGraphicsRectItem *m_safeRect;
     int m_width;
     int m_height;
+#if KDE_IS_VERSION(4,7,0)
+    KMessageWidget *m_menuMessage;
+#endif
 
 private slots:
     void buildButton();