+inline void MainInterface::createStatusBar()
+{
+ /****************
+ * Status Bar *
+ ****************/
+ /* Widgets Creation*/
+ b_remainingTime = false;
+ timeLabel = new TimeLabel;
+ timeLabel->setText( " --:--/--:-- " );
+ timeLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
+ timeLabel->setToolTip( qtr( "Toggle between elapsed and remaining time" ) );
+ nameLabel = new QLabel;
+ nameLabel->setTextInteractionFlags( Qt::TextSelectableByMouse
+ | Qt::TextSelectableByKeyboard );
+ speedLabel = new SpeedLabel( p_intf, "1.00x" );
+ speedLabel->setToolTip(
+ qtr( "Current playback speed.\nRight click to adjust" ) );
+ speedLabel->setContextMenuPolicy ( Qt::CustomContextMenu );
+
+ /* Styling those labels */
+ timeLabel->setFrameStyle( QFrame::Sunken | QFrame::Panel );
+ speedLabel->setFrameStyle( QFrame::Sunken | QFrame::Panel );
+ nameLabel->setFrameStyle( QFrame::Sunken | QFrame::StyledPanel);
+
+
+ /* and adding those */
+ statusBar()->addWidget( nameLabel, 8 );
+ statusBar()->addPermanentWidget( speedLabel, 0 );
+ statusBar()->addPermanentWidget( timeLabel, 0 );
+
+ /* timeLabel behaviour:
+ - double clicking opens the goto time dialog
+ - right-clicking and clicking just toggle between remaining and
+ elapsed time.*/
+ CONNECT( timeLabel, timeLabelClicked(), this, toggleTimeDisplay() );
+ CONNECT( timeLabel, timeLabelDoubleClicked(), THEDP, gotoTimeDialog() );
+ CONNECT( timeLabel, timeLabelDoubleClicked(), this, toggleTimeDisplay() );
+
+ /* Speed Label behaviour:
+ - right click gives the vertical speed slider */
+ CONNECT( speedLabel, customContextMenuRequested( QPoint ),
+ this, showSpeedMenu( QPoint ) );
+}
+
+inline void MainInterface::initSystray()
+{
+ bool b_createSystray = false;
+ bool b_systrayAvailable = QSystemTrayIcon::isSystemTrayAvailable();
+ if( config_GetInt( p_intf, "qt-start-minimized") )
+ {
+ if( b_systrayAvailable )
+ {
+ b_createSystray = true;
+ hide();
+ }
+ else msg_Err( p_intf, "You can't minimize if you haven't a system "
+ "tray bar" );
+ }
+ if( config_GetInt( p_intf, "qt-system-tray") )
+ b_createSystray = true;
+
+ if( b_systrayAvailable && b_createSystray )
+ createSystray();
+}
+