Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-macos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue 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-macos
Commits
3a2dc0ce
Commit
3a2dc0ce
authored
5 years ago
by
Kateryna Kostiuk
Browse files
Options
Downloads
Patches
Plain Diff
account migration: remove password confirmation field
Change-Id: I03148a51b583426df21436bb78e31ab7783193ec
parent
aae92d8a
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/MigrateRingAccountsWC.h
+0
-21
0 additions, 21 deletions
src/MigrateRingAccountsWC.h
src/MigrateRingAccountsWC.mm
+24
-37
24 additions, 37 deletions
src/MigrateRingAccountsWC.mm
ui/Base.lproj/MigrateRingAccountsWindow.xib
+24
-64
24 additions, 64 deletions
ui/Base.lproj/MigrateRingAccountsWindow.xib
with
48 additions
and
122 deletions
src/MigrateRingAccountsWC.h
+
0
−
21
View file @
3a2dc0ce
...
...
@@ -41,27 +41,6 @@ namespace lrc {
@interface
MigrateRingAccountsWC
:
AbstractLoadingWC
<
LoadingWCProtocol
>
/**
* password string contained in passwordField.
*/
@property
(
retain
)
NSString
*
password
;
/**
* passwordConfirmation string contained in passwordConfirmationField.
*/
@property
(
retain
)
NSString
*
passwordConfirmation
;
/**
* computed properties calculated by password string contained in
* passwordField and passwordCOnfirmation string contained
* inpasswordConfirmationField
* This is a KVO method to bind the text with the OK Button
* if password.length is > 0 AND passwordConfirmation.length > 0
* AND password isEqualsToString passwordCOnfirmationbutton is enabled,
* otherwise disabled
*/
@property
(
readonly
)
BOOL
validatePasswords
;
@property
lrc
::
api
::
NewAccountModel
*
accountModel
;
@property
QString
accountToMigrate
;
...
...
This diff is collapsed.
Click to expand it.
src/MigrateRingAccountsWC.mm
+
24
−
37
View file @
3a2dc0ce
...
...
@@ -27,12 +27,12 @@
@interface
MigrateRingAccountsWC
()
<
NSTextFieldDelegate
>
{
__unsafe_unretained
IBOutlet
NSSecureTextField
*
passwordField
;
__unsafe_unretained
IBOutlet
NSSecureTextField
*
passwordConfirmField
;
__unsafe_unretained
IBOutlet
NSTextField
*
infoField
;
__unsafe_unretained
IBOutlet
NSTextField
*
errorField
;
__unsafe_unretained
IBOutlet
ITProgressIndicator
*
progressIndicator
;
__unsafe_unretained
IBOutlet
NSImageView
*
profileImage
;
__unsafe_unretained
IBOutlet
NSTextField
*
alias
;
__strong
IBOutlet
NSLayoutConstraint
*
infoTopConstraints
;
}
-
(
IBAction
)
onClickComplete
:(
id
)
sender
;
...
...
@@ -83,9 +83,12 @@ QMetaObject::Connection stateChanged;
profileImage
.
image
=
image
;
}
else
{
profileImage
.
image
=
[
NSImage
imageNamed
:
@"default_avatar_overlay.png"
];
profileImage
.
wantsLayer
=
YES
;
profileImage
.
layer
.
backgroundColor
=
[[
NSColor
grayColor
]
CGColor
];
}
alias
.
stringValue
=
accountInfo
.
profileInfo
.
alias
.
toNSString
();
infoTopConstraints
.
constant
=
accountInfo
.
profileInfo
.
alias
.
isEmpty
()
?
-
20
:
20
;
NSMutableAttributedString
*
infoMessage
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
NSLocalizedString
(
@"This account needs to be migrated"
,
@"Text shown to the user"
)];
[
infoMessage
appendAttributedString
:[[
NSAttributedString
alloc
]
initWithString
:
@"
\n
"
]];
...
...
@@ -135,9 +138,6 @@ QMetaObject::Connection stateChanged;
-
(
IBAction
)
startMigration
:(
NSButton
*
)
sender
{
if
(
!
[
self
validatePasswords
])
{
[
self
showError
:
NSLocalizedString
(
@"Password and confirmation mismatch."
,
@"Text show to the user when password didn't match"
)];
}
else
{
[
self
showLoading
];
errorTimer
=
[
NSTimer
scheduledTimerWithTimeInterval
:
30
target:
self
...
...
@@ -156,22 +156,9 @@ QMetaObject::Connection stateChanged;
}
});
lrc
::
api
::
account
::
ConfProperties_t
accountProperties
=
self
.
accountModel
->
getAccountConfig
(
accountToMigrate
);
accountProperties
.
archivePassword
=
QString
::
fromNSString
(
self
.
password
);
accountProperties
.
archivePassword
=
QString
::
fromNSString
(
password
Field
.
stringValue
);
self
.
accountModel
->
setAccountConfig
(
accountToMigrate
,
accountProperties
);
}
}
-
(
BOOL
)
validatePasswords
{
BOOL
result
=
(
self
.
password
.
length
!=
0
&&
[
self
.
password
isEqualToString
:
self
.
passwordConfirmation
]);
NSLog
(
@"ValidatesPasswords : %s"
,
result
?
"true"
:
"false"
);
return
result
;
}
+
(
NSSet
*
)
keyPathsForValuesAffectingValidatePasswords
{
return
[
NSSet
setWithObjects
:
@"password"
,
@"passwordConfirmation"
,
nil
];
}
#pragma mark - Delegates
-
(
void
)
didComplete
...
...
This diff is collapsed.
Click to expand it.
ui/Base.lproj/MigrateRingAccountsWindow.xib
+
24
−
64
View file @
3a2dc0ce
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