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
b11bba67
Commit
b11bba67
authored
Aug 28, 2012
by
Angelo Haller
Committed by
Jean-Baptiste Kempf
Aug 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: allow to change the art
Close #1624 Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
cfbe138d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
0 deletions
+42
-0
modules/gui/qt4/components/info_panels.cpp
modules/gui/qt4/components/info_panels.cpp
+1
-0
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+21
-0
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/components/interface_widgets.hpp
+1
-0
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+18
-0
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+1
-0
No files found.
modules/gui/qt4/components/info_panels.cpp
View file @
b11bba67
...
...
@@ -169,6 +169,7 @@ MetaPanel::MetaPanel( QWidget *parent,
CONNECT
(
seqtot_text
,
textEdited
(
QString
),
this
,
enterEditMode
()
);
CONNECT
(
date_text
,
textEdited
(
QString
),
this
,
enterEditMode
()
);
CONNECT
(
THEMIM
->
getIM
(),
artChanged
(
QString
),
this
,
enterEditMode
()
);
/* CONNECT( rating_text, valueChanged( QString ), this, enterEditMode( QString ) );*/
/* We are not yet in Edit Mode */
...
...
modules/gui/qt4/components/interface_widgets.cpp
View file @
b11bba67
...
...
@@ -50,6 +50,7 @@
#include <QTimer>
#include <QSlider>
#include <QBitmap>
#include <QUrl>
#ifdef Q_WS_X11
# include <X11/Xlib.h>
...
...
@@ -520,6 +521,10 @@ CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i )
CONNECT
(
action
,
triggered
(),
this
,
askForUpdate
()
);
addAction
(
action
);
action
=
new
QAction
(
qtr
(
"Cover art from file"
),
this
);
CONNECT
(
action
,
triggered
(),
this
,
setArtFromFile
()
);
addAction
(
action
);
showArtUpdate
(
""
);
}
...
...
@@ -570,6 +575,22 @@ void CoverArtLabel::askForUpdate()
THEMIM
->
getIM
()
->
requestArtUpdate
(
p_item
);
}
void
CoverArtLabel
::
setArtFromFile
()
{
if
(
!
p_item
)
return
;
QString
filePath
=
QFileDialog
::
getOpenFileName
(
this
,
qtr
(
"Choose Image"
),
p_intf
->
p_sys
->
filepath
,
qtr
(
"Image Files (*.gif *.jpg *.jpeg *.png)"
)
);
if
(
filePath
.
isEmpty
()
)
return
;
QString
fileUrl
=
QUrl
::
fromLocalFile
(
filePath
).
toString
();
THEMIM
->
getIM
()
->
setArt
(
p_item
,
fileUrl
);
}
TimeLabel
::
TimeLabel
(
intf_thread_t
*
_p_intf
,
TimeLabel
::
Display
_displayType
)
:
ClickableQLabel
(),
p_intf
(
_p_intf
),
bufTimer
(
new
QTimer
(
this
)
),
buffering
(
false
),
showBuffering
(
false
),
bufVal
(
-
1
),
displayType
(
_displayType
)
...
...
modules/gui/qt4/components/interface_widgets.hpp
View file @
b11bba67
...
...
@@ -248,6 +248,7 @@ public slots:
void
showArtUpdate
(
const
QString
&
);
void
showArtUpdate
(
input_item_t
*
);
void
askForUpdate
();
void
setArtFromFile
();
};
#endif
modules/gui/qt4/input_manager.cpp
View file @
b11bba67
...
...
@@ -38,6 +38,7 @@
#include <vlc_aout_intf.h>
#include <QApplication>
#include <QFile>
#include <assert.h>
...
...
@@ -719,6 +720,23 @@ void InputManager::UpdateArt()
emit
artChanged
(
artUrl
);
}
void
InputManager
::
setArt
(
input_item_t
*
p_item
,
QString
fileUrl
)
{
if
(
hasInput
()
)
{
char
*
psz_cachedir
=
config_GetUserDir
(
VLC_CACHE_DIR
);
QString
old_url
=
THEMIM
->
getIM
()
->
decodeArtURL
(
p_item
);
if
(
old_url
.
startsWith
(
QString
::
fromUtf8
(
psz_cachedir
)
)
)
QFile
(
old_url
).
remove
();
/* Purge cached artwork */
free
(
psz_cachedir
);
input_item_SetArtURL
(
p_item
,
fileUrl
.
toUtf8
().
constData
()
);
UpdateArt
();
}
}
inline
void
InputManager
::
UpdateStats
()
{
assert
(
p_input
);
...
...
modules/gui/qt4/input_manager.hpp
View file @
b11bba67
...
...
@@ -149,6 +149,7 @@ public:
bool
hasVideo
()
{
return
hasInput
()
&&
b_video
;
}
bool
hasVisualisation
();
void
requestArtUpdate
(
input_item_t
*
p_item
);
void
setArt
(
input_item_t
*
p_item
,
QString
fileUrl
);
QString
getName
()
{
return
oldName
;
}
static
const
QString
decodeArtURL
(
input_item_t
*
p_item
);
...
...
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