#include <QStatusBar>
#include <QLabel>
#include <QStackedWidget>
+#include <QFileInfo>
#include <vlc_keys.h> /* Wheel event */
#include <vlc_vout_display.h> /* vout_thread_t and VOUT_ events */
input_name = "";
b_interfaceFullScreen= false;
b_hasPausedWhenMinimized = false;
-
+ i_kc_offset = false;
/* Ask for Privacy */
FirstRun::CheckAndRun( this, p_intf );
#ifdef WIN32
himl = NULL;
p_taskbl = NULL;
- taskbar_wmsg = RegisterWindowMessage("TaskbarButtonCreated");
+ taskbar_wmsg = RegisterWindowMessage(TEXT("TaskbarButtonCreated"));
#endif
/*********************************
stackCentralW = new QVLCStackedWidget( main );
/* Bg Cone */
- bgWidget = new BackgroundWidget( p_intf );
+ if ( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY
+ && var_InheritBool( p_intf, "qt-icon-change" ) )
+ {
+ bgWidget = new EasterEggBackgroundWidget( p_intf );
+ CONNECT( this, kc_pressed(), bgWidget, animate() );
+ }
+ else
+ bgWidget = new BackgroundWidget( p_intf );
+
stackCentralW->addWidget( bgWidget );
if ( !var_InheritBool( p_intf, "qt-bgcone" ) )
bgWidget->setWithArt( false );
{
if( !fullscreenControls ) return;
- IMEvent *eShow = new IMEvent( FullscreenControlToggle_Type );
+ IMEvent *eShow = new IMEvent( IMEvent::FullscreenControlToggle );
QApplication::postEvent( fullscreenControls, eShow );
}
debug();
}
+const Qt::Key MainInterface::kc[10] =
+{
+ Qt::Key_Up, Qt::Key_Up,
+ Qt::Key_Down, Qt::Key_Down,
+ Qt::Key_Left, Qt::Key_Right, Qt::Key_Left, Qt::Key_Right,
+ Qt::Key_B, Qt::Key_A
+};
+
void MainInterface::dockPlaylist( bool p_docked )
{
if( b_plDocked == p_docked ) return;
{
if( !controls ) return 0;
return( (controls->isVisible() ? CONTROLS_VISIBLE : CONTROLS_HIDDEN )
- + CONTROLS_ADVANCED * controls->b_advancedVisible );
+ + CONTROLS_ADVANCED * controls->b_advancedVisible );
+}
+
+StandardPLPanel *MainInterface::getPlaylistView()
+{
+ if( !playlistWidget ) return NULL;
+ else return playlistWidget->mainView;
}
void MainInterface::setStatusBarVisibility( bool b_visible )
*/
void MainInterface::dropEventPlay( QDropEvent *event, bool b_play, bool b_playlist )
{
- if( event->possibleActions() & ( Qt::CopyAction | Qt::MoveAction ) )
+ if( event->possibleActions() & ( Qt::CopyAction | Qt::MoveAction | Qt::LinkAction ) )
event->setDropAction( Qt::CopyAction );
else
return;
if( url.isValid() )
{
QString mrl = toURI( url.toEncoded().constData() );
- playlist_Add( THEPL, qtu(mrl), NULL,
+ QFileInfo info( url.toLocalFile() );
+ if( info.exists() && info.isSymLink() )
+ {
+ QString target = info.symLinkTarget();
+ QUrl url;
+ if( QFile::exists( target ) )
+ {
+ url = QUrl::fromLocalFile( target );
+ }
+ else
+ {
+ url.setUrl( target );
+ }
+ mrl = toURI( url.toEncoded().constData() );
+ }
+ if( mrl.length() > 0 )
+ {
+ playlist_Add( THEPL, qtu(mrl), NULL,
PLAYLIST_APPEND | (first ? PLAYLIST_GO: PLAYLIST_PREPARSE),
PLAYLIST_END, b_playlist, pl_Unlocked );
- first = false;
- RecentsMRL::getInstance( p_intf )->addRecent( mrl );
+ first = false;
+ RecentsMRL::getInstance( p_intf )->addRecent( mrl );
+ }
}
}
void MainInterface::keyPressEvent( QKeyEvent *e )
{
handleKeyPress( e );
+
+ /* easter eggs sequence handling */
+ if ( e->key() == kc[ i_kc_offset ] )
+ i_kc_offset++;
+ else
+ i_kc_offset = 0;
+
+ if ( i_kc_offset == (sizeof( kc ) / sizeof( Qt::Key )) )
+ {
+ i_kc_offset = 0;
+ emit kc_pressed();
+ }
}
void MainInterface::handleKeyPress( QKeyEvent *e )