Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
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
Hide 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
****************************************************************************
* Copyright (C) 2006-20
09 the VideoLAN team
* Copyright (C) 2006-20
10 VideoLAN and AUTHORS
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
...
...
@@ -72,7 +72,8 @@
#include <vlc_vout_window.h>
#include <vlc_vout_display.h>
// #define DEBUG_INTF
//#define DEBUG_INTF
/* Callback prototypes */
static
int
PopupMenuCB
(
vlc_object_t
*
p_this
,
const
char
*
psz_variable
,
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 )
settings
=
getSettings
();
settings
->
beginGroup
(
"MainWindow"
);
/* */
b_plDocked
=
getSettings
()
->
value
(
"pl-dock-status"
,
true
).
toBool
();
/**
* Retrieve saved sizes for main window
* mainBasedSize = based window size for normal mode
...
...
@@ -305,7 +310,7 @@ MainInterface::~MainInterface()
/* Save playlist state */
if
(
playlistWidget
)
{
if
(
!
isDocked
()
)
if
(
!
is
Pl
Docked
()
)
QVLCTools
::
saveWidgetPosition
(
p_intf
,
"Playlist"
,
playlistWidget
);
delete
playlistWidget
;
...
...
@@ -330,7 +335,7 @@ MainInterface::~MainInterface()
/* Save states */
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
(
"adv-controls"
,
getControlsVisibilityStatus
()
&
CONTROLS_ADVANCED
);
...
...
@@ -765,7 +770,7 @@ void MainInterface::doComponentsUpdate()
/* Here we resize to sizeHint() and not adjustsize because we want
the videoWidget to be exactly the correctSize */
#if
ndef NDEBUG
#if
def DEBUG_INTF
debug
();
#endif
/* This is WRONG, but I believe there is a Qt bug here */
...
...
@@ -777,7 +782,7 @@ void MainInterface::doComponentsUpdate()
void
MainInterface
::
debug
()
{
#if
ndef NDEBUG
#if
def DEBUG_INTF
msg_Dbg
(
p_intf
,
"Stack Size: %i - %i"
,
stackCentralW
->
size
().
height
(),
size
().
width
()
);
if
(
videoEmbeddedFlag
)
msg_Dbg
(
p_intf
,
"Stack Size: %i - %i"
,
...
...
@@ -994,15 +999,11 @@ int MainInterface::controlVideo( int i_query, va_list args )
/**
* Toggle the playlist widget or dialog
**/
void
MainInterface
::
createPlaylist
(
bool
b_show
)
void
MainInterface
::
createPlaylist
()
{
playlistWidget
=
new
PlaylistWidget
(
p_intf
,
this
);
i_pl_dock
=
PL_BOTTOM
;
/* i_pl_dock = (pl_dock_e)getSettings()
->value( "pl-dock-status", PL_UNDOCKED ).toInt(); */
if
(
i_pl_dock
==
PL_UNDOCKED
)
if
(
!
b_plDocked
)
{
playlistWidget
->
setWindowFlags
(
Qt
::
Window
);
...
...
@@ -1014,35 +1015,28 @@ void MainInterface::createPlaylist( bool b_show )
else
{
#ifdef DEBUG_INTF
msg_Warn
(
p_intf
,
"Here %i"
,
stackCentralW
->
currentIndex
()
);
msg_Warn
(
p_intf
,
"Here
1
%i"
,
stackCentralW
->
currentIndex
()
);
#endif
stackCentralW
->
insertWidget
(
PLAYL_TAB
,
playlistWidget
);
#ifdef DEBUG_INTF
msg_Warn
(
p_intf
,
"Here %i"
,
stackCentralW
->
currentIndex
()
);
msg_Warn
(
p_intf
,
"Here
2
%i"
,
stackCentralW
->
currentIndex
()
);
#endif
}
if
(
b_show
)
{
playlistVisible
=
true
;
stackCentralW
->
show
();
}
}
void
MainInterface
::
togglePlaylist
()
{
#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
if
(
!
playlistWidget
)
{
createPlaylist
(
true
);
}
createPlaylist
();
#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
if
(
i_pl_dock
!=
PL_UNDOCKED
)
if
(
b_plDocked
)
{
/* Playlist not visible */
if
(
stackCentralW
->
currentIndex
()
!=
PLAYL_TAB
)
...
...
@@ -1057,17 +1051,40 @@ void MainInterface::togglePlaylist()
playlistVisible
=
(
stackCentralW
->
currentIndex
()
==
PLAYL_TAB
);
//doComponentsUpdate(); //resize( sizeHint() );
}
else
{
playlistWidget
->
setWindowFlags
(
Qt
::
Window
);
playlistVisible
=
!
playlistVisible
;
playlistWidget
->
setVisible
(
playlistVisible
);
}
}
/* Function called from the menu to undock the playlist */
void
MainInterface
::
undockPlaylist
()
void
MainInterface
::
dockPlaylist
(
bool
p_docked
)
{
// dockPL->setFloating( true );
// adjustSize();
b_plDocked
=
p_docked
;
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
)
...
...
modules/gui/qt4/main_interface.hpp
View file @
84a974e6
...
...
@@ -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
{
Q_OBJECT
;
...
...
@@ -91,6 +84,7 @@ public:
QMenu
*
getSysTrayMenu
()
{
return
systrayMenu
;
}
#endif
int
getControlsVisibilityStatus
();
bool
isPlDocked
()
{
return
(
b_plDocked
!=
false
);
}
/* Sizehint() */
virtual
QSize
sizeHint
()
const
;
...
...
@@ -113,12 +107,12 @@ protected:
private:
void
createMainWidget
(
QSettings
*
);
void
createStatusBar
();
void
createPlaylist
();
/* Systray */
void
handleSystray
();
void
createSystray
();
void
initSystray
();
bool
isDocked
()
{
return
(
i_pl_dock
!=
PL_UNDOCKED
);
}
void
showTab
(
int
i_tab
);
void
restoreStackOldWidget
();
...
...
@@ -167,7 +161,7 @@ private:
QSize
mainBasedSize
;
///< based Wnd (normal mode only)
QSize
mainVideoSize
;
///< Wnd with video (all modes)
int
i_visualmode
;
///< Visual Mode
pl_dock_e
i_pl_dock
;
bool
b_plDocked
;
int
i_bg_height
;
///< Save height of bgWidget
bool
b_hideAfterCreation
;
...
...
@@ -177,11 +171,10 @@ private:
UINT
taskbar_wmsg
;
void
createTaskBarButtons
();
#endif
void
createPlaylist
(
bool
);
public
slots
:
void
undockPlaylist
();
void
dockPlaylist
(
pl_dock_e
i_pos
=
PL_BOTTOM
);
void
dockPlaylist
(
bool
b_docked
=
true
);
void
toggleMinimalView
(
bool
);
void
togglePlaylist
();
#ifndef HAVE_MAEMO
...
...
modules/gui/qt4/menus.cpp
View file @
84a974e6
...
...
@@ -474,6 +474,12 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
if
(
mi
->
getControlsVisibilityStatus
()
&
CONTROLS_ADVANCED
)
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
)
// 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