Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Gautam Chitnis
web-ui-redesign
Commits
734452c8
Commit
734452c8
authored
Jan 16, 2008
by
Jean-Baptiste Kempf
Browse files
Qt4 - fix some saving and reading size bugs. Patch by Andre Weber
parent
2279878d
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/gui/qt4/main_interface.cpp
View file @
734452c8
...
...
@@ -293,7 +293,15 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
move
(
settings
->
value
(
"pos"
,
QPoint
(
0
,
0
)
).
toPoint
()
);
resize
(
settings
->
value
(
"size"
,
QSize
(
350
,
60
)
).
toSize
()
);
QSize
newSize
=
settings
->
value
(
"size"
,
QSize
(
350
,
60
)
).
toSize
();
if
(
newSize
.
isValid
()
)
{
resize
(
newSize
);
}
else
{
msg_Warn
(
p_intf
,
"Invalid size in constructor"
);
}
int
tgPlay
=
settings
->
value
(
"playlist-visible"
,
0
).
toInt
();
settings
->
endGroup
();
...
...
@@ -738,8 +746,11 @@ void MainInterface::togglePlaylist()
settings
->
endGroup
();
settings
->
beginGroup
(
"playlist"
);
dockPL
->
move
(
settings
->
value
(
"pos"
,
QPoint
(
0
,
0
)
).
toPoint
()
);
dockPL
->
resize
(
settings
->
value
(
"size"
,
QSize
(
400
,
300
)
).
toSize
()
);
QSize
newSize
=
settings
->
value
(
"size"
,
QSize
(
400
,
300
)
).
toSize
();
if
(
newSize
.
isValid
()
)
dockPL
->
resize
(
newSize
);
settings
->
endGroup
();
dockPL
->
show
();
playlistVisible
=
true
;
}
...
...
modules/gui/qt4/util/qvlcframe.hpp
View file @
734452c8
...
...
@@ -58,7 +58,10 @@ protected:
{
QSettings
settings
(
"vlc"
,
"vlc-qt-interface"
);
settings
.
beginGroup
(
name
);
resize
(
settings
.
value
(
"size"
,
defSize
).
toSize
()
);
/* never trust any saved size ;-) */
QSize
newSize
=
settings
.
value
(
"size"
,
defSize
).
toSize
();
if
(
newSize
.
isValid
()
)
resize
(
newSize
);
move
(
settings
.
value
(
"pos"
,
defPos
).
toPoint
()
);
settings
.
endGroup
();
}
...
...
@@ -66,7 +69,10 @@ protected:
{
QSettings
settings
(
"vlc"
,
"vlc-qt-interface"
);
settings
.
beginGroup
(
name
);
settings
.
setValue
(
"size"
,
size
()
);
/* only save valid sizes ... */
QSize
currentsize
=
size
();
if
(
currentsize
.
isValid
()
)
settings
.
setValue
(
"size"
,
currentsize
);
settings
.
setValue
(
"pos"
,
pos
()
);
settings
.
endGroup
();
}
...
...
@@ -156,18 +162,27 @@ protected:
move
(
settings
.
value
(
"pos"
,
QPoint
(
0
,
0
)
).
toPoint
()
);
settings
.
endGroup
();
}
void
readSettings
(
QString
name
)
{
QSettings
settings
(
"vlc"
,
"vlc-qt-interface"
);
settings
.
beginGroup
(
name
);
mainSize
=
settings
.
value
(
"size"
,
QSize
(
0
,
0
)
).
toSize
();
if
(
!
mainSize
.
isValid
()
)
{
mainSize
=
QSize
(
0
,
0
);
}
settings
.
endGroup
();
}
void
writeSettings
(
QString
name
)
{
QSettings
settings
(
"vlc"
,
"vlc-qt-interface"
);
settings
.
beginGroup
(
name
);
settings
.
setValue
(
"size"
,
size
()
);
/* only save valid sizes ... */
QSize
currentsize
=
size
();
if
(
currentsize
.
isValid
()
)
settings
.
setValue
(
"size"
,
currentsize
);
settings
.
setValue
(
"pos"
,
pos
()
);
settings
.
endGroup
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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