[vlmc-devel] commit: ClipMetadataDisplayer: Add an information icon about the workspace state. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Mon Jun 28 00:57:05 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Mon Jun 28 00:05:56 2010 +0200| [5fb810b39aedc03d4f0ea754c74864bedec0c694] | committer: Hugo Beauzée-Luyssen 

ClipMetadataDisplayer: Add an information icon about the workspace state.

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

 resources/images/ko.png                   |  Bin 0 -> 1333 bytes
 resources/images/ok.png                   |  Bin 0 -> 2901 bytes
 ressources.qrc                            |    2 ++
 src/Gui/media/ClipMetadataDisplayer.cpp   |   13 +++++++++++++
 src/Gui/media/ClipMetadataDisplayer.h     |    1 +
 src/Gui/media/ui/ClipMetadataDisplayer.ui |   16 +++++++++++++++-
 src/Media/Media.cpp                       |    1 +
 src/Media/Media.h                         |    1 +
 8 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/resources/images/ko.png b/resources/images/ko.png
new file mode 100644
index 0000000..351659b
Binary files /dev/null and b/resources/images/ko.png differ
diff --git a/resources/images/ok.png b/resources/images/ok.png
new file mode 100644
index 0000000..01334d0
Binary files /dev/null and b/resources/images/ok.png differ
diff --git a/ressources.qrc b/ressources.qrc
index e88270c..ac85688 100644
--- a/ressources.qrc
+++ b/ressources.qrc
@@ -35,6 +35,8 @@
         <file alias="youtube">resources/images/youtube.png</file>
         <file alias="network">resources/images/network.png</file>
         <file alias="down">resources/images/down.png</file>
+        <file alias="ok">resources/images/ok.png</file>
+        <file alias="ko">resources/images/ko.png</file>
     </qresource>
     <qresource prefix="/text">
         <file>AUTHORS</file>
diff --git a/src/Gui/media/ClipMetadataDisplayer.cpp b/src/Gui/media/ClipMetadataDisplayer.cpp
index f817482..b505184 100644
--- a/src/Gui/media/ClipMetadataDisplayer.cpp
+++ b/src/Gui/media/ClipMetadataDisplayer.cpp
@@ -56,6 +56,8 @@ ClipMetadataDisplayer::metadataUpdated( const Media *media )
     m_ui->nbAudioTracksValueLabel->setText( QString::number( media->nbAudioTracks() ) );
     //Path:
     m_ui->pathValueLabel->setText( media->fileInfo()->absoluteFilePath() );
+    //Workspace:
+    workspaceStateChanged( media->isInWorkspace() );
 }
 
 void
@@ -100,6 +102,17 @@ ClipMetadataDisplayer::setWatchedClip( const Clip *clip )
         connect( m_watchedMedia, SIGNAL( metaDataComputed(const Media*) ),
                  this, SLOT( metadataUpdated( const Media*) ) );
     }
+    connect( m_watchedMedia, SIGNAL( workspaceStateChanged( bool ) ),
+             this, SLOT( workspaceStateChanged( bool ) ) );
+}
+
+void
+ClipMetadataDisplayer::workspaceStateChanged( bool state )
+{
+    if ( state == true )
+        m_ui->inProjectWorkspaceValueLabel->setPixmap( QPixmap( ":/images/ok" ).scaled( 16, 16 ) );
+    else
+        m_ui->inProjectWorkspaceValueLabel->setPixmap( QPixmap( ":/images/ko" ).scaled( 16, 16 ) );
 }
 
 void
diff --git a/src/Gui/media/ClipMetadataDisplayer.h b/src/Gui/media/ClipMetadataDisplayer.h
index 4000971..fd37bcb 100644
--- a/src/Gui/media/ClipMetadataDisplayer.h
+++ b/src/Gui/media/ClipMetadataDisplayer.h
@@ -54,6 +54,7 @@ class ClipMetadataDisplayer : public QWidget
 
     private slots:
         void                            metadataUpdated( const Media *media );
+        void                            workspaceStateChanged( bool state );
         void                            clipDestroyed( Clip* clip );
 
 };
diff --git a/src/Gui/media/ui/ClipMetadataDisplayer.ui b/src/Gui/media/ui/ClipMetadataDisplayer.ui
index 2068369..a7d69ef 100644
--- a/src/Gui/media/ui/ClipMetadataDisplayer.ui
+++ b/src/Gui/media/ui/ClipMetadataDisplayer.ui
@@ -229,7 +229,7 @@
         </property>
        </widget>
       </item>
-      <item row="7" column="0">
+      <item row="8" column="0">
        <spacer name="verticalSpacer">
         <property name="orientation">
          <enum>Qt::Vertical</enum>
@@ -242,6 +242,20 @@
         </property>
        </spacer>
       </item>
+      <item row="7" column="0">
+       <widget class="QLabel" name="inProjectWorkspaceLabel">
+        <property name="text">
+         <string>In project workspace</string>
+        </property>
+       </widget>
+      </item>
+      <item row="7" column="1">
+       <widget class="QLabel" name="inProjectWorkspaceValueLabel">
+        <property name="text">
+         <string/>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
diff --git a/src/Media/Media.cpp b/src/Media/Media.cpp
index 3e1eb8a..c405d3e 100644
--- a/src/Media/Media.cpp
+++ b/src/Media/Media.cpp
@@ -293,4 +293,5 @@ Media::setFilePath( const QString &filePath )
         m_inWorkspace = false;
         m_workspacePath = "";
     }
+    emit workspaceStateChanged( m_inWorkspace );
 }
diff --git a/src/Media/Media.h b/src/Media/Media.h
index 3afc186..8040fb5 100644
--- a/src/Media/Media.h
+++ b/src/Media/Media.h
@@ -183,6 +183,7 @@ protected:
 signals:
     void                        metaDataComputed( const Media* );
     void                        audioSpectrumComputed( const QUuid& );
+    void                        workspaceStateChanged( bool );
 };
 
 #endif // MEDIA_H__



More information about the Vlmc-devel mailing list