Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
6c7e607f
Commit
6c7e607f
authored
Jun 02, 2022
by
Jean-Baptiste Mardelle
Browse files
Online resources: only show warning about loading time once.
CCBUG: 454470
parent
f4cdefe0
Pipeline
#184413
passed with stage
in 9 minutes and 35 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/monitor/monitor.cpp
View file @
6c7e607f
...
...
@@ -1636,6 +1636,9 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i
disconnect
(
m_controller
.
get
(),
&
ProjectClip
::
boundsChanged
,
m_glMonitor
->
getControllerProxy
(),
&
MonitorProxy
::
updateClipBounds
);
disconnect
(
m_controller
.
get
(),
&
ProjectClip
::
registeredClipChanged
,
m_controller
.
get
(),
&
ProjectClip
::
checkClipBounds
);
}
}
else
if
(
controller
==
nullptr
)
{
// Nothing to do
return
;
}
disconnect
(
this
,
&
Monitor
::
seekPosition
,
this
,
&
Monitor
::
seekRemap
);
m_controller
=
controller
;
...
...
@@ -1808,11 +1811,13 @@ const QString Monitor::activeClipId()
void
Monitor
::
slotPreviewResource
(
const
QString
&
path
,
const
QString
&
title
)
{
if
(
!
QUrl
::
fromUserInput
(
path
).
isLocalFile
())
{
warningMessage
(
i18n
(
"It maybe takes a while until the preview is loaded"
),
15000
);
if
(
isPlaying
())
{
stop
(
);
}
QApplication
::
processEvents
();
slotOpenClip
(
nullptr
);
m_streamAction
->
setVisible
(
false
);
// TODO: direct loading of the producer blocks UI, we should use a task to load the producer
m_glMonitor
->
setProducer
(
path
);
m_timePos
->
setRange
(
0
,
m_glMonitor
->
producer
()
->
get_length
()
-
1
);
m_glMonitor
->
getControllerProxy
()
->
setClipProperties
(
-
1
,
ClipType
::
Unknown
,
false
,
title
);
...
...
src/monitor/monitor.h
View file @
6c7e607f
...
...
@@ -242,8 +242,6 @@ private slots:
void
slotForceSize
(
QAction
*
a
);
void
buildBackgroundedProducer
(
int
pos
);
void
slotSeekToKeyFrame
();
/** @brief Display a non blocking error message to user **/
void
warningMessage
(
const
QString
&
text
,
int
timeout
=
5000
,
const
QList
<
QAction
*>
&
actions
=
QList
<
QAction
*>
());
void
slotLockMonitor
(
bool
lock
);
void
slotSwitchPlay
();
void
slotEditInlineMarker
();
...
...
@@ -288,6 +286,8 @@ public slots:
void
slotRewind
(
double
speed
=
0
)
override
;
void
slotRewindOneFrame
(
int
diff
=
1
);
void
slotForwardOneFrame
(
int
diff
=
1
);
/** @brief Display a non blocking error message to user **/
void
warningMessage
(
const
QString
&
text
,
int
timeout
=
5000
,
const
QList
<
QAction
*>
&
actions
=
QList
<
QAction
*>
());
void
slotStart
();
/** @brief Set position and information for the trimming preview
* @param pos Absolute position in frames
...
...
src/onlineresources/resourcewidget.cpp
View file @
6c7e607f
...
...
@@ -28,6 +28,7 @@
ResourceWidget
::
ResourceWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
,
m_showloadingWarning
(
true
)
{
setFont
(
QFontDatabase
::
systemFont
(
QFontDatabase
::
SmallestReadableFont
));
setupUi
(
this
);
...
...
@@ -463,9 +464,18 @@ void ResourceWidget::slotPreviewItem()
if
(
!
m_currentItem
)
{
return
;
}
blockUI
(
true
);
emit
previewClip
(
m_currentItem
->
data
(
previewRole
).
toString
(),
i18n
(
"Online Resources Preview"
));
const
QString
path
=
m_currentItem
->
data
(
previewRole
).
toString
();
if
(
m_showloadingWarning
&&
!
QUrl
::
fromUserInput
(
path
).
isLocalFile
())
{
message_line
->
setText
(
i18n
(
"It maybe takes a while until the preview is loaded"
));
message_line
->
setMessageType
(
KMessageWidget
::
Warning
);
message_line
->
show
();
QTimer
::
singleShot
(
6000
,
message_line
,
&
KMessageWidget
::
animatedHide
);
repaint
();
// Only show this warning once
m_showloadingWarning
=
false
;
}
emit
previewClip
(
path
,
i18n
(
"Online Resources Preview"
));
blockUI
(
false
);
}
...
...
src/onlineresources/resourcewidget.hpp
View file @
6c7e607f
...
...
@@ -66,6 +66,7 @@ private:
/** @brief Default icon size for the views. */
QSize
m_iconSize
;
int
wheelAccumulatedDelta
;
bool
m_showloadingWarning
;
ResourceItemInfo
getItemById
(
const
QString
&
id
);
void
loadConfig
();
void
saveConfig
();
...
...
src/ui/resourcewidget_ui.ui
View file @
6c7e607f
...
...
@@ -6,11 +6,24 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
507
</width>
<height>
457
</height>
<width>
313
</width>
<height>
335
</height>
</rect>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"4"
column=
"4"
>
<spacer
name=
"spacer_horiz"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
81
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"2"
column=
"0"
colspan=
"7"
>
<widget
class=
"QSplitter"
name=
"splitter"
>
<property
name=
"orientation"
>
...
...
@@ -191,42 +204,38 @@
</widget>
</widget>
</item>
<item
row=
"1"
column=
"0"
colspan=
"7"
>
<widget
class=
"KMessageWidget"
name=
"message_line"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
<item
row=
"4"
column=
"3"
>
<widget
class=
"QToolButton"
name=
"button_zoomin"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
<property
name=
"wordWrap"
>
<bool>
false
</bool>
<property
name=
"icon"
>
<iconset
theme=
"zoom-in"
>
<normaloff>
.
</normaloff>
.
</iconset>
</property>
<property
name=
"
closeButtonVisibl
e"
>
<bool>
fals
e
</bool>
<property
name=
"
autoRais
e"
>
<bool>
tru
e
</bool>
</property>
</widget>
</item>
<item
row=
"
3
"
column=
"
2
"
>
<widget
class=
"Q
Slider"
name=
"slider_zoom
"
>
<property
name=
"
minimumSize
"
>
<size>
<
widt
h>
4
0
</
widt
h>
<
height>
0
</height
>
</size>
<item
row=
"
4
"
column=
"
6
"
>
<widget
class=
"Q
PushButton"
name=
"button_import
"
>
<property
name=
"
sizePolicy
"
>
<size
policy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<
horstretc
h>
0
</
horstretc
h>
<
verstretch>
0
</verstretch
>
</size
policy
>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
100
</width>
<height>
16777215
</height>
</size>
<property
name=
"text"
>
<string>
Import
</string>
</property>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
<property
name=
"icon"
>
<iconset
theme=
"document-import"
>
<normaloff>
.
</normaloff>
.
</iconset>
</property>
</widget>
</item>
<item
row=
"
3
"
column=
"5"
>
<item
row=
"
4
"
column=
"5"
>
<widget
class=
"QPushButton"
name=
"button_preview"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
...
...
@@ -243,51 +252,26 @@
</property>
</widget>
</item>
<item
row=
"3"
column=
"3"
>
<widget
class=
"QToolButton"
name=
"button_zoomin"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
<property
name=
"icon"
>
<iconset
theme=
"zoom-in"
>
<normaloff>
.
</normaloff>
.
</iconset>
</property>
<property
name=
"autoRaise"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"3"
column=
"4"
>
<spacer
name=
"spacer_horiz"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<item
row=
"4"
column=
"2"
>
<widget
class=
"QSlider"
name=
"slider_zoom"
>
<property
name=
"minimumSize"
>
<size>
<width>
81
</width>
<height>
2
0
</height>
<width>
40
</width>
<height>
0
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"3"
column=
"6"
>
<widget
class=
"QPushButton"
name=
"button_import"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
Import
</string>
<property
name=
"maximumSize"
>
<size>
<width>
100
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"icon"
>
<iconset
theme=
"document-import"
>
<normaloff>
.
</normaloff>
.
</iconset>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item
row=
"
3
"
column=
"1"
>
<item
row=
"
4
"
column=
"1"
>
<widget
class=
"QToolButton"
name=
"button_zoomout"
>
<property
name=
"text"
>
<string>
...
</string>
...
...
@@ -345,15 +329,31 @@
</layout>
</widget>
</item>
<item
row=
"3"
column=
"1"
colspan=
"6"
>
<widget
class=
"KMessageWidget"
name=
"message_line"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"wordWrap"
>
<bool>
false
</bool>
</property>
<property
name=
"closeButtonVisible"
>
<bool>
false
</bool>
</property>
</widget>
</item>
</layout>
<zorder>
splitter
</zorder>
<zorder>
service_box_2
</zorder>
<zorder>
message_line
</zorder>
<zorder>
button_preview
</zorder>
<zorder>
button_import
</zorder>
<zorder>
button_zoomin
</zorder>
<zorder>
button_zoomout
</zorder>
<zorder>
slider_zoom
</zorder>
<zorder>
message_line
</zorder>
</widget>
<customwidgets>
<customwidget>
...
...
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