Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
b220e881
Commit
b220e881
authored
Nov 12, 2009
by
Christophe Courtaut
Browse files
Fixed media removal in Library
parent
9664ddaa
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/GUI/Library/MediaLibraryWidget.cpp
View file @
b220e881
...
...
@@ -26,8 +26,10 @@ MediaLibraryWidget::MediaLibraryWidget( QWidget* parent ) : QWidget( parent )
{
m_nav
=
new
StackViewController
(
this
);
MediaListViewController
*
list
=
new
MediaListViewController
(
m_nav
);
Library
*
library
=
Library
::
getInstance
();
connect
(
list
,
SIGNAL
(
mediaSelected
(
Media
*
)
),
this
,
SLOT
(
mediaSelection
(
Media
*
)
)
);
connect
(
list
,
SIGNAL
(
mediaDeleted
(
const
QUuid
&
)
),
library
,
SLOT
(
removingMediaAsked
(
const
QUuid
&
)
)
);
connect
(
library
,
SIGNAL
(
mediaRemoved
(
QUuid
)
),
list
,
SLOT
(
mediaRemoved
(
const
QUuid
&
)
)
);
m_nav
->
pushViewController
(
list
);
}
...
...
src/GUI/Library/MediaListViewController.cpp
View file @
b220e881
...
...
@@ -19,6 +19,7 @@ void MediaListViewController::newMediaLoaded( Media* media )
MediaCellView
*
cell
=
new
MediaCellView
(
media
->
getUuid
()
);
connect
(
cell
,
SIGNAL
(
cellSelected
(
QUuid
)
),
this
,
SLOT
(
cellSelection
(
QUuid
)
)
);
connect
(
cell
,
SIGNAL
(
cellDeleted
(
QUuid
)
),
this
,
SLOT
(
mediaDeletion
(
QUuid
)
)
);
cell
->
setThumbnail
(
media
->
getSnapshot
()
);
cell
->
setTitle
(
media
->
getFileName
()
);
...
...
@@ -37,5 +38,17 @@ void MediaListViewController::cellSelection( const QUuid& uuid )
p
.
setColor
(
QPalette
::
Window
,
QColor
(
Qt
::
darkBlue
)
);
m_cells
->
value
(
uuid
)
->
setPalette
(
p
);
m_currentUuid
=
uuid
;
emit
mediaSelected
(
Library
::
getInstance
()
->
getMedia
(
uuid
)
);
emit
mediaSelected
(
Library
::
getInstance
()
->
getMedia
(
uuid
)
);
}
void
MediaListViewController
::
mediaDeletion
(
const
QUuid
&
uuid
)
{
emit
mediaDeleted
(
uuid
);
}
void
MediaListViewController
::
mediaRemoved
(
const
QUuid
&
uuid
)
{
removeCell
(
m_cells
->
value
(
uuid
)
);
m_cells
->
remove
(
uuid
);
m_currentUuid
=
QUuid
();
}
src/GUI/Library/MediaListViewController.h
View file @
b220e881
...
...
@@ -23,7 +23,11 @@ private:
public
slots
:
void
newMediaLoaded
(
Media
*
);
void
cellSelection
(
const
QUuid
&
uuid
);
void
mediaDeletion
(
const
QUuid
&
uuid
);
void
mediaRemoved
(
const
QUuid
&
uuid
);
signals:
void
mediaSelected
(
Media
*
media
);
void
mediaDeleted
(
const
QUuid
&
uuid
);
};
#endif // MEDIALISTVIEWCONTROLLER_H
Write
Preview
Supports
Markdown
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