Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
465f5a01
Commit
465f5a01
authored
Oct 28, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: fix the view checked() state in the ViewMenu
parent
6950dc05
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
3 deletions
+18
-3
modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/playlist.cpp
+4
-2
modules/gui/qt4/components/playlist/playlist.hpp
modules/gui/qt4/components/playlist/playlist.hpp
+2
-0
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+10
-1
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+2
-0
No files found.
modules/gui/qt4/components/playlist/playlist.cpp
View file @
465f5a01
...
@@ -111,7 +111,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
...
@@ -111,7 +111,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
CONNECT
(
viewSelectionMapper
,
mapped
(
int
),
mainView
,
showView
(
int
)
);
CONNECT
(
viewSelectionMapper
,
mapped
(
int
),
mainView
,
showView
(
int
)
);
QActionGroup
*
actionGroup
=
new
QActionGroup
(
this
);
QActionGroup
*
actionGroup
=
new
QActionGroup
(
this
);
QAction
*
viewActions
[
StandardPLPanel
::
VIEW_COUNT
];
for
(
int
i
=
0
;
i
<
StandardPLPanel
::
VIEW_COUNT
;
i
++
)
for
(
int
i
=
0
;
i
<
StandardPLPanel
::
VIEW_COUNT
;
i
++
)
{
{
viewActions
[
i
]
=
actionGroup
->
addAction
(
viewNames
[
i
]
);
viewActions
[
i
]
=
actionGroup
->
addAction
(
viewNames
[
i
]
);
...
@@ -119,6 +119,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
...
@@ -119,6 +119,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
viewSelectionMapper
->
setMapping
(
viewActions
[
i
],
i
);
viewSelectionMapper
->
setMapping
(
viewActions
[
i
],
i
);
CONNECT
(
viewActions
[
i
],
triggered
(),
viewSelectionMapper
,
map
()
);
CONNECT
(
viewActions
[
i
],
triggered
(),
viewSelectionMapper
,
map
()
);
}
}
viewActions
[
0
]
->
setChecked
(
true
);
QMenu
*
viewMenu
=
new
QMenu
(
viewButton
);
QMenu
*
viewMenu
=
new
QMenu
(
viewButton
);
viewMenu
->
addActions
(
actionGroup
->
actions
()
);
viewMenu
->
addActions
(
actionGroup
->
actions
()
);
...
@@ -223,9 +224,10 @@ void PlaylistWidget::changeView( const QModelIndex& index )
...
@@ -223,9 +224,10 @@ void PlaylistWidget::changeView( const QModelIndex& index )
{
{
searchEdit
->
clear
();
searchEdit
->
clear
();
locationBar
->
setIndex
(
index
);
locationBar
->
setIndex
(
index
);
int
i
=
mainView
->
getViewNumber
();
viewActions
[
i
]
->
setChecked
(
true
);
}
}
#include <QSignalMapper>
#include <QSignalMapper>
#include <QMenu>
#include <QMenu>
#include <QPainter>
#include <QPainter>
...
...
modules/gui/qt4/components/playlist/playlist.hpp
View file @
465f5a01
...
@@ -57,6 +57,8 @@ private:
...
@@ -57,6 +57,8 @@ private:
QSplitter
*
leftSplitter
;
QSplitter
*
leftSplitter
;
StandardPLPanel
*
mainView
;
StandardPLPanel
*
mainView
;
QAction
*
viewActions
[
4
/* StandardPLPanel::VIEW_COUNT*/
];
LocationBar
*
locationBar
;
LocationBar
*
locationBar
;
SearchLineEdit
*
searchEdit
;
SearchLineEdit
*
searchEdit
;
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
465f5a01
...
@@ -348,11 +348,20 @@ void StandardPLPanel::showView( int i_view )
...
@@ -348,11 +348,20 @@ void StandardPLPanel::showView( int i_view )
}
}
viewStack
->
setCurrentWidget
(
currentView
);
viewStack
->
setCurrentWidget
(
currentView
);
//viewActions[i_view]->setChecked( true );
browseInto
();
browseInto
();
gotoPlayingItem
();
gotoPlayingItem
();
}
}
const
int
StandardPLPanel
::
getViewNumber
()
{
if
(
currentView
==
treeView
)
return
TREE_VIEW
;
else
if
(
currentView
==
iconView
)
return
ICON_VIEW
;
else
if
(
currentView
==
listView
)
return
LIST_VIEW
;
}
void
StandardPLPanel
::
cycleViews
()
void
StandardPLPanel
::
cycleViews
()
{
{
if
(
currentView
==
iconView
)
if
(
currentView
==
iconView
)
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
465f5a01
...
@@ -70,6 +70,8 @@ public:
...
@@ -70,6 +70,8 @@ public:
LIST_VIEW
,
LIST_VIEW
,
VIEW_COUNT
};
VIEW_COUNT
};
const
int
getViewNumber
();
protected:
protected:
PLModel
*
model
;
PLModel
*
model
;
...
...
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