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
b2c030c3
Commit
b2c030c3
authored
Jul 28, 2020
by
Jean-Baptiste Mardelle
Browse files
Ensure the "Editing" layout is loaded on first run
parent
be4d311a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/layoutmanagement.cpp
View file @
b2c030c3
...
...
@@ -132,6 +132,7 @@ void LayoutManagement::initializeLayouts()
layoutOrder
.
writeEntry
(
QString
::
number
(
j
),
entry
);
j
++
;
}
config
->
reparseConfiguration
();
}
for
(
int
i
=
1
;
i
<
10
;
i
++
)
{
QString
layoutName
;
...
...
@@ -171,7 +172,7 @@ void LayoutManagement::activateLayout(QAbstractButton *button)
if
(
!
button
)
{
return
;
}
loadLayout
(
button
->
text
());
loadLayout
(
button
->
text
()
,
false
);
}
void
LayoutManagement
::
slotLoadLayout
(
QAction
*
action
)
...
...
@@ -184,26 +185,10 @@ void LayoutManagement::slotLoadLayout(QAction *action)
if
(
layoutId
.
isEmpty
())
{
return
;
}
if
(
loadLayout
(
layoutId
))
{
// Activate layout button
QList
<
QAbstractButton
*>
buttons
=
m_containerGrp
->
buttons
();
bool
buttonFound
=
false
;
for
(
auto
*
button
:
buttons
)
{
if
(
button
->
text
()
==
layoutId
)
{
QSignalBlocker
bk
(
m_containerGrp
);
button
->
setChecked
(
true
);
buttonFound
=
true
;
}
}
if
(
!
buttonFound
&&
m_containerGrp
->
checkedButton
())
{
m_containerGrp
->
setExclusive
(
false
);
m_containerGrp
->
checkedButton
()
->
setChecked
(
false
);
m_containerGrp
->
setExclusive
(
true
);
}
}
loadLayout
(
layoutId
,
true
);
}
bool
LayoutManagement
::
loadLayout
(
const
QString
&
layoutId
)
bool
LayoutManagement
::
loadLayout
(
const
QString
&
layoutId
,
bool
selectButton
)
{
KSharedConfigPtr
config
=
KSharedConfig
::
openConfig
(
QStringLiteral
(
"kdenlive-layoutsrc"
));
KConfigGroup
layouts
(
config
,
"Layouts"
);
...
...
@@ -219,6 +204,23 @@ bool LayoutManagement::loadLayout(const QString &layoutId)
}
pCore
->
window
()
->
centralWidget
()
->
setHidden
(
!
timelineVisible
);
pCore
->
window
()
->
restoreState
(
state
);
if
(
selectButton
)
{
// Activate layout button
QList
<
QAbstractButton
*>
buttons
=
m_containerGrp
->
buttons
();
bool
buttonFound
=
false
;
for
(
auto
*
button
:
buttons
)
{
if
(
button
->
text
()
==
layoutId
)
{
QSignalBlocker
bk
(
m_containerGrp
);
button
->
setChecked
(
true
);
buttonFound
=
true
;
}
}
if
(
!
buttonFound
&&
m_containerGrp
->
checkedButton
())
{
m_containerGrp
->
setExclusive
(
false
);
m_containerGrp
->
checkedButton
()
->
setChecked
(
false
);
m_containerGrp
->
setExclusive
(
true
);
}
}
return
true
;
}
...
...
src/layoutmanagement.h
View file @
b2c030c3
...
...
@@ -26,6 +26,8 @@ class LayoutManagement : public QObject
public:
explicit
LayoutManagement
(
QObject
*
parent
);
/** @brief Load a layout by its name. */
bool
loadLayout
(
const
QString
&
layoutId
,
bool
selectButton
);
private
slots
:
/** @brief Saves the widget layout. */
...
...
@@ -45,8 +47,6 @@ private:
QHBoxLayout
*
m_containerLayout
;
KSelectAction
*
m_loadLayout
;
QList
<
QAction
*>
m_layoutActions
;
/** @brief Load a layout by its name. */
bool
loadLayout
(
const
QString
&
layoutId
);
};
#endif
src/mainwindow.cpp
View file @
b2c030c3
...
...
@@ -257,7 +257,7 @@ void MainWindow::init()
fr
->
setLineWidth
(
1
);
ctnLay
->
addWidget
(
fr
);
setupActions
();
new
LayoutManagement
(
this
);
LayoutManagement
*
layoutManager
=
new
LayoutManagement
(
this
);
QDockWidget
*
libraryDock
=
addDock
(
i18n
(
"Library"
),
QStringLiteral
(
"library"
),
pCore
->
library
());
...
...
@@ -514,7 +514,7 @@ void MainWindow::init()
if
(
current
->
availableSize
().
height
()
<
1000
)
{
resize
(
current
->
availableSize
());
}
else
{
resize
(
current
->
availableSize
()
/
1.
5
);
resize
(
current
->
availableSize
()
/
1.
2
);
}
}
}
...
...
@@ -743,6 +743,7 @@ void MainWindow::init()
KdenliveSettings
::
setCurrenttmpfolder
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
TempLocation
));
updateActionsToolTip
();
layoutManager
->
loadLayout
(
QStringLiteral
(
"Editing"
),
true
);
QTimer
::
singleShot
(
0
,
this
,
&
MainWindow
::
GUISetupDone
);
#ifdef USE_JOGSHUTTLE
...
...
Eugen Mohr
@emohr
mentioned in issue
#769 (closed)
·
Jul 30, 2020
mentioned in issue
#769 (closed)
mentioned in issue #769
Toggle commit list
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