Commit de1210ab authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: Fixing main Interface, phase 1.

Removes a lot of hacks, especially around manipulating size (no more sizeHint(), very limited use of doComponentsUpdate and updateGeometry() ),
Simplify the number of starting options of the interface
Fixes crashes due to QStackWidget limitations
Still a lot of debug around, but mostly commented out, that will go in future commits
Close #3401
Close #3210
Close #3332
Close #1717
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent b20a3618
...@@ -314,6 +314,9 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) ...@@ -314,6 +314,9 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
CONNECT( THEMIM->getIM(), artChanged( QString ), CONNECT( THEMIM->getIM(), artChanged( QString ),
this, updateArt( const QString& ) ); this, updateArt( const QString& ) );
/* Start Hidden */
label->hide();
} }
void BackgroundWidget::resizeEvent( QResizeEvent * event ) void BackgroundWidget::resizeEvent( QResizeEvent * event )
......
/***************************************************************************** /*****************************************************************************
* playlist.cpp : Custom widgets for the playlist * playlist.cpp : Custom widgets for the playlist
**************************************************************************** ****************************************************************************
* Copyright © 2007-2008 the VideoLAN team * Copyright © 2007-2010 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Clément Stenac <zorglub@videolan.org> * Authors: Clément Stenac <zorglub@videolan.org>
...@@ -117,7 +117,6 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par ) ...@@ -117,7 +117,6 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
/* In case we want to keep the splitter informations */ /* In case we want to keep the splitter informations */
// components shall never write there setting to a fixed location, may infer // components shall never write there setting to a fixed location, may infer
// with other uses of the same component... // with other uses of the same component...
// getSettings()->beginGroup( "playlist" );
getSettings()->beginGroup("Playlist"); getSettings()->beginGroup("Playlist");
restoreState( getSettings()->value("splitterSizes").toByteArray()); restoreState( getSettings()->value("splitterSizes").toByteArray());
leftSplitter->restoreState( getSettings()->value("leftSplitterGeometry").toByteArray() ); leftSplitter->restoreState( getSettings()->value("leftSplitterGeometry").toByteArray() );
...@@ -161,3 +160,17 @@ void PlaylistWidget::closeEvent( QCloseEvent *event ) ...@@ -161,3 +160,17 @@ void PlaylistWidget::closeEvent( QCloseEvent *event )
event->ignore(); event->ignore();
} }
} }
void PlaylistWidget::forceHide()
{
leftSplitter->hide();
rightPanel->hide();
updateGeometry();
}
void PlaylistWidget::forceShow()
{
leftSplitter->show();
rightPanel->show();
updateGeometry();
}
...@@ -46,7 +46,7 @@ class ArtLabel : public CoverArtLabel ...@@ -46,7 +46,7 @@ class ArtLabel : public CoverArtLabel
{ {
public: public:
ArtLabel( QWidget *parent, intf_thread_t *intf ) ArtLabel( QWidget *parent, intf_thread_t *intf )
: CoverArtLabel( parent, intf ) {}; : CoverArtLabel( parent, intf ) {}
virtual void mouseDoubleClickEvent( QMouseEvent *event ) virtual void mouseDoubleClickEvent( QMouseEvent *event )
{ {
...@@ -61,6 +61,8 @@ class PlaylistWidget : public QSplitter ...@@ -61,6 +61,8 @@ class PlaylistWidget : public QSplitter
public: public:
PlaylistWidget( intf_thread_t *_p_i, QWidget * ); PlaylistWidget( intf_thread_t *_p_i, QWidget * );
virtual ~PlaylistWidget(); virtual ~PlaylistWidget();
void forceHide();
void forceShow();
private: private:
PLSelector *selector; PLSelector *selector;
ArtLabel *art; ArtLabel *art;
...@@ -72,6 +74,7 @@ protected: ...@@ -72,6 +74,7 @@ protected:
virtual void dropEvent( QDropEvent *); virtual void dropEvent( QDropEvent *);
virtual void dragEnterEvent( QDragEnterEvent * ); virtual void dragEnterEvent( QDragEnterEvent * );
virtual void closeEvent( QCloseEvent * ); virtual void closeEvent( QCloseEvent * );
}; };
#endif #endif
This diff is collapsed.
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "util/qvlcframe.hpp" #include "util/qvlcframe.hpp"
#include "components/preferences_widgets.hpp" /* First Start */ #include "components/preferences_widgets.hpp" /* First Start */
#ifdef WIN32 #ifdef WIN32
#include <vlc_windows_interfaces.h> #include <vlc_windows_interfaces.h>
#endif #endif
...@@ -87,7 +88,7 @@ public: ...@@ -87,7 +88,7 @@ public:
bool isPlDocked() { return ( b_plDocked != false ); } bool isPlDocked() { return ( b_plDocked != false ); }
/* Sizehint() */ /* Sizehint() */
virtual QSize sizeHint() const; // virtual QSize sizeHint() const;
protected: protected:
void dropEventPlay( QDropEvent *, bool); void dropEventPlay( QDropEvent *, bool);
...@@ -116,11 +117,10 @@ private: ...@@ -116,11 +117,10 @@ private:
void initSystray(); void initSystray();
/* Mess about stackWidget */ /* Mess about stackWidget */
void showTab( int i_tab ); void showTab( QWidget *);
void showVideo();
void showBg();
void restoreStackOldWidget(); void restoreStackOldWidget();
void showVideo() { showTab( VIDEO_TAB ); }
void showBg() { showTab( BACKG_TAB ); }
void hideStackWidget() { showTab( HIDDEN_TAB ); }
/* */ /* */
QSettings *settings; QSettings *settings;
...@@ -133,27 +133,21 @@ private: ...@@ -133,27 +133,21 @@ private:
ControlsWidget *controls; ControlsWidget *controls;
InputControlsWidget *inputC; InputControlsWidget *inputC;
FullscreenControllerWidget *fullscreenControls; FullscreenControllerWidget *fullscreenControls;
/* Widgets */
QStackedWidget *stackCentralW; QStackedWidget *stackCentralW;
/* Video */
VideoWidget *videoWidget; VideoWidget *videoWidget;
BackgroundWidget *bgWidget; BackgroundWidget *bgWidget;
VisualSelector *visualSelector;
PlaylistWidget *playlistWidget; PlaylistWidget *playlistWidget;
//VisualSelector *visualSelector;
/* Status Bar */ /* Status Bar */
QLabel *nameLabel; QLabel *nameLabel;
QLabel *cryptedLabel; QLabel *cryptedLabel;
/* Status and flags */ /* Status and flags */
enum { QWidget *stackCentralOldWidget;
HIDDEN_TAB = -1,
BACKG_TAB = 0,
VIDEO_TAB = 1,
PLAYL_TAB = 2,
};
int stackCentralOldState;
/* Flags */ /* Flags */
bool b_notificationEnabled; /// Systray Notifications bool b_notificationEnabled; /// Systray Notifications
...@@ -180,7 +174,6 @@ private: ...@@ -180,7 +174,6 @@ private:
#endif #endif
public slots: public slots:
void undockPlaylist();
void dockPlaylist( bool b_docked = true ); void dockPlaylist( bool b_docked = true );
void toggleMinimalView( bool ); void toggleMinimalView( bool );
void togglePlaylist(); void togglePlaylist();
......
...@@ -437,10 +437,6 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, ...@@ -437,10 +437,6 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
qtr( "Play&list" ), mi, qtr( "Play&list" ), mi,
SLOT( togglePlaylist() ), qtr( "Ctrl+L" ) ); SLOT( togglePlaylist() ), qtr( "Ctrl+L" ) );
/*menu->addSeparator();
menu->addAction( qtr( "Undock from Interface" ), mi,
SLOT( undockPlaylist() ), qtr( "Ctrl+U" ) );*/
menu->addSeparator(); menu->addSeparator();
if( with_intf ) if( with_intf )
......
...@@ -150,10 +150,6 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * ); ...@@ -150,10 +150,6 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
"as lyrics, album arts...\n" \ "as lyrics, album arts...\n" \
" - minimal mode with limited controls" ) " - minimal mode with limited controls" )
#define QT_NORMAL_MODE_TEXT N_( "Classic" )
#define QT_ALWAYS_VIDEO_MODE_TEXT N_( "Complete (with information area)" )
#define QT_MINIMAL_MODE_TEXT N_( "Minimal (without menu)" )
#define QT_FULLSCREEN_TEXT N_( "Show a controller in fullscreen mode" ) #define QT_FULLSCREEN_TEXT N_( "Show a controller in fullscreen mode" )
#define QT_NATIVEOPEN_TEXT N_( "Embed the file browser in open dialog" ) #define QT_NATIVEOPEN_TEXT N_( "Embed the file browser in open dialog" )
...@@ -165,12 +161,7 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * ); ...@@ -165,12 +161,7 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
#define QT_AUTOLOAD_EXTENSIONS_LONGTEXT N_( "Automatically load the "\ #define QT_AUTOLOAD_EXTENSIONS_LONGTEXT N_( "Automatically load the "\
"extensions module on startup" ) "extensions module on startup" )
/* Various modes definition */ #define QT_MINIMAL_MODE_TEXT N_("Start in minimal view (without menus)" )
static const int i_mode_list[] =
{ QT_NORMAL_MODE, QT_ALWAYS_VIDEO_MODE, QT_MINIMAL_MODE };
static const char *const psz_mode_list_text[] =
{ QT_NORMAL_MODE_TEXT, QT_ALWAYS_VIDEO_MODE_TEXT, QT_MINIMAL_MODE_TEXT };
/**********************************************************************/ /**********************************************************************/
vlc_module_begin () vlc_module_begin ()
...@@ -182,9 +173,9 @@ vlc_module_begin () ...@@ -182,9 +173,9 @@ vlc_module_begin ()
set_callbacks( OpenIntf, Close ) set_callbacks( OpenIntf, Close )
add_shortcut("qt") add_shortcut("qt")
add_integer( "qt-display-mode", QT_NORMAL_MODE, NULL,
QT_MODE_TEXT, QT_MODE_LONGTEXT, false ) add_bool( "qt-minimal-view", false, NULL, QT_MINIMAL_MODE_TEXT,
change_integer_list( i_mode_list, psz_mode_list_text, NULL ) QT_MINIMAL_MODE_TEXT, false );
add_bool( "qt-notification", true, NULL, NOTIFICATION_TEXT, add_bool( "qt-notification", true, NULL, NOTIFICATION_TEXT,
NOTIFICATION_LONGTEXT, false ) NOTIFICATION_LONGTEXT, false )
...@@ -245,6 +236,7 @@ vlc_module_begin () ...@@ -245,6 +236,7 @@ vlc_module_begin ()
false ) false )
add_obsolete_bool( "qt-blingbling" ) /* Suppressed since 1.0.0 */ add_obsolete_bool( "qt-blingbling" ) /* Suppressed since 1.0.0 */
add_obsolete_integer( "qt-display-mode" ) /* Suppressed since 1.1.0 */
#ifdef WIN32 #ifdef WIN32
linked_with_a_crap_library_which_uses_atexit() linked_with_a_crap_library_which_uses_atexit()
......
...@@ -45,12 +45,6 @@ ...@@ -45,12 +45,6 @@
#define HAS_QT45 ( QT_VERSION >= 0x040500 ) #define HAS_QT45 ( QT_VERSION >= 0x040500 )
enum {
QT_NORMAL_MODE = 0,
QT_ALWAYS_VIDEO_MODE,
QT_MINIMAL_MODE
};
enum { enum {
DialogEventType = 0, DialogEventType = 0,
IMEventType = 100, IMEventType = 100,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment