var_AddCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
vlc_object_release( p_playlist );
}
+ if( QSystemTrayIcon::isSystemTrayAvailable() &&
+ ( config_GetInt( p_intf, "qt-start-mininimized") == 1))
+ {
+ hide();
+ createSystrayMenu();
+ }
if( QSystemTrayIcon::isSystemTrayAvailable() &&
( config_GetInt( p_intf, "qt-system-tray") == 1))
createSystrayMenu();
+
}
MainInterface::~MainInterface()
void MainInterface::createSystrayMenu()
{
QIcon iconVLC = QIcon( QPixmap( ":/vlc128.png" ) );
- sysTray = new QSystemTrayIcon( iconVLC );
+ sysTray = new QSystemTrayIcon( iconVLC, this );
systrayMenu = new QMenu( qtr( "VLC media player" ), this );
systrayMenu->setIcon( iconVLC );
QVLCMenu::updateSystrayMenu( this, p_intf, true );
QVLCMenu::updateSystrayMenu( this, p_intf ) ;
}
+void MainInterface::toggleUpdateSystrayMenu()
+{
+ QVLCMenu::updateSystrayMenu( this, p_intf );
+ toggleVisible();
+}
+
void MainInterface::handleSystrayClick( QSystemTrayIcon::ActivationReason reason )
{
switch( reason )
{
case QSystemTrayIcon::Trigger:
- this->show(); break;
+ this->toggleVisible(); break;
case QSystemTrayIcon::MiddleClick:
sysTray->showMessage( qtr( "VLC media player" ),
- qtr( "Control menu for the player" ),
+ qtr( "Control menu for the player" )
+ + nameLabel->text() ,
QSystemTrayIcon::Information, 4000 );
break;
}
public slots:
void undockPlaylist();
void playlist();
+ void toggleUpdateSystrayMenu();
private slots:
void setNavigation( int );
void setStatus( int );
void visual();
void advanced();
void updateVolume( int sliderVolume );
- void updateSystrayMenu( int );
void handleSystrayClick( QSystemTrayIcon::ActivationReason );
+ void updateSystrayMenu( int );
};
POPUP_PLAY_ENTRIES( sysMenu );
sysMenu->addSeparator();
- if( mi->isVisible() || b_force_visible )
+ if( !mi->isVisible() || b_force_visible )
{
- sysMenu->addAction( qtr("Hide Interface"), mi, SLOT( hide() ) );
+ sysMenu->addAction( qtr("Hide Interface"), mi,
+ SLOT( toggleUpdateSystrayMenu() ) );
}
else
{
- sysMenu->addAction( qtr("Show Interface"), mi, SLOT( show() ) );
+ sysMenu->addAction( qtr("Show Interface"), mi,
+ SLOT( toggleUpdateSystrayMenu() ) );
}
DP_SADD( sysMenu, qtr("&Open" ), "", "", openFileDialog(), "" );
DP_SADD( sysMenu, qtr("&Quit") , "", "", quit(), "" );
"in order to control VLC media player" \
"for basic actions")
+#define MINIMIZED_TEXT N_("Start VLC only with a systray icon")
+#define MINIMIZED_LONGTEXT N_("When you launch VLC with that option" \
+ "VLC will start just with an icon in" \
+ "your taskbar")
vlc_module_begin();
set_shortname( (char *)"Qt" );
set_description( (char*)_("Qt interface") );
ADVANCED_PREFS_LONGTEXT, VLC_FALSE );
add_bool( "qt-system-tray", VLC_TRUE, NULL, SYSTRAY_TEXT,
SYSTRAY_LONGTEXT, VLC_FALSE);
+ add_bool( "qt-start-mininimized", VLC_FALSE, NULL, MINIMIZED_TEXT,
+ MINIMIZED_LONGTEXT, VLC_TRUE);
set_callbacks( OpenDialogs, Close );
vlc_module_end();