Status bar fixed
[qtmeetings] / src / UserInterface / Views / RoomStatusIndicatorWidget.cpp
index ca53b9d..d71fcb1 100644 (file)
@@ -132,7 +132,7 @@ QPalette RoomStatusIndicatorWidget::createPalette(Room::Status aStatus)
        int cropheight(pixmap.height() - yoffset);
 
        QBrush brush;
-       if (windowState() == Qt::WindowFullScreen)
+       if ( (pixmap.width() == rect().width()) && (pixmap.height() == rect().height()) )
        {
                // Use the full image in full screen mode
                brush.setTexture(pixmap);
@@ -151,11 +151,38 @@ QPalette RoomStatusIndicatorWidget::createPalette(Room::Status aStatus)
        return palette;
 }
 
-void RoomStatusIndicatorWidget::setCurrentTime(QTime aCurrentTime)
+void RoomStatusIndicatorWidget::setConnectionStatus( QDateTime aCurrentTime, bool aConnected,
+               QTime aLastUpdated, QString aError )
 {
        iTimeDisplay->setText( aCurrentTime.toString( iTimeFormat ) );
+       if ( aLastUpdated.isNull() )
+               iStatusBar->setText( tr("Disconnected") , BorderedBarWidget::LeftAlign );
+       else
+       {
+               iDefaultRoomLabel->setHidden( false );
+               iUntilTextLabel->setHidden( false );
+               iStatusLabel->setHidden( false );
+
+               if (!aConnected)
+               {
+                       iStatusBar->setText( tr("Disconnected").arg(aLastUpdated.toString(iTimeFormat))
+                                       , BorderedBarWidget::LeftAlign );
+               }
+               else
+               {
+                       iStatusBar->setText( tr("Connected - Last update %1").arg(aLastUpdated.toString(iTimeFormat)) ,
+                                       BorderedBarWidget::LeftAlign );
+               }
+       }
+       showError( aError );
+}
+
+void RoomStatusIndicatorWidget::showError( QString aError )
+{
+       iStatusBar->setText( aError );
 }
 
+
 void RoomStatusIndicatorWidget::statusChanged(const Room::Status aStatus, const QTime aUntil)
 {
        iStatusLabel->setText(tr( "is %1" ).arg(statusToText(aStatus) ) );
@@ -195,24 +222,10 @@ bool RoomStatusIndicatorWidget::event(QEvent *event)
 
 void RoomStatusIndicatorWidget::connectionEstablished()
 {
-       if ( !connectedOnce)
-       { 
-               // Just got the required meetings for the first time              
-               qDebug() << "RoomStatusIndicatorWidget::connectionEstablished() first call";
-               iDefaultRoomLabel->setHidden( false);
-               iUntilTextLabel->setHidden( false);
-               iStatusLabel->setHidden( false);
-       }
-       else
-       {
-               qDebug() << "RoomStatusIndicatorWidget::connectionEstablished()";
-       }
        ViewBase::connectionEstablished();
-       iStatusBar->setText( tr("Connected"), BorderedBarWidget::LeftAlign );
 }
 
 void RoomStatusIndicatorWidget::connectionLost()
 {
        ViewBase::connectionLost();
-       iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign );
 }