Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-windows
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-client-windows
Commits
cb364743
Commit
cb364743
authored
9 years ago
by
Edric Milaret
Committed by
gerrit2
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ui: remember mainwindow size and pos on exit
Change-Id: I82585c4567d620f4ced6e2864486e50ec77d3b35 Tuleap: #396
parent
47c40eb2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mainwindow.cpp
+11
-1
11 additions, 1 deletion
mainwindow.cpp
settingskey.h
+2
-1
2 additions, 1 deletion
settingskey.h
with
13 additions
and
2 deletions
mainwindow.cpp
+
11
−
1
View file @
cb364743
...
@@ -80,6 +80,13 @@ MainWindow::MainWindow(QWidget* parent) :
...
@@ -80,6 +80,13 @@ MainWindow::MainWindow(QWidget* parent) :
}
}
#endif
#endif
QSettings
settings
;
QVariant
size
=
settings
.
value
(
SettingsKey
::
savedSize
);
QVariant
pos
=
settings
.
value
(
SettingsKey
::
savedPos
);
if
(
size
.
isValid
()
&&
pos
.
isValid
())
{
resize
(
size
.
toSize
());
move
(
pos
.
toPoint
());
}
else
resize
(
1054
,
600
);
resize
(
1054
,
600
);
#ifdef ENABLE_AUTOUPDATE
#ifdef ENABLE_AUTOUPDATE
...
@@ -192,5 +199,8 @@ MainWindow::closeEvent(QCloseEvent* event)
...
@@ -192,5 +199,8 @@ MainWindow::closeEvent(QCloseEvent* event)
if
(
settings
.
value
(
SettingsKey
::
closeOrMinimized
).
toBool
())
{
if
(
settings
.
value
(
SettingsKey
::
closeOrMinimized
).
toBool
())
{
this
->
hide
();
this
->
hide
();
event
->
ignore
();
event
->
ignore
();
}
else
{
settings
.
setValue
(
SettingsKey
::
savedSize
,
size
());
settings
.
setValue
(
SettingsKey
::
savedPos
,
pos
());
}
}
}
}
This diff is collapsed.
Click to expand it.
settingskey.h
+
2
−
1
View file @
cb364743
...
@@ -22,7 +22,8 @@ namespace SettingsKey {
...
@@ -22,7 +22,8 @@ namespace SettingsKey {
constexpr
static
char
closeOrMinimized
[]
=
"closeOrMin"
;
constexpr
static
char
closeOrMinimized
[]
=
"closeOrMin"
;
constexpr
static
char
autoAnswer
[]
=
"autoAnswer"
;
constexpr
static
char
autoAnswer
[]
=
"autoAnswer"
;
constexpr
static
char
savedSize
[]
=
"savedSize"
;
constexpr
static
char
savedPos
[]
=
"savedPos"
;
}
}
#define accountAutoAnswer(A) (A+SettingsKey::autoAnswer)
#define accountAutoAnswer(A) (A+SettingsKey::autoAnswer)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment