[vlmc-devel] commit: Fixing some GUI mess. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Sun Jun 27 23:06:24 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Jun 22 15:28:40 2010 +0200| [26f00a72142cef22f1353cb6e0319b64b76a576b] | committer: Hugo Beauzée-Luyssen 

Fixing some GUI mess.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=26f00a72142cef22f1353cb6e0319b64b76a576b
---

 src/Gui/ClipProperty.cpp                |    2 +-
 src/Gui/import/ImportController.cpp     |    3 +-
 src/Gui/import/ImportController.h       |    1 -
 src/Gui/import/ui/ImportController.ui   |   10 ++-
 src/Gui/media/ClipMetadataDisplayer.cpp |    6 +-
 src/Gui/media/ClipMetadataDisplayer.h   |    2 +-
 src/Gui/ui/ClipProperty.ui              |  127 +++++++++++++++----------------
 7 files changed, 77 insertions(+), 74 deletions(-)

diff --git a/src/Gui/ClipProperty.cpp b/src/Gui/ClipProperty.cpp
index 1e4113f..739cc71 100644
--- a/src/Gui/ClipProperty.cpp
+++ b/src/Gui/ClipProperty.cpp
@@ -57,7 +57,7 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
     connect( ui->addTagsButton, SIGNAL( clicked() ), this, SLOT( addTagsRequired() ) );
     connect( ui->deleteTagsButton, SIGNAL( clicked() ), this, SLOT( removeTagsRequired() ) );
 
-    new ClipMetadataDisplayer( clip, ui->metadataContainer );
+    ui->metadataContainer->setWatchedClip( clip );
 }
 
 ClipProperty::~ClipProperty()
diff --git a/src/Gui/import/ImportController.cpp b/src/Gui/import/ImportController.cpp
index 9134f89..6d7c708 100644
--- a/src/Gui/import/ImportController.cpp
+++ b/src/Gui/import/ImportController.cpp
@@ -59,7 +59,6 @@ ImportController::ImportController(QWidget *parent) :
     m_mediaListView = new MediaListView( m_stackNav, m_temporaryMedias );
     m_tag = new TagWidget( m_ui->tagContainer, 6 );
     m_filesModel = new QFileSystemModel( this );
-    m_metadataDisplayer = new ClipMetadataDisplayer( NULL, m_ui->metadataContainer );
     m_stackNav->pushViewController( m_mediaListView );
 
     m_nameFilters << Media::AudioExtensions.split(' ', QString::SkipEmptyParts)
@@ -134,7 +133,7 @@ ImportController::clipSelection( Clip* clip )
     const QUuid& uuid = clip->uuid();
     if ( m_currentUuid == uuid )
         return ;
-    m_metadataDisplayer->setWatchedClip( clip );
+    m_ui->metadataContainer->setWatchedClip( clip );
     m_preview->stop();
     m_currentUuid = uuid;
     m_tag->clipSelected( clip );
diff --git a/src/Gui/import/ImportController.h b/src/Gui/import/ImportController.h
index dd9437a..0162a4e 100644
--- a/src/Gui/import/ImportController.h
+++ b/src/Gui/import/ImportController.h
@@ -86,7 +86,6 @@ class ImportController : public QDialog
         quint32                     m_nbMediaLoaded;
         ClipRenderer*               m_clipRenderer;
         QStringList                 m_nameFilters;
-        ClipMetadataDisplayer       *m_metadataDisplayer;
 
     public slots:
         void        accept();
diff --git a/src/Gui/import/ui/ImportController.ui b/src/Gui/import/ui/ImportController.ui
index 123cdac..0a8f53b 100644
--- a/src/Gui/import/ui/ImportController.ui
+++ b/src/Gui/import/ui/ImportController.ui
@@ -127,7 +127,7 @@
           </widget>
          </item>
          <item>
-          <widget class="QWidget" name="metadataContainer" native="true"/>
+          <widget class="ClipMetadataDisplayer" name="metadataContainer" native="true"/>
          </item>
          <item>
           <widget class="QWidget" name="tagContainer" native="true"/>
@@ -150,6 +150,14 @@
    </item>
   </layout>
  </widget>
+ <customwidgets>
+  <customwidget>
+   <class>ClipMetadataDisplayer</class>
+   <extends>QWidget</extends>
+   <header>ClipMetadataDisplayer.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
  <resources>
   <include location="../../../../ressources.qrc"/>
  </resources>
diff --git a/src/Gui/media/ClipMetadataDisplayer.cpp b/src/Gui/media/ClipMetadataDisplayer.cpp
index a6102b3..800b359 100644
--- a/src/Gui/media/ClipMetadataDisplayer.cpp
+++ b/src/Gui/media/ClipMetadataDisplayer.cpp
@@ -27,14 +27,12 @@
 
 #include <QTime>
 
