Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
84a974e6
Commit
84a974e6
authored
Feb 24, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: undock the playlist
Ref #3332 Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
9ab96188
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
42 deletions
+58
-42
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+48
-31
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+4
-11
modules/gui/qt4/menus.cpp
modules/gui/qt4/menus.cpp
+6
-0
No files found.
modules/gui/qt4/main_interface.cpp
View file @
84a974e6
/*****************************************************************************
/*****************************************************************************
* main_interface.cpp : Main interface
* main_interface.cpp : Main interface
****************************************************************************
****************************************************************************
* Copyright (C) 2006-20
09 the VideoLAN team
* Copyright (C) 2006-20
10 VideoLAN and AUTHORS
* $Id$
* $Id$
*
*
* Authors: Clément Stenac <zorglub@videolan.org>
* Authors: Clément Stenac <zorglub@videolan.org>
...
@@ -72,7 +72,8 @@
...
@@ -72,7 +72,8 @@
#include <vlc_vout_window.h>
#include <vlc_vout_window.h>
#include <vlc_vout_display.h>
#include <vlc_vout_display.h>
// #define DEBUG_INTF
//#define DEBUG_INTF
/* Callback prototypes */
/* Callback prototypes */
static
int
PopupMenuCB
(
vlc_object_t
*
p_this
,
const
char
*
psz_variable
,
static
int
PopupMenuCB
(
vlc_object_t
*
p_this
,
const
char
*
psz_variable
,
vlc_value_t
old_val
,
vlc_value_t
new_val
,
void
*
param
);
vlc_value_t
old_val
,
vlc_value_t
new_val
,
void
*
param
);
...
@@ -130,6 +131,10 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
...
@@ -130,6 +131,10 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
settings
=
getSettings
();
settings
=
getSettings
();
settings
->
beginGroup
(
"MainWindow"
);
settings
->
beginGroup
(
"MainWindow"
);
/* */
b_plDocked
=
getSettings
()
->
value
(
"pl-dock-status"
,
true
).
toBool
();
/**
/**
* Retrieve saved sizes for main window
* Retrieve saved sizes for main window
* mainBasedSize = based window size for normal mode
* mainBasedSize = based window size for normal mode
...
@@ -305,7 +310,7 @@ MainInterface::~MainInterface()
...
@@ -305,7 +310,7 @@ MainInterface::~MainInterface()
/* Save playlist state */
/* Save playlist state */
if
(
playlistWidget
)
if
(
playlistWidget
)
{
{
if
(
!
isDocked
()
)
if
(
!
is
Pl
Docked
()
)
QVLCTools
::
saveWidgetPosition
(
p_intf
,
"Playlist"
,
playlistWidget
);
QVLCTools
::
saveWidgetPosition
(
p_intf
,
"Playlist"
,
playlistWidget
);
delete
playlistWidget
;
delete
playlistWidget
;
...
@@ -330,7 +335,7 @@ MainInterface::~MainInterface()
...
@@ -330,7 +335,7 @@ MainInterface::~MainInterface()
/* Save states */
/* Save states */
settings
->
beginGroup
(
"MainWindow"
);
settings
->
beginGroup
(
"MainWindow"
);
settings
->
setValue
(
"pl-dock-status"
,
(
int
)
i_pl_dock
);
settings
->
setValue
(
"pl-dock-status"
,
b_plDocked
);
settings
->
setValue
(
"playlist-visible"
,
(
int
)
playlistVisible
);
settings
->
setValue
(
"playlist-visible"
,
(
int
)
playlistVisible
);
settings
->
setValue
(
"adv-controls"
,
settings
->
setValue
(
"adv-controls"
,
getControlsVisibilityStatus
()
&
CONTROLS_ADVANCED
);
getControlsVisibilityStatus
()
&
CONTROLS_ADVANCED
);
...
@@ -765,7 +770,7 @@ void MainInterface::doComponentsUpdate()
...
@@ -765,7 +770,7 @@ void MainInterface::doComponentsUpdate()
/* Here we resize to sizeHint() and not adjustsize because we want
/* Here we resize to sizeHint() and not adjustsize because we want
the videoWidget to be exactly the correctSize */
the videoWidget to be exactly the correctSize */
#if
ndef NDEBUG
#if
def DEBUG_INTF
debug
();
debug
();
#endif
#endif
/* This is WRONG, but I believe there is a Qt bug here */
/* This is WRONG, but I believe there is a Qt bug here */
...
@@ -777,7 +782,7 @@ void MainInterface::doComponentsUpdate()
...
@@ -777,7 +782,7 @@ void MainInterface::doComponentsUpdate()
void
MainInterface
::
debug
()
void
MainInterface
::
debug
()
{
{
#if
ndef NDEBUG
#if
def DEBUG_INTF
msg_Dbg
(
p_intf
,
"Stack Size: %i - %i"
,
stackCentralW
->
size
().
height
(),
size
().
width
()
);
msg_Dbg
(
p_intf
,
"Stack Size: %i - %i"
,
stackCentralW
->
size
().
height
(),
size
().
width
()
);
if
(
videoEmbeddedFlag
)
if
(
videoEmbeddedFlag
)
msg_Dbg
(
p_intf
,
"Stack Size: %i - %i"
,
msg_Dbg
(
p_intf
,
"Stack Size: %i - %i"
,
...
@@ -994,15 +999,11 @@ int MainInterface::controlVideo( int i_query, va_list args )
...
@@ -994,15 +999,11 @@ int MainInterface::controlVideo( int i_query, va_list args )
/**
/**
* Toggle the playlist widget or dialog
* Toggle the playlist widget or dialog
**/
**/
void
MainInterface
::
createPlaylist
(
bool
b_show
)
void
MainInterface
::
createPlaylist
()
{
{
playlistWidget
=
new
PlaylistWidget
(
p_intf
,
this
);
playlistWidget
=
new
PlaylistWidget
(
p_intf
,
this
);
i_pl_dock
=
PL_BOTTOM
;
if
(
!
b_plDocked
)
/* i_pl_dock = (pl_dock_e)getSettings()
->value( "pl-dock-status", PL_UNDOCKED ).toInt(); */
if
(
i_pl_dock
==
PL_UNDOCKED
)
{
{
playlistWidget
->
setWindowFlags
(
Qt
::
Window
);
playlistWidget
->
setWindowFlags
(
Qt
::
Window
);
...
@@ -1014,35 +1015,28 @@ void MainInterface::createPlaylist( bool b_show )
...
@@ -1014,35 +1015,28 @@ void MainInterface::createPlaylist( bool b_show )
else
else
{
{
#ifdef DEBUG_INTF
#ifdef DEBUG_INTF
msg_Warn
(
p_intf
,
"Here %i"
,
stackCentralW
->
currentIndex
()
);
msg_Warn
(
p_intf
,
"Here
1
%i"
,
stackCentralW
->
currentIndex
()
);
#endif
#endif
stackCentralW
->
insertWidget
(
PLAYL_TAB
,
playlistWidget
);
stackCentralW
->
insertWidget
(
PLAYL_TAB
,
playlistWidget
);
#ifdef DEBUG_INTF
#ifdef DEBUG_INTF
msg_Warn
(
p_intf
,
"Here %i"
,
stackCentralW
->
currentIndex
()
);
msg_Warn
(
p_intf
,
"Here
2
%i"
,
stackCentralW
->
currentIndex
()
);
#endif
#endif
}
}
if
(
b_show
)
{
playlistVisible
=
true
;
stackCentralW
->
show
();
}
}
}
void
MainInterface
::
togglePlaylist
()
void
MainInterface
::
togglePlaylist
()
{
{
#ifdef DEBUG_INTF
#ifdef DEBUG_INTF
msg_Warn
(
p_intf
,
"Here toggling %i %i"
,
stackCentralW
->
currentIndex
(),
stackCentralOldState
);
msg_Warn
(
p_intf
,
"Here toggling
1
%i %i"
,
stackCentralW
->
currentIndex
(),
stackCentralOldState
);
#endif
#endif
if
(
!
playlistWidget
)
if
(
!
playlistWidget
)
{
createPlaylist
();
createPlaylist
(
true
);
}
#ifdef DEBUG_INTF
#ifdef DEBUG_INTF
msg_Warn
(
p_intf
,
"Here toggling %i %i"
,
stackCentralW
->
currentIndex
(),
stackCentralOldState
);
msg_Warn
(
p_intf
,
"Here toggling
2
%i %i"
,
stackCentralW
->
currentIndex
(),
stackCentralOldState
);
#endif
#endif
if
(
i_pl_dock
!=
PL_UNDOCKED
)
if
(
b_plDocked
)
{
{
/* Playlist not visible */
/* Playlist not visible */
if
(
stackCentralW
->
currentIndex
()
!=
PLAYL_TAB
)
if
(
stackCentralW
->
currentIndex
()
!=
PLAYL_TAB
)
...
@@ -1057,17 +1051,40 @@ void MainInterface::togglePlaylist()
...
@@ -1057,17 +1051,40 @@ void MainInterface::togglePlaylist()
playlistVisible
=
(
stackCentralW
->
currentIndex
()
==
PLAYL_TAB
);
playlistVisible
=
(
stackCentralW
->
currentIndex
()
==
PLAYL_TAB
);
//doComponentsUpdate(); //resize( sizeHint() );
//doComponentsUpdate(); //resize( sizeHint() );
}
}
else
{
playlistWidget
->
setWindowFlags
(
Qt
::
Window
);
playlistVisible
=
!
playlistVisible
;
playlistWidget
->
setVisible
(
playlistVisible
);
}
}
}
/* Function called from the menu to undock the playlist */
void
MainInterface
::
dockPlaylist
(
bool
p_docked
)
void
MainInterface
::
undockPlaylist
()
{
{
// dockPL->setFloating( true );
b_plDocked
=
p_docked
;
// adjustSize();
if
(
!
playlistWidget
)
return
;
/* Playlist wasn't created yet */
if
(
!
p_docked
)
{
stackCentralW
->
removeWidget
(
playlistWidget
);
playlistWidget
->
setWindowFlags
(
Qt
::
Window
);
QVLCTools
::
restoreWidgetPosition
(
p_intf
,
"Playlist"
,
playlistWidget
,
QSize
(
600
,
300
)
);
playlistWidget
->
show
();
stackCentralW
->
hide
();
doComponentsUpdate
();
}
else
{
stackCentralW
->
insertWidget
(
PLAYL_TAB
,
playlistWidget
);
stackCentralW
->
setCurrentWidget
(
playlistWidget
);
stackCentralW
->
show
();
}
}
}
void
MainInterface
::
dockPlaylist
(
pl_dock_e
i_pos
)
/* Function called from the menu to undock the playlist */
void
MainInterface
::
undockPlaylist
()
{
{
dockPlaylist
(
false
);
}
}
void
MainInterface
::
toggleMinimalView
(
bool
b_switch
)
void
MainInterface
::
toggleMinimalView
(
bool
b_switch
)
...
...
modules/gui/qt4/main_interface.hpp
View file @
84a974e6
...
@@ -62,13 +62,6 @@ enum {
...
@@ -62,13 +62,6 @@ enum {
};
};
typedef
enum
pl_dock_e
{
PL_UNDOCKED
,
PL_BOTTOM
,
PL_RIGHT
,
PL_LEFT
}
pl_dock_e
;
class
MainInterface
:
public
QVLCMW
class
MainInterface
:
public
QVLCMW
{
{
Q_OBJECT
;
Q_OBJECT
;
...
@@ -91,6 +84,7 @@ public:
...
@@ -91,6 +84,7 @@ public:
QMenu
*
getSysTrayMenu
()
{
return
systrayMenu
;
}
QMenu
*
getSysTrayMenu
()
{
return
systrayMenu
;
}
#endif
#endif
int
getControlsVisibilityStatus
();
int
getControlsVisibilityStatus
();
bool
isPlDocked
()
{
return
(
b_plDocked
!=
false
);
}
/* Sizehint() */
/* Sizehint() */
virtual
QSize
sizeHint
()
const
;
virtual
QSize
sizeHint
()
const
;
...
@@ -113,12 +107,12 @@ protected:
...
@@ -113,12 +107,12 @@ protected:
private:
private:
void
createMainWidget
(
QSettings
*
);
void
createMainWidget
(
QSettings
*
);
void
createStatusBar
();
void
createStatusBar
();
void
createPlaylist
();
/* Systray */
/* Systray */
void
handleSystray
();
void
handleSystray
();
void
createSystray
();
void
createSystray
();
void
initSystray
();
void
initSystray
();
bool
isDocked
()
{
return
(
i_pl_dock
!=
PL_UNDOCKED
);
}
void
showTab
(
int
i_tab
);
void
showTab
(
int
i_tab
);
void
restoreStackOldWidget
();
void
restoreStackOldWidget
();
...
@@ -167,7 +161,7 @@ private:
...
@@ -167,7 +161,7 @@ private:
QSize
mainBasedSize
;
///< based Wnd (normal mode only)
QSize
mainBasedSize
;
///< based Wnd (normal mode only)
QSize
mainVideoSize
;
///< Wnd with video (all modes)
QSize
mainVideoSize
;
///< Wnd with video (all modes)
int
i_visualmode
;
///< Visual Mode
int
i_visualmode
;
///< Visual Mode
pl_dock_e
i_pl_dock
;
bool
b_plDocked
;
int
i_bg_height
;
///< Save height of bgWidget
int
i_bg_height
;
///< Save height of bgWidget
bool
b_hideAfterCreation
;
bool
b_hideAfterCreation
;
...
@@ -177,11 +171,10 @@ private:
...
@@ -177,11 +171,10 @@ private:
UINT
taskbar_wmsg
;
UINT
taskbar_wmsg
;
void
createTaskBarButtons
();
void
createTaskBarButtons
();
#endif
#endif
void
createPlaylist
(
bool
);
public
slots
:
public
slots
:
void
undockPlaylist
();
void
undockPlaylist
();
void
dockPlaylist
(
pl_dock_e
i_pos
=
PL_BOTTOM
);
void
dockPlaylist
(
bool
b_docked
=
true
);
void
toggleMinimalView
(
bool
);
void
toggleMinimalView
(
bool
);
void
togglePlaylist
();
void
togglePlaylist
();
#ifndef HAVE_MAEMO
#ifndef HAVE_MAEMO
...
...
modules/gui/qt4/menus.cpp
View file @
84a974e6
...
@@ -474,6 +474,12 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
...
@@ -474,6 +474,12 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
if
(
mi
->
getControlsVisibilityStatus
()
&
CONTROLS_ADVANCED
)
if
(
mi
->
getControlsVisibilityStatus
()
&
CONTROLS_ADVANCED
)
action
->
setChecked
(
true
);
action
->
setChecked
(
true
);
/* Docked Playlist */
action
=
menu
->
addAction
(
qtr
(
"Docked Playlist"
)
);
action
->
setCheckable
(
true
);
action
->
setChecked
(
mi
->
isPlDocked
()
);
CONNECT
(
action
,
triggered
(
bool
),
mi
,
dockPlaylist
(
bool
)
);
if
(
with_intf
)
if
(
with_intf
)
// I don't want to manage consistency between menus, so no popup-menu
// I don't want to manage consistency between menus, so no popup-menu
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment