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 )
CONNECT( THEMIM->getIM(), artChanged( QString ),
this, updateArt( const QString& ) );
/* Start Hidden */
label->hide();
}
void BackgroundWidget::resizeEvent( QResizeEvent * event )
......
/*****************************************************************************
* playlist.cpp : Custom widgets for the playlist
****************************************************************************
* Copyright © 2007-2008 the VideoLAN team
* Copyright © 2007-2010 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
......@@ -117,7 +117,6 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
/* In case we want to keep the splitter informations */
// components shall never write there setting to a fixed location, may infer
// with other uses of the same component...
// getSettings()->beginGroup( "playlist" );
getSettings()->beginGroup("Playlist");
restoreState( getSettings()->value("splitterSizes").toByteArray());
leftSplitter->restoreState( getSettings()->value("leftSplitterGeometry").toByteArray() );
......@@ -161,3 +160,17 @@ void PlaylistWidget::closeEvent( QCloseEvent *event )
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
{
public:
ArtLabel( QWidget *parent, intf_thread_t *intf )
: CoverArtLabel( parent, intf ) {};
: CoverArtLabel( parent, intf ) {}
virtual void mouseDoubleClickEvent( QMouseEvent *event )
{
......@@ -61,6 +61,8 @@ class PlaylistWidget : public QSplitter
public:
PlaylistWidget( intf_thread_t *_p_i, QWidget * );
virtual ~PlaylistWidget();
void forceHide();
void forceShow();
private:
PLSelector *selector;
ArtLabel *art;
......@@ -72,6 +74,7 @@ protected:
virtual void dropEvent( QDropEvent *);
virtual void dragEnterEvent( QDragEnterEvent * );
virtual void closeEvent( QCloseEvent * );
};
#endif
This diff is collapsed.
......@@ -29,6 +29,7 @@
#include "util/qvlcframe.hpp"
#include "components/preferences_widgets.hpp" /* First Start */
#ifdef WIN32
#include <vlc_windows_interfaces.h>
#endif
......@@ -87,7 +88,7 @@ public:
bool isPlDocked() { return ( b_plDocked != false ); }
/* Sizehint() */
virtual QSize sizeHint() const;
// virtual QSize sizeHint() const;
protected:
void dropEventPlay( QDropEvent *, bool);
......@@ -116,11 +117,10 @@ private:
void initSystray();
/* Mess about stackWidget */
void showTab( int i_tab );
void showTab( QWidget *);
void showVideo();
void showBg();
void restoreStackOldWidget();
void showVideo() { showTab( VIDEO_TAB ); }
void showBg() { showTab( BACKG_TAB ); }
void hideStackWidget() { showTab( HIDDEN_TAB ); }
/* */
QSettings *settings;
......@@ -133,27 +133,21 @@ private:
ControlsWidget *controls;
InputControlsWidget *inputC;
FullscreenControllerWidget *fullscreenControls;
/* Widgets */
QStackedWidget *stackCentralW;
/* Video */
VideoWidget *videoWidget;
BackgroundWidget *bgWidget;
VisualSelector *visualSelector;
PlaylistWidget *playlistWidget;
//VisualSelector *visualSelector;
/* Status Bar */
QLabel *nameLabel;
QLabel *cryptedLabel;
/* Status and flags */
enum {
HIDDEN_TAB = -1,
BACKG_TAB = 0,
VIDEO_TAB = 1,
PLAYL_TAB = 2,
};
int stackCentralOldState;
QWidget *stackCentralOldWidget;
/* Flags */
bool b_notificationEnabled; /// Systray Notifications
......@@ -180,7 +174,6 @@ private:
#endif
public slots:
void undockPlaylist();
void dockPlaylist( bool b_docked = true );
void toggleMinimalView( bool );
void togglePlaylist();
......
......@@ -437,10 +437,6 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
qtr( "Play&list" ), mi,
SLOT( togglePlaylist() ), qtr( "Ctrl+L" ) );
/*menu->addSeparator();
menu->addAction( qtr( "Undock from Interface" ), mi,
SLOT( undockPlaylist() ), qtr( "Ctrl+U" ) );*/
menu->addSeparator();
if( with_intf )
......
......@@ -150,10 +150,6 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
"as lyrics, album arts...\n" \
" - 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_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 * );
#define QT_AUTOLOAD_EXTENSIONS_LONGTEXT N_( "Automatically load the "\
"extensions module on startup" )
/* Various modes definition */
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 };
#define QT_MINIMAL_MODE_TEXT N_("Start in minimal view (without menus)" )
/**********************************************************************/
vlc_module_begin ()
......@@ -182,9 +173,9 @@ vlc_module_begin ()
set_callbacks( OpenIntf, Close )
add_shortcut("qt")
add_integer( "qt-display-mode", QT_NORMAL_MODE, NULL,
QT_MODE_TEXT, QT_MODE_LONGTEXT, false )
change_integer_list( i_mode_list, psz_mode_list_text, NULL )
add_bool( "qt-minimal-view", false, NULL, QT_MINIMAL_MODE_TEXT,
QT_MINIMAL_MODE_TEXT, false );
add_bool( "qt-notification", true, NULL, NOTIFICATION_TEXT,
NOTIFICATION_LONGTEXT, false )
......@@ -245,6 +236,7 @@ vlc_module_begin ()
false )
add_obsolete_bool( "qt-blingbling" ) /* Suppressed since 1.0.0 */
add_obsolete_integer( "qt-display-mode" ) /* Suppressed since 1.1.0 */
#ifdef WIN32
linked_with_a_crap_library_which_uses_atexit()
......
......@@ -45,12 +45,6 @@
#define HAS_QT45 ( QT_VERSION >= 0x040500 )
enum {
QT_NORMAL_MODE = 0,
QT_ALWAYS_VIDEO_MODE,
QT_MINIMAL_MODE
};
enum {
DialogEventType = 0,
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