]> git.sesse.net Git - vlc/commitdiff
Qt: display a locker in the statusBar when encryption is set.
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 21 Feb 2009 13:52:22 +0000 (14:52 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 21 Feb 2009 13:52:22 +0000 (14:52 +0100)
This needs the core event, of course, in order to work... (not yet done, and probably for later).

modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp

index fed980f9edf66793c8138ce6e608521cadcf158c..d2c9310365b189961a80b555f6c21026c59c1ddc 100644 (file)
@@ -129,6 +129,7 @@ void InputManager::delInput()
     emit statusChanged( END_S );
 
     emit teletextPossible( false );
+    emit encryptionChanged( false );
     emit AtoBchanged( false, false );
     emit voutChanged( false );
     emit voutListChanged( NULL, 0 );
index 94f84d05a299b86b551476def7d354f39493c475..f7fb204f17ace81c0b76ea4f1bb7f9dfaf5df910 100644 (file)
@@ -187,10 +187,12 @@ signals:
     void AtoBchanged( bool, bool );
     /// Vout
     void voutChanged( bool );
+    void voutListChanged( vout_thread_t **pp_vout, int i_vout );
+    /// Other
     void synchroChanged();
     void bookmarksChanged();
     void cachingChanged( float );
-    void voutListChanged( vout_thread_t **pp_vout, int i_vout );
+    void encryptionChanged( bool );
 };
 
 class MainInputManager : public QObject
index 06aaab0f0ffa59cef3d2511c784e8227fd045de7..a577ae9c9e931153e5e035836e9707b56094098b 100644 (file)
@@ -82,6 +82,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     playlistVisible      = false;
     input_name           = "";
     fullscreenControls   = NULL;
+    cryptedLabel         = NULL;
 
     /* Ask for privacy */
     askForPrivacy();
@@ -348,6 +349,20 @@ inline void MainInterface::createStatusBar()
        - right-clicking and clicking just toggle between remaining and
          elapsed time.*/
     CONNECT( timeLabel, timeLabelDoubleClicked(), THEDP, gotoTimeDialog() );
+
+    CONNECT( THEMIM->getIM(), encryptionChanged( bool ) , this, showCryptedLabel( bool ) );
+}
+
+void MainInterface::showCryptedLabel( bool )
+{
+    if( cryptedLabel == NULL )
+    {
+        cryptedLabel = new QLabel;
+        cryptedLabel->setPixmap( QPixmap( ":/eject" ) );
+        statusBar()->addWidget( cryptedLabel );
+    }
+
+    cryptedLabel->show();
 }
 
 inline void MainInterface::initSystray()
index c84df947dbe0db326eea292c77611c124b444cfe..3f84db8bce4db23384cc10907d77873f8bbeb6df 100644 (file)
@@ -141,6 +141,7 @@ private:
 
     /* Status Bar */
     QLabel              *nameLabel;
+    QLabel              *cryptedLabel;
 
     virtual void customEvent( QEvent *);
     virtual void keyPressEvent( QKeyEvent *);
@@ -171,6 +172,8 @@ private slots:
     void handleSystrayClick( QSystemTrayIcon::ActivationReason );
     void updateSystrayTooltipName( QString );
     void updateSystrayTooltipStatus( int );
+
+    void showCryptedLabel( bool );
 signals:
     void askReleaseVideo( );
     void askVideoToResize( unsigned int, unsigned int );