Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-client-windows
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
savoirfairelinux
jami-client-windows
Commits
07f8349e
Commit
07f8349e
authored
Dec 26, 2018
by
Andreas Traczyk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wizard: save avatar after account creation
Change-Id: I00b34f9d94605651ffe1d99b214b70a47f6cf59b
parent
6c323c6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
8 deletions
+32
-8
newwizardwidget.cpp
newwizardwidget.cpp
+6
-0
photoboothwidget.cpp
photoboothwidget.cpp
+22
-8
photoboothwidget.h
photoboothwidget.h
+4
-0
No files found.
newwizardwidget.cpp
View file @
07f8349e
...
...
@@ -295,6 +295,9 @@ NewWizardWidget::slotRegisteredNameFound(const std::string& accountId,
const
std
::
string
&
address
,
const
std
::
string
&
name
)
{
Q_UNUSED
(
accountId
);
Q_UNUSED
(
address
);
using
namespace
lrc
::
api
::
account
;
if
(
name
.
length
()
<
3
)
{
registrationStateOk_
=
false
;
...
...
@@ -400,6 +403,9 @@ NewWizardWidget::createRingAccount(const QString &displayName,
LRCInstance
::
accountModel
().
setAccountConfig
(
LRCInstance
::
getCurrAccId
(),
accountProperties
);
emit
NavigationRequested
(
ScreenEnum
::
CallScreen
);
});
if
(
ui
->
setAvatarWidget
->
hasAvatar
())
{
LRCInstance
::
setCurrAccAvatar
(
ui
->
setAvatarWidget
->
getAvatarPixmap
());
}
QObject
::
disconnect
(
*
connection
);
if
(
connection
)
{
delete
connection
;
...
...
photoboothwidget.cpp
View file @
07f8349e
...
...
@@ -33,7 +33,8 @@
PhotoboothWidget
::
PhotoboothWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
),
fileName_
(
""
),
ui
(
new
Ui
::
PhotoboothWidget
)
ui
(
new
Ui
::
PhotoboothWidget
),
hasAvatar_
(
false
)
{
ui
->
setupUi
(
this
);
ui
->
videoFeed
->
setIsFullPreview
(
true
);
...
...
@@ -64,6 +65,7 @@ PhotoboothWidget::~PhotoboothWidget()
void
PhotoboothWidget
::
startBooth
()
{
hasAvatar_
=
false
;
ui
->
videoFeed
->
setResetPreview
(
true
);
Video
::
PreviewManager
::
instance
().
stopPreview
();
Video
::
PreviewManager
::
instance
().
startPreview
();
...
...
@@ -97,9 +99,9 @@ PhotoboothWidget::on_importButton_clicked()
Video
::
PreviewManager
::
instance
().
stopPreview
();
auto
image
=
QImage
(
fileName_
);
auto
avatar
=
image
.
scaled
(
100
,
100
,
Qt
::
KeepAspectRatioByExpanding
,
Qt
::
SmoothTransformation
);
a
uto
avatarPixmap
=
QPixmap
::
fromImage
(
Utils
::
getCirclePhoto
(
avatar
,
ui
->
avatarLabel
->
width
()));
LRCInstance
::
setCurrAccAvatar
(
avatarPixmap
);
ui
->
avatarLabel
->
setPixmap
(
avatarPixmap
)
;
a
vatarPixmap_
=
QPixmap
::
fromImage
(
Utils
::
getCirclePhoto
(
avatar
,
ui
->
avatarLabel
->
width
()));
ui
->
avatarLabel
->
setPixmap
(
avatarPixmap_
);
hasAvatar_
=
true
;
stopBooth
();
}
...
...
@@ -122,14 +124,26 @@ PhotoboothWidget::on_takePhotoButton_clicked()
flashAnimation_
->
start
(
QPropertyAnimation
::
KeepWhenStopped
);
QtConcurrent
::
run
(
[
=
]
{
[
this
]
{
Video
::
PreviewManager
::
instance
().
stopPreview
();
auto
photo
=
ui
->
videoFeed
->
takePhoto
();
auto
avatar
=
photo
.
scaled
(
100
,
100
,
Qt
::
KeepAspectRatioByExpanding
,
Qt
::
SmoothTransformation
);
a
uto
avatarPixmap
=
QPixmap
::
fromImage
(
Utils
::
getCirclePhoto
(
avatar
,
ui
->
avatarLabel
->
width
()));
LRCInstance
::
setCurrAccAvatar
(
avatarPixmap
);
ui
->
avatarLabel
->
setPixmap
(
avatarPixmap
)
;
a
vatarPixmap_
=
QPixmap
::
fromImage
(
Utils
::
getCirclePhoto
(
avatar
,
ui
->
avatarLabel
->
width
()));
ui
->
avatarLabel
->
setPixmap
(
avatarPixmap_
);
hasAvatar_
=
true
;
stopBooth
();
});
}
}
const
QPixmap
&
PhotoboothWidget
::
getAvatarPixmap
()
{
return
avatarPixmap_
;
}
bool
PhotoboothWidget
::
hasAvatar
()
{
return
hasAvatar_
;
}
\ No newline at end of file
photoboothwidget.h
View file @
07f8349e
...
...
@@ -36,6 +36,8 @@ public:
~
PhotoboothWidget
();
void
startBooth
();
void
stopBooth
();
const
QPixmap
&
getAvatarPixmap
();
bool
hasAvatar
();
private
slots
:
void
on_importButton_clicked
();
...
...
@@ -47,6 +49,8 @@ private:
QLabel
*
flashOverlay_
;
QPropertyAnimation
*
flashAnimation_
;
QPixmap
avatarPixmap_
;
bool
hasAvatar_
;
bool
takePhotoState_
;
...
...
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