-ClipMetadataDisplayer::ClipMetadataDisplayer( const Clip *clip, QWidget *parent /*= NULL*/ ) :
+ClipMetadataDisplayer::ClipMetadataDisplayer( QWidget *parent /*= NULL*/ ) :
     QWidget( parent ),
     m_ui( new Ui::ClipMetadataDisplayer ),
-    m_watchedClip( clip )
+    m_watchedClip( NULL )
 {
     m_ui->setupUi( this );
-    if ( clip != NULL )
-        setWatchedClip( clip );
 }
 
 void
diff --git a/src/Gui/media/ClipMetadataDisplayer.h b/src/Gui/media/ClipMetadataDisplayer.h
index 21ded0f..71be732 100644
--- a/src/Gui/media/ClipMetadataDisplayer.h
+++ b/src/Gui/media/ClipMetadataDisplayer.h
@@ -36,7 +36,7 @@ class ClipMetadataDisplayer : public QWidget
     Q_DISABLE_COPY(ClipMetadataDisplayer);
 
     public:
-        explicit ClipMetadataDisplayer( const Clip* clip, QWidget *parent = 0 );
+        explicit ClipMetadataDisplayer( QWidget *parent = 0 );
 
         void                            setWatchedClip( const Clip *clip );
 
diff --git a/src/Gui/ui/ClipProperty.ui b/src/Gui/ui/ClipProperty.ui
index ea1fa6d..4ee9246 100644
--- a/src/Gui/ui/ClipProperty.ui
+++ b/src/Gui/ui/ClipProperty.ui
@@ -6,15 +6,15 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>522</width>
-    <height>388</height>
+    <width>713</width>
+    <height>360</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string/>
   </property>
   <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0" colspan="4">
+   <item row="0" column="0" colspan="3">
     <widget class="QFrame" name="frame">
      <property name="frameShape">
       <enum>QFrame::StyledPanel</enum>
@@ -57,19 +57,6 @@
      </layout>
     </widget>
    </item>
-   <item row="0" column="4">
-    <spacer name="horizontalSpacer_2">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>40</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
    <item row="1" column="0">
     <widget class="QLabel" name="label">
      <property name="text">
@@ -77,48 +64,6 @@
      </property>
     </widget>
    </item>
-   <item row="2" column="0" colspan="6">
-    <widget class="QListView" name="metaTagsView">
-     <property name="selectionMode">
-      <enum>QAbstractItemView::MultiSelection</enum>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="5">
-    <spacer name="horizontalSpacer">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>40</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="3" column="6">
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="layoutDirection">
-      <enum>Qt::LeftToRight</enum>
-     </property>
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-     </property>
-     <property name="centerButtons">
-      <bool>false</bool>
-     </property>
-    </widget>
-   </item>
    <item row="1" column="1">
     <widget class="QToolButton" name="addTagsButton">
      <property name="text">
@@ -141,18 +86,64 @@
      </property>
     </widget>
    </item>
-   <item row="2" column="6">
-    <widget class="QPlainTextEdit" name="annotationInput"/>
-   </item>
-   <item row="1" column="6">
+   <item row="1" column="3">
     <widget class="QLabel" name="annotationLabel">
      <property name="text">
       <string>Annotations :</string>
      </property>
     </widget>
    </item>
-   <item row="0" column="6">
-    <widget class="QWidget" name="metadataContainer" native="true">
+   <item row="2" column="0" colspan="3">
+    <widget class="QListView" name="metaTagsView">
+     <property name="selectionMode">
+      <enum>QAbstractItemView::MultiSelection</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="3">
+    <widget class="QPlainTextEdit" name="annotationInput"/>
+   </item>
+   <item row="4" column="3">
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QDialogButtonBox" name="buttonBox">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="layoutDirection">
+        <enum>Qt::LeftToRight</enum>
+       </property>
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="standardButtons">
+        <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+       </property>
+       <property name="centerButtons">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="0" column="3">
+    <widget class="ClipMetadataDisplayer" name="metadataContainer" native="true">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
        <horstretch>0</horstretch>
@@ -169,6 +160,14 @@
    </item>
   </layout>
  </widget>
+ <customwidgets>
+  <customwidget>
+   <class>ClipMetadataDisplayer</class>
+   <extends>QWidget</extends>
+   <header>ClipMetadataDisplayer.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
  <resources>
   <include location="../../../ressources.qrc"/>
  </resources>



More information about the Vlmc-devel mailing list