Commit from NYC/NY/Columbia University ;)
12 files changed:
components/preferences_widgets.moc.cpp \
components/complete_preferences.moc.cpp \
components/simple_preferences.moc.cpp \
components/preferences_widgets.moc.cpp \
components/complete_preferences.moc.cpp \
components/simple_preferences.moc.cpp \
- components/open.moc.cpp \
+ components/open_panels.moc.cpp \
components/interface_widgets.moc.cpp \
components/playlist/panels.moc.cpp \
components/playlist/selector.moc.cpp \
components/interface_widgets.moc.cpp \
components/playlist/panels.moc.cpp \
components/playlist/selector.moc.cpp \
components/preferences_widgets.cpp \
components/complete_preferences.cpp \
components/simple_preferences.cpp \
components/preferences_widgets.cpp \
components/complete_preferences.cpp \
components/simple_preferences.cpp \
+ components/open_panels.cpp \
components/interface_widgets.cpp \
components/playlist/standardpanel.cpp \
components/playlist/selector.cpp \
components/interface_widgets.cpp \
components/playlist/standardpanel.cpp \
components/playlist/selector.cpp \
components/preferences_widgets.hpp \
components/complete_preferences.hpp \
components/simple_preferences.hpp \
components/preferences_widgets.hpp \
components/complete_preferences.hpp \
components/simple_preferences.hpp \
+ components/open_panels.hpp \
components/interface_widgets.hpp \
components/playlist/panels.hpp \
components/playlist/selector.hpp \
components/interface_widgets.hpp \
components/playlist/panels.hpp \
components/playlist/selector.hpp \
* DA Control Widget !
*****************************/
ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
* DA Control Widget !
*****************************/
ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
bool b_advControls,
bool b_shiny ) :
QFrame( NULL ), p_intf( _p_i )
bool b_advControls,
bool b_shiny ) :
QFrame( NULL ), p_intf( _p_i )
setupSmallButton( playlistButton );
controlLayout->addWidget( playlistButton, 3, 11, Qt::AlignBottom );
BUTTON_SET_IMG( playlistButton, "" , playlist.png, qtr( "Show playlist" ) );
setupSmallButton( playlistButton );
controlLayout->addWidget( playlistButton, 3, 11, Qt::AlignBottom );
BUTTON_SET_IMG( playlistButton, "" , playlist.png, qtr( "Show playlist" ) );
+ CONNECT( playlistButton, clicked(), _p_mi, togglePlaylist() );
/** extended Settings **/
QPushButton *extSettingsButton = new QPushButton( "F" );
/** extended Settings **/
QPushButton *extSettingsButton = new QPushButton( "F" );
Q_OBJECT
public:
/* p_intf, advanced control visible or not, blingbling or not */
Q_OBJECT
public:
/* p_intf, advanced control visible or not, blingbling or not */
- ControlsWidget( intf_thread_t *, bool, bool );
+ ControlsWidget( intf_thread_t *, MainInterface*, bool, bool );
// QSize sizeHint() const;
virtual ~ControlsWidget();
// QSize sizeHint() const;
virtual ~ControlsWidget();
-#include "components/open.hpp"
+#include "components/open_panels.hpp"
#include "dialogs/open.hpp"
#include "dialogs_provider.hpp"
#include "components/preferences_widgets.hpp"
#include "dialogs/open.hpp"
#include "dialogs_provider.hpp"
#include "components/preferences_widgets.hpp"
#include "input_manager.hpp"
#include "dialogs/open.hpp"
#include "input_manager.hpp"
#include "dialogs/open.hpp"
-#include "components/open.hpp"
#include <QTabWidget>
#include <QGridLayout>
#include <QTabWidget>
#include <QGridLayout>
#include "util/qvlcframe.hpp"
#include "dialogs_provider.hpp"
#include "ui/open.h"
#include "util/qvlcframe.hpp"
#include "dialogs_provider.hpp"
#include "ui/open.h"
-#include "components/open.hpp"
+#include "components/open_panels.hpp"
class QString;
class QToolButton;
class QString;
class QToolButton;
void DialogsProvider::quit()
{
vlc_object_kill( p_intf );
void DialogsProvider::quit()
{
vlc_object_kill( p_intf );
+ QApplication::closeAllWindows();
void InputManager::update()
{
/// \todo Emit the signals only if it changed
void InputManager::update()
{
/// \todo Emit the signals only if it changed
{
val.i_int = 0;
var_Change( p_input, "chapter", VLC_VAR_CHOICESCOUNT, &val, NULL );
{
val.i_int = 0;
var_Change( p_input, "chapter", VLC_VAR_CHOICESCOUNT, &val, NULL );
+ emit navigationChanged( (val.i_int > 0) ? 1 : 2 );
+ /*if( val.i_int > 0 )
{
emit navigationChanged( 1 ); // 1 = chapter, 2 = title, 0 = NO
}
else
{
emit navigationChanged( 2 );
{
emit navigationChanged( 1 ); // 1 = chapter, 2 = title, 0 = NO
}
else
{
emit navigationChanged( 2 );
void InputManager::sliderUpdate( float new_pos )
{
void InputManager::sliderUpdate( float new_pos )
{
- if( hasInput() )
- var_SetFloat( p_input, "position", new_pos );
+ if( hasInput() ) var_SetFloat( p_input, "position", new_pos );
}
void InputManager::togglePlayPause()
{
vlc_value_t state;
var_Get( p_input, "state", &state );
}
void InputManager::togglePlayPause()
{
vlc_value_t state;
var_Get( p_input, "state", &state );
- if( state.i_int != PAUSE_S )
- {
+ state.i_int = ( ( state.i_int != PAUSE_S ) ? PAUSE_S : PLAYING_S );
+ /*{
/* A stream is being played, pause it */
/* A stream is being played, pause it */
+ /* state.i_int = PAUSE_S;
}
else
{
/* Stream is paused, resume it */
}
else
{
/* Stream is paused, resume it */
- state.i_int = PLAYING_S;
- }
+ /*state.i_int = PLAYING_S;
+ }*/
var_Set( p_input, "state", state );
emit statusChanged( state.i_int );
}
var_Set( p_input, "state", state );
emit statusChanged( state.i_int );
}
bool hasVideo() { return b_has_video; }
bool b_has_audio, b_has_video, b_had_audio, b_had_video;
private:
bool hasVideo() { return b_has_video; }
bool b_has_audio, b_has_video, b_had_audio, b_had_video;
private:
- int i_old_playing_status;
- QString old_name;
- int i_rate;
+ int i_old_playing_status;
+ QString old_name;
+ int i_rate;
public slots:
void togglePlayPause();
void update(); ///< Periodic updates
public slots:
void togglePlayPause();
void update(); ///< Periodic updates
InputManager *getIM() { return im; };
private:
InputManager *getIM() { return im; };
private:
- InputManager *im;
- intf_thread_t *p_intf;
- input_thread_t *p_input;
- static MainInputManager *instance;
MainInputManager( intf_thread_t *);
MainInputManager( intf_thread_t *);
+
+ InputManager *im;
+ intf_thread_t *p_intf;
+ input_thread_t *p_input;
+ static MainInputManager *instance;
public slots:
void togglePlayPause();
void stop();
public slots:
void togglePlayPause();
void stop();
void inputChanged( input_thread_t *);
};
void inputChanged( input_thread_t *);
};
MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
{
/* Variables initialisation */
MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
{
/* Variables initialisation */
- need_components_update = false;
+ // need_components_update = false;
bgWidget = NULL; videoWidget = NULL; playlistWidget = NULL;
bgWidget = NULL; videoWidget = NULL; playlistWidget = NULL;
- embeddedPlaylistWasActive = videoIsActive = false;
if( config_GetInt( p_intf, "privacy-ask") )
{
QList<ConfigControl *> controls;
if( config_GetInt( p_intf, "privacy-ask") )
{
QList<ConfigControl *> controls;
- privacyDialog( controls );
-
- QList<ConfigControl *>::Iterator i;
- for( i = controls.begin() ; i != controls.end() ; i++ )
+ if( privacyDialog( controls ) == QDialog::Accepted )
- ConfigControl *c = qobject_cast<ConfigControl *>(*i);
- c->doApply( p_intf );
- }
+ QList<ConfigControl *>::Iterator i;
+ for( i = controls.begin() ; i != controls.end() ; i++ )
+ {
+ ConfigControl *c = qobject_cast<ConfigControl *>(*i);
+ c->doApply( p_intf );
+ }
- config_PutInt( p_intf, "privacy-ask" , 0 );
- config_SaveConfigFile( p_intf, NULL );
+ config_PutInt( p_intf, "privacy-ask" , 0 );
+ config_SaveConfigFile( p_intf, NULL );
+ }
/* Set The Video In emebedded Mode or not */
videoEmbeddedFlag = false;
/* Set The Video In emebedded Mode or not */
videoEmbeddedFlag = false;
- if( config_GetInt( p_intf, "embedded-video" ) )
- videoEmbeddedFlag = true;
+ if( config_GetInt( p_intf, "embedded-video" ) ) videoEmbeddedFlag = true;
+ /* Are we in the enhanced always-video mode or not ? */
alwaysVideoFlag = false;
if( videoEmbeddedFlag && config_GetInt( p_intf, "qt-always-video" ) )
alwaysVideoFlag = true;
/* Set the other interface settings */
alwaysVideoFlag = false;
if( videoEmbeddedFlag && config_GetInt( p_intf, "qt-always-video" ) )
alwaysVideoFlag = true;
/* Set the other interface settings */
- visualSelectorEnabled = settings->value( "visual-selector", false ).toBool();
+ //FIXME I don't like that code
+ visualSelectorEnabled = settings->value( "visual-selector", false ).toBool();
notificationEnabled = config_GetInt( p_intf, "qt-notification" )
? true : false;
notificationEnabled = config_GetInt( p_intf, "qt-notification" )
? true : false;
/* Create a Dock to get the playlist */
dockPL = new QDockWidget( qtr("Playlist"), this );
/* Create a Dock to get the playlist */
dockPL = new QDockWidget( qtr("Playlist"), this );
- dockPL->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::MinimumExpanding );
+ dockPL->setSizePolicy( QSizePolicy::Preferred,
+ QSizePolicy::MinimumExpanding );
dockPL->setFeatures( QDockWidget::AllDockWidgetFeatures );
dockPL->setAllowedAreas( Qt::LeftDockWidgetArea
| Qt::RightDockWidgetArea
dockPL->setFeatures( QDockWidget::AllDockWidgetFeatures );
dockPL->setAllowedAreas( Qt::LeftDockWidgetArea
| Qt::RightDockWidgetArea
/* Init input manager */
MainInputManager::getInstance( p_intf );
ON_TIMEOUT( updateOnTimer() );
/* Init input manager */
MainInputManager::getInstance( p_intf );
ON_TIMEOUT( updateOnTimer() );
- //ON_TIMEOUT( debug() );
+ //ON_TIMEOUT( debug() ):;
/********************
* Various CONNECTs *
/********************
* Various CONNECTs *
updateGeometry();
settings->endGroup();
}
updateGeometry();
settings->endGroup();
}
void MainInterface::handleMainUi( QSettings *settings )
{
/* Create the main Widget and the mainLayout */
void MainInterface::handleMainUi( QSettings *settings )
{
/* Create the main Widget and the mainLayout */
- QWidget *main = new QWidget( this );
- mainLayout = new QVBoxLayout( main );
+ QWidget *main = new QWidget;
setCentralWidget( main );
setCentralWidget( main );
+ mainLayout = new QVBoxLayout( main );
/* Margins, spacing */
main->setContentsMargins( 0, 0, 0, 0 );
mainLayout->setMargin( 0 );
/* Create the CONTROLS Widget */
/* Margins, spacing */
main->setContentsMargins( 0, 0, 0, 0 );
mainLayout->setMargin( 0 );
/* Create the CONTROLS Widget */
- bool b_shiny = config_GetInt( p_intf, "qt-blingbling" );
- controls = new ControlsWidget( p_intf,
+ /* bool b_shiny = config_GetInt( p_intf, "qt-blingbling" ); */
+ controls = new ControlsWidget( p_intf, this,
settings->value( "adv-controls", false ).toBool(),
settings->value( "adv-controls", false ).toBool(),
- b_shiny );
-
- /* Configure the Controls, the playlist button doesn't trigger THEDP
- but the toggle from this MainInterface */
- BUTTONACT( controls->playlistButton, togglePlaylist() );
+ config_GetInt( p_intf, "qt-blingbling" ) );
/* Add the controls Widget to the main Widget */
/* Add the controls Widget to the main Widget */
- mainLayout->addWidget( controls );
+ mainLayout->insertWidget( 0, controls );
/* Create the Speed Control Widget */
speedControl = new SpeedControlWidget( p_intf );
speedControlMenu = new QMenu( this );
/* Create the Speed Control Widget */
speedControl = new SpeedControlWidget( p_intf );
speedControlMenu = new QMenu( this );
- QWidgetAction *widgetAction = new QWidgetAction( this );
+
+ QWidgetAction *widgetAction = new QWidgetAction( speedControl );
widgetAction->setDefaultWidget( speedControl );
speedControlMenu->addAction( widgetAction );
widgetAction->setDefaultWidget( speedControl );
speedControlMenu->addAction( widgetAction );
{
bgWidget = new BackgroundWidget( p_intf );
bgWidget->widgetSize = settings->value( "backgroundSize",
{
bgWidget = new BackgroundWidget( p_intf );
bgWidget->widgetSize = settings->value( "backgroundSize",
- QSize( 300, 300 ) ).toSize();
+ QSize( 300, 200 ) ).toSize();
bgWidget->resize( bgWidget->widgetSize );
bgWidget->updateGeometry();
mainLayout->insertWidget( 0, bgWidget );
bgWidget->resize( bgWidget->widgetSize );
bgWidget->updateGeometry();
mainLayout->insertWidget( 0, bgWidget );
-void MainInterface::privacyDialog( QList<ConfigControl *> controls )
+int MainInterface::privacyDialog( QList<ConfigControl *> controls )
{
QDialog *privacy = new QDialog( this );
{
QDialog *privacy = new QDialog( this );
gLayout->addWidget( ok, 2, 2 );
CONNECT( ok, clicked(), privacy, accept() );
gLayout->addWidget( ok, 2, 2 );
CONNECT( ok, clicked(), privacy, accept() );
+ return privacy->exec();
}
//FIXME remove me at the end...
}
//FIXME remove me at the end...
-/* This is dead code and need to be removed AT THE END */
+/* FIXME This is dead code and need to be removed AT THE END */
void MainInterface::resizeEvent( QResizeEvent *e )
{
if( videoWidget )
void MainInterface::resizeEvent( QResizeEvent *e )
{
if( videoWidget )
void MainInterface::toggleTimeDisplay()
{
void MainInterface::toggleTimeDisplay()
{
- b_remainingTime = ( b_remainingTime ? false : true );
+ b_remainingTime = !b_remainingTime;
+ //b_remainingTime = ( b_remainingTime ? false : true );
}
void MainInterface::setName( QString name )
}
void MainInterface::setName( QString name )
speedControl->updateControls( rate );
}
speedControl->updateControls( rate );
}
+//FIXME Remove this function at the end...
void MainInterface::updateOnTimer()
{
void MainInterface::updateOnTimer()
{
- /* \todo Make this event-driven */
- if( intf_ShouldDie( p_intf ) )
+ /* if( intf_ShouldDie( p_intf ) )
{
QApplication::closeAllWindows();
QApplication::quit();
{
QApplication::closeAllWindows();
QApplication::quit();
#if 0
if( need_components_update )
{
#if 0
if( need_components_update )
{
*/
void MainInterface::toggleUpdateSystrayMenu()
{
*/
void MainInterface::toggleUpdateSystrayMenu()
{
+ /* If hidden, show it */
if( isHidden() )
{
show();
if( isHidden() )
{
show();
}
else if( isMinimized() )
{
}
else if( isMinimized() )
{
showNormal();
activateWindow();
}
else
{
showNormal();
activateWindow();
}
else
{
#ifdef WIN32
/* check if any visible window is above vlc in the z-order,
* but ignore the ones always on top */
#ifdef WIN32
/* check if any visible window is above vlc in the z-order,
* but ignore the ones always on top */
case QSystemTrayIcon::MiddleClick:
sysTray->showMessage( qtr( "VLC media player" ),
qtr( "Control menu for the player" ),
case QSystemTrayIcon::MiddleClick:
sysTray->showMessage( qtr( "VLC media player" ),
qtr( "Control menu for the player" ),
- QSystemTrayIcon::Information, 4000 );
+ QSystemTrayIcon::Information, 3000 );
if( notificationEnabled && ( isHidden() || isMinimized() ) )
{
sysTray->showMessage( qtr( "VLC media player" ), name,
if( notificationEnabled && ( isHidden() || isMinimized() ) )
{
sysTray->showMessage( qtr( "VLC media player" ), name,
- QSystemTrayIcon::NoIcon, 4000 );
+ QSystemTrayIcon::NoIcon, 3000 );
switch( i_status )
{
case 0:
switch( i_status )
{
case 0:
{
sysTray->setToolTip( qtr( "VLC media player" ) );
break;
{
sysTray->setToolTip( qtr( "VLC media player" ) );
break;
{
hide();
vlc_object_kill( p_intf );
{
hide();
vlc_object_kill( p_intf );
+ QApplication::closeAllWindows();
+ QApplication::quit();
}
/*****************************************************************************
}
/*****************************************************************************
void handleSystray();
void createSystray();
void handleSystray();
void createSystray();
- void privacyDialog( QList<ConfigControl *> controls );
+ int privacyDialog( QList<ConfigControl *> controls );
/* Video */
VideoWidget *videoWidget;
virtual void keyPressEvent( QKeyEvent *);
virtual void wheelEvent( QWheelEvent * );
/* Video */
VideoWidget *videoWidget;
virtual void keyPressEvent( QKeyEvent *);
virtual void wheelEvent( QWheelEvent * );
- bool embeddedPlaylistWasActive;
bool videoIsActive;
QSize savedVideoSize;
bool videoIsActive;
QSize savedVideoSize